public PortletApplicationProxyImpl(PortletApplication app) { this.app = app; this.name = app.getName(); }
public PortletApplicationBean(final PortletApplication portletApplication) name = portletApplication.getName(); contextPath = portletApplication.getContextPath(); localContextPath = portletApplication.getLocalContextPath(); defaultNamespace = portletApplication.getDefaultNamespace(); applicationType = portletApplication.getApplicationType(); checksum = portletApplication.getChecksum(); revision = portletApplication.getRevision(); for (DisplayName displayName : portletApplication.getDisplayNames()) for (Description description : portletApplication.getDescriptions()) metadataBean = new GenericMetadataBean(portletApplication.getMetadata()); for (ContainerRuntimeOption containerRuntimeOption : portletApplication.getContainerRuntimeOptions())
protected void updateSearchEngine(boolean remove,PortletApplication pa ) { if (searchEngine != null) { List<PortletDefinition> portletDefList = pa.getPortlets(); List<PortletDefinition> cloneDefList = pa.getClones(); List<Object> list = new ArrayList<Object>(portletDefList.size() + cloneDefList.size() + 1); if (remove) { list.addAll(portletDefList); list.addAll(cloneDefList); list.add(pa); searchEngine.remove(list); log.info("Un-Registered the portlet application in the search engine... " + pa.getName()); } else { list.add(pa); list.addAll(portletDefList); list.addAll(cloneDefList); searchEngine.add(list); log.info("Registered the portlet application in the search engine... " + pa.getName()); } } }
protected int list(PrintWriter writer) { writer.println("Listed Portlet Applications"); Iterator iter = registry.getPortletApplications().iterator(); PortletApplication pa; while (iter.hasNext()) { pa = (PortletApplication) iter.next(); writer.println(pa.getName() + ":" + pa.getContextPath() + ":" + (portletFactory.isPortletApplicationRegistered(pa) ? "ACTIVE" : "INACTIVE")); } return OK; }
Unmarshaller u = jc.createUnmarshaller(); PortletApp pa = (PortletApp) u.unmarshal(in); app.setJetspeedSecurityConstraint(pa.getSecurityConstraintRef()); for (Service s : pa.getServices()) app.addJetspeedServiceReference(s.getName()); app.getMetadata().addField(JetspeedLocale.convertStringToLocale(m.getLang()), m.getMetadataName(), m.getContent()); PortletDefinition pd = app.getPortlet(p.getPortletName()); if (pd != null) CustomPortletMode jcpm = app.getCustomPortletMode(cpm.getMappedName()); if (jcpm != null && app.getCustomPortletMode(cpm.getName()) == null) CustomWindowState jcws = app.getCustomWindowState(cws.getMappedName()); if (jcws != null && app.getCustomWindowState(cws.getName()) == null) UserAttributeRef jref = app.addUserAttributeRef(ref.getName()); jref.setNameLink(ref.getNameLink()); Description desc = jref.addDescription("en");
if (oldPA != null) revision = oldPA.getRevision(); unregisterPortletApplication(oldPA, false); oldPA = null; pa.setApplicationType(paType); if (revision > 0) pa.setRevision(revision); pa.setContextPath("<portal>"); nodeManager.addNode(new Long(pa.getRevision()), pa.getName()); if ( autoCreateRoles && roleManager != null && pa.getSecurityRoles() != null ) for (SecurityRole sr : pa.getSecurityRoles()) if ( !roleManager.roleExists(sr.getName()) )
d = pa.getDisplayName(JetspeedLocale.convertStringToLocale(lang)); if (d == null) d = pa.addDisplayName(lang); d = pa.getDescription(JetspeedLocale.convertStringToLocale(lang)); if (d == null) d = pa.addDescription(lang); for (SecurityRole sr : pa.getSecurityRoles()) r = pa.addSecurityRole(roleName); if (encoding.length() > 0) pa.addLocaleEncodingMapping(JetspeedLocale.convertStringToLocale(locale), encoding);
PortletApplication pa = (PortletApplication) o; Description defaultDescription = pa.getDescription(JetspeedLocale.getDefaultLocale()); if (defaultDescription != null) result.setTitle(pa.getName()); result.setKey(KEY_PREFIX + pa.getName()); result.setType(ParsedObject.OBJECT_TYPE_PORTLET_APPLICATION); result.setClassName(pa.getClass().getName()); fieldMap.put(ParsedObject.ID, pa.getName()); Collection fields = pa.getMetadata().getFields(); for (Iterator fieldIter = fields.iterator(); fieldIter.hasNext();)
public PortletDefinitionBean(final PortletDefinition portletDefinition) applicationName = portletApplication.getName(); applicationContextPath = portletApplication.getContextPath(); portletName = portletDefinition.getPortletName(); uniqueName = portletDefinition.getUniqueName(); GenericMetadata appMetadata = portletApplication.getMetadata();
PortletDefinition copy = source.getApplication().addClone(newPortletName); PortletApplication destApp = source.getApplication(); destApp.getClones().remove(copy); throw new FailedToStorePortletDefinitionException(e); PortletDefinition pd = getPortletDefinitionByUniqueName(PortletRegistryHelper.makeUniqueName(source.getApplication().getName(), newPortletName)); PortletApplication pa = pd.getApplication(); searchEngine.remove(pa.getPortlets()); searchEngine.remove(pa.getClones()); searchEngine.add(pa); searchEngine.add(pa.getPortlets()); searchEngine.add(pa.getClones());
public void removeAllClones(PortletApplication pa) throws RegistryException { Criteria c = new Criteria(); c.addEqualTo("cloneParent", pa.getName()); getPersistenceBrokerTemplate().deleteByQuery(QueryFactory.newQuery(PortletDefinitionImpl.class, c)); pa.getClones().clear(); this.updatePortletApplication(pa); }
Iterator pi = pa.getPortlets().iterator(); PortletDefinition pd = null; JSPortlets portlets = new JSPortlets(); if (p != null) log.debug("--processed PA " + pa.getName() + " with pd=" + pd.getPortletName()); portlets.add(p); log.debug("--processed PA " + pa.getName() + " with NULL pd=" + pd.getPortletName()); log.debug("--exporting PA " + pa.getName()); jsApplication.setName(pa.getName()); jsApplication.setPortlets(portlets);
if ( pa.getApplicationType() != paType ) throw new RegistryException("Cannot start portlet application "+contextName+": as Application Types don't match: " + pa.getApplicationType() + " != " + paType); int status = nodeManager.checkNode(new Long(pa.getRevision()), pa.getName()); boolean reregister = false; boolean deploy = false; log.warn("The portlet application " + pa.getName() + " is registered in the database but not locally .... we will reregister"); reregister = true; if (checksum != pa.getChecksum()) log.warn("The provided portlet application " + pa.getName() + " is a different version than in the database (db-checksum=" + pa.getChecksum() + ", local-checksum=: " + checksum + ") .... we will redeploy (also to the database)"); deploy = true; if (checksum != pa.getChecksum()) log.warn("The provided portlet application " + pa.getName() + " is a different version than in the local node info and the database (db-checksum=" + pa.getChecksum() + ", local-checksum=: " + checksum + ") .... we will reregister AND redeploy (also to the database)"); if (checksum != pa.getChecksum()) log.error("The portlet application " + pa.getName() + " provided for the upgrade IS WRONG. The database checksum= " + pa.getChecksum() + ", but the local=" + checksum + "....THIS NEEDS TO BE CORRECTED"); nodeManager.addNode(new Long(pa.getRevision()), pa.getName()); } catch (Exception e) log.error("Adding node for portlet application " + pa.getName() + " caused exception" , e);
PortletMode currentMappedMode = pa.getMappedPortletMode(currentMode); WindowState currentMappedState = pa.getMappedWindowState(currentState); customMode = pa.getCustomPortletMode(mappedMode); customState = pa.getCustomWindowState(mappedState);
try if (locale != null && pa.getResourceBundle() != null) String paName = pa.getName(); Map<Locale, ResourceBundle> bundleCache = applicationResourceBundleCache.get(paName); if (bundleCache == null) bundle = loadResourceBundle(locale, pa.getResourceBundle(), paCl);
String paName = pa.getName(); List<PortletURLGenerationListener> cacheListeners = this.portletListenerCache.get(paName); List<? extends Listener> paListenerList = pa.getListeners();
Collection<PortletDefinition> pds = filterPortletDefinitionsBySecurityAccess(pa.getPortlets(), JetspeedActions.MASK_VIEW, servletRequest); pdBeans.setTotalSize(pds.size()); PortletDefinition pd = pa.getPortlet(definitionName); pd = pa.getClone(definitionName);
if (pa.isLayoutApplication()) continue; String uniqueName = pa.getName() + "::" + portlet.getPortletName(); if (securityAccessController.checkPortletAccess(portlet, JetspeedActions.MASK_VIEW))
protected void deleteData(Map<String,Object> settings, Logger log) throws SerializerException { if (isSettingSet(settings, JetspeedSerializer.KEY_PROCESS_USER_PREFERENCES)) { log.info("deleting applications"); try { for (PortletApplication pa : registry.getPortletApplications()) { List<PortletDefinition> portlets = pa.getPortlets(); List<PortletDefinition> clones = pa.getClones(); if (searchEngine != null) { List<Object> list = new ArrayList<Object>(portlets.size() + clones.size() + 1); list.add(pa); list.addAll(portlets); list.addAll(clones); searchEngine.remove(list); } registry.removeApplication(pa); } } catch (Exception e) { throw new SerializerException(e); } } }