definition.getMetadata().copyFields(addDefinition.getMetadata().getFields());
definition.getMetadata().copyFields(addDefinition.getMetadata().getFields());
menu.getMetadata().copyFields(source.getMetadata().getFields()); menuSeparator.getMetadata().copyFields(source.getMetadata().getFields());
/** * Copy shared fragments attributes. * * @param source source fragments * @param copyIds flag indicating whether to copy or preserve fragment ids * @param dest destination fragments * @throws NodeException on error creating fragments */ protected void copyFragmentsAttributes(BaseFragmentsElement source, boolean copyIds, BaseFragmentsElement dest) throws NodeException { // create the new page and copy attributes dest.setTitle(source.getTitle()); dest.setShortTitle(source.getShortTitle()); dest.setVersion(source.getVersion()); // copy locale specific metadata dest.getMetadata().copyFields(source.getMetadata().getFields()); // copy security constraints SecurityConstraints srcSecurity = source.getSecurityConstraints(); if ((srcSecurity != null) && !srcSecurity.isEmpty()) { SecurityConstraints copiedSecurity = copySecurityConstraints(PAGE_NODE_TYPE, srcSecurity); dest.setSecurityConstraints(copiedSecurity); } // copy fragments BaseFragmentElement root = copyFragment(source.getRootFragment(), null, copyIds); dest.setRootFragment(root); }
public Link copyLink(Link source, String path) throws NodeException { // create the new link and copy attributes Link link = newLink(path); link.setTitle(source.getTitle()); link.setShortTitle(source.getShortTitle()); link.setSkin(source.getSkin()); link.setVersion(source.getVersion()); link.setTarget(source.getTarget()); link.setUrl(source.getUrl()); link.setHidden(source.isHidden()); // copy locale specific metadata link.getMetadata().copyFields(source.getMetadata().getFields()); // copy security constraints SecurityConstraints srcSecurity = source.getSecurityConstraints(); if ((srcSecurity != null) && !srcSecurity.isEmpty()) { SecurityConstraints copiedSecurity = copySecurityConstraints(LINK_NODE_TYPE, srcSecurity); link.setSecurityConstraints(copiedSecurity); } return link; }
folder.getMetadata().copyFields(source.getMetadata().getFields());