Package com.google.enterprise.connector.filenet4.filewrap

Examples of com.google.enterprise.connector.filenet4.filewrap.IUserContext


  }

  @Override
  public IBaseObject fetchObject(String type, IId id, PropertyFilter filter)
          throws RepositoryDocumentException {
    IBaseObject obj = objects.get(id);
    if (ClassNames.DOCUMENT.equals(type)) {
      return new MockDocument(obj);
    } else if (ClassNames.VERSION_SERIES.equals(type)) {
      return new MockVersionSeries(obj);
    } else {
View Full Code Here


          actionProp.nextValue().toString());

      String id =
          doc.findProperty(SpiConstants.PROPNAME_DOCID).nextValue().toString();
      if (ActionType.ADD.equals(actionType)) {
        IBaseObject object = os.getObject(null, id);
        assertFalse(object instanceof FileDeletionObject);
        assertTrue(checkpointContains(docList.checkpoint(),
            doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
            JsonField.LAST_MODIFIED_TIME));
        isAddTested = true;
      } else if (ActionType.DELETE.equals(actionType)) {
        IBaseObject object = os.getObject(null, id);
        if (object.isDeletionEvent()) {
          assertTrue(checkpointContains(docList.checkpoint(),
              doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
              JsonField.LAST_DELETION_EVENT_TIME));
          isDeletionEventTested = true;
        } else {
View Full Code Here

      String[] entries, boolean releasedVersion)
          throws ParseException, RepositoryDocumentException {
    Map<IId, IBaseObject> objectMap = new HashMap<IId, IBaseObject>();
    Calendar cal = Calendar.getInstance();
    for (String entry : entries) {
      IBaseObject object = createObject(entry, Value.calendarToIso8601(cal),
          false, releasedVersion);
      objectMap.put(new FnId(entry), new FileDeletionObject(object));
    }
    return objectMap;
  }
View Full Code Here

  private Map<IId, IBaseObject> generateCustomDeletion(String[][] entries,
      boolean releasedVersion)
          throws ParseException, RepositoryDocumentException {
    Map<IId, IBaseObject> objectMap = new HashMap<IId, IBaseObject>();
    for (String[] line : entries) {
      IBaseObject object =
          createObject(line[0], line[1], false, releasedVersion);
      objectMap.put(new FnId(line[0]), new FileDeletionObject(object));
    }
    return objectMap;
  }
View Full Code Here

        + "and ContentSize IS NOT NULL  AND (ISCLASS(d, Document) "
        + "OR ISCLASS(d, WorkflowDefinition))  ORDER BY DateLastModified,Id");
    assertEquals(1, test.getSize());
    Iterator<? extends IBaseObject> it = test.getIterator();
    while (it.hasNext()) {
      IBaseObject ibo = it.next();
      assertEquals("{" + TestConnection.docId1 + "}", ibo.get_Id().toString());
    }
  }
View Full Code Here

  public Document nextDocument() throws RepositoryException {
    logger.entering("FileDocumentList", "nextDocument()");

    fileDocument = null;
    if (objects.hasNext()) {
      IBaseObject object = objects.next();
      if (object.isDeletionEvent()) {
        fileDocumentToDeleteDate = object.getModifyDate();
        docIdToDelete = object.get_Id();
        if (object.isReleasedVersion()) {
          fileDocument = createDeleteDocument(object);
        } else {
          throw new SkippedDocumentException("Skip a deletion event [ID: "
              + docIdToDelete + "] of an unreleased document.");
        }
      } else if (object instanceof FileDeletionObject) {
        fileDocumentToDeleteDocsDate = object.getModifyDate();
        docIdToDeleteDocs = object.get_Id();
        if (object.isReleasedVersion()) {
          fileDocument = createDeleteDocument(object);
        } else {
          throw new SkippedDocumentException("Skip custom deletion [ID: "
              + docIdToDeleteDocs + "] because document is not a released "
              + "version.");
        }
      } else {
        fileDocumentDate = object.getModifyDate();
        docId = object.get_Id();
        fileDocument = createAddDocument(object);
      }
    } else {
      logger.finest("Processing ACL document");
      fileDocument = acls.pollFirst();
View Full Code Here

    connec.setContent_engine_url(TestConnection.uri);

    fs = (FileSession) connec.login();

    iof = (IObjectFactory) Class.forName(TestConnection.objectFactory).newInstance();
    IConnection conn = iof.getConnection(TestConnection.uri, TestConnection.adminUsername, TestConnection.adminPassword);
    // Domain domain = Factory.Domain.getInstance(conn.getConnection(),
    // null);
    ios = iof.getObjectStore(TestConnection.objectStore, conn, TestConnection.adminUsername, TestConnection.adminPassword);

    fd = (IDocument) ios.fetchObject(ClassNames.DOCUMENT,
View Full Code Here

    connec.setContent_engine_url(TestConnection.uri);

    fs = (FileSession) connec.login();

    iof = (IObjectFactory) Class.forName(TestConnection.objectFactory).newInstance();
    IConnection conn = iof.getConnection(TestConnection.uri, TestConnection.adminUsername, TestConnection.adminPassword);
    // Domain domain = Factory.Domain.getInstance(conn.getConnection(),
    // "P8.V4");
    ios = iof.getObjectStore(TestConnection.objectStore, conn, TestConnection.username, TestConnection.password);

  }
View Full Code Here

    connec.setIs_public("true");

    fs = (FileSession) connec.login();

    iof = (IObjectFactory) Class.forName(TestConnection.objectFactory).newInstance();
    IConnection conn = iof.getConnection(TestConnection.uri, TestConnection.adminUsername, TestConnection.adminPassword);
    ios = iof.getObjectStore(TestConnection.objectStore, conn, TestConnection.username, TestConnection.password);

    adminUser = MockUtil.createAdministratorUser();
  }
View Full Code Here

      logger.config("Authorizing DocID: " + docId + " for user: "
          + user.get_Name());
      // Check whether the search user is authorized to view document
      // contents or
      // not.
      IDocument releasedVersion = versionSeries.get_ReleasedVersion();
      Permissions permissions = new Permissions(
          releasedVersion.get_Permissions(), releasedVersion.get_Owner());
      if (permissions.authorize(user)) {
        logger.log(Level.INFO, "As per the ACLS User "
            + user.get_Name()
            + " is authorized for document DocID " + docId);
        authorizationResponse = new AuthorizationResponse(true,
            docId);

        if (checkMarkings) {
          logger.log(Level.INFO, "Authorizing DocID: " + docId
              + " for user: " + user.get_Name()
              + " for Marking sets ");

          // check whether current document has property values
          // set for properties associated with marking sets or
          // not //
          if (releasedVersion.get_ActiveMarkings() != null) {
            logger.log(Level.INFO, "Document has property associated with Markings set");

            // check whether USER is authorized to view the
            // document as per the Marking set security applied
            // over it.
            MarkingPermissions markingPermissions =
                new MarkingPermissions(releasedVersion.get_ActiveMarkings());
            if (markingPermissions.authorize(user)) {
              logger.log(Level.INFO, "As per the Marking Sets User "
                  + user.get_Name()
                  + " is authorized for document DocID "
                  + docId);
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.filenet4.filewrap.IUserContext

Copyright © 2018 www.massapicom. 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.