/** * Add a parameter for a channel in both the ILF and PLF using the appropriate mechanisms for * incorporated nodes versus owned nodes. */ public void perform() throws PortalException { // push the change into the PLF if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) { // we are dealing with an incorporated node ParameterEditManager.addParmEditDirective(ilfNode, nodeId, name, value, person); } else { // node owned by user so add parameter child directly Document plf = RDBMDistributedLayoutStore.getPLF(person); Element plfNode = plf.getElementById(nodeId); addParameterChild(plfNode, name, value); } // push the change into the ILF addParameterChild(ilfNode, name, value); }
/** * Create and append a parameter edit directive to parameter edits set for applying a user * specified value to a named parameter of the incorporated channel represented by the passed-in * target id. If one already exists for that node and that name then the value of the existing * edit is changed to the passed-in value. */ public static synchronized void addParmEditDirective( Element compViewChannelNode, String targetId, String name, String value, IPerson person) throws PortalException { Document plf = (Document) person.getAttribute(Constants.PLF); Element parmSet = getParmEditSet(plf, person, true); NodeList edits = parmSet.getChildNodes(); Element existingEdit = null; for (int i = 0; i < edits.getLength(); i++) { Element edit = (Element) edits.item(i); if (edit.getAttribute(Constants.ATT_TARGET).equals(targetId) && edit.getAttribute(Constants.ATT_NAME).equals(name)) { existingEdit = edit; break; } } if (existingEdit == null) // existing one not found, create a new one { addParmEditDirective(targetId, name, value, person, plf, parmSet); return; } existingEdit.setAttribute(Constants.ATT_USER_VALUE, value); }