You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2019/03/29 05:04:11 UTC

svn commit: r1856515 - in /manifoldcf/branches/CONNECTORS-1566/connectors/csws/connector/src/main/java/org/apache/manifoldcf: crawler/connectors/csws/CswsConnector.java csws/CswsSession.java

Author: kwright
Date: Fri Mar 29 05:04:11 2019
New Revision: 1856515

URL: http://svn.apache.org/viewvc?rev=1856515&view=rev
Log:
More work

Modified:
    manifoldcf/branches/CONNECTORS-1566/connectors/csws/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/csws/CswsConnector.java
    manifoldcf/branches/CONNECTORS-1566/connectors/csws/connector/src/main/java/org/apache/manifoldcf/csws/CswsSession.java

Modified: manifoldcf/branches/CONNECTORS-1566/connectors/csws/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/csws/CswsConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1566/connectors/csws/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/csws/CswsConnector.java?rev=1856515&r1=1856514&r2=1856515&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1566/connectors/csws/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/csws/CswsConnector.java (original)
+++ manifoldcf/branches/CONNECTORS-1566/connectors/csws/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/csws/CswsConnector.java Fri Mar 29 05:04:11 2019
@@ -38,6 +38,8 @@ import com.opentext.livelink.service.cor
 import com.opentext.livelink.service.core.DateValue;
 import com.opentext.livelink.service.core.IntegerValue;
 import com.opentext.livelink.service.docman.AttributeGroup;
+import com.opentext.livelink.service.docman.AttributeGroupDefinition;
+import com.opentext.livelink.service.docman.Attribute;
 import com.opentext.livelink.service.docman.Metadata;
 import com.opentext.livelink.service.docman.CategoryInheritance;
 import com.opentext.livelink.service.docman.GetNodesInContainerOptions;
@@ -1184,6 +1186,7 @@ public class CswsConnector extends org.a
         {
           // Find all the metadata associated with this object, and then
           // find the set of category pathnames that correspond to it.
+          // TBD
           int[] catIDs = getObjectCategoryIDs(objID);
           categoryPaths = catAccum.getCategoryPathsAttributeNames(catIDs);
           // Sort!
@@ -3176,43 +3179,22 @@ public class CswsConnector extends org.a
     {
       try
       {
-        // MHL - TBD
-        /*
-        LLValue catID = new LLValue();
-        catID.setAssoc();
-        catID.add("ID", catObjectID);
-        catID.add("Type", LAPI_ATTRIBUTES.CATEGORY_TYPE_LIBRARY);
-
-        LLValue catVersion = new LLValue();
-        int status = LLDocs.FetchCategoryVersion(catID,catVersion);
-        if (status == 107105 || status == 107106)
+        final AttributeGroupDefinition def = cswsSession.getCategoryDefinition(catObjectID);
+        if (def == null) {
           return;
-        if (status != 0)
-        {
-          throw new ManifoldCFException("Error getting category version: "+Integer.toString(status));
-        }
-
-        LLValue children = new LLValue();
-        status = LLAttributes.AttrListNames(catVersion,null,children);
-        if (status != 0)
-        {
-          throw new ManifoldCFException("Error getting attribute names: "+Integer.toString(status));
         }
-        
-        if (children != null)
-        {
-          rval = new String[children.size()];
-          LLValueEnumeration en = children.enumerateValues();
-
-          int j = 0;
-          while (en.hasMoreElements())
-          {
-            LLValue v = (LLValue)en.nextElement();
-            rval[j] = v.toString();
-            j++;
-          }
+        final List<? extends Attribute> atts = def.getAttributes();
+        int attrCount = 0;
+        for (final Attribute at : atts) {
+          // Check for CATEGORY_TYPE_LIBRARY
+          //if (at.getType().equals(CATEGORY_TYPE_LIBRARY))
+          attrCount++;
+        }
+        rval = new String[attrCount];
+        attrCount = 0;
+        for (final Attribute at : atts) {
+          rval[attrCount++] = at.getDisplayName();
         }
-        */
       }
       catch (Throwable e)
       {
@@ -3220,7 +3202,7 @@ public class CswsConnector extends org.a
       }
     }
 
-    public LLValue finishUp()
+    public String[] finishUp()
       throws ManifoldCFException, ServiceInterruption, InterruptedException
     {
       join();

Modified: manifoldcf/branches/CONNECTORS-1566/connectors/csws/connector/src/main/java/org/apache/manifoldcf/csws/CswsSession.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1566/connectors/csws/connector/src/main/java/org/apache/manifoldcf/csws/CswsSession.java?rev=1856515&r1=1856514&r2=1856515&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1566/connectors/csws/connector/src/main/java/org/apache/manifoldcf/csws/CswsSession.java (original)
+++ manifoldcf/branches/CONNECTORS-1566/connectors/csws/connector/src/main/java/org/apache/manifoldcf/csws/CswsSession.java Fri Mar 29 05:04:11 2019
@@ -60,6 +60,8 @@ import com.opentext.livelink.service.doc
 import com.opentext.livelink.service.docman.NodePermissions;
 import com.opentext.livelink.service.docman.Version;
 import com.opentext.livelink.service.docman.NodeRights;
+import com.opentext.livelink.service.docman.AttributeGroupDefinition;
+import com.opentext.livelink.service.docman.Attribute;
 import com.opentext.livelink.service.memberservice.User;
 import com.opentext.livelink.service.memberservice.Member;
 import com.opentext.livelink.service.searchservices.SResultPage;
@@ -267,6 +269,15 @@ public class CswsSession
     }
   }
 
+  public AttributeGroupDefinition getCategoryDefinition(final long catId)
+    throws ManifoldCFException, ServiceInterruption {
+    try {
+      return getDocumentManagementHandle().getCategoryDefinition(catId, version, getOTAuthentication());
+    } catch (SOAPFaultException e) {
+      processSOAPFault(e);
+    }      
+  }
+  
   public User getUser(final long userId) 
     throws ManifoldCFException, ServiceInterruption {
     try {