New Site nodeID parameter in Javascript action
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2010 08:01 AM
Hello,
Iam trying to implement Site Templates for Share. Because of problems with permissions and the deepcopy Iam trying to do this with a custom action whenever a node is created on in the Site node.
The Javascript is triggered by an action whenever a subfolder is created in the Sites folder of the repository, but now I need the nodeID of the new Site within this script.
How can I retreive the new Site name and the nodeID.
Default parameter space point towards the Sites node of the repository
Default parameter Site is null.
Any ideas?
Gr. Remco
Iam trying to implement Site Templates for Share. Because of problems with permissions and the deepcopy Iam trying to do this with a custom action whenever a node is created on in the Site node.
The Javascript is triggered by an action whenever a subfolder is created in the Sites folder of the repository, but now I need the nodeID of the new Site within this script.
How can I retreive the new Site name and the nodeID.
Default parameter space point towards the Sites node of the repository
Default parameter Site is null.
Any ideas?
Gr. Remco
Labels:
- Labels:
-
Archive
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2010 04:49 AM
If I understand what you are trying to do correctly I think you need to:
1) Create an rule on the /Company Home/Sites folder that is tiggered when folders are created in that folder. This rule should tigger a script
2) In the script:
- The "document" root scoped object (see http://wiki.alfresco.com/wiki/3.4_JavaScript_API#Root_Scope_Objects) will be the folder that's just been created
- Check that the folder that is being created is of type: {http://www.alfresco.org/model/site/1.0}sites just to be sure e.g.
See also http://wiki.alfresco.com/wiki/JavaScript_API_Cookbook for more examples on how to use the APIs
1) Create an rule on the /Company Home/Sites folder that is tiggered when folders are created in that folder. This rule should tigger a script
2) In the script:
- The "document" root scoped object (see http://wiki.alfresco.com/wiki/3.4_JavaScript_API#Root_Scope_Objects) will be the folder that's just been created
- Check that the folder that is being created is of type: {http://www.alfresco.org/model/site/1.0}sites just to be sure e.g.
document.type == "{http://www.alfresco.org/model/site/1.0}sites"
- You can get the documents nodeRef using document.nodeRef
or ID using document.id
- Use the javascript APIs to copy or create your template content into the newly created folderSee also http://wiki.alfresco.com/wiki/JavaScript_API_Cookbook for more examples on how to use the APIs
