Changeset 30413

Show
Ignore:
Timestamp:
02/21/08 19:38:54 (9 months ago)
Author:
sfermigier
Message:

Tabs->whitespace, cosmit.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-api/src/main/java/org/nuxeo/ecm/core/api/DocumentSecurityException.java

    r29127 r30413  
     1/* 
     2 * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors. 
     3 * 
     4 * All rights reserved. This program and the accompanying materials 
     5 * are made available under the terms of the GNU Lesser General Public License 
     6 * (LGPL) version 2.1 which accompanies this distribution, and is available at 
     7 * http://www.gnu.org/licenses/lgpl.html 
     8 * 
     9 * This library is distributed in the hope that it will be useful, 
     10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
     12 * Lesser General Public License for more details. 
     13 * 
     14 * Contributors: 
     15 *     Nuxeo - initial API and implementation 
     16 * 
     17 * $Id$ 
     18 */ 
     19 
    120package org.nuxeo.ecm.core.api; 
    221 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-api/src/main/java/org/nuxeo/ecm/core/api/event/CoreEvent.java

    r30133 r30413  
    3333public interface CoreEvent { 
    3434 
    35        /** 
    36         * Tests if this event is a composite event. Composite events may have nested events. 
    37        
    38         * @return true if this is a composite event, false otherwise 
    39         */ 
    40        boolean isComposite(); 
     35    /** 
     36    * Tests if this event is a composite event. Composite events may have nested events. 
     37   
     38    * @return true if this is a composite event, false otherwise 
     39    */ 
     40    boolean isComposite(); 
    4141 
    42        /** 
    43         * Get nested events if any. 
    44         * <p> 
    45         * Composite events are always returning a non null list. 
    46         * If there are no nested events an empty list is returned. 
    47         * <p> 
    48         * Be aware that the returned list may not be a copy of the internal list of nested events 
    49         * thus modifying it may also modify the composite event. 
    50         *<p> 
    51         * Non composite events are always returning null 
    52        
    53         * @return the nested event list or null if this is not a composite event 
    54         */ 
    55        List<CoreEvent> getNestedEvents(); 
     42    /** 
     43    * Get nested events if any. 
     44    * <p> 
     45    * Composite events are always returning a non null list. 
     46    * If there are no nested events an empty list is returned. 
     47    * <p> 
     48    * Be aware that the returned list may not be a copy of the internal list of nested events 
     49    * thus modifying it may also modify the composite event. 
     50    *<p> 
     51    * Non composite events are always returning null 
     52   
     53    * @return the nested event list or null if this is not a composite event 
     54    */ 
     55    List<CoreEvent> getNestedEvents(); 
    5656 
    5757 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-api/src/main/java/org/nuxeo/ecm/core/api/event/impl/CompositeEvent.java

    r30133 r30413  
    3636public class CompositeEvent extends CoreEventImpl { 
    3737 
    38        protected List<CoreEvent> events; 
     38    protected final List<CoreEvent> events; 
    3939 
    40        /** 
    41        
    42         */ 
    43        public CompositeEvent(String eventId, Object source, Map<String, ?> info, 
     40    /** 
     41   
     42    */ 
     43    public CompositeEvent(String eventId, Object source, Map<String, ?> info, 
    4444            Principal principal, String category, String comment) { 
    45                super (eventId, source, info, principal, category, comment); 
    46                this.events = new ArrayList<CoreEvent>(); 
    47        
     45        super (eventId, source, info, principal, category, comment); 
     46        events = new ArrayList<CoreEvent>(); 
     47   
    4848 
    4949 
    50        @Override 
    51        public List<CoreEvent> getNestedEvents() { 
    52                return events; 
    53        
     50    @Override 
     51    public List<CoreEvent> getNestedEvents() { 
     52        return events; 
     53   
    5454 
    55        @Override 
    56        public boolean isComposite() { 
    57                return true; 
    58        
     55    @Override 
     56    public boolean isComposite() { 
     57        return true; 
     58   
    5959 
    60        public void addEvent(CoreEvent event) { 
    61                events.add(event); 
    62        
     60    public void addEvent(CoreEvent event) { 
     61        events.add(event); 
     62   
    6363 
    64        public List<CoreEvent>getAllNestedEvents() { 
    65                List<CoreEvent> result = new ArrayList<CoreEvent>(); 
    66                collectNestedEvents(result); 
    67                return result; 
    68        
     64    public List<CoreEvent>getAllNestedEvents() { 
     65        List<CoreEvent> result = new ArrayList<CoreEvent>(); 
     66        collectNestedEvents(result); 
     67        return result; 
     68   
    6969 
    70        public void collectNestedEvents(List<CoreEvent> result) { 
    71                for (CoreEvent event : result) { 
    72                        result.add(event); 
    73                        if (event.isComposite()) { 
    74                                ((CompositeEvent)event).collectNestedEvents(result); 
    75                        
    76                
    77        
     70    public void collectNestedEvents(List<CoreEvent> result) { 
     71        for (CoreEvent event : result) { 
     72            result.add(event); 
     73            if (event.isComposite()) { 
     74                ((CompositeEvent)event).collectNestedEvents(result); 
     75           
     76       
     77   
    7878} 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-api/src/main/java/org/nuxeo/ecm/core/api/event/impl/CoreEventImpl.java

    r30133 r30413  
    6767 
    6868    public boolean isComposite() { 
    69        return false; 
     69        return false; 
    7070    } 
    7171 
    7272    public List<CoreEvent> getNestedEvents() { 
    73        return null; 
     73        return null; 
    7474    } 
    7575 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-api/src/main/java/org/nuxeo/ecm/core/api/impl/DocumentModelImpl.java

    r30308 r30413  
    14651465 
    14661466    public DocumentModel clone() throws CloneNotSupportedException { 
    1467        DocumentModelImpl dm = (DocumentModelImpl)super.clone(); 
    1468 //    dm.id =id; 
    1469 //    dm.acp = acp; 
    1470 //    dm.currentLifeCycleState = currentLifeCycleState; 
    1471 //    dm.lifeCyclePolicy = lifeCyclePolicy; 
    1472 //    dm.declaredSchemas = declaredSchemas; // schemas are immutable so we don't clone the array 
    1473 //    dm.flags = flags; 
    1474 //    dm.repositoryName = repositoryName; 
    1475 //    dm.ref = ref; 
    1476 //    dm.parentRef = parentRef; 
    1477 //    dm.path = path; // path is immutable 
    1478 //    dm.isACPLoaded = isACPLoaded; 
    1479 //    dm.prefetch = dm.prefetch; // prefetch can be shared 
    1480 //    dm.lock = lock; 
    1481 //    dm.sourceId =sourceId; 
    1482 //    dm.sid = sid; 
    1483 //    dm.type = type; 
    1484        dm.declaredFacets = new HashSet<String>(declaredFacets); // facets should be clones too - they are not immutable 
    1485        // context data is keeping contextual info so it is reseted 
    1486        dm.contextData = new ScopedMap(); 
    1487  
    1488        // copy parts 
    1489        dm.dataModels = new DataModelMapImpl(); 
    1490        for (Map.Entry<String,DataModel> entry : dataModels.entrySet()) { 
    1491                String key = entry.getKey(); 
    1492                DataModel data = entry.getValue(); 
    1493                DataModelImpl newData = new DataModelImpl(key, data.getMap()); 
    1494                dm.dataModels.put(key, newData); 
    1495        
    1496        return dm; 
     1467        DocumentModelImpl dm = (DocumentModelImpl)super.clone(); 
     1468//        dm.id =id; 
     1469//        dm.acp = acp; 
     1470//        dm.currentLifeCycleState = currentLifeCycleState; 
     1471//        dm.lifeCyclePolicy = lifeCyclePolicy; 
     1472//        dm.declaredSchemas = declaredSchemas; // schemas are immutable so we don't clone the array 
     1473//        dm.flags = flags; 
     1474//        dm.repositoryName = repositoryName; 
     1475//        dm.ref = ref; 
     1476//        dm.parentRef = parentRef; 
     1477//        dm.path = path; // path is immutable 
     1478//        dm.isACPLoaded = isACPLoaded; 
     1479//        dm.prefetch = dm.prefetch; // prefetch can be shared 
     1480//        dm.lock = lock; 
     1481//        dm.sourceId =sourceId; 
     1482//        dm.sid = sid; 
     1483//        dm.type = type; 
     1484        dm.declaredFacets = new HashSet<String>(declaredFacets); // facets should be clones too - they are not immutable 
     1485        // context data is keeping contextual info so it is reseted 
     1486        dm.contextData = new ScopedMap(); 
     1487 
     1488        // copy parts 
     1489        dm.dataModels = new DataModelMapImpl(); 
     1490        for (Map.Entry<String,DataModel> entry : dataModels.entrySet()) { 
     1491            String key = entry.getKey(); 
     1492            DataModel data = entry.getValue(); 
     1493            DataModelImpl newData = new DataModelImpl(key, data.getMap()); 
     1494            dm.dataModels.put(key, newData); 
     1495       
     1496        return dm; 
    14971497    } 
    14981498 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-api/src/main/java/org/nuxeo/ecm/core/api/model/impl/ListProperty.java

    r30097 r30413  
    135135    } 
    136136 
     137    @Override 
    137138    protected Serializable getDefaultValue() { 
    138         Serializable value = (Serializable)getField().getDefaultValue(); 
     139        Serializable value = (Serializable) field.getDefaultValue(); 
    139140        if (value == null) { 
    140141            value = new ArrayList<Serializable>(); 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-api/src/main/java/org/nuxeo/ecm/core/api/security/ACL.java

    r29901 r30413  
    7878     * @return a copy 
    7979     */ 
    80     public Object clone(); 
     80    Object clone(); 
    8181 
    8282} 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-api/src/main/java/org/nuxeo/ecm/core/api/security/ACP.java

    r30105 r30413  
    173173     * @return a copy 
    174174     */ 
    175     public Object clone(); 
     175    Object clone(); 
    176176 
    177177} 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-client/src/main/java/org/nuxeo/ecm/core/client/NuxeoClient.java

    r30085 r30413  
    5555 
    5656    private LoginHandler loginHandler; 
    57     private List<RepositoryInstance> repositoryInstances; 
    58     private ListenerList connectionListeners; 
     57    private final List<RepositoryInstance> repositoryInstances; 
     58    private final ListenerList connectionListeners; 
    5959 
    6060    private InvokerLocator locator; 
    6161    private String serverName; 
    62     private AutoConfigurationService cfg; 
     62    private final AutoConfigurationService cfg; 
    6363    private RepositoryManager repositoryMgr = null; 
    6464 
    6565    private boolean multiThreadedLogin = false; 
    6666 
    67  
    68     private static NuxeoClient instance = new NuxeoClient(); 
    69  
    70     public static NuxeoClient getInstance() { 
    71         return instance; 
    72     } 
    73  
     67    private static final NuxeoClient instance = new NuxeoClient(); 
    7468 
    7569    private NuxeoClient() { 
     
    7872        this.loginHandler = loginHandler == null ? new DefaultLoginHandler() : loginHandler; 
    7973        this.repositoryInstances = new Vector<RepositoryInstance>(); 
     74    } 
     75 
     76    public static NuxeoClient getInstance() { 
     77        return instance; 
    8078    } 
    8179 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-facade/src/test/java/org/nuxeo/ecm/core/api/TestLocalAPI.java

    r30221 r30413  
    123123 
    124124        assertTrue(p.isPhantom()); 
    125         assertEquals(null, p.getValue()); 
     125        assertNull(p.getValue()); 
    126126        p.setValue(12); 
    127127        assertEquals(new Long(12), p.getValue()); 
     
    134134        p.setValue(null); 
    135135        assertFalse(p.isPhantom()); 
    136         assertEquals(null, p.getValue()); 
     136        assertNull(p.getValue()); 
    137137 
    138138        remote.saveDocument(doc); 
     
    141141        p = dp.get("long"); 
    142142//        assertTrue(p.isPhantom()); 
    143         assertEquals(null, p.getValue()); 
     143        assertNull(p.getValue()); 
    144144        p.setValue(new Long(13)); 
    145145        p.remove(); 
    146146        assertTrue(p.isRemoved()); 
    147         assertEquals(null, p.getValue()); 
     147        assertNull(p.getValue()); 
    148148 
    149149        remote.saveDocument(doc); 
     
    152152        p = dp.get("long"); 
    153153        assertTrue(p.isPhantom()); 
    154         assertEquals(null, p.getValue()); 
     154        assertNull(p.getValue()); 
    155155    } 
    156156 
     
    290290 
    291291            dm.setValue("price", 123); 
    292             assertEquals((long)123, dm.getValue("price")); 
     292            assertEquals(123L, dm.getValue("price")); 
    293293            dm.setValue("price", 124); 
    294             assertEquals((long)124, dm.getValue("price")); 
     294            assertEquals(124L, dm.getValue("price")); 
    295295 
    296296            dm.setValue("author/pJob", "Programmer"); 
     
    334334 
    335335    public static byte[] createBytes(int size, byte val) { 
    336        byte[] bytes = new byte[size]; 
    337        Arrays.fill(bytes, val); 
    338        return bytes; 
     336        byte[] bytes = new byte[size]; 
     337        Arrays.fill(bytes, val); 
     338        return bytes; 
    339339    } 
    340340 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-io/src/main/java/org/nuxeo/ecm/core/io/IODocumentManager.java

    r29979 r30413  
    3535 * provided DocumentReader or InputStream as a source and DocumentWriter that 
    3636 * knows how the documents will be saved into the repository. 
    37  *  
     37 * 
    3838 * @author <a href="mailto:dm@nuxeo.com">Dragos Mihalache</a> 
    3939 */ 
     
    4949 
    5050    /** 
    51      *  
     51     * 
    5252     * @param customDocReader reader from the input stream 
    5353     * @param customDocWriter 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-io/src/main/java/org/nuxeo/ecm/core/io/impl/AbstractDocumentReader.java

    r29029 r30413  
    4646 
    4747            /*NXP-1688 Rux: no ID, it should be a OS folder and not an exported one*/ 
    48             if (doc.getId() != null) 
     48            if (doc.getId() != null) { 
    4949                docs.add(doc); 
     50            } 
    5051        } 
    5152        if (docs.isEmpty()) { 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-io/src/main/java/org/nuxeo/ecm/core/io/impl/plugins/DocumentModelWriter.java

    r29029 r30413  
    9393        PathRef pathRef = new PathRef(targetPath.toString()); 
    9494        try { 
    95             if (session.exists(pathRef)) 
     95            if (session.exists(pathRef)) { 
    9696                previousDoc = session.getDocument(pathRef); 
     97            } 
    9798        } catch (ClientException ce) { 
    9899            //don't care, document considered inexistent 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-jca/src/main/java/org/nuxeo/ecm/core/jca/JCAManagedConnectionFactory.java

    r28980 r30413  
    119119     * Creates a Connection Factory instance. 
    120120     */ 
    121     public Object createConnectionFactory(ConnectionManager cm) 
    122             throws ResourceException { 
     121    public Object createConnectionFactory(ConnectionManager cm) { 
    123122        JCAConnectionFactory handle = new JCAConnectionFactory(this, cm); 
    124123        log("Created repository handle (" + handle + ')'); 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-jcr-connector/src/main/java/org/nuxeo/ecm/core/repository/jcr/DocumentPartWriter.java

    r30093 r30413  
    5757 */ 
    5858public class DocumentPartWriter { 
    59      
     59 
    6060    private static final Log log = LogFactory.getLog(DocumentPartWriter.class); 
    6161 
     
    216216    public static void writeListProperty(Node node, Property prop) throws Exception { 
    217217        // check if there are removed properties 
    218         ArrayList<String> removed = (ArrayList<String>) prop.getData("@removed"); 
     218        List<String> removed = (List<String>) prop.getData("@removed"); 
    219219        if (removed != null) { // remove them 
    220220            for (String key : removed) { 
    221                 if (key != null) removePropertyNode(node, key); 
     221                if (key != null) { 
     222                    removePropertyNode(node, key); 
     223                } 
    222224            } 
    223225            // remove app. data 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-jcr-connector/src/main/java/org/nuxeo/ecm/core/repository/jcr/JCRBlob.java

    r30221 r30413  
    218218     */ 
    219219    public InputStream getStream() throws IOException { 
    220        return new JCRBlobInputStream(this); 
     220        return new JCRBlobInputStream(this); 
    221221    } 
    222222 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core-jcr-connector/src/main/java/org/nuxeo/ecm/core/repository/jcr/JCRBlobInputStream.java

    r30227 r30413  
    4040public class JCRBlobInputStream extends InputStream { 
    4141 
    42        private static Log log = LogFactory.getLog(JCRBlobInputStream.class); 
     42    private static final Log log = LogFactory.getLog(JCRBlobInputStream.class); 
    4343 
    44        private InputStream  in; 
    45        private JCRBlob blob; 
     44    private InputStream  in; 
     45    private JCRBlob blob; 
    4646 
    47        public JCRBlobInputStream(JCRBlob blob) { 
    48                this.blob = blob; 
    49                this.in = null; 
    50        
     47    public JCRBlobInputStream(JCRBlob blob) { 
     48        this.blob = blob; 
     49        in = null; 
     50   
    5151 
    52        @Override 
    53        public synchronized void reset() throws IOException { 
    54                if (in != null) { 
    55                        close(); 
    56                
    57                in = this.blob.getStream(); 
    58        
     52    @Override 
     53    public synchronized void reset() throws IOException { 
     54        if (in != null) { 
     55            close(); 
     56       
     57        in = blob.getStream(); 
     58   
    5959 
    60        @Override 
    61        public void close() throws IOException { 
    62                getIn().close(); 
    63                in = null; 
    64        
     60    @Override 
     61    public void close() throws IOException { 
     62        getIn().close(); 
     63        in = null; 
     64   
    6565 
    66        @Override 
    67        public int read(byte[] b, int off, int len) throws IOException { 
    68                return getIn().read(b, off, len); 
    69        
     66    @Override 
     67    public int read(byte[] b, int off, int len) throws IOException { 
     68        return getIn().read(b, off, len); 
     69   
    7070 
    71        @Override 
    72        public int read(byte[] b) throws IOException { 
    73                return getIn().read(b); 
    74        
     71    @Override 
     72    public int read(byte[] b) throws IOException { 
     73        return getIn().read(b); 
     74   
    7575 
    76        @Override 
    77        public int read() throws IOException { 
    78                return getIn().read(); 
    79        
     76    @Override 
     77    public int read() throws IOException { 
     78        return getIn().read(); 
     79   
    8080 
    81        @Override 
    82        public int available() throws IOException { 
    83                return getIn().available(); 
    84        
     81    @Override 
     82    public int available() throws IOException { 
     83        return getIn().available(); 
     84   
    8585 
     86    @Override 
     87    public boolean equals(Object obj) { 
     88        return getIn().equals(obj); 
     89    } 
    8690 
    87        @Override 
    88        public boolean equals(Object obj) { 
    89                return getIn().equals(obj); 
    90        
     91    @Override 
     92    public int hashCode() { 
     93        return getIn().hashCode(); 
     94   
    9195 
    92        @Override 
    93        public int hashCode() { 
    94                return getIn().hashCode(); 
    95        
     96    @Override 
     97    public synchronized void mark(int readlimit) { 
     98        getIn().mark(readlimit); 
     99   
    96100 
    97        @Override 
    98        public synchronized void mark(int readlimit)
    99                getIn().mark(readlimit); 
    100        
     101    @Override 
     102    public long skip(long n) throws IOException
     103        return getIn().skip(n); 
     104   
    101105 
    102        @Override 
    103        public long skip(long n) throws IOException
    104                return getIn().skip(n); 
    105        
     106    @Override 
     107    public boolean markSupported()
     108        return getIn().markSupported(); 
     109   
    106110 
    107        @Override 
    108        public boolean markSupported() { 
    109                return getIn().markSupported(); 
    110        
     111    @Override 
     112    public String toString() { 
     113        return getIn().toString(); 
     114   
    111115 
    112         @Override 
    113         public String toString() { 
    114                 return getIn().toString(); 
    115         } 
    116  
    117         public final InputStream getIn() { 
    118                 if (in == null) { 
    119                         try { 
    120                                 in = blob._getStream(); 
    121                         } catch (IOException e) { 
    122                                 log.error("Failed to open input stream from jcr blob", e); 
    123                         } 
    124                 } 
    125                 return in; 
    126         } 
     116    public final InputStream getIn() { 
     117        if (in == null) { 
     118            try { 
     119                in = blob._getStream(); 
     120            } catch (IOException e) { 
     121                log.error("Failed to open input stream from jcr blob", e); 
     122            } 
     123        } 
     124        return in; 
     125    } 
    127126 
    128127} 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core/src/main/java/org/nuxeo/ecm/core/api/AbstractSession.java

    r30108 r30413  
    563563            DocumentModel docModel = DocumentModelFactory.createDocumentModel( 
    564564                    sessionId, docType); 
    565             if (options==null) 
     565            if (options == null) { 
    566566                options = new HashMap<String, Object>(); 
     567            } 
    567568            // do not forward this event on the JMS Bus 
    568569            options.put("BLOCK_JMS_PRODUCING", true); 
     
    10181019            Document doc = resolveReference(docRef); 
    10191020            Document parentDoc = doc.getParent(); 
    1020             if (parentDoc == null) 
     1021            if (parentDoc == null) { 
    10211022                return null; 
     1023            } 
    10221024            if (!hasPermission(parentDoc, READ)) { 
    1023                 throw new DocumentSecurityException("Provilege READ is not granted to " + getPrincipal().getName()); 
     1025                throw new DocumentSecurityException( 
     1026                        "Privilege READ is not granted to " + getPrincipal().getName()); 
    10241027            } 
    10251028            return readModel(parentDoc, null); 
     
    22922295 
    22932296    public String getSuperParentType(DocumentModel doc) throws ClientException { 
    2294         DocumentModel SuperSpace = getSuperSpace(doc); 
    2295         if (SuperSpace == null) { 
     2297        DocumentModel superSpace = getSuperSpace(doc); 
     2298        if (superSpace == null) { 
    22962299            return null; 
    22972300        } else { 
    2298             return SuperSpace.getType(); 
     2301            return superSpace.getType(); 
    22992302        } 
    23002303    } 
     
    23182321    } 
    23192322 
    2320  
    23212323    // walk the tree up until a accessible doc is found 
    2322     private DocumentModel getDirectAccessibleParent(DocumentRef docRef) throws ClientException 
    2323    
     2324    private DocumentModel getDirectAccessibleParent(DocumentRef docRef) 
     2325            throws ClientException
    23242326        try { 
    23252327            Document doc = resolveReference(docRef); 
    23262328            Document parentDoc = doc.getParent(); 
    2327             if (parentDoc==null) 
    2328                 return readModel(doc,null); 
     2329            if (parentDoc == null) { 
     2330                return readModel(doc, null); 
     2331            } 
    23292332            if (!hasPermission(parentDoc, READ)) { 
    23302333                String parentPath = parentDoc.getPath(); 
    2331                 if ("/".equals(parentPath))
     2334                if ("/".equals(parentPath))
    23322335                    return getRootDocument(); 
    2333                 } 
    2334                 else{ 
     2336                } else { 
    23352337                    // try on parent 
    2336                     return getDirectAccessibleParent(new PathRef(parentDoc.getPath())); 
     2338                    return getDirectAccessibleParent( 
     2339                            new PathRef(parentDoc.getPath())); 
    23372340                } 
    23382341            } 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core/src/main/java/org/nuxeo/ecm/core/listener/impl/CoreEventListenerServiceImpl.java

    r30133 r30413  
    162162 
    163163    public void start() { 
    164        throw new UnsupportedOperationException("Transaction are not supported"); 
     164        throw new UnsupportedOperationException("Transaction are not supported"); 
    165165    } 
    166166 
    167167    public void end() { 
    168        throw new UnsupportedOperationException("Transaction are not supported"); 
     168        throw new UnsupportedOperationException("Transaction are not supported"); 
    169169    } 
    170170 
    171171    public void commit() { 
    172        throw new UnsupportedOperationException("Transaction are not supported"); 
     172        throw new UnsupportedOperationException("Transaction are not supported"); 
    173173    } 
    174174 
    175175    public void rollback() { 
    176        throw new UnsupportedOperationException("Transaction are not supported"); 
     176        throw new UnsupportedOperationException("Transaction are not supported"); 
    177177    } 
    178178 
  • org.nuxeo.ecm.core/branches/1.4/nuxeo-core/src/main/java/org/nuxeo/ecm/core/listener/impl/DefaultEventService.java

    r30133 r30413  
    2121import java.util.ArrayList; 
    2222import java.util.Collection; 
     23import java.util.List; 
    2324 
    2425import org.apache.commons.logging.Log; 
     
    8081 
    8182    public void start() { 
    82        eventTree.set(new EventTree()); 
     83        eventTree.set(new EventTree()); 
    8384    } 
    8485 
    8586    public boolean isTransactionStarted() { 
    86        return eventTree.get() != null; 
     87        return eventTree.get() != null; 
    8788    } 
    8889 
    8990    public void commit() { 
    90        try { 
    91                EventTree tree = eventTree.get(); 
    92                if (tree == null) { 
    93                        throw new IllegalStateException("Not in a transaction"); 
    94                
    95                CompositeEvent parent = tree.pop(); 
    96                if (parent == null) { // no more parent events - fire events 
    97                        for (CoreEvent event : tree.events) { 
    98                                fire(event); 
    99                        
    100                
    101        } finally { 
    102                end(); 
    103        
     91        try { 
     92            EventTree tree = eventTree.get(); 
     93            if (tree == null) { 
     94                throw new IllegalStateException("Not in a transaction"); 
     95           
     96            CompositeEvent parent = tree.pop(); 
     97            if (parent == null) { // no more parent events - fire events 
     98                for (CoreEvent event : tree.events) { 
     99                    fire(event); 
     100               
     101           
     102        } finally { 
     103            end(); 
     104       
    104105    } 
    105106 
    106107    public void rollback() { 
    107                EventTree tree = eventTree.get(); 
    108                if (tree == null) { 
    109                        throw new IllegalStateException("Not in a transaction"); 
    110                
    111        CompositeEvent parent = tree.pop(); 
     108        EventTree tree = eventTree.get(); 
     109        if (tree == null) { 
     110            throw new IllegalStateException("Not in a transaction"); 
     111       
     112        CompositeEvent parent = tree.pop(); 
    112113        if (parent == null) { 
    113                tree.events.clear(); 
    114                end(); 
    115        
     114            tree.events.clear(); 
     115            end(); 
     116       
    116117    } 
    117118 
    118119    public void end() { 
    119        eventTree.set(null); 
     120        eventTree.set(null); 
    120121    } 
    121122 
    122123    public void notifyEventListeners(CoreEvent coreEvent) { 
    123