mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
- AVM Web Script Sample (browse stores, folders, content)
- Fix Web Script issue where urls contained ; (due to tomcat) - Allow AVMScriptStore to be passed through script converters (add serializable) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6071 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
36
config/alfresco/bootstrap/webscripts/avmbrowse.get.js
Normal file
36
config/alfresco/bootstrap/webscripts/avmbrowse.get.js
Normal file
@@ -0,0 +1,36 @@
|
||||
script:
|
||||
{
|
||||
// extract avm store id and path
|
||||
var fullpath = url.extension.split("/");
|
||||
if (fullpath.length == 0)
|
||||
{
|
||||
status.code = 400;
|
||||
status.message = "Store id has not been provided.";
|
||||
status.redirect = true;
|
||||
break script;
|
||||
}
|
||||
var storeid = fullpath[0];
|
||||
var path = (fullpath.length == 1 ? "/" : "/" + fullpath.slice(1).join("/"));
|
||||
|
||||
// locate avm node from path
|
||||
var store = avm.lookupStore(storeid);
|
||||
if (store == undefined)
|
||||
{
|
||||
status.code = 404;
|
||||
status.message = "Store " + storeid + " not found.";
|
||||
status.redirect = true;
|
||||
break script;
|
||||
}
|
||||
var node = avm.lookupNode(storeid + ":" + path);
|
||||
if (node == undefined)
|
||||
{
|
||||
status.code = 404;
|
||||
status.message = "Path " + path + " within store " + storeid + " not found.";
|
||||
status.redirect = true;
|
||||
break script;
|
||||
}
|
||||
|
||||
// setup model for templates
|
||||
model.store = store;
|
||||
model.folder = node;
|
||||
}
|
Reference in New Issue
Block a user