Return-Path: X-Original-To: apmail-chemistry-dev-archive@www.apache.org Delivered-To: apmail-chemistry-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E3C4794CD for ; Wed, 5 Oct 2011 13:58:57 +0000 (UTC) Received: (qmail 18145 invoked by uid 500); 5 Oct 2011 13:58:57 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 18108 invoked by uid 500); 5 Oct 2011 13:58:57 -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 Received: (qmail 18100 invoked by uid 99); 5 Oct 2011 13:58:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2011 13:58:57 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2011 13:58:55 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id D347A2AAEEE for ; Wed, 5 Oct 2011 13:58:33 +0000 (UTC) Date: Wed, 5 Oct 2011 13:58:33 +0000 (UTC) From: "Tobias Mattsson (Created) (JIRA)" To: dev@chemistry.apache.org Message-ID: <2077235627.11928.1317823113867.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (CMIS-440) Introduce type handlers to allow different content structures MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Introduce type handlers to allow different content structures ------------------------------------------------------------- Key: CMIS-440 URL: https://issues.apache.org/jira/browse/CMIS-440 Project: Chemistry Issue Type: Improvement Components: opencmis-server-jcr Affects Versions: OpenCMIS 0.6.0 Reporter: Tobias Mattsson We have a content structure that differs from the structure that is assumed in opencmis jcr. I.e. our documents are not of type nt:file, our folders are a sub-type of nt:folder but we have meta-data around in nodes of type nt:folder which we don't want to show and we want to hide the system folders directly under the root. To get things working with our structure we've had to make customizations in quite a few places. To make it manageable we've introduced a handler that is responsible for tasks related to a certain type. This is similar to what the TODO in JcrNodeFactory describes. A type handler is responsible for: * providing a TypeDefinition (see CMIS-439) * testing if it handles a specific javax.jcr.Node * creating a JcrNode instance for the type (which is now done by JcrNodeFactory) * providing IdentifierMap for queries (now done by JcrNodeFactory) * creating a new object of the type, this is now done in JcrFolder addNode and addFolder so if you have many documents you have to add the code for creating all of them there, spreading the handling of your new type around The type handlers are managed by TypeHandlerManager which keep the list of handlers and have utility methods that loop through the handlers to calls the right handler. A really nifty thing here is that the TypeHandlerManager can expose a Predicate that loops type handlers to see if a Node is handled or not, this means that things in the jcr repository for which there is no CMIS type are hidden. This predicate needs to take effect in alot of places, both in JcrFolder and in JcrRepository, I've solved this by giving JcrFolder a wrapped Node that applies the predicate to all NodeIterators it returns. What do you think? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira