AnsweredAssumed Answered

Remove non existing aspect from node

Question asked by ceeliro on Sep 19, 2014
Latest reply on Sep 19, 2014 by ceeliro
Hi All,

I am trying to run a batch in the Share JavaScript console that removes an specific aspect applied to some nodes. The problem is that the aspect is a custom aspect and doesn't exist anymore in our last release

Example


var def =
{
  query: "@name:283.JPG",
  store: "workspace://SpacesStore"
};
var results = search.query(def);
for each(var node in results) {
     logger.log(node.name + " (" + node.typeShort + "): " + node.nodeRef);
     if(node.hasAspect("icmr:protectedContent")) {
          logger.log("Removing aspect");
        node.removeAspect("icmr:protectedContent");
   }
}


The error


500 Internal Error
An error inside the HTTP server which prevented it from fulfilling the request.
08190051 Wrapped Exception (with status template): 08190009 Failed to execute script 'Javascript Console Script': Class {http://www.alfresco.org/model/icmr/1.0}protectedContent has not been defined in the data dictionary


Any suggestion on how to achieve this?
Thanks in advance

Outcomes