10-24-2011 07:57 AM
10-24-2011 09:01 AM
10-24-2011 01:38 PM
11-21-2011 11:41 AM
11-21-2011 12:16 PM
11-21-2011 12:44 PM
11-22-2011 03:20 AM
Here are a few files you can look at in the remote-api and slingshot projects.
Data webscript example : http://localhost:8080/alfresco/service/api/people/admin/sites
Data webscript files in source (remote-api project) :
/Remote API/config/alfresco/templates/webscripts/org/alfresco/repository/person/person.sites.get.desc.xml
/Remote API/config/alfresco/templates/webscripts/org/alfresco/repository/person/person.sites.get.js
/Remote API/config/alfresco/templates/webscripts/org/alfresco/repository/person/person.sites.get.json.ftl
Presentation webscript call example (slingshot project) :
/Slingshot/config/alfresco/site-webscripts/org/alfresco/components/dashlets/my-sites.get.js
11-22-2011 08:45 AM
11-22-2011 08:53 AM
11-22-2011 09:33 AM
Here are a few files you can look at in the remote-api and slingshot projects.It is a complete example, just look at the javascript controller (person.sites.get.js) :
Data webscript example : http://localhost:8080/alfresco/service/api/people/admin/sites
Data webscript files in source (remote-api project) :
/Remote API/config/alfresco/templates/webscripts/org/alfresco/repository/person/person.sites.get.desc.xml
/Remote API/config/alfresco/templates/webscripts/org/alfresco/repository/person/person.sites.get.js
/Remote API/config/alfresco/templates/webscripts/org/alfresco/repository/person/person.sites.get.json.ftl
Presentation webscript call example (slingshot project) :
/Slingshot/config/alfresco/site-webscripts/org/alfresco/components/dashlets/my-sites.get.js
function main()
{
// Get the user name of the person to get
var userName = url.templateArgs.userid;
// Get the person who has that user name
var person = people.getPerson(userName);
if (person === null)
{
// Return 404 - Not Found
status.setCode(status.STATUS_NOT_FOUND, "Person " + userName + " does not exist");
return;
}
// Get the list of sites
var sites = siteService.listUserSites(userName);
var sizeString = args["size"];
if (sizeString != null)
{
var size = parseInt(sizeString);
if (size < sites.length)
{
// Only return the first n sites based on the passed page size
var pagedSites = new Array(size);
for (var index = 0; index < size; index++)
{
pagedSites[index] = sites[index];
}
sites = pagedSites;
}
}
model.sites = sites;
}
main();
This is using the following javascript API objects : people and siteService. These are the kind of objects you would use to get stuff out of the repository.
…
// This returns a ScriptNode from the repository (see Javascript API)
var updateNode = search.findNode(updateNodeRef);
…
// A few other bunch of Javascript API calls you can find in this controller (write content in the repository to the updatedNode, checkin updatedNode)
// Update the working copy content
updateNode.properties.content.write(content);
// Reset working copy mimetype and encoding
updateNode.properties.content.guessMimetype(filename);
updateNode.properties.content.guessEncoding();
// check it in again, with supplied version history note
updateNode = updateNode.checkin(description, majorVersion);
…
As for Java-backed webscript, you would have a description file and a template file as in any other webscript + a java class and a bean reference in your Spring context file.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.