Uploaded image for project: 'Nuxeo Java Client'
  1. Nuxeo Java Client
  2. JAVACLIENT-225

Fix usage of Java client with LTS 2021

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.12.0
    • Component/s: API

      Description

      Since the introduction of secured properties which are readonly, a big part of the Java client calls fail when run as a non Administrator.

      2 examples :

              Builder builder = new NuxeoClient.Builder();
              builder.url("http://localhost:8080/nuxeo")
                     .authentication("joe", "joe")
                     .schemas("*")
                     .connectTimeout(0)
                     .timeout(0);
              NuxeoClient nuxeoClient = builder.connect();
              
              Document doc = nuxeoClient.repository().fetchDocumentById("78caf297-9dfb-4ffd-955f-24f81af864e8");
      
              Operation operation = nuxeoClient.operation("Document.CreateVersion")
                                               .input(doc)
                                               .param("increment", "Minor");
      
              operation.execute();
       

      and

              Builder builder = new NuxeoClient.Builder();
              builder.url("http://localhost:8080/nuxeo").authentication("joe", "joe").schemas("*");
              NuxeoClient client = builder.connect();
      
              Document document = client.repository().fetchDocumentById("78caf297-9dfb-4ffd-955f-24f81af864e8");
              ACP acp = document.fetchPermissions();
              List<ACL> acls = acp.getAcls();
              for (ACL acl :acls) {
                  if (ACL.LOCAL_ACL.equals(acl.getName())) {
                      for (ACE ace : acl.getAces()) {
                          if ("thierry".equals(ace.getUsername())) {
                          document.removePermission(ace.getId(), ace.getUsername(), ACL.LOCAL_ACL);
                          }
                      }
                  }
              }
              
              client.disconnect();
      

       

      Removing "schemas("*") from the client builder fixes both cases.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: