- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2016 03:37 AM
Is it possible make association as target type with specific property? for eg: some type X has a property which is either true or false. I want to associate the type with property value true only. Please advice
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2016 09:58 AM
It would be far more instructive for you to give it a shot and then report back if you get stuck.
To get you started, here is a JavaScript snippet that does a search:
var query = "+TYPE:\"cm:folder\" +@cm\\:name:\"" + PARENT_FOLDER_NAME + "\"";
var results = search.luceneSearch(query);
if (results.length != 1) {
logger.log("Expected to find exactly one folder named " + PARENT_FOLDER_NAME + " but instead found " + results.length);
return;
}
You may also want to install the JavaScript console. It can be used as a nice little JavaScript testing Ui directly within Alfresco Share:
And here are some docs:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2016 03:46 PM
It sounds like you want to create an association between two objects if and only if the property on one of the objects has a certain value. You can do this on an ad hoc basis by writing a script that performs a search for documents with the property value, then creates the association if it does not exist.
If you want to do this every time a document is created, you can write a behavior to check the property value, then create the association.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2016 07:10 AM
Hi Jeff,
Am setting a property with a default value when ever a document being uploaded in a space by applying a rule.
"You can do this on an ad hoc basis by writing a script that performs a search for documents with the property value, then creates the association if it does not exist." can you please help to make the script or showing some sample script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2016 09:58 AM
It would be far more instructive for you to give it a shot and then report back if you get stuck.
To get you started, here is a JavaScript snippet that does a search:
var query = "+TYPE:\"cm:folder\" +@cm\\:name:\"" + PARENT_FOLDER_NAME + "\"";
var results = search.luceneSearch(query);
if (results.length != 1) {
logger.log("Expected to find exactly one folder named " + PARENT_FOLDER_NAME + " but instead found " + results.length);
return;
}
You may also want to install the JavaScript console. It can be used as a nice little JavaScript testing Ui directly within Alfresco Share:
And here are some docs:
