SAIL-10 - Data Lists in Share. Various enhancements and improvements. SAIL-106 - Edit list page. SAIL-109 - Duplicate Row. New ScriptNode API, getTypePropertyNames

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19422 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mike Hatfield
2010-03-20 11:02:23 +00:00
parent 0219778d77
commit 783ce15a2c
3 changed files with 25 additions and 12 deletions

View File

@@ -37,19 +37,11 @@
<type>d:text</type> <type>d:text</type>
</property> </property>
</properties> </properties>
<mandatory-aspects>
<!-- Do not archive during development phase -->
<aspect>sys:temporary</aspect>
</mandatory-aspects>
</type> </type>
<type name="dl:dataListItem"> <type name="dl:dataListItem">
<title>Data List parent type</title> <title>Data List parent type</title>
<parent>cm:content</parent> <parent>cm:content</parent>
<mandatory-aspects>
<!-- Do not archive during development phase -->
<aspect>sys:temporary</aspect>
</mandatory-aspects>
</type> </type>
<type name="dl:todoList"> <type name="dl:todoList">

View File

@@ -124,8 +124,9 @@ public class ScriptFormService extends BaseScopableProcessorExtension
* @param itemId The identifier of the item to retrieve a form for * @param itemId The identifier of the item to retrieve a form for
* @param postData The post data, this can be a Map of name value * @param postData The post data, this can be a Map of name value
* pairs, a webscript FormData object or a JSONObject * pairs, a webscript FormData object or a JSONObject
* @return The persisted object
*/ */
public void saveForm(String itemKind, String itemId, Object postData) public Object saveForm(String itemKind, String itemId, Object postData)
{ {
// A note on data conversion as passed in to this method: // A note on data conversion as passed in to this method:
// Each of the 3 submission methods (multipart/formdata, JSON Post and // Each of the 3 submission methods (multipart/formdata, JSON Post and
@@ -145,9 +146,9 @@ public class ScriptFormService extends BaseScopableProcessorExtension
{ {
logger.debug("ScriptFormService.saveForm: postData not instanceof FormData."); logger.debug("ScriptFormService.saveForm: postData not instanceof FormData.");
} }
return; return null;
} }
formService.saveForm(new Item(itemKind, itemId), dataForFormService); return formService.saveForm(new Item(itemKind, itemId), dataForFormService);
} }
} }

View File

@@ -54,8 +54,10 @@ import org.alfresco.repo.workflow.jscript.JscriptWorkflowInstance;
import org.alfresco.scripts.ScriptException; import org.alfresco.scripts.ScriptException;
import org.alfresco.service.ServiceRegistry; import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.dictionary.ClassDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
import org.alfresco.service.cmr.lock.LockStatus; import org.alfresco.service.cmr.lock.LockStatus;
import org.alfresco.service.cmr.model.FileInfo; import org.alfresco.service.cmr.model.FileInfo;
import org.alfresco.service.cmr.model.FileNotFoundException; import org.alfresco.service.cmr.model.FileNotFoundException;
@@ -806,7 +808,25 @@ public class ScriptNode implements Serializable, Scopeable, NamespacePrefixResol
return this.properties; return this.properties;
} }
/**
* Return all the property names defined for this node's type as an array.
*
* @param useShortQNames if true short-form qnames will be returned, else long-form.
* @return Array of property names for this node's type.
*/
public Scriptable getTypePropertyNames(boolean useShortQNames)
{
Set<QName> props = this.services.getDictionaryService().getClass(this.getQNameType()).getProperties().keySet();
Object[] result = new Object[props.size()];
int count = 0;
for (QName qname : props)
{
result[count++] = useShortQNames ? getShortQName(qname).toString() : qname.toString();
}
return Context.getCurrentContext().newArray(this.scope, result);
}
/** /**
* @return true if this Node is a container (i.e. a folder) * @return true if this Node is a container (i.e. a folder)
*/ */