11-27-2008 11:57 PM
var data = companyhome.childByNamePath("/Guest Home/a.xml");
if(data == null ){
logger.log("No files found");
status.code = 404;
status.message = "No files found";
status.redirect = true;
} else {
model.storeid = data.getId();
model.dataRetrieved = data;
}
2)The second way could be performing a lucene search for the ID of that file.
var files = search.luceneSearch("ID:\"workspace://SpacesStore/0d18339a-1c6e-4b92-975f-1d9004e96264\"");
if (files == null || files.length == 0) {
logger.log("No files found");
status.code = 404;
status.message = "No files found";
status.redirect = true;
} else {
var data = files[0];
model.storeid = data.getId();
model.dataRetrieved = data;
}
Now both the codes work fine for the file in the guest home directory.12-05-2008 04:13 AM
script: {
var store="youwebapp–sandboxname";
var contentPath ="/www/avm_webapps/ROOT/path/to/your/content";
if (storeExists(store)) {
var node = avm.lookupNode(store + ":" + contentPath);
if (node == null) {
status.code = 404;
status.message = store + " could not be found.";
status.redirect = true;
return;
}
model.data = node;
}
}
function storeExists(store){
var storeRoot = avm.lookupStore(store);
if (storeRoot == null){
status.code = 404;
status.message = store + " could not be found.";
status.redirect = true;
return false;
}
return true;
}
12-08-2008 11:27 PM
12-09-2008 03:33 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.