[ 
https://issues.apache.org/jira/browse/CONNECTORS-1566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16921100#comment-16921100
 ] 

Kishore Kumar commented on CONNECTORS-1566:
-------------------------------------------

Hi [~kwri...@metacarta.com],

 

Please find the below sample code to get Node metadata from Content Server.

Document Metadata can be retrieved from getMetadata() of Node object.

 
{code:java}
public void getNodeMetadata(long nodeId) throws Exception {
    DocumentManagement docManClient = getDocManClient();
    Node node = docManClient.getNode(103504);
    Metadata metadata = node.getMetadata();
    if(metadata != null){
        List<AttributeGroup> attributeGroups = metadata.getAttributeGroups();
        for (AttributeGroup attrGroup : attributeGroups) {
            //Look for only Categories
            //AttributeGroup includes system metadata as well.
            //Uncomment below if condition, if only Categories is required.
            //if("Category".equals(attrGroup.getType())){
                System.out.println("Category --> " + 
attrGroup.getDisplayName());
                List<DataValue> attributes = attrGroup.getValues();
                for (DataValue attribute : attributes) {
                    System.out.println(attribute.getClass().getSimpleName());
                    System.out.println("  Attribute Name --> " + 
attribute.getDescription() + " | Attribute Key --> " + attribute.getKey());
                    if(attribute instanceof StringValue){
                        StringValue stringValue = (StringValue)attribute;
                        System.out.println("    Attribute Value --> " + 
stringValue.getValues().toString());
                    }else if(attribute instanceof IntegerValue){
                        IntegerValue integerValue = (IntegerValue)attribute;
                        System.out.println("    Attribute Value --> " + 
integerValue.getValues().toString());
                    }else if(attribute instanceof BooleanValue){
                        BooleanValue booleanValue = (BooleanValue) attribute;
                        System.out.println("    Attribute Value --> " + 
booleanValue.getValues().toString());
                    }else if(attribute instanceof TableValue){
                        TableValue tableValue = (TableValue)attribute;
                        //TODO: Get attributes recursively from a set
                        System.out.println("    Attribute Value --> " + 
tableValue.getValues().toString());
                    }
                }
            //}
        }
    }
}
{code}

> Develop CSWS connector as a replacement for deprecated LiveLink LAPI connector
> ------------------------------------------------------------------------------
>
>                 Key: CONNECTORS-1566
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-1566
>             Project: ManifoldCF
>          Issue Type: Task
>          Components: LiveLink connector
>    Affects Versions: ManifoldCF 2.12
>            Reporter: Karl Wright
>            Assignee: Karl Wright
>            Priority: Major
>             Fix For: ManifoldCF 2.14
>
>         Attachments: OTCS_IIS.png, OTCS_Tomcat.png, chrome_cgfC00ujx7.png
>
>
> LAPI is being deprecated.  We need to develop a replacement for it using the 
> ContentServer Web Services API.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to