As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<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>
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 invoicableif 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>
<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>
<type name="foo:pinv"> … <mandatory-aspects> <aspect>foo:pInvoice</aspect> </mandatory-aspects>
@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); }
You said you have written some webscripts. I wanted to learn webscripts sir. If any good resource to learn that if you advice i will be really happy and thankful to you invictus!!!!!