02-12-2015 09:54 PM
<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="sc:somecompanymodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!– Optional meta-data about the model –>
<description>SomeCompany Content Model</description>
<author>Some Guy</author>
<version>1.0</version>
<!– Imports are required to allow references to definitions in other models –>
<imports>
<!– Import Alfresco Dictionary Definitions –>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
<!– Import Alfresco Content Domain Model Definitions –>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
</imports>
<!– Introduction of new namespaces defined by this model –>
<namespaces>
<namespace uri="http://www.somecompany.com/model/content/1.0" prefix="sc" />
</namespaces>
<type name="sc:searchField">
<title>Search Fields</title>
<description>The search field payer organization defined</description>
<parent>cm:cmobject</parent>
<properties>
<property name="sc:organizationId">
<type>d:text</type>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
</property>
<property name="sc:definedSearchedFields">
<type>d:text</type>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
</property>
</properties>
</type>
<type name="sc:searchFields_root">
<title>Search Field Root</title>
<parent>cm:cmobject</parent>
<associations>
<child-association name="sc:searchFields">
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>sc:searchField</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</child-association>
</associations>
<mandatory-aspects>
<aspect>sys:aspect_root</aspect>
</mandatory-aspects>
</type>
</types>
</model>
List<StoreRef> stores = nodeService.getStores();
StoreRef store = null;
for(StoreRef s : stores) {
if(s.getProtocol().equalsIgnoreCase(StoreRef.PROTOCOL_WORKSPACE) && s.getIdentifier().equalsIgnoreCase("SpacesStore")) {
store = s;
break;
}
}
02-13-2015 04:50 AM
NodeRef rootNode = nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
02-13-2015 12:56 PM
02-16-2015 04:13 AM
NodeRef rootNode = nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
QName nodeTypeQName = QName.createQName(NAMESPACE_HIGHROADS_CONTENT_MODEL, TYPE_HR_SEARCHFIELD_ROOT);
ChildAssociationRef childAssRef = nodeService.createNode(rootNode, ContentModel.ASSOC_CHILDREN, QName.createQName("{app}searchfields"), nodeTypeQName);
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.