02-04-2010 06:48 AM
<type name="foo:baseDocument">
<title>Base Document</title>
<parent>cm:content</parent>
<properties>
<property name="foo:documentType">
<title>document type</title>
<type>d:text</type>
<mandatory>false</mandatory>
<index enabled="true">
<atomic>false</atomic>
<stored>false</stored>
<tokenised>true</tokenised>
</index>
</property>
<property name="foo:extraRef">
<title>Extra Reference</title>
<type>d:text</type>
<mandatory>false</mandatory>
<index enabled="true">
<atomic>false</atomic>
<stored>false</stored>
<tokenised>true</tokenised>
</index>
</property>
I want to apply new aspect only to <foo:documentType> property and not entire content-type <foo:baseDocument>. How to do this? 02-04-2010 09:51 AM
02-05-2010 12:16 AM
02-08-2010 05:42 PM
02-09-2010 12:17 AM
02-10-2010 09:35 AM
Hi Invictus,
Thank you for quick reply invictus. You are absolutely right sir. Actually i wanted to do that thing only, i.e. applying aspect based on <foo:documentType> value.
i.e.
if foo:documentType = "purchase Invoice" then aspect is invoicable
if foo:documentType = "report" then aspect is reportable etc.
Thanks and Regards,
Sachin Bhat.
<type name="foo:baseDocument">
…
</type>
<type name="foo:purchaseinvoice">
<title>Purchase Invoice</title>
<parent>foo:baseDocument</parent>
…
</type>
<type name="foo:report">
<title>Report</title>
<parent>foo:baseDocument</parent>
…
</type>
This way you can test to see whether the document is of type "foo:report" or "foo03-25-2010 07:50 AM
<types>
<type name="foo:baseDocument">
<title>Base Document</title>
<parent>cm:content</parent>
<properties>
<property name="foo:documentType">
<type>d:text</type>
</property>
</properties>
</type>
<type name="foo:pinv">
<title>Pinv</title>
<parent>foo:baseDocument</parent>
<properties>
<property name="foo:pinvSupCode">
<type>d:text</type>
</property>
</properties>
</type>
<type name="foo:sinv">
<title>Sinv</title>
<parent>foo:baseDocument</parent>
<properties>
<property name="foo:sinvCusCode">
<type>d:text</type>
</property>
</properties>
</type>
</types>
<aspects>
<aspect name="foo:pInvoice">
<title>pinvoicable</title>
<parent>foo:commonAspect1</parent>
<properties>
<property name="foo:pSupCode">
<title>Supplier code</title>
<type>d:text</type>
</property>
</properties>
</aspect>
<aspect name="foo:sInvoice">
<title>sinvoicable</title>
<parent>foo:commonAspect1</parent>
<properties>
<property name="foo:sCusCode">
<title>Customer Code</title>
<type>d:text</type>
</property>
</properties>
</aspect>
<aspect name="foo:brcptInvoice">
<title>brcptvoicable</title>
<parent>foo:commonAspect1</parent>
<properties>
<property name="foo:brBankAccRef">
<title>Bank Ref</title>
<type>d:text</type>
</property>
</properties>
</aspect>
</aspects>
<field id="foo:documentType" template="core.field.combo" default="cm:content">
<params>
<plugins>jibe.plugins.comboSelectLast</plugins>
<width>150</width>
<comboModel>jibe.Cache.contentTypes</comboModel>
</params>
<validation-rules>
<rule id="mandatory" />
</validation-rules>
</field>
03-26-2010 01:06 PM
<type name="foo:pinv">
…
<mandatory-aspects>
<aspect>foo:pInvoice</aspect>
</mandatory-aspects>
That will apply the aspect foo03-28-2010 03:17 PM
@Progress(message = "progress.repo.reloadNode", cancelable = false)
@RemoteMethod(name = "repo.document.reloadNode")
public void reloadNode(Context context) {
DocumentNode node = new DocumentNode((String) context.get("nodeId"));
//NodeRef nodeRef = node.getNodeRef();
String docType = (String)context.getArg("foo:documentType");
System.out.println("document type:"+docType);
node.setProperties(context.getRequestMap());
context.setNode(node);
modelsManager.replaceEntry(node);
if("foo:pinv".equals(docType)){
node.enablePinv(docType);
}else if("foo:brcpt".equals(docType)){
node.enableBrcpt(docType);
}else if("foo:sinv".equals(docType)){
node.enableSinv(docType);
}else if("foo:batchPinv".equals(docType)){
node.enableBatchPinv(docType);
}
context.setProducedResponse(Context.RESULT_SUCCESS);
}
final QName PINVOICE = QName.createQName("foo:pInvoice", serviceRegistry.getNamespaceService());
final QName SINVOICE = QName.createQName("foo:sInvoice", serviceRegistry.getNamespaceService());
final QName DOCTYPE = QName.createQName("foo:documentType", serviceRegistry.getNamespaceService());
public void enablePinv(String docType) {
NodeService nodeService = serviceRegistry.getNodeService();
nodeService.setProperty(nodeRef, DOCTYPE, docType);
Serializable value = nodeService.getProperty(nodeRef, DOCTYPE);
QName changedValue = nodeService.getType(nodeRef);
System.out.println("enablePinv(DOCTYPE):"+value.toString());
System.out.println("enablePinv(getTYPE):"+changedValue.toString());
Set<QName> aspects = nodeService.getAspects(this.nodeRef);
for (QName aspect : aspects) {
nodeService.removeAspect(nodeRef, aspect);
}
nodeService.addAspect(nodeRef, PINVOICE, null);
}
public void enableSinv(String docType) {
NodeService nodeService = serviceRegistry.getNodeService();
nodeService.setProperty(nodeRef, DOCTYPE, docType);
Serializable value = nodeService.getProperty(nodeRef, DOCTYPE);
QName changedValue = nodeService.getType(nodeRef);
System.out.println("enableSinv(DOCTYPE):"+value.toString());
System.out.println("enableSinv(getTYPE):"+changedValue.toString());
Set<QName> aspects = nodeService.getAspects(nodeRef);
for (QName aspect : aspects) {
nodeService.removeAspect(nodeRef, aspect);
}
nodeService.addAspect(nodeRef, SINVOICE, null);
}
03-29-2010 10:55 AM
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.