/** * Fills the given element with a {@link CmsXmlCategoryValue} for the given data.<p> * * @param element the element to fill * @param id the id to use * @param rootPath the path to use * @param type the relation type to use */ public static void fillEntry(Element element, CmsUUID id, String rootPath, CmsRelationType type) { CmsLink link = new CmsLink(CmsXmlCategoryValue.TYPE_VFS_LINK, type, id, rootPath, true); // get xml node Element linkElement = element.element(CmsXmlPage.NODE_LINK); if (linkElement == null) { // create xml node if needed linkElement = element.addElement(CmsXmlPage.NODE_LINK); } // update xml node CmsLinkUpdateUtil.updateXmlForVfsFile(link, linkElement); }
/** * Fills the given element with a {@link CmsXmlVfsFileValue} for the given data.<p> * * @param element the element to fill * @param id the id to use * @param rootPath the path to use * @param type the relation type to use */ public static void fillEntry(Element element, CmsUUID id, String rootPath, CmsRelationType type) { CmsLink link = new CmsLink(CmsXmlVfsFileValue.TYPE_VFS_LINK, type, id, rootPath, true); // get xml node Element linkElement = element.element(CmsXmlPage.NODE_LINK); if (linkElement == null) { // create xml node if needed linkElement = element.addElement(CmsXmlPage.NODE_LINK); } // update xml node CmsLinkUpdateUtil.updateXmlForVfsFile(link, linkElement); }
/** * Sets the value as a structure id.<p> * * @param cms the current CMS context * @param id the structure id which should be stored in the category value */ public void setIdValue(CmsObject cms, CmsUUID id) { CmsRelationType type = CmsRelationType.CATEGORY; CmsLink link = new CmsLink(TYPE_VFS_LINK, type, id, "@", true); // link management check link.checkConsistency(cms); // update xml node CmsLinkUpdateUtil.updateXmlForVfsFile(link, m_element.addElement(CmsXmlPage.NODE_LINK)); }
/** * Updates the given xml element with this link information.<p> * * @param link the link to get the information from * @param name the (optional) name of the link * @param element the <link> element to update */ public static void updateXmlForHtmlValue(CmsLink link, String name, Element element) { // if element is not null if (element != null) { // update the additional attributes if (name != null) { updateAttribute(element, CmsLink.ATTRIBUTE_NAME, link.getName()); } updateAttribute(element, CmsLink.ATTRIBUTE_INTERNAL, Boolean.toString(link.isInternal())); // update the common sub-elements and attributes updateXmlForVfsFile(link, element); } }
/** * Updates the given xml element with this link information.<p> * * @param link the link to get the information from * @param name the (optional) name of the link * @param element the <link> element to update */ public static void updateXmlForHtmlValue(CmsLink link, String name, Element element) { // if element is not null if (element != null) { // update the additional attributes if (name != null) { updateAttribute(element, CmsLink.ATTRIBUTE_NAME, link.getName()); } updateAttribute(element, CmsLink.ATTRIBUTE_INTERNAL, Boolean.toString(link.isInternal())); // update the common sub-elements and attributes updateXmlForVfsFile(link, element); } }
/** * Sets the value as a structure id.<p> * * @param cms the current CMS context * @param id the structure id which should be stored in the file value */ public void setIdValue(CmsObject cms, CmsUUID id) { CmsRelationType type = getRelationType(getPath()); CmsLink link = new CmsLink(TYPE_VFS_LINK, type, id, "@", true); // link management check link.checkConsistency(cms); // update xml node CmsLinkUpdateUtil.updateXmlForVfsFile(link, m_element.addElement(CmsXmlPage.NODE_LINK)); }
CmsLinkUpdateUtil.updateXmlForVfsFile(link, m_element.addElement(CmsXmlPage.NODE_LINK));
CmsLinkUpdateUtil.updateXmlForVfsFile(link, m_element.addElement(CmsXmlPage.NODE_LINK));
CmsLinkUpdateUtil.updateXmlForVfsFile(link, m_element.addElement(CmsXmlPage.NODE_LINK));