public void storePortletPreference(org.apache.jetspeed.om.portlet.PortletDefinition portletdefinition, String windowId, String userName, Map<String, PortletPreference> map) { String appName = portletdefinition.getApplication().getName(); String portletName = portletdefinition.getPortletName(); storePortletPreference(appName, portletName, windowId, userName, map); }
public PortletDefinitionBean(final PortletDefinition portletDefinition) PortletApplication portletApplication = portletDefinition.getApplication(); applicationName = portletApplication.getName(); applicationContextPath = portletApplication.getContextPath(); portletName = portletDefinition.getPortletName(); uniqueName = portletDefinition.getUniqueName(); portletInfoBean = new PortletInfoBean(portletDefinition.getPortletInfo()); for (DisplayName displayName : portletDefinition.getDisplayNames()) for (Description description : portletDefinition.getDescriptions()) for (Supports supports : portletDefinition.getSupports()) for (Language language : portletDefinition.getLanguages()) metadataBean = new GenericMetadataBean(portletDefinition.getMetadata()); for (ContainerRuntimeOption containerRuntimeOption : portletDefinition.getContainerRuntimeOptions()) for (InitParam initParam : portletDefinition.getInitParams())
/** * 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; }
public void removeClone(PortletDefinition clone) throws RegistryException { if (!clone.isClone()) { throw new IllegalArgumentException("The portlet is not a cloned one: " + clone.getUniqueName()); } PortletApplication pa = clone.getApplication(); getPersistenceBrokerTemplate().delete(clone); pa.getClones().remove(clone); this.updatePortletApplication(pa); }
public void resolvePublicRenderParametersMapping() { if (pd != null && qnameToIdentifierMap == null) { qnameToIdentifierMap = new HashMap<QName, String>(); identifierToQNameMap = new HashMap<String, QName>(); for (String identifier : pd.getSupportedPublicRenderParameters()) { PublicRenderParameter prp = pd.getApplication().getPublicRenderParameter(identifier); if (prp != null) { qnameToIdentifierMap.put(prp.getQName(), identifier); identifierToQNameMap.put(identifier, prp.getQName()); } } } }
if (this.portletDefinitionExists(newPortletName, source.getApplication())) PortletDefinition copy = source.getApplication().addClone(newPortletName); PortletApplication destApp = source.getApplication(); DisplayName displayName = copy.addDisplayName(JetspeedLocale.getDefaultLocale().getLanguage()); displayName.setDisplayName(newPortletName); copy.setPortletClass(source.getPortletClass()); copy.setResourceBundle(source.getResourceBundle()); copy.setPreferenceValidatorClassname(source.getPreferenceValidatorClassname()); copy.setExpirationCache(source.getExpirationCache()); copy.setCacheScope(source.getCacheScope()); for (LocalizedField field : source.getMetadata().getFields()) copy.getMetadata().addField(field.getLocale(), field.getName(), field.getValue()); copy.setJetspeedSecurityConstraint(source.getJetspeedSecurityConstraint()); for (Description desc : source.getDescriptions()) Description copyDesc = copy.addDescription(desc.getLang()); copyDesc.setDescription(desc.getDescription()); for (InitParam initParam : source.getInitParams()) InitParam copyInitParam = copy.addInitParam(initParam.getParamName()); copyInitParam.setParamValue(initParam.getParamValue());
String displayNameText = pd.getDisplayNameText(JetspeedLocale.getDefaultLocale()); result.setTitle(displayNameText); String description = pd.getDescriptionText(JetspeedLocale.getDefaultLocale()); result.setDescription(description); result.setKey(KEY_PREFIX + pd.getUniqueName()); result.setType(ParsedObject.OBJECT_TYPE_PORTLET); fieldMap.put(ParsedObject.ID, pd.getPortletName()); PortletApplication pa = (PortletApplication)pd.getApplication(); fieldMap.put(PORTLET_APPLICATION, pa.getName()); Collection mdFields = pd.getMetadata().getFields(); for (Iterator fieldIter = mdFields.iterator(); fieldIter.hasNext();) for (Description d : pd.getDescriptions()) for (DisplayName d : pd.getDisplayNames()) for (Language lang : pd.getLanguages())
public WindowState getState(PortletWindow window) { WindowState state = getMappedState(window.getId().toString()); if (state != null && !JetspeedActions.getStandardWindowStates().contains(state)) { PortletApplication pa = window.getPortletDefinition().getApplication(); state = pa.getCustomWindowState(state); } return state; }
String paName = pd.getApplication().getName(); String pdName = pd.getPortletName(); Class<?> portletClazz = paCl.loadClass(pd.getPortletClass());
String paName = pd.getApplication().getName(); String pdName = pd.getPortletName(); if (bundle == null) Language l = pd.getLanguage(locale); if (pd.getResourceBundle() == null) ResourceBundle loadedBundle = loadResourceBundle(l.getLocale(), pd.getResourceBundle(), paCl); if (loadedBundle != null)
String paName = pd.getApplication().getName(); String pdName = pd.getPortletName(); String className = pd.getPreferenceValidatorClassname();
public FailedToStorePortletDefinitionException( PortletDefinition portlet, String reason ) { this("Unable to store portlet definition "+portlet.getPortletName()+". Resaon: "+reason); }
if (securityMode == SecurityAccessController.CONSTRAINTS) String constraintRef = portlet.getJetspeedSecurityConstraint(); if (constraintRef == null) constraintRef = ((PortletApplication)portlet.getApplication()).getJetspeedSecurityConstraint(); if (constraintRef == null) AccessController.checkPermission((Permission)pf.newPermission(pf.PORTLET_PERMISSION,portlet.getUniqueName(), mask));
List<Supports> supports = portlet.getSupports(); PortletApplication pa = window.getPortletDefinition().getApplication(); String portletName = portlet.getUniqueName();
public PortletDefinitionCompositeProxy(PortletDefinition def) { this.def = def; this.name = def.getUniqueName(); }
public synchronized static void cacheAdd(Identity oid, Object obj) { oidCache.remove(oid); PortletDefinition pd = (PortletDefinition)obj; if (pd.getApplication() == null) { return; } CacheElement entry = new EhCacheElementImpl(oid, obj); oidCache.put(entry); DistributedCacheObject wrapper = new RegistryCacheObjectWrapper(oid, pd.getUniqueName()); nameCache.remove(pd.getUniqueName()); CacheElement nameEntry = nameCache.createElement(pd.getUniqueName(), wrapper); nameCache.put(nameEntry); if (listeners != null) { for (int ix=0; ix < listeners.size(); ix++) { RegistryEventListener listener = (RegistryEventListener)listeners.get(ix); listener.portletUpdated((PortletDefinition)obj); } } }
private boolean isDeclaredAsPublishingEvent(PortletWindow portletWindow, QName qname) { PortletDefinition pd = portletWindow.getPortletDefinition(); List<? extends EventDefinitionReference> events = pd.getSupportedPublishingEvents(); if (events != null) { String defaultNamespace = pd.getApplication().getDefaultNamespace(); for (EventDefinitionReference ref : events) { QName name = ref.getQualifiedName(defaultNamespace); if (name == null) { continue; } if (qname.equals(name)) { return true; } } } return false; }
for (PortletDefinition portlet : portlets) for (SecurityRoleRef roleRef : portlet.getSecurityRoleRefs()) + portlet.getPortletName(); throw new PortletApplicationException(errorMsg);
CacheElement element = trackingCache.get(window.getPortletDefinition().getUniqueName()); if (element != null) { List<String> windows = (List<String>)element.getContent(); Collection<LocalizedField> fields = def.getMetadata().getFields(PortalReservedParameters.PORTLET_EXTENDED_DESCRIPTOR_OUT_OF_SERVICE);
private List<PortletWindow> getPortletsRegisteredOnPage(RequestContext rc, ContentFragment fragment, Event event, List<PortletWindow> eventTargets) { List<ContentFragment> fragments = fragment.getFragments(); if (fragments != null && fragments.size() > 0) { for (ContentFragment child : fragments) { getPortletsRegisteredOnPage(rc, child, event, eventTargets); } } // might need to create the PortletWindow if yet undefined PortletWindow portletWindow = rc.getPortletWindow(fragment); if (portletWindow == null || !portletWindow.isValid()) return eventTargets; PortletDefinition portlet = portletWindow.getPortletDefinition(); if (checkSecurityConstraints && !checkSecurityConstraint(portlet, fragment)) { return eventTargets; } if (portletTracking.isOutOfService(portletWindow)) { return eventTargets; } List<? extends EventDefinitionReference> processingEvents = portlet.getSupportedProcessingEvents(); if (isEventSupported(processingEvents, event.getQName(), portlet.getApplication().getDefaultNamespace())) { eventTargets.add(portletWindow); } return eventTargets; }