@Override public IPortletType getType() { return this.portletDefinition.getType(); }
@Override public IPortletType getType() { return this.portletDefinition.getType(); }
@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; }
private Element getElementForChannel( Document doc, String chanId, IPortletDefinition def, String locale) { final Element channel = doc.createElement("channel"); // the ID attribute is the identifier for the Channel element channel.setAttribute("ID", chanId); channel.setIdAttribute("ID", true); channel.setAttribute("chanID", def.getPortletDefinitionId().getStringId()); channel.setAttribute("timeout", String.valueOf(def.getTimeout())); if (locale != null) { channel.setAttribute("name", def.getName(locale)); channel.setAttribute("title", def.getTitle(locale)); channel.setAttribute("description", def.getDescription(locale)); channel.setAttribute("locale", locale); } else { channel.setAttribute("name", def.getName()); channel.setAttribute("title", def.getTitle()); channel.setAttribute("description", def.getDescription()); } channel.setAttribute("fname", def.getFName()); // chanClassArg is so named to highlight that we are using the argument // to the method rather than the instance variable chanClass channel.setAttribute("typeID", String.valueOf(def.getType().getId())); for (final IPortletDefinitionParameter param : def.getParameters()) { final Element parameter = doc.createElement("parameter"); parameter.setAttribute("name", param.getName()); parameter.setAttribute("value", param.getValue()); channel.appendChild(parameter); } return channel; }
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); }
channelAttrs.add( EVENT_FACTORY.createAttribute( "typeID", Integer.toString(chanDef.getType().getId()))); channelAttrs.add(EVENT_FACTORY.createAttribute("hidden", "false")); channelAttrs.add(EVENT_FACTORY.createAttribute("unremovable", "true"));
/** * 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()); } }
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; }
|| portletDefinitionRegistry.getPortletDefinition(form.getId()).getType().getId() != form.getTypeId()) {
@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); }
@Override @PortalTransactional public IMarketplaceRating createOrUpdateRating( int rating, String userName, String review, IPortletDefinition portletDefinition) { MarketplaceRatingImpl temp = new MarketplaceRatingImpl(); 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); temp.setMarketplaceRatingPK(tempPK); temp.setRating(rating); temp.setReview(review); return this.createOrUpdateRating(temp); }
this.setTitle(def.getTitle()); this.setTimeout(def.getTimeout()); this.setTypeId(def.getType().getId()); this.setApplicationId(def.getPortletDescriptorKey().getWebAppName()); this.setPortletName(def.getPortletDescriptorKey().getPortletName());
rep.setResourceTimeout(convertToBigInteger(def.getResourceTimeout())); rep.setTitle(def.getTitle()); rep.setType(def.getType().getName());
protected IUserLayoutChannelDescription createUserLayoutChannelDescription( String nodeId, IPortletDefinition chanDef) { IUserLayoutChannelDescription ulnd = new UserLayoutChannelDescription(); ulnd.setId(nodeId); ulnd.setName(chanDef.getName()); ulnd.setUnremovable(true); ulnd.setImmutable(true); ulnd.setHidden(false); ulnd.setTitle(chanDef.getTitle()); ulnd.setDescription(chanDef.getDescription()); ulnd.setChannelPublishId("" + chanDef.getPortletDefinitionId().getStringId()); ulnd.setChannelTypeId("" + chanDef.getType().getId()); ulnd.setFunctionalName(chanDef.getFName()); ulnd.setTimeout(chanDef.getTimeout()); Set<IPortletDefinitionParameter> parms = chanDef.getParameters(); for (IPortletDefinitionParameter parm : parms) { ulnd.setParameterValue(parm.getName(), parm.getValue()); } return ulnd; }