/** * A factory method to create a <code>UserLayoutNodeDescription</code> instance, based on the * information provided in the user layout <code>Element</code>. * * @param xmlNode a user layout DTD folder/channel <code>Element</code> value * @return an <code>UserLayoutNodeDescription</code> value * @exception PortalException if the xml passed is somehow invalid. */ public static UserLayoutNodeDescription createUserLayoutNodeDescription(Element xmlNode) throws PortalException { // is this a folder or a channel ? String nodeName = xmlNode.getNodeName(); if (nodeName.equals("channel")) { return new UserLayoutChannelDescription(xmlNode); } else if (nodeName.equals("folder")) { return new UserLayoutFolderDescription(xmlNode); } else { throw new PortalException( "Given XML element '" + nodeName + "' is neither folder nor channel"); } }
IUserLayoutChannelDescription channel = new UserLayoutChannelDescription(definition);
final IUserLayoutManager ulm = upm.getUserLayoutManager(); final IUserLayoutChannelDescription channel = new UserLayoutChannelDescription(pdef);
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; }