HOla, me estoy iniciando en ALfresco y me interesa mucho como has hecho lo desubir un fichero mediante un web scripts y añadirle la categoria. ¿Qué formato le das al fichero para marcar las categorías? por otro lado, podrías pasarme el fuente del sripts? Muchas gracias
var cats = document.properties["cm:categories"];
//list categories
for (var i = 0; i < cats.length ; i++)
{
var catName = cats[i].name;
document.content += "—————>"+catName+"\n";
}
//add one category
var root_cats = classification.getRootCategories("cm:generalclassifiable");
var cat = root_cats[1];
cats.push(cat);
document.properties["cm:categories"] = cats;
document.save();
var check = search.luceneSearch("@cm\\:name:\"MYCLASSIFICATION\" AND TYPE:\"category\"");
if(check.length == 0) {
// /{http://www.alfresco.org/model/content/1.0}categoryRoot
var root = search.luceneSearch("@cm\\:name:\"categories\" AND TYPE:\"category_root\"")[0];
root.createNode("MYCLASSIFICATION", "{http://www.alfresco.org/model/content/1.0}category", "cm:categories");
}
var root = search.luceneSearch("@cm\\:name:\"Tags\" AND TYPE:\"category\"")[0];
var subcategory = root.createNode("NOMBRE", "{http://www.alfresco.org/model/content/1.0}category", "cm:subcategories");
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.