From dev-return-10140-archive-asf-public=cust-asf.ponee.io@chemistry.apache.org Tue Sep 4 17:23:37 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id D8293180629 for ; Tue, 4 Sep 2018 17:23:36 +0200 (CEST) Received: (qmail 99479 invoked by uid 500); 4 Sep 2018 15:23:35 -0000 Mailing-List: contact dev-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list dev@chemistry.apache.org Delivered-To: moderator for dev@chemistry.apache.org Received: (qmail 45087 invoked by uid 99); 4 Sep 2018 15:07:46 -0000 X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.139 X-Spam-Level: *** X-Spam-Status: No, score=3.139 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, MANY_SPAN_IN_TEXT=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=9iqJRGOBby66Jo2QZapylVskHv5ADWFFI+LkEFivhuk=; b=n/qlu0bESjkU1bofDnmAVoi0MZUxZBXCudlXpI+XSq8GNate5xh4xLg82zWJwqo1hF mWDrQtDcieUBQHz7HdZNe/y78f5XYGXvIkO/4oAeuY5hHACu37jqNe2QasVhAZOCSs+V gBDeUqUPyMSr+vEdBS/kJu+FetjqZ1idDu3AQLSozJ7NIF//C4ppnYetACjxEzo2Vrq+ IqwXQ2i58eNXqlhnS8Gf9/JqSgx31DKyYBE1W6r/A7G6DOeVKTbfgReX0rPW+kAO1iQl 8avYM9JghnO+hv3QDl5lE9BEhcJ+rwfXR9Jew+PPEPXDVcSDZ0qMnnlZ0EbwFhU1zZBn QJjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=9iqJRGOBby66Jo2QZapylVskHv5ADWFFI+LkEFivhuk=; b=PjH5khFRdOCpbrw6qeDYWK5vqFJDqYKhlM+sh+EGSTokBJcmWTycNZ+5Tcro0BUbKi f9JmZzu4IrKmoMH6q+PBy2SFIDmrEe2TgTrdJLwVQbwuBTrH7tNDL9ZTolrC6KPHu7aJ BenVeZclQK28krxDUqg8S17a0x8pATESGBaXAOIaoL0UUsJB8Bc62Pzv1NMkdFXue+zj roSTOIuE6zA7WQwWbhqFSjG9sTuleyfyc4gb9otheRsMsFOD0sLfVh/a9WrxTyO9wO2P y6JybTuxKtr+2hUt5xgNRtR1BbazdJpjdFZCzCcbr1Z5HNhehhfcmLiG8vaiM/TKcTbk hpyw== X-Gm-Message-State: APzg51A1+/zydLoaX13/KthY+P9fMda+So1sBhS4D7xs8SmL7GNwelJK 5l4T+4XffGY+CrQzbzuK2jPX859LUkmFqAoO1DP/rA5v X-Google-Smtp-Source: ANB0VdYNDc5mSAgJqpmGOL7nGExjhClXymG6FU6PoM48DOeUwEDcxZ7oDX/3Dh1EiUY7rV5uUhVv0zHgqhwP3J5PE8Q= X-Received: by 2002:a5d:6381:: with SMTP id p1-v6mr1607198wru.106.1536073658177; Tue, 04 Sep 2018 08:07:38 -0700 (PDT) MIME-Version: 1.0 From: Kar Tech Date: Tue, 4 Sep 2018 16:07:27 +0100 Message-ID: Subject: Inmemory cmis instance does not support creating document with version state To: dev@chemistry.apache.org Content-Type: multipart/alternative; boundary="000000000000bea8f005750d0426" --000000000000bea8f005750d0426 Content-Type: text/plain; charset="UTF-8" Hi Dev Team, I am trying to create a document against the inmemory CMIS instance that is locally running in my machine. I get the below error, when I try to create a document with VersioningState.MAJOR Does my in memory instance need to be setup with any specify operation context to support versioning? or is there any other setup required ? Based on the apache documentation, seems like versioning is automatically supported. Below is my createDocument method for reference Thanks Kar private static Document createDocument(UserSession userSession, Folder parentFolder, String documentName, byte[] data, String mimeType, Map metadata ) throws ActionNotEntitledException { Document document; if(isActionEntitled(Action.CAN_CREATE_DOCUMENT, parentFolder.getAllowableActions().getAllowableActions())){ ByteArrayInputStream stream = new ByteArrayInputStream(data); ContentStream contentStream = userSession.getSession().getObjectFactory().createContentStream(documentName, data.length, mimeType, stream); // prepare properties Map documentProperties = new HashMap<>(); documentProperties.put(PropertyIds.NAME, documentName); documentProperties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document"); document = parentFolder.createDocument(documentProperties, contentStream, VersioningState.MAJOR, null, null,null, ); //Add secondary properties such as aspect properties if(metadata != null && !metadata.isEmpty()){ document.updateProperties(metadata); } } else{ throw new ActionNotEntitledException("User " + userSession.getUserName() + " not entitled to create Document"); } return document; } --000000000000bea8f005750d0426--