public Object invoke(Object proxy, Method m, Object[] args) throws Throwable { try { if (def == null) { def = registry.getPortletDefinitionByUniqueName(name); } return m.invoke(def, args); } catch (InvocationTargetException e) { throw e.getTargetException(); } }
public Object invoke(Object proxy, Method m, Object[] args) throws Throwable { try { if (m.getName().equals("getRealApplication")) { return getRealApplication(); } else if (m.getName().equals("setRealApplication")) { setRealApplication((PortletApplication)args[0]); return null; } else { if (app == null) { app = registry.getPortletApplication(name, true); } return m.invoke(app, args); } } catch (InvocationTargetException e) { throw e.getTargetException(); } }
private void importEntities(JSSnapshot snapshot, Map<String,Object> settings, Logger log) throws SerializerException { JSApplications applications = snapshot.getApplications(); if (applications == null) { return; } // import preferences for registered portlets if applications // have been registered; otherwise, import all preferences boolean importAll = registry.getPortletApplications().isEmpty(); if (!applications.isEmpty()) { Iterator it = applications.iterator(); while (it.hasNext()) { JSApplication app = (JSApplication) it.next(); PortletApplication portletApp = registry.getPortletApplication(app.getName()); if ((portletApp != null) || importAll) { importPA(app, portletApp, settings, log); } } } }
protected int unregister(PrintWriter writer, String paName) { int result = stop(writer, paName); if (result != OK) { return result; } PortletApplication pa = registry.getPortletApplication(paName); try { registry.removeApplication(pa); writer.println("Portlet Application " + paName + " unregistered"); return OK; } catch (RegistryException e) { writer.println("Error: Failed to unregister Portlet Application " + paName + ": " + e.getMessage()); e.printStackTrace(writer); return ERROR_UNEXPECTED; } }
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); } } }
PortletDefinition pd = portletRegistry.getPortletDefinitionByUniqueName(uniqueName); Collection<PortletDefinition> pds = filterPortletDefinitionsBySecurityAccess(portletRegistry.getAllDefinitions(), JetspeedActions.MASK_VIEW, servletRequest); pdBeans.setTotalSize(pds.size()); PortletApplication pa = portletRegistry.getPortletApplication(applicationName, true);
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; }
protected void unregisterPortletApplication(PortletApplication pa, boolean purgeEntityInfo) throws RegistryException { updateSearchEngine(true,pa); // todo keep (User)Prefs? lockRegistry(RegistryLock.WRITE); try { registry.removeApplication(pa); } finally { unlockRegistry(RegistryLock.WRITE); } revokeDefaultPermissions(pa.getName()); }
/** * Get the portal-wide list of available layouts. * * @return A list of layout portlets of type <code>PortletDefinitionComposite</code> */ public List<LayoutInfo> getLayouts( RequestContext request ) { List list = new LinkedList(); Iterator portlets = registry.getAllDefinitions().iterator(); while ( portlets.hasNext() ) { PortletDefinition portlet = (PortletDefinition)portlets.next(); PortletApplication app = (PortletApplication)portlet.getApplication(); String appName = app.getName(); if ( appName == null ) continue; if ( ! appName.equals( "jetspeed-layouts" ) ) continue; String uniqueName = appName + "::" + portlet.getPortletName(); list.add( new LayoutInfoImpl( uniqueName, portlet.getDisplayNameText( request.getLocale() ), portlet.getDescriptionText( request.getLocale() ) ) ); } return list; }
/** * <p> * Constructor providing access to the {@link UserManager}. * </p> * * @param userMgr The user manager. * @param registry The portlet registry component. */ public UserInfoManagerImpl(PortletRegistry registry) { this.registry = registry; registry.addRegistryListener(this); }
private void exportEntities(JSSnapshot snapshot, Map<String,Object> settings, Logger log) throws SerializerException Collection col = registry.getPortletApplications(); if ((col == null) || (col.size() == 0)) return;
portlets = registry.getAllDefinitions().iterator(); else portlets = searchEngine.search(filter).getResults().iterator();
return null; return registry.getPortletDefinitionByUniqueName(name, true);
protected List<UserAttributeRef> getLinkedUserAttr(String appName) { // Check if user info map is in cache. List<UserAttributeRef> linkedUserAttr = appUserInfoAttrCache.get(appName); if (linkedUserAttr == null) { PortletApplication pa = registry.getPortletApplication(appName, true); if (null == pa) { log.debug(PortletRequest.USER_INFO + " is set to null"); return null; } List<UserAttribute> userAttributes = pa.getUserAttributes(); List<UserAttributeRef> userAttributeRefs = pa.getUserAttributeRefs(); linkedUserAttr = mapLinkedUserAttributes(userAttributes, userAttributeRefs); appUserInfoAttrCache.put(appName, linkedUserAttr); } return linkedUserAttr; }
PortletApplication pa = portletRegistry.getPortletApplication(appName); Collection<PortletApplication> pas = portletRegistry.getPortletApplications(); paBeans.setTotalSize(pas.size()); PortletApplication pa = portletRegistry.getPortletApplication(applicationName, true);
public PortletDefinition getPortletDefinition() { // there are cases when jetspeed gets initialized before // all of the portlet web apps have. In this event, premature // access to the portal would cause portlet entities to be cached // with their associated window without there corresponding PortletDefinition // (becuase the PortletApplication has yet to be registered). if (this.portletDefinition == null) { PortletDefinition pd = registry .getPortletDefinitionByUniqueName(getPortletUniqueName()); if (pd != null) { // only store a really found PortletDefinition // to prevent an IllegalArgumentException to be thrown setPortletDefinition(pd); } else { return null; } } return this.portletDefinition; }
PortletApplication pa = portletRegistry.getPortletApplication(paName, true); boolean thisPAStatus = portletFactory.isPortletApplicationRegistered(pa); if (thisPAStatus)
if ( portletName != null && portletName.length() > 0 ) PortletDefinition portletDef = registry.getPortletDefinitionByUniqueName( portletName, true );
try pa = registry.getPortletApplication(paName);