Examples of DMDataSet


Examples of org.apache.manifoldcf.crawler.connectors.meridio.DMDataSet

      /*=================================================================
      * Call a method in the Web Services API to get the Meridio system
      * name back - just something simple to test the connection
      * end-to-end
      *================================================================*/
      DMDataSet ds = meridio_.getStaticData();
      if (null == ds)
      {
        Logging.connectors.debug("Meridio: DM DataSet returned was null in 'check' method");
        return "Connection failed - null DM DataSet";
      }

      if (Logging.connectors.isDebugEnabled())
        Logging.connectors.debug("Meridio System Name is [" +
        ds.getSYSTEMINFO().getSystemName() + "] and the comment is [" +
        ds.getSYSTEMINFO().getComment() + "]");

      /*=================================================================
      * For completeness, we also call a method in the RM Web
      * Service API
      *================================================================*/
 
View Full Code Here

Examples of org.apache.manifoldcf.crawler.connectors.meridio.DMDataSet

            Logging.connectors.debug("URL for document '" + new Long(docId).toString() + "' is '" + fileURL + "'");

          /*=================================================================
          * Get the object's ACLs and owner information
          *================================================================*/
          DMDataSet documentData = null;
          documentData = meridio_.getDocumentData((int)docId, true, true, false, false,
            DmVersionInfo.LATEST, false, false, false);

          if (null == documentData)
          {
            if (Logging.connectors.isDebugEnabled())
              Logging.connectors.debug("Meridio: Could not retrieve document data for document id '" +
              new Long(docId).toString() + "' in processDocuments method - deleting document.");
            activities.deleteDocument(documentIdentifier,docVersion);
            i++;
            continue;
          }

          if (null == documentData.getDOCUMENTS() ||
            documentData.getDOCUMENTS().length != 1)
          {
            if (Logging.connectors.isDebugEnabled())
              Logging.connectors.debug("Meridio: Could not retrieve document owner for document id '" +
              new Long(docId).toString() + "' in processDocuments method. No information or incorrect amount " +
              "of information was returned");
            activities.deleteDocument(documentIdentifier,docVersion);
            i++;
            continue;
          }

          // Do path metadata
          if (pathAttributeName != null && pathAttributeName.length() > 0)
          {
            if (Logging.connectors.isDebugEnabled())
              Logging.connectors.debug("Meridio: Path attribute name is "+pathAttributeName);
            RMDataSet partList;
            int recordType = documentData.getDOCUMENTS()[0].getPROP_recordType();
            if (recordType == 0 || recordType == 4 || recordType == 19)
              partList = meridio_.getRecordPartList((int)docId, false, false);
            else
              partList = meridio_.getDocumentPartList((int)docId);
            if (partList != null)
            {
              if (Logging.connectors.isDebugEnabled())
                Logging.connectors.debug("Meridio: Document '"+new Long(docId).toString()+"' has a part list with "+Integer.toString(partList.getRm2vPart().length)+" values");

              for (int k = 0; k < partList.getRm2vPart().length; k++)
              {
                repositoryDocument.addField(pathAttributeName,matchMap.translate(partList.getRm2vPart()[k].getParentTitlePath()));
              }
            }
            else
            {
              if (Logging.connectors.isDebugEnabled())
                Logging.connectors.debug("Meridio: Document '"+new Long(docId).toString()+"' has no part list, so no path attribute");
            }
          }

          // Process acls.  If there are forced acls, use those, otherwise get them from Meridio.
          String [] allowAcls;
          String [] denyAcls;

          // forcedAcls will be null if security is off, or nonzero length if security is on but hard-wired
          if (forcedAcls != null && forcedAcls.length == 0)
          {
            ACCESSCONTROL [] documentAcls = documentData.getACCESSCONTROL();
            ArrayList allowAclsArrayList = new ArrayList();
            ArrayList denyAclsArrayList = new ArrayList();

            // Allow a broken authority to disable all Meridio documents, even if the document is 'wide open', because
            // Meridio does not permit viewing of the document if the user does not exist (at least, I don't know of a way).
            denyAclsArrayList.add(denyToken);

            if (documentAcls != null)
            {
              for (int j = 0; j < documentAcls.length; j++)
              {
                if (Logging.connectors.isDebugEnabled())
                  Logging.connectors.debug(
                  "Object Id '" + documentAcls[j].getObjectId() + "' " +
                  "Object Type '" + documentAcls[j].getObjectType() + "' " +
                  "Permission '" + documentAcls[j].getPermission() + "' " +
                  "User Id '" + documentAcls[j].getUserId() + "' " +
                  "Group Id '" + documentAcls[j].getGroupId() + "'");

                if (documentAcls[j].getPermission() == 0// prohibit permission
                {
                  if (documentAcls[j].getGroupId() > 0)
                  {
                    denyAclsArrayList.add("G" + documentAcls[j].getGroupId());
                  } else if (documentAcls[j].getUserId() > 0)
                  {
                    denyAclsArrayList.add("U" + documentAcls[j].getUserId());
                  }
                }
                else                                       // read, amend or manage
                {
                  if (documentAcls[j].getGroupId() > 0)
                  {
                    allowAclsArrayList.add("G" + documentAcls[j].getGroupId());
                  } else if (documentAcls[j].getUserId() > 0)
                  {
                    allowAclsArrayList.add("U" + documentAcls[j].getUserId());
                  }
                }
              }
            }

            DOCUMENTS document = documentData.getDOCUMENTS()[0];

            if (Logging.connectors.isDebugEnabled())
              Logging.connectors.debug("Document id '" + new Long(docId).toString() + "' is owned by owner id '" +
              document.getPROP_ownerId() + "' having the owner name '" +
              document.getPROP_ownerName() + "' Record Type is '" +
View Full Code Here

Examples of org.apache.manifoldcf.crawler.connectors.meridio.DMDataSet

    try
    {
      Logging.connectors.debug("Entering documentSpecificationSearch");

      int currentSearchTerm = 1;
      DMDataSet dsSearchCriteria = new DMDataSet();

      /*====================================================================
      * Exclude things marked for delete
      *===================================================================*/
      PROPERTY_TERMS drDeleteSearch = new PROPERTY_TERMS();
      drDeleteSearch.setId(currentSearchTerm++);
      drDeleteSearch.setTermType(new Short("1").shortValue());       //0=STRING, 1=NUMBER, 2=DATE
      drDeleteSearch.setPropertyName("PROP_markedForDelete");
      drDeleteSearch.setCategoryId(4);                               //Global Standard/Fixed Property
      drDeleteSearch.setNum_relation(new Short("0").shortValue());   //dmNumRelation.EQUAL
      drDeleteSearch.setNum_value(0);
      drDeleteSearch.setParentId(1);
      drDeleteSearch.setIsVersionProperty(false);
      dsSearchCriteria.addPROPERTY_TERMS(drDeleteSearch);

      /*====================================================================
      * Restrict based on start & end date/time, if necessssary
      *===================================================================*/
      if (startTime > 0L)
      {
        Logging.connectors.debug("Start Date/time is <" + new Date(startTime) + "> in ms <" + startTime + ">" +
          " End Date/time is <" + new Date(endTime) + "> in ms <" + endTime + ">");

        PROPERTY_TERMS drDateStart = new PROPERTY_TERMS();
        drDateStart.setId(currentSearchTerm++);
        drDateStart.setTermType(new Short("2").shortValue());       //0=STRING, 1=NUMBER, 2=DATE
        drDateStart.setPropertyName("PROP_lastModifiedDate");
        drDateStart.setCategoryId(4);                                 //Global Standard/Fixed Property
        drDateStart.setDate_relation(new Short("11").shortValue());   //dtONORAFTER
        drDateStart.setDate_value(new Date(startTime));
        drDateStart.setParentId(1);
        drDateStart.setIsVersionProperty(false);
        dsSearchCriteria.addPROPERTY_TERMS(drDateStart);

        PROPERTY_TERMS drDateEnd = new PROPERTY_TERMS();
        drDateEnd.setId(currentSearchTerm++);
        drDateEnd.setTermType(new Short("2").shortValue());        //0=STRING, 1=NUMBER, 2=DATE
        drDateEnd.setPropertyName("PROP_lastModifiedDate");
        drDateEnd.setCategoryId(4);                                //Global Standard/Fixed Property
        drDateEnd.setDate_relation(new Short("8").shortValue())//dtBEFORE
        drDateEnd.setDate_value(new Date(endTime));
        drDateEnd.setParentId(1);
        drDateEnd.setIsVersionProperty(false);
        dsSearchCriteria.addPROPERTY_TERMS(drDateEnd);
      }

      /*====================================================================
      * Just add a dummy term to make the conditional logic easier; i.e.
      * always add an "AND" - the dummy term is required in case there are
      * no other search criteria - i.e. we could be searching the whole
      * Meridio repository
      *
      * Search for document id's which are > 0 - this will always be true
      *===================================================================*/
      PROPERTY_TERMS drDocIdSearch = new PROPERTY_TERMS();
      drDocIdSearch.setId(currentSearchTerm++);
      drDocIdSearch.setTermType(new Short("1").shortValue());       //0=STRING, 1=NUMBER, 2=DATE
      drDocIdSearch.setPropertyName("PROP_documentId");
      drDocIdSearch.setCategoryId(4);                               //Global Standard/Fixed Property
      drDocIdSearch.setNum_relation(new Short("3").shortValue());   //dmNumRelation.GREATER
      drDocIdSearch.setNum_value(0);
      drDocIdSearch.setParentId(1);
      drDocIdSearch.setIsVersionProperty(false);
      dsSearchCriteria.addPROPERTY_TERMS(drDocIdSearch);

      if (restrictDocumentId != null && restrictDocumentId.length == 1)
      {
        /*====================================================================
        * Restrict the search query to just the 1 document ID passed in
        *===================================================================*/
        PROPERTY_TERMS drDocIdSearchRestricted = new PROPERTY_TERMS();
        drDocIdSearchRestricted.setId(currentSearchTerm++);
        drDocIdSearchRestricted.setTermType(new Short("1").shortValue());       //0=STRING, 1=NUMBER, 2=DATE
        drDocIdSearchRestricted.setPropertyName("PROP_documentId");
        drDocIdSearchRestricted.setCategoryId(4);                               //Global Standard/Fixed Property
        drDocIdSearchRestricted.setNum_relation(new Short("0").shortValue());   //dmNumRelation.EQUAL
        drDocIdSearchRestricted.setNum_value(restrictDocumentId[0]);            //Search for the specific doc ID
        drDocIdSearchRestricted.setParentId(1);
        drDocIdSearchRestricted.setIsVersionProperty(false);
        dsSearchCriteria.addPROPERTY_TERMS(drDocIdSearchRestricted);
      }
      else if (restrictDocumentId != null && restrictDocumentId.length > 1)
      {
        /*====================================================================
        * Multiple document id's have been passed in, so we need to "or"
        * them together
        *===================================================================*/
        for (int i = 0; i < restrictDocumentId.length; i++)
        {
          PROPERTY_TERMS drDocIdSearchRestricted = new PROPERTY_TERMS();
          drDocIdSearchRestricted.setId(currentSearchTerm++);
          drDocIdSearchRestricted.setTermType(new Short("1").shortValue());       //0=STRING, 1=NUMBER, 2=DATE
          drDocIdSearchRestricted.setPropertyName("PROP_documentId");
          drDocIdSearchRestricted.setCategoryId(4);                               //Global Standard/Fixed Property
          drDocIdSearchRestricted.setNum_relation(new Short("0").shortValue());   //dmNumRelation.EQUAL
          drDocIdSearchRestricted.setNum_value(restrictDocumentId[i]);            //Search for the specific doc ID
          drDocIdSearchRestricted.setParentId(4);
          drDocIdSearchRestricted.setIsVersionProperty(false);
          dsSearchCriteria.addPROPERTY_TERMS(drDocIdSearchRestricted);
        }

        PROPERTY_OPS drMIMETypeOps = new PROPERTY_OPS();
        drMIMETypeOps.setId(4);
        drMIMETypeOps.setParentId(1);
        drMIMETypeOps.setOperator(new Short("1").shortValue());    // OR
        dsSearchCriteria.addPROPERTY_OPS(drMIMETypeOps);
      }

      PROPERTY_OPS drPropertyOps = new PROPERTY_OPS();
      drPropertyOps.setId(1);
      drPropertyOps.setOperator(new Short("0").shortValue());   //AND
      dsSearchCriteria.addPROPERTY_OPS(drPropertyOps);

      /*====================================================================
      * Filter on documents, records, or documents and records
      *
      * The "SearchDocuments" method returns both documents and records; to
      * return just documents, get things where the recordType is not
      * 0, 4 or 19 (refer to Meridio Documentation)
      *===================================================================*/
      String searchOn = null;
      for (int i = 0; i < docSpec.getChildCount(); i++)
      {
        SpecificationNode sn = docSpec.getChild(i);

        if (sn.getType().equals("SearchOn"))
        {
          searchOn = sn.getAttributeValue("value");
        }
      }

      if (searchOn != null && searchOn.equals("DOCUMENTS_ONLY"))
      {
        PROPERTY_TERMS drDocsOrRecsSearch = new PROPERTY_TERMS();
        drDocsOrRecsSearch.setId(currentSearchTerm++);
        drDocsOrRecsSearch.setTermType(new Short("1").shortValue());       //0=STRING, 1=NUMBER, 2=DATE
        drDocsOrRecsSearch.setPropertyName("PROP_recordType");
        drDocsOrRecsSearch.setCategoryId(4);                               //Global Standard/Fixed Property
        drDocsOrRecsSearch.setNum_relation(new Short("1").shortValue());   //dmNumberRelation.NOTEQUAL=1
        drDocsOrRecsSearch.setNum_value(0);
        drDocsOrRecsSearch.setParentId(1);
        drDocsOrRecsSearch.setIsVersionProperty(false);
        dsSearchCriteria.addPROPERTY_TERMS(drDocsOrRecsSearch);

        PROPERTY_TERMS drDocsOrRecsSearch2 = new PROPERTY_TERMS();
        drDocsOrRecsSearch2.setId(currentSearchTerm++);
        drDocsOrRecsSearch2.setTermType(new Short("1").shortValue());       //0=STRING, 1=NUMBER, 2=DATE
        drDocsOrRecsSearch2.setPropertyName("PROP_recordType");
        drDocsOrRecsSearch2.setCategoryId(4);                               //Global Standard/Fixed Property
        drDocsOrRecsSearch2.setNum_relation(new Short("1").shortValue());   //dmNumberRelation.NOTEQUAL=1
        drDocsOrRecsSearch2.setNum_value(4);
        drDocsOrRecsSearch2.setParentId(1);
        drDocsOrRecsSearch2.setIsVersionProperty(false);
        dsSearchCriteria.addPROPERTY_TERMS(drDocsOrRecsSearch2);

        PROPERTY_TERMS drDocsOrRecsSearch3 = new PROPERTY_TERMS();
        drDocsOrRecsSearch3.setId(currentSearchTerm++);
        drDocsOrRecsSearch3.setTermType(new Short("1").shortValue());       //0=STRING, 1=NUMBER, 2=DATE
        drDocsOrRecsSearch3.setPropertyName("PROP_recordType");
        drDocsOrRecsSearch3.setCategoryId(4);                               //Global Standard/Fixed Property
        drDocsOrRecsSearch3.setNum_relation(new Short("1").shortValue());   //dmNumberRelation.NOTEQUAL=1
        drDocsOrRecsSearch3.setNum_value(19);
        drDocsOrRecsSearch3.setParentId(1);
        drDocsOrRecsSearch3.setIsVersionProperty(false);
        dsSearchCriteria.addPROPERTY_TERMS(drDocsOrRecsSearch3);
      }

      /*====================================================================
      * Filter on documents, records, or documents and records
      *
      * The "SearchDocuments" method returns both documents and records; to
      * return just records, get things where the recordType is 4 or greater
      *===================================================================*/
      if (searchOn != null && searchOn.equals("RECORDS_ONLY"))
      {
        PROPERTY_TERMS drDocsOrRecsSearch = new PROPERTY_TERMS();
        drDocsOrRecsSearch.setId(currentSearchTerm++);
        drDocsOrRecsSearch.setTermType(new Short("1").shortValue());       //0=STRING, 1=NUMBER, 2=DATE
        drDocsOrRecsSearch.setPropertyName("PROP_recordType");
        drDocsOrRecsSearch.setCategoryId(4);                               //Global Standard/Fixed Property
        drDocsOrRecsSearch.setNum_relation(new Short("5").shortValue());   //dmNumberRelation.GREATEROREQUAL=5
        drDocsOrRecsSearch.setNum_value(4);
        drDocsOrRecsSearch.setParentId(1);
        drDocsOrRecsSearch.setIsVersionProperty(false);
        dsSearchCriteria.addPROPERTY_TERMS(drDocsOrRecsSearch);
      }

      /*====================================================================
      * Filter on class or folder (if any)
      *===================================================================*/
      for (int i = 0; i < docSpec.getChildCount(); i++)
      {
        SpecificationNode sn = docSpec.getChild(i);

        if (sn.getType().equals("SearchPath"))
        {
          String searchPath   = sn.getAttributeValue("path");
          int searchContainer = meridio_.findClassOrFolder(searchPath);

          if (searchContainer > 0)
          {
            SEARCH_CONTAINERS drSearchContainers = new SEARCH_CONTAINERS();
            drSearchContainers.setContainerId(searchContainer);
            dsSearchCriteria.addSEARCH_CONTAINERS(drSearchContainers);

            Logging.connectors.debug("Found path [" +  searchPath + "] id: [" +
              searchContainer + "]");
          }
          else if (searchContainer == 0)
          {
            Logging.connectors.debug("Meridio: Found FilePlan root, so not including in search criteria!");
          }
          else
          {
            /*====================================================================
            * We can't find the path, so ignore it.
            *
            * This is potentially opening up the search scope, i.e. if there was
            * one path which was being searched and then the Meridio FilePlan is
            * re-organised and the path no longer exists (but the original content
            * has just been moved in the tree) then this could cause all the
            * Meridio content to be returned
            *===================================================================*/
            Logging.connectors.warn("Meridio: Did not find FilePlan path [" +  searchPath + "]. " +
              "The path is therefore *not* being used to restrict the search scope");
          }
        }
      }

      /*====================================================================
      * Filter on category (if any)
      *===================================================================*/
      CATEGORIES [] meridioCategories = meridio_.getCategories().getCATEGORIES();
      // Create a map from title to category ID
      HashMap categoryMap = new HashMap();
      int i = 0;
      while (i < meridioCategories.length)
      {
        String title = meridioCategories[i].getPROP_title();
        long categoryID = meridioCategories[i].getPROP_categoryId();
        categoryMap.put(title,new Long(categoryID));
        i++;
      }

      ArrayList categoriesToAdd = new ArrayList ();

      for (i = 0; i < docSpec.getChildCount(); i++)
      {
        SpecificationNode sn = docSpec.getChild(i);

        if (sn.getType().equals("SearchCategory"))
        {
          String searchCategory   = sn.getAttributeValue("category");
          Long categoryIDObject = (Long)categoryMap.get(searchCategory);
          if (categoryIDObject != null)
          {
            if (Logging.connectors.isDebugEnabled())
              Logging.connectors.debug("Meridio: Category [" + searchCategory + "] match, ID=[" + categoryIDObject + "]");
            categoriesToAdd.add(categoryIDObject);
          }
          else
          {
            if (Logging.connectors.isDebugEnabled())
              Logging.connectors.debug("Meridio: No match found for Category [" + searchCategory + "]");
          }
        }
      }

      for (i = 0; i < categoriesToAdd.size(); i++)
      {
        PROPERTY_TERMS drDocsOrRecsSearch = new PROPERTY_TERMS();
        drDocsOrRecsSearch.setId(currentSearchTerm++);
        drDocsOrRecsSearch.setTermType(new Short("1").shortValue());       //0=STRING, 1=NUMBER, 2=DATE
        drDocsOrRecsSearch.setPropertyName("PROP_categoryId");
        drDocsOrRecsSearch.setCategoryId(4);                               //Global Standard/Fixed Property
        drDocsOrRecsSearch.setNum_relation(new Short("0").shortValue());   //dmNumberRelation.GREATEROREQUAL=5
        drDocsOrRecsSearch.setNum_value(((Long) categoriesToAdd.get(i)).longValue());
        if (categoriesToAdd.size() == 1// If there is one term, we can use the AND clause
        {
          drDocsOrRecsSearch.setParentId(1);
        }
        else                      // Otherwise, need to have an OR subclause
        {
          drDocsOrRecsSearch.setParentId(2);
        }
        drDocsOrRecsSearch.setIsVersionProperty(false);
        dsSearchCriteria.addPROPERTY_TERMS(drDocsOrRecsSearch);
      }

      /*====================================================================
      * Filter on MIME Type (if any are in the Document Specification)
      *===================================================================*/
      String [] mimeTypes = getMIMETypes(docSpec);
      for (i = 0; i < mimeTypes.length; i++)
      {
        PROPERTY_TERMS drMIMETypesSearch = new PROPERTY_TERMS();
        drMIMETypesSearch.setId(currentSearchTerm++);
        drMIMETypesSearch.setTermType(new Short("0").shortValue());       //0=STRING, 1=NUMBER, 2=DATE
        drMIMETypesSearch.setPropertyName("PROP_W_mimeType");
        drMIMETypesSearch.setCategoryId(4);                               //Global Standard/Fixed Property
        drMIMETypesSearch.setStr_relation(new Short("0").shortValue());   //dmNumberRelation.GREATEROREQUAL=5
        drMIMETypesSearch.setStr_value(mimeTypes[i]);
        if (mimeTypes.length == 1// If there is one term, we can use the AND clause
        {
          drMIMETypesSearch.setParentId(1);
        }
        else                      // Otherwise, need to have an OR subclause
        {
          drMIMETypesSearch.setParentId(3);
        }
        drMIMETypesSearch.setIsVersionProperty(true);
        dsSearchCriteria.addPROPERTY_TERMS(drMIMETypesSearch);
      }

      if (categoriesToAdd.size() > 1)
      {
        PROPERTY_OPS drCategoryOps = new PROPERTY_OPS();
        drCategoryOps.setId(2);
        drCategoryOps.setParentId(1);
        drCategoryOps.setOperator(new Short("1").shortValue());    // OR
        dsSearchCriteria.addPROPERTY_OPS(drCategoryOps);
      }
      if (mimeTypes.length > 1)
      {
        PROPERTY_OPS drMIMETypeOps = new PROPERTY_OPS();
        drMIMETypeOps.setId(3);
        drMIMETypeOps.setParentId(1);
        drMIMETypeOps.setOperator(new Short("1").shortValue());    // OR
        dsSearchCriteria.addPROPERTY_OPS(drMIMETypeOps);
      }

      /*====================================================================
      * Define what is being returned: include the properties that are
      * present within the document specification
      *===================================================================*/
      int returnResultsAdded = 0;
      if (returnMetadata != null && returnMetadata.length > 0)
      {
        PROPERTYDEFS [] propertyDefs = meridio_.getStaticData().getPROPERTYDEFS();

        // Build a hash table containing standard and custom properties
        HashMap propertyMap = new HashMap();
        HashMap customMap = new HashMap();
        i = 0;
        while (i < propertyDefs.length)
        {
          PROPERTYDEFS def = propertyDefs[i++];
          if (def.getTableName().equals("DOCUMENTS"))
          {
            propertyMap.put(def.getDisplayName(),def.getColumnName());
          }
          else if (def.getTableName().equals("DOCUMENT_CUSTOMPROPS"))
          {
            Long categoryID = new Long(def.getCategoryId());
            HashMap dataMap = (HashMap)customMap.get(categoryID);
            if (dataMap == null)
            {
              dataMap = new HashMap();
              customMap.put(categoryID,dataMap);
            }
            dataMap.put(def.getDisplayName(),def.getColumnName());
          }
        }

        for (i = 0; i < returnMetadata.length; i++)
        {
          long categoryMatch = 0;
          boolean isCategoryMatch    = false;

          RESULTDEFS drResultDefs = new RESULTDEFS();
          drResultDefs.setIsVersionProperty(false);

          if (returnMetadata[i].getCategoryName() == null ||
            returnMetadata[i].getCategoryName().length() == 0)
          {
            isCategoryMatch = true;
            categoryMatch   = 4;
          }
          else
          {
            Long categoryIDObject = (Long)categoryMap.get(returnMetadata[i].getCategoryName());
            if (categoryIDObject != null)
            {
              isCategoryMatch = true;
              categoryMatch = categoryIDObject.longValue();
            }
          }

          if (!isCategoryMatch)
          {
            if (Logging.connectors.isDebugEnabled())
              Logging.connectors.debug("Meridio: Category '" + returnMetadata[i].getCategoryName() + "' no match found for search results criteria!");
            continue;
          }
          else
          {

            /*====================================================================
            * Find the matching property name for the display name (as it is the
            * property column name that is required by the search)
            *===================================================================*/

            String columnName = (String)propertyMap.get(returnMetadata[i].getPropertyName());
            if (columnName == null)
            {
              HashMap categoryMatchMap = (HashMap)customMap.get(new Long(categoryMatch));
              if (categoryMatchMap != null)

              {
                columnName = (String)categoryMatchMap.get(returnMetadata[i].getPropertyName());
              }

            }

            if (columnName != null)
              drResultDefs.setPropertyName(columnName);
            else
            {
              if (Logging.connectors.isDebugEnabled())
                Logging.connectors.debug("Meridio: No property match found for '" + returnMetadata[i].getPropertyName() + "'");
              continue;
            }

            drResultDefs.setCategoryId(categoryMatch);
            dsSearchCriteria.addRESULTDEFS(drResultDefs);
            returnResultsAdded++;
          }
        }
      }

      /*====================================================================
      * We always need to return something in the search results, so add
      * the last modified date if nothing else was provided
      *===================================================================*/
      if (returnResultsAdded == 0)
      {
        RESULTDEFS drResultDefs = new RESULTDEFS();
        drResultDefs.setPropertyName("PROP_lastModifiedDate");
        drResultDefs.setIsVersionProperty(false);
        drResultDefs.setCategoryId(4);
        dsSearchCriteria.addRESULTDEFS(drResultDefs);
      }

      /*====================================================================
      * Call the search method
      *===================================================================*/
 
View Full Code Here

Examples of org.apache.manifoldcf.crawler.connectors.meridio.DMDataSet

    // Create the search criteria to determine the user id
    //
    // Create a dataset and a property terms row (search for
    // user properties
    //=============================================================
    DMDataSet dsSearchCriteria = new DMDataSet();
    PROPERTY_TERMS drUserSearch = new PROPERTY_TERMS();

    //=============================================================
    // Populate the property row with the search criteria
    //
    // Find the user that matches based on their name
    //=============================================================
    drUserSearch.setId(1);
    drUserSearch.setTermType(new Short("0").shortValue());          // STRING
    drUserSearch.setPropertyName("PROP_loginName");
    drUserSearch.setStr_relation(new Short("0").shortValue());      // IS
    drUserSearch.setStr_value(userName);
    drUserSearch.setParentId(1);
    dsSearchCriteria.addPROPERTY_TERMS(drUserSearch);

    //=============================================================
    // Only return the user account if it is enabled
    //=============================================================
    PROPERTY_TERMS drUserEnabled = new PROPERTY_TERMS();
    drUserEnabled.setId(2);
    drUserEnabled.setTermType(new Short("1").shortValue());         // NUMBER
    drUserEnabled.setPropertyName("PROP_enabled");
    drUserEnabled.setNum_relation(new Short("0").shortValue());     // EQUAL
    drUserEnabled.setNum_value(1);
    drUserEnabled.setParentId(1);
    dsSearchCriteria.addPROPERTY_TERMS(drUserEnabled);

    //=============================================================
    // 'AND' the two terms together
    //=============================================================
    PROPERTY_OPS drPropertyOps = new PROPERTY_OPS();
    drPropertyOps.setId(1);
    drPropertyOps.setOperator(new Short("0").shortValue());   //AND
    dsSearchCriteria.addPROPERTY_OPS(drPropertyOps);

    //=============================================================
    // Create the result definitions criteria: just the user ID is
    // required
    //=============================================================
    RESULTDEFS drResultDefs = new RESULTDEFS();
    drResultDefs.setPropertyName("PROP_id");
    drResultDefs.setIsVersionProperty(false);
    dsSearchCriteria.addRESULTDEFS(drResultDefs);

    DMSearchResults dsSearchResults = null;
    dsSearchResults = this.searchUsers(dsSearchCriteria, 1, 1, false);

    long rval;
View Full Code Here

Examples of org.apache.manifoldcf.crawler.connectors.meridio.DMDataSet

        GetUserDataWTResponseGetUserDataWTResult userData = null;

        userData = meridioDMWebService_.getUserData(loginToken_, new UnsignedInt(userId),
          getPropList, getCanDo, getGroups, getSharedContainers, getStoredSearches, getLockedDocuments);

        DMDataSet dmDS = getDMDataSet(userData.get_any());

        if (oLog != null) oLog.debug("Meridio: Exiting getUserData method.");

          return dmDS;
      }
View Full Code Here

Examples of org.apache.manifoldcf.crawler.connectors.meridio.DMDataSet

        getDocumentResponse = meridioDMWebService_.getDocumentData(loginToken_, new UnsignedInt(docId),
          getPropList, getAcl, getCanDo, getPolicy, getVersions, getKeywords,
          getReferencingContainers, getLockInfo);

        DMDataSet ds = getDMDataSet(getDocumentResponse.get_any());

        if (oLog != null) oLog.debug("Meridio: Exiting getDocumentData method.");

          return ds;
      }
View Full Code Here

Examples of org.apache.manifoldcf.crawler.connectors.meridio.DMDataSet

        getContainerDataResponse = meridioDMWebService_.getContainerData(loginToken_, new UnsignedInt(containerId),
          getPropList, getAcl, getCanDo, getChildContainers, getContainerRefs, getDocumentRefs,
          getStoredSearchRefs, getKeywords, getReferencingContainers);

        DMDataSet ds = getDMDataSet(getContainerDataResponse.get_any());

        if (oLog != null) oLog.debug("Meridio: Exiting getContainerData method.");

          return ds;
      }
View Full Code Here

Examples of org.apache.manifoldcf.crawler.connectors.meridio.DMDataSet

      String documentXML = writer.writeToString(resultDocument);

      //oLog.debug("Meridio: Result: " + documentXML);

      StringReader sr = new StringReader(documentXML);
      DMDataSet dsDM  = new DMDataSet();
      dsDM            = DMDataSet.unmarshal(sr);

      if (oLog != null) oLog.debug("Meridio: Exiting getDMDataSet method.");

        return dsDM;
View Full Code Here

Examples of org.apache.manifoldcf.crawler.connectors.meridio.DMDataSet

    // Create the search criteria to determine the user id
    //
    // Create a dataset and a property terms row (search for
    // user properties
    //=============================================================
    DMDataSet dsSearchCriteria = new DMDataSet();
    PROPERTY_TERMS drUserSearch = new PROPERTY_TERMS();

    //=============================================================
    // Populate the property row with the search criteria
    //
    // Find the user that matches based on their name
    //=============================================================
    drUserSearch.setId(1);
    drUserSearch.setTermType(new Short("0").shortValue());          // STRING
    drUserSearch.setPropertyName("PROP_loginName");
    drUserSearch.setStr_relation(new Short("0").shortValue());      // IS
    drUserSearch.setStr_value(userName);
    drUserSearch.setParentId(1);
    dsSearchCriteria.addPROPERTY_TERMS(drUserSearch);

    //=============================================================
    // Only return the user account if it is enabled
    //=============================================================
    PROPERTY_TERMS drUserEnabled = new PROPERTY_TERMS();
    drUserEnabled.setId(2);
    drUserEnabled.setTermType(new Short("1").shortValue());         // NUMBER
    drUserEnabled.setPropertyName("PROP_enabled");
    drUserEnabled.setNum_relation(new Short("0").shortValue());     // EQUAL
    drUserEnabled.setNum_value(1);
    drUserEnabled.setParentId(1);
    dsSearchCriteria.addPROPERTY_TERMS(drUserEnabled);

    //=============================================================
    // 'AND' the two terms together
    //=============================================================
    PROPERTY_OPS drPropertyOps = new PROPERTY_OPS();
    drPropertyOps.setId(1);
    drPropertyOps.setOperator(new Short("0").shortValue());   //AND
    dsSearchCriteria.addPROPERTY_OPS(drPropertyOps);

    //=============================================================
    // Create the result definitions criteria: just the user ID is
    // required
    //=============================================================
    RESULTDEFS drResultDefs = new RESULTDEFS();
    drResultDefs.setPropertyName("PROP_id");
    drResultDefs.setIsVersionProperty(false);
    dsSearchCriteria.addRESULTDEFS(drResultDefs);

    DMSearchResults dsSearchResults = null;
    dsSearchResults = this.searchUsers(dsSearchCriteria, 1, 1, false);

    long rval;
View Full Code Here

Examples of org.apache.manifoldcf.crawler.connectors.meridio.DMDataSet

        GetUserDataWTResponseGetUserDataWTResult userData = null;

        userData = meridioDMWebService_.getUserData(loginToken_, new UnsignedInt(userId),
          getPropList, getCanDo, getGroups, getSharedContainers, getStoredSearches, getLockedDocuments);

        DMDataSet dmDS = getDMDataSet(userData.get_any());

        if (oLog != null) oLog.debug("Meridio: Exiting getUserData method.");

          return dmDS;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.