/** * Construct channel information from a Channel Definition object. * * @param definition */ public UserLayoutChannelDescription(IPortletDefinition definition) { this.title = definition.getTitle(); this.name = definition.getName(); this.name = definition.getName(); this.description = definition.getDescription(); this.channelPublishId = String.valueOf(definition.getPortletDefinitionId().getStringId()); this.channelTypeId = String.valueOf(definition.getType().getId()); this.functionalName = definition.getFName(); this.timeout = definition.getTimeout(); for (IPortletDefinitionParameter param : definition.getParameters()) { this.setParameterValue(param.getName(), param.getValue()); } }
public PortletTuple(IPortletDefinition pdef) { this.id = pdef.getPortletDefinitionId().getStringId(); this.name = pdef.getName(); this.fname = pdef.getFName(); this.description = pdef.getDescription(); this.type = pdef.getType().getName(); this.lifecycleState = pdef.getLifecycleState().toString(); this.categories = getPortletCategories(pdef); }
@Override @PortalTransactional public IMarketplaceRating getRating(String userName, IPortletDefinition portletDefinition) { PortletDefinitionImpl tempPortlet = new PortletDefinitionImpl( portletDefinition.getType(), portletDefinition.getFName(), portletDefinition.getName(), portletDefinition.getTitle(), portletDefinition.getPortletDescriptorKey().getWebAppName(), portletDefinition.getPortletDescriptorKey().getPortletName(), portletDefinition.getPortletDescriptorKey().isFrameworkPortlet(), portletDefinition.getPortletDefinitionId()); MarketplaceRatingPK tempPK = new MarketplaceRatingPK(userName, tempPortlet); return this.getRating(tempPK); }
/** * Initialize the state using portlet definition. Class fields will be retrieved from portlet * definition using specified locale. * * @param definition portelt definition to use (must not be null). * @param locale specifies the localization to use. */ public LocalizedPortletDefinition(IPortletDefinition definition, String locale) { assert definition != null; if (locale != null) { this.name = definition.getName(locale); this.title = definition.getTitle(locale); this.description = definition.getDescription(locale); } else { this.name = definition.getName(); this.title = definition.getTitle(); this.description = definition.getDescription(); } }
private Map<String, String> getPortletAttrs(IPortletDefinition portlet, String url) { final Map<String, String> rslt = new TreeMap<>(); rslt.put("name", portlet.getName()); rslt.put("fname", portlet.getFName()); rslt.put("title", portlet.getTitle()); rslt.put("description", portlet.getDescription()); rslt.put("url", url); return rslt; } }
rep.setFname(def.getFName()); rep.setDesc(def.getDescription()); rep.setName(def.getName()); rep.setTimeout(BigInteger.valueOf(def.getTimeout())); rep.setActionTimeout(convertToBigInteger(def.getActionTimeout())); rep.setEventTimeout(convertToBigInteger(def.getEventTimeout())); rep.setRenderTimeout(convertToBigInteger(def.getRenderTimeout())); rep.setResourceTimeout(convertToBigInteger(def.getResourceTimeout())); rep.setTitle(def.getTitle()); rep.setType(def.getType().getName()); for (IPortletLifecycleEntry ple : def.getLifecycle()) { final LifecycleEntry entry = new LifecycleEntry(); entry.setName(ple.getLifecycleState().toString()); final IPortletDescriptorKey portletDescriptorKey = def.getPortletDescriptorKey(); if (portletDescriptorKey.isFrameworkPortlet()) { portletDescriptor.setIsFramework(true); for (IPortletDefinitionParameter param : def.getParameters()) { final ExternalPortletParameter externalPortletParameter = new ExternalPortletParameter(); for (IPortletPreference pref : def.getPortletPreferences()) { final ExternalPortletPreference externalPortletPreference = new ExternalPortletPreference(); final IGroupMember gm = GroupService.getGroupMember(
this.setId(def.getPortletDefinitionId().getStringId()); this.setFname(def.getFName()); this.setName(def.getName()); this.setDescription(def.getDescription()); this.setTitle(def.getTitle()); this.setTimeout(def.getTimeout()); this.setTypeId(def.getType().getId()); this.setApplicationId(def.getPortletDescriptorKey().getWebAppName()); this.setPortletName(def.getPortletDescriptorKey().getPortletName()); this.setFramework(def.getPortletDescriptorKey().isFrameworkPortlet()); if (def.getParameter(IPortletDefinition.EDITABLE_PARAM) != null) { this.setEditable( Boolean.parseBoolean( def.getParameter(IPortletDefinition.EDITABLE_PARAM).getValue())); if (def.getParameter(IPortletDefinition.CONFIGURABLE_PARAM) != null) { this.setConfigurable( Boolean.parseBoolean( def.getParameter(IPortletDefinition.CONFIGURABLE_PARAM).getValue())); if (def.getParameter(IPortletDefinition.HAS_HELP_PARAM) != null) { this.setHasHelp( Boolean.parseBoolean( def.getParameter(IPortletDefinition.HAS_HELP_PARAM).getValue())); if (def.getParameter(IPortletDefinition.HAS_ABOUT_PARAM) != null) { this.setHasAbout( Boolean.parseBoolean( def.getParameter(IPortletDefinition.HAS_ABOUT_PARAM).getValue()));
private ChannelBean getChannel( IPortletDefinition definition, WebRequest request, Locale locale) { ChannelBean channel = new ChannelBean(); channel.setId(definition.getPortletDefinitionId().getStringId()); channel.setDescription(definition.getDescription(locale.toString())); channel.setFname(definition.getFName()); channel.setName(definition.getName(locale.toString())); channel.setState(definition.getLifecycleState().toString()); channel.setTitle(definition.getTitle(locale.toString())); channel.setTypeId(definition.getType().getId()); // See api docs for postProcessIconUrlParameter() below IPortletDefinitionParameter iconParameter = definition.getParameter(ICON_URL_PARAMETER_NAME); if (iconParameter != null) { IPortletDefinitionParameter evaluated = postProcessIconUrlParameter(iconParameter, request); channel.setIconUrl(evaluated.getValue()); } return channel; }
if (!hasLifecyclePermission(publisher, def.getLifecycleState(), categoryBeans)) { logger.warn( "User '" || portletDefinitionRegistry.getPortletDefinition(form.getId()).getType().getId() != form.getTypeId()) { } else { portletDef = portletDefinitionRegistry.getPortletDefinition(form.getId()); portletDef.setType(portletType); portletDef.setFName(form.getFname()); portletDef.setName(form.getName()); portletDef.setTitle(form.getTitle()); portletDef.getPortletDescriptorKey().setWebAppName(form.getApplicationId()); portletDef.getPortletDescriptorKey().setPortletName(form.getPortletName()); portletDef.getPortletDescriptorKey().setFrameworkPortlet(form.isFramework()); portletDef.setDescription(form.getDescription()); portletDef.setTimeout(form.getTimeout()); String value = form.getParameters().get(key).getValue(); if (!StringUtils.isBlank(value)) { portletDef.addParameter(key, value); portletDef.addParameter( IPortletDefinition.EDITABLE_PARAM, Boolean.toString(form.isEditable())); portletDef.addParameter( IPortletDefinition.CONFIGURABLE_PARAM, Boolean.toString(form.isConfigurable())); portletDef.addParameter(
title = portletDef.getTitle(); description = portletDef.getDescription(); fname = portletDef.getFName(); url = portletDef.getAlternativeMaximizedLink(); target = portletDef.getTarget(); isAltMaxUrl = StringUtils.isNotBlank(url); IPortletDefinitionParameter iconParam = portletDef.getParameter("iconUrl"); if (iconParam != null) { this.setIconUrl(iconParam.getValue()); IPortletDefinitionParameter faIconParam = portletDef.getParameter("faIcon"); if (faIconParam != null) { this.setFaIcon(faIconParam.getValue()); portletDef.getParametersAsUnmodifiableMap()); for (IPortletPreference pref : portletDef.getPortletPreferences()) { if (CONTENT_PORTLET_PREFERENCE.equals(pref.getName()) && pref.getValues().length == 1 && portletDef.getPortletDescriptorKey() != null && STATIC_CONTENT_PORTLET_WEBAPP_NAME.equals( portletDef.getPortletDescriptorKey().getWebAppName())) {
@Override public IPortletDefinitionId getPortletDefinitionId() { return this.portletDefinition.getPortletDefinitionId(); }
@Override public String getFName() { return this.portletDefinition.getFName(); }
@Override @PortalTransactional public IPortletDefinition savePortletDefinition(IPortletDefinition portletDefinition) { Validate.notNull(portletDefinition, "portletDefinition can not be null"); Validate.notNull( portletDefinition.getType(), "portletDefinition portlet type can not be null"); Validate.notEmpty(portletDefinition.getFName(), "portletDefinition fname can not be null"); Validate.notEmpty(portletDefinition.getName(), "portletDefinition name can not be null"); Validate.notEmpty(portletDefinition.getTitle(), "portletDefinition title can not be null"); this.getEntityManager().persist(portletDefinition); return portletDefinition; }
isFramework != null ? isFramework : false); } else { final IPortletDescriptorKey portletDescriptorKey = rslt.getPortletDescriptorKey(); portletDescriptorKey.setPortletName(portletDescriptor.getPortletName()); if (isFramework != null && isFramework) { portletDescriptorKey.setWebAppName(portletDescriptor.getWebAppName()); rslt.setName(epd.getName()); rslt.setTitle(epd.getTitle()); rslt.setType(portletType); rslt.setDescription(epd.getDesc()); final BigInteger timeout = epd.getTimeout(); if (timeout != null) { rslt.setTimeout(timeout.intValue()); rslt.setActionTimeout(actionTimeout.intValue()); rslt.setEventTimeout(eventTimeout.intValue()); rslt.setRenderTimeout(renderTimeout.intValue()); rslt.setResourceTimeout(resourceTimeout.intValue()); rslt.setParameters(parameters); rslt.setPortletPreferences(preferenceList);
portletDefinition.getPortletDefinitionId(); if (this.supportsEvent(event, portletDefinitionId)) { this.logger.debug("{} supports event {}", portletDefinition, event); portletDefinition.getParameter( PortletExecutionManager.DISABLE_PORTLET_EVENTS_PARAMETER); if (disablePortletEvents != null logger.info( "Ignoring portlet events for portlet '{}' because they have been disabled.", portletDefinition.getFName()); continue; portletDefinition.getParameter( PortletExecutionManager.DISABLE_PORTLET_EVENTS_PARAMETER); if (disablePortletEvents != null logger.info( "Ignoring portlet events for portlet '{}' because they have been disabled.", portletDefinition.getFName()); continue; portletDefinition.getPortletDefinitionId();
portletDefinition.getPortletDefinitionId().getStringId())) { portletDefinition.getPortletDefinitionId().getLongId(), fname, portletDefinition.getTitle(locale.toString()), portletDefinition.getDescription(locale.toString()));
portlet, this.marketplaceService, this.portletCategoryRegistry))) { final SearchResult result = new SearchResult(); result.setTitle(portlet.getTitle()); result.setSummary(portlet.getDescription()); result.getType().add("marketplace"); httpServletRequest, portlet.getFName()); final IPortalUrlBuilder portalUrlBuilder = this.portalUrlProvider.getPortalUrlBuilderByPortletFName( httpServletRequest, portlet.getFName(), UrlType.RENDER); final IPortletUrlBuilder portletUrlBuilder = portalUrlBuilder.getPortletUrlBuilder(portletWindowId); PortletUrlParameter fNameParam = new PortletUrlParameter(); fNameParam.setName("fName"); fNameParam.getValue().add(portlet.getFName()); url.getParam().add(fNameParam); result.setPortletUrl(url);
protected long getPortletRenderTimeout( IPortletWindowId portletWindowId, HttpServletRequest request) { if (this.ignoreTimeouts) { return DEBUG_TIMEOUT; } final IPortletDefinition portletDefinition = getPortletDefinition(portletWindowId, request); final Integer renderTimeout = portletDefinition.getRenderTimeout(); if (renderTimeout != null) { return getModifiedTimeout(portletDefinition, request, renderTimeout); } return getModifiedTimeout(portletDefinition, request, portletDefinition.getTimeout()); }
@ResourceMapping @RequestMapping(params = "action=getEntityList") public ModelAndView getEntityList() throws Exception { final List<IPortletDefinition> portletDefs = portletDefinitionDao.getPortletDefinitions(); final List<TranslatableEntity> entities = new ArrayList<TranslatableEntity>(); for (IPortletDefinition portletDef : portletDefs) { TranslatableEntity entity = new TranslatableEntity(); entity.setId(portletDef.getPortletDefinitionId().getStringId()); entity.setTitle(portletDef.getTitle()); entities.add(entity); } return new ModelAndView("json", "entities", entities); }
@Override public String getName() { return this.portletDefinition.getName(); }