02-05-2011 12:46 PM
// doc.properties["my:prop1"] = "new constant value";
// doc.properties["my:prop2"] = "new other constant value"';
doc.properties["rma:originator"] = "John Q. Author";
doc.properties["rma:originationOrganization"] = "SomeCO Limited Inc.";
doc.properties["rma:publicationDate"] = "Fri Feb 04 01:00:00 EST 2011";
/* more stuff */
doc.save(); /* to save the properties just set *
"22:28:40,403 User:gnyce ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 01040963 Failed to execute script 'workspace://SpacesStore/6376f7ac-4516-4809-8db3-94b08bb32cab':
01040962 ReferenceError: "doc" is not defined. (workspace://SpacesStore/6376f7ac-4516-4809-8db3-94b08bb32cab#3)
org.alfresco.scripts.ScriptException: 01040963 Failed to execute script 'workspace://SpacesStore/6376f7ac-4516-4809-8d
b3-94b08bb32cab': 01040962 ReferenceError: "doc" is not defined. (workspace://SpacesStore/6376f7ac-4516-4809-8db3-94b0
8bb32cab#3) at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:244)
at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:195)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
<SNIP>
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "doc" is not defined. (workspace://SpacesStore/6376f7ac-4516-4809-8db3-94b08bb32cab#3)"
02-05-2011 10:27 PM
Caused by: org.alfresco.service.cmr.repository.datatype.TypeConversionException: The property value is not compatible
with the type defined for the property:
property: Name: {http://www.alfresco.org/model/recordsmanagement/1.0}publicationDateTitle: Publication Date
Description: null
Default Value: null
DataType Name: {http://www.alfresco.org/model/dictionary/1.0}date
ContainerClass Name: {http://www.alfresco.org/model/recordsmanagement/1.0}record
isMultiValued: false
isMandatory: true
isMandatoryEnforced: falseisProtected: false
isIndexed: true
isStoredInIndex: false
isIndexedAtomically: true
indexTokenisationMode: TRUE
value: 2011020400:00:00
value type: class java.lang.String
02-05-2011 11:26 PM
//set variable to be the created value, then set values
var PubDate = document.properties["cm:created"];
document.properties["rma:originator"] = "John Q. Originator";
document.properties["rma:originatingOrganization"] = "SOMECO Company Ltd Inc";
document.properties["rma:publicationDate"] = PubDate;
document.save();
02-06-2011 12:10 AM
document.properties["rmc:MyCustomFieldNameHere"] = "Fill in field with this metadata";
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.