As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
/** * CopySpaceMetadata * * This script makes sure that a content "inherits" is containing space metadata. * It will not overwrite already existing metadata about the content */ // Make sure that the content have the aspects the space has for(var i in space.aspects){ if(!document.hasAspect(i)){ document.addAspect(i); } } // Set the properties from the space to the content, unless they already are set for(var i in space.properties){ if(document.property[i] == null){ document.property[i] = space.properties[i]; } }
document.save();
for(var i in space.aspects){ logger.log("Found aspect " + i); }
for(var i in space.aspects){ logger.log("Found aspect " + i); if(!document.hasAspect(i)){ logger.log("Adding aspect: " + i + " to document"); document.addAspect(i); } }
for(var i in space.aspects){ logger.log("Found aspect " + i); if(!document.hasAspect(i)){ logger.log("Adding aspect: " + i + " to document"); document.addAspect(space.aspects[i]); } }
for (prop in object) { if (object.hasOwnProperty(prop) { // do something } }
for (var i=0; i < space.aspects.length; i++) { logger.log(space.aspects[i]); }
/** * CopySpaceMetadata * * This script makes sure that a content "inherits" is containing space metadata. * It will not overwrite already existing metadata about the content */ // Make sure that the content have the aspects the space has logger.log("Script CopySpaceMetadata started"); var myArr = space.aspects.toArray(); // Copy the aspects from the space to the content for(i in myArr){ logger.log("Found aspect " + myArr[i]); if(!document.hasAspect(myArr[i])){ logger.log("Adding aspect: " + myArr[i] + " to document"); document.addAspect(myArr[i]); } } // Set the properties from the space to the content, unless they already are set for(var i in space.properties){ logger.log("Found property: " + space.properties[i]); if(document.properties[i] == null){ document.properties[i] = space.properties[i]; } }