Setting properties on custom content types

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2008 09:06 PM
I have a custom content type with custom properties. I would like to set the value of some of these properties in a script that is executed by the content owner when the content is moved to another folder, i.e,
contenttype1.properties["typeSo far I have been unable to do this. Should this be possible?ropertyName"] = someValue;
Labels:
- Labels:
-
Archive
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2008 05:39 AM
For sure it is possible, you have to set up a outbound rule with script action and is subtype for the folder where your custom document types are placed.
1. Make sure that your custom type is shown on the list of possible types for the is-subtype condition. You do this by editing web-client-config.xml, try to look for subtypes element
2. Write the script which will set the custom property
3. Put it in Data Dictionary/Scripts folder
4. Set up outbound rule with Execute script action
Kind regards,
Denis
1. Make sure that your custom type is shown on the list of possible types for the is-subtype condition. You do this by editing web-client-config.xml, try to look for subtypes element
2. Write the script which will set the custom property
3. Put it in Data Dictionary/Scripts folder
4. Set up outbound rule with Execute script action
Kind regards,
Denis

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2008 08:17 PM
For sure it is possible, you have to set up a outbound rule with script action and is subtype for the folder where your custom document types are placed.
1. Make sure that your custom type is shown on the list of possible types for the is-subtype condition. You do this by editing web-client-config.xml, try to look for subtypes element
2. Write the script which will set the custom property
3. Put it in Data Dictionary/Scripts folder
4. Set up outbound rule with Execute script action
Kind regards,
Denis
Dennis,
Thank you for the response.
I have been unable to accomplish this. I have tried in scripts that are executed on outbound content from the source folder and on incoming content in the destination folder. If I define the properties as properties of a custom aspect, I can then set the values and add the aspect. But if the properties are properties of the custom content type I can't set them.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2008 06:24 AM
Might be your custom content type definition is the problem. Try posting the model definition file

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2008 08:46 AM
First check that node is of the right type using the node browser. Then run your script via Run Action, if your script is not doing what you think it should do, enable the JavaScript debugger and step through the code.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2008 07:40 PM
The model appears to be good. All of the properties appear and can be set when the files are uploaded and they persist when files are moved or copied from one space to another. I can also edit them using the details view after they have been uploaded and the changes persist when the file is moved or copied.
I can't enable the javascript debugger since I'm using jre 1.6 but I can simplify the file to the point that it only contains the setProperty statements and put setPermission statements before or after the setProperty statements. In this case the set permission statements execute successfully but the set property statements don't, even when I hardcode the values I am setting them to.
As I said earlier, if I define the properties in question as properties of custom aspects and they can be set and added to the content in javascript with no problem.
I can't enable the javascript debugger since I'm using jre 1.6 but I can simplify the file to the point that it only contains the setProperty statements and put setPermission statements before or after the setProperty statements. In this case the set permission statements execute successfully but the set property statements don't, even when I hardcode the values I am setting them to.
As I said earlier, if I define the properties in question as properties of custom aspects and they can be set and added to the content in javascript with no problem.
