You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@manifoldcf.apache.org by "Karl Wright (JIRA)" <ji...@apache.org> on 2015/10/28 23:10:28 UTC

[jira] [Commented] (CONNECTORS-1248) CMIS connector doesn't detect changes to content under some conditions

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

Karl Wright commented on CONNECTORS-1248:
-----------------------------------------

Hi all,

The current (trunk) computation of the version string for a CMIS document looks like this:

{code}
      String versionString;

      if (cmisObject.getBaseType().getId().equals(CMIS_DOCUMENT_BASE_TYPE)) {
        Document document = (Document) cmisObject;

        // Since documents that are not current have different node id's, we can return a constant version,
        // EXCEPT when the document is not the current one (in which case we delete)
        boolean isCurrentVersion;
        try {
          Document d = document.getObjectOfLatestVersion(false);
          isCurrentVersion = d.getId().equals(documentIdentifier);
        } catch (CmisObjectNotFoundException e) {
          isCurrentVersion = false;
        }
        if (isCurrentVersion) {
          //System.out.println(" is latest version");
          //versionString = documentIdentifier + ":" + cmisQuery;
      // take into account of the last modification date
            long lmdSeconds = document.getLastModificationDate().getTimeInMillis();
            versionString = documentIdentifier + lmdSeconds + ":" + cmisQuery;
        } else {
          //System.out.println(" is NOT latest vrersion");
          activities.deleteDocument(documentIdentifier);
          continue;
        }
      } else {
        //a CMIS folder will always be processed
        //System.out.println(" is folder");
        versionString = StringUtils.EMPTY;
      }
{code}

As you can see, there's already an inclusion of getLastModificationDate().getTimeInMillis(), so I think this may have already been fixed.

{code}
1705809 piergiorgi       // take into account of the last modification date
1705809 piergiorgi             long lmdSeconds = document.getLastModificationDate().getTimeInMillis();
1705809 piergiorgi             versionString = documentIdentifier + lmdSeconds + ":" + cmisQuery;
{code}

So I think we can close this ticket?



> CMIS connector doesn't detect changes to content under some conditions
> ----------------------------------------------------------------------
>
>                 Key: CONNECTORS-1248
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-1248
>             Project: ManifoldCF
>          Issue Type: Bug
>          Components: CMIS connector
>    Affects Versions: ManifoldCF 2.2
>            Reporter: Karl Wright
>            Assignee: Karl Wright
>             Fix For: ManifoldCF 2.3
>
>         Attachments: sample-patch-for1.7.2.txt
>
>
> As commented elsewhere:
> {quote}
> When I worked with the CMIS connector I had to modify the logic to append document.getLastModificationDate().getTimeInMillis() to the versionString for it to pick up changes.  The Alfresco document version won't update when you modify metadata.  My memory is terrible, but I believe that even modifying content may not do it unless you have the proper 'versioning' aspect applied.
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)