@Override public PortletDefinition getParentPortletDescriptor(IPortletDefinitionId portletDefinitionId) { final IPortletDefinition portletDefinition = this.getPortletDefinition(portletDefinitionId); if (portletDefinition == null) { return null; } final Tuple<String, String> portletDescriptorKeys = this.getPortletDescriptorKeys(portletDefinition); final PortletRegistryService portletRegistryService = this.portalDriverContainerServices.getPortletRegistryService(); try { return portletRegistryService.getPortlet( portletDescriptorKeys.first, portletDescriptorKeys.second); } catch (PortletContainerException e) { if (this.logger.isDebugEnabled()) { this.logger.warn( "No portlet descriptor could be found for the portlet definition, null will be returned: " + portletDefinition, e); } else { this.logger.warn( "No portlet descriptor could be found for the portlet definition, null will be returned: " + portletDefinition + " Enable DEBUG for stack trace."); } return null; } }
public boolean isPortletManagedMode(String portletId, String mode) { String applicationId = PortletWindowConfig.parseContextPath(portletId); String applicationName = applicationId; // if (applicationName.length() > 0) // { // applicationName = applicationName.substring(1); // } try { PortletApplicationDefinition portletApp = portletRegistry.getPortletApplication(applicationName); Iterator<? extends CustomPortletMode> customModes = portletApp.getCustomPortletModes().iterator(); while (customModes.hasNext()) { CustomPortletMode customMode = (CustomPortletMode) customModes.next(); boolean isPortletManagedMode = !customMode.isPortalManaged(); if (isPortletManagedMode && customMode.getPortletMode().equalsIgnoreCase(mode)) { return true; } } } catch (PortletContainerException e) { LOG.error("Error determining portlet managed mode support, so we assume that it is false.", e); } return false; }
portletRegistryService.getRegisteredPortletApplicationNames(); iter.hasNext(); ) { final String applicationName = iter.next(); try { applicationDefninition = portletRegistryService.getPortletApplication(applicationName); } catch (PortletContainerException e) { throw new RuntimeException(
portletAppDD = portletRegistry.getPortletApplication(applicationName); } catch (PortletContainerException e) { StringBuffer errMsg = new StringBuffer(
@Override public PortletDefinition getParentPortletDescriptor(IPortletDefinitionId portletDefinitionId) { final IPortletDefinition portletDefinition = this.getPortletDefinition(portletDefinitionId); if (portletDefinition == null) { return null; } final Tuple<String, String> portletDescriptorKeys = this.getPortletDescriptorKeys(portletDefinition); final PortletRegistryService portletRegistryService = this.portalDriverContainerServices.getPortletRegistryService(); try { return portletRegistryService.getPortlet( portletDescriptorKeys.first, portletDescriptorKeys.second); } catch (PortletContainerException e) { if (this.logger.isDebugEnabled()) { this.logger.warn( "No portlet descriptor could be found for the portlet definition, null will be returned: " + portletDefinition, e); } else { this.logger.warn( "No portlet descriptor could be found for the portlet definition, null will be returned: " + portletDefinition + " Enable DEBUG for stack trace."); } return null; } }
@Override public PortletApplicationDefinition getParentPortletApplicationDescriptor( IPortletDefinitionId portletDefinitionId) { final IPortletDefinition portletDefinition = this.getPortletDefinition(portletDefinitionId); if (portletDefinition == null) { return null; } final Tuple<String, String> portletDescriptorKeys = this.getPortletDescriptorKeys(portletDefinition); final PortletRegistryService portletRegistryService = this.portalDriverContainerServices.getPortletRegistryService(); try { return portletRegistryService.getPortletApplication(portletDescriptorKeys.first); } catch (PortletContainerException e) { this.logger.warn( "No portlet application descriptor could be found likely not deployed. For portlet definition: " + portletDefinition, e); return null; } }
final PortletDefinition portletDescriptor; try { portletDescriptor = portletRegistryService.getPortlet(portletAppId, portletName); } catch (PortletContainerException e) { this.logger.warn(
@Override public PortletApplicationDefinition getParentPortletApplicationDescriptor( IPortletDefinitionId portletDefinitionId) { final IPortletDefinition portletDefinition = this.getPortletDefinition(portletDefinitionId); if (portletDefinition == null) { return null; } final Tuple<String, String> portletDescriptorKeys = this.getPortletDescriptorKeys(portletDefinition); final PortletRegistryService portletRegistryService = this.portalDriverContainerServices.getPortletRegistryService(); try { return portletRegistryService.getPortletApplication(portletDescriptorKeys.first); } catch (PortletContainerException e) { this.logger.warn( "No portlet application descriptor could be found likely not deployed. For portlet definition: " + portletDefinition, e); return null; } }
/** * Get a portlet descriptor matching the current portlet definition form. If the current form * does not represent a portlet, the application or portlet name fields are blank, or the * portlet description cannot be retrieved, the method will return <code>null</code>. * * @param form * @return */ public PortletDefinition getPortletDescriptor(PortletDefinitionForm form) { final Tuple<String, String> portletDescriptorKeys = this.getPortletDescriptorKeys(form); if (portletDescriptorKeys == null) { return null; } final String portletAppId = portletDescriptorKeys.first; final String portletName = portletDescriptorKeys.second; final PortletRegistryService portletRegistryService = portalDriverContainerServices.getPortletRegistryService(); try { return portletRegistryService.getPortlet(portletAppId, portletName); } catch (PortletContainerException e) { e.printStackTrace(); return null; } }
public boolean isPortletModeSupportedByPortlet(String portletId, String mode) { // View mode is always supported if (mode.equalsIgnoreCase(PortletMode.VIEW.toString())) { return true; } String applicationId = PortletWindowConfig.parseContextPath(portletId); String applicationName = applicationId; String portletName = PortletWindowConfig.parsePortletName(portletId); try { if (portletRegistry == null) { LOG.error("Optional Portlet Registry Service not found."); throw new PortletContainerException("Optional Portlet Registry Service not found."); } PortletApplicationDefinition ctx = portletRegistry.getPortletApplication(applicationName); for (Supports sd : ctx.getPortlet(portletName).getSupports()) { if (sd.getMimeType().matches("(?:\\*|\\*/\\*|text/html|text/\\*)")) { for (String pm : sd.getPortletModes()) { if (pm.equalsIgnoreCase(mode)) { return true; } } } } } catch (PortletContainerException e) { LOG.error("Error determining mode support.", e); } LOG.info("Portlet mode '" + mode + "' not found for portletId: '" + portletId + "'"); return false; }
private boolean isDeclaredAsPublishingEvent(QName qname) { String applicationId = PortletWindowConfig.parseContextPath(portletWindow.getId().getStringId()); String applicationName = applicationId; String portletName = PortletWindowConfig.parsePortletName(portletWindow.getId().getStringId()); List<? extends EventDefinitionReference> events = null; try { events = portletRegistry.getPortlet(applicationName, portletName).getSupportedPublishingEvents(); } catch (PortletContainerException e1) { e1.printStackTrace(); } if (events != null) { for (EventDefinitionReference ref : events) { QName name = ref.getQualifiedName(); if (name == null) { continue; } if (qname.equals(name)) { return true; } } } return false; }
portletAppDD = portletRegistry.getPortletApplication(applicationName);
try { portletDef = portletRegistryService.getPortlet( form.getApplicationId(), form.getPortletName()); } catch (PortletContainerException e) {
/** * Gets all modes supported by a portlet that are defined in the portlet's supports child element in portlet.xml. * * @param portletId * of interest. * @return all portlet modes supported by a portlet. */ public Set<PortletMode> getSupportedPortletModes(String portletId) throws PortletContainerException { Set<PortletMode> modeSet = new HashSet<PortletMode>(); modeSet.add(PortletMode.VIEW); // view is always supported String applicationId = PortletWindowConfig.parseContextPath(portletId); String applicationName = applicationId; String portletName = PortletWindowConfig.parsePortletName(portletId); if (portletRegistry == null) { LOG.error("Optional Portlet Registry Service not found."); throw new PortletContainerException("Optional Portlet Registry Service not found."); } PortletApplicationDefinition portletApp = portletRegistry.getPortletApplication(applicationName); for (Supports sd : portletApp.getPortlet(portletName).getSupports()) { if (sd.getMimeType().matches("(?:\\*|\\*/\\*|text/html|text/\\*)")) { for (String pm : sd.getPortletModes()) { modeSet.add((new PortletMode(pm))); } } } return modeSet; }
try { portletAppDD = portletRegistry .getPortletApplication(applicationName); List<? extends PortletDefinition> portletDDs = portletAppDD .getPortlets();
String appName = PortletWindowConfig.fromId(pid).getContextPath(); try { String pv = dc.getPortletRegistryService().getPortletApplication(appName).getVersion(); portalURL.setVersion(pid, pv); if (isTrace) {