@Override public String getDescription(String locale) { return this.portletDefinition.getDescription(); }
@Override public String getDescription() { return this.portletDefinition.getDescription(); }
@Override public String getDescription(String locale) { return this.portletDefinition.getDescription(); }
@Override public String getDescription() { return this.portletDefinition.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; } }
/** * Performs a case-insensitive comparison of the user's query against several important fields * from the {@link IPortletDefinition}. * * @param query The user's search terms, which seem to be forced lower-case * @param portlet Definition of portlet to check name, title, and description * @return true if the query string is contained in the above 3 attributes; otherwise, false */ public static boolean matches(final String query, final IPortletDefinition portlet) { /* * The query parameter is coming in lower case always (even when upper * or mixed case is entered by the user). We really want a case- * insensitive comparison here anyway; for safety, we will make certain * it is insensitive. */ final String lcQuery = query.toLowerCase(); final boolean titleMatch = portlet.getTitle().toLowerCase().contains(lcQuery); final boolean nameMatch = portlet.getName().toLowerCase().contains(lcQuery); final boolean descMatch = portlet.getDescription() != null && portlet.getDescription().toLowerCase().contains(lcQuery); final boolean fnameMatch = portlet.getFName().toLowerCase().contains(lcQuery); return titleMatch || nameMatch || descMatch || fnameMatch; }
/** * 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 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; }
fname, portletDefinition.getTitle(locale.toString()), portletDefinition.getDescription(locale.toString()));
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 public SearchResults getSearchResults(PortletRequest request, SearchRequest query) { final String queryString = query.getSearchTerms().toLowerCase(); final List<IPortletDefinition> portlets = portletDefinitionRegistry.getAllPortletDefinitions(); final HttpServletRequest httpServletRequest = this.portalRequestUtils.getPortletHttpRequest(request); final SearchResults results = new SearchResults(); for (IPortletDefinition portlet : portlets) { if (portletRegistryUtil.matches(queryString, portlet)) { final SearchResult result = new SearchResult(); result.setTitle(portlet.getTitle()); result.setSummary(portlet.getDescription()); result.getType().add(searchResultType); String url = portletRegistryUtil.buildPortletUrl(httpServletRequest, portlet); if (url != null) { result.setExternalUrl(url); results.getSearchResult().add(result); } } } return results; } }
channelAttrs.add(EVENT_FACTORY.createAttribute("name", chanDef.getName())); channelAttrs.add( EVENT_FACTORY.createAttribute("description", chanDef.getDescription())); channelAttrs.add(EVENT_FACTORY.createAttribute("title", chanDef.getTitle())); channelAttrs.add(
/** * 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; }
description = portletDef.getDescription(); fname = portletDef.getFName(); url = portletDef.getAlternativeMaximizedLink();
final SearchResult result = new SearchResult(); result.setTitle(portlet.getTitle()); result.setSummary(portlet.getDescription()); result.getType().add("marketplace");
this.setFname(def.getFName()); this.setName(def.getName()); this.setDescription(def.getDescription()); this.setTitle(def.getTitle()); this.setTimeout(def.getTimeout());
rep.setDesc(def.getDescription()); rep.setName(def.getName()); rep.setTimeout(BigInteger.valueOf(def.getTimeout()));
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; }