Package org.apache.slide.event

Examples of org.apache.slide.event.ContentEvent$Fork


        // Invoke interceptors
        invokeInterceptors(token, revisionDescriptors, revisionDescriptor,
                           null, POST_RETRIEVE);
       
        // Fire event
        if ( ContentEvent.RETRIEVE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.RETRIEVE, new ContentEvent(this, token, namespace,  objectUri.toString(), revisionDescriptors, revisionDescriptor));

        return revisionDescriptor;
    }
View Full Code Here


        // Invoke interceptors
        invokeInterceptors(token, null, revisionDescriptor,
                           revisionContent, POST_RETRIEVE);
       
        // Fire event
        if ( ContentEvent.RETRIEVE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.RETRIEVE, new ContentEvent(this, token, namespace, objectUri.toString(), revisionDescriptor, revisionContent));

        return revisionContent;
    }
View Full Code Here

           
            // We update the descriptor
            revisionDescriptor.setRevisionNumber(newRevisionNumber);

            // Fire event
            if ( ContentEvent.CREATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.CREATE, new ContentEvent(this, token, namespace, objectUri.toString(), revisionDescriptors, revisionDescriptor, revisionContent));

            // Invoke interceptors
            invokeInterceptors(token, revisionDescriptors, revisionDescriptor,
                               revisionContent, PRE_STORE);
           
            if (revisionContent != null) {
                // Storing the new revision contents
                objectUri.getStore()
                    .createRevisionContent(objectUri, revisionDescriptor,
                                           revisionContent);
            }
            // Now creating the revision desriptor in the store
            revisionDescriptor.setModificationDate(revisionDescriptor.getCreationDate());
            revisionDescriptor.setModificationUser(
                securityHelper.getPrincipal(token).getPath().lastSegment());
            objectUri.getStore()
                .createRevisionDescriptor(objectUri, revisionDescriptor);
           
        } else {
            // We don't use versioning for this object.
            // Two options :
            // - The object already has one (and only one) revision,
            //   so we update it
            // - The object dooesn't have any revisions right now, so we create
            //   the initial revision
            newRevisionNumber = new NodeRevisionNumber();
            revisionDescriptor.setRevisionNumber(newRevisionNumber);
           
            if (!revisionDescriptors.hasRevisions()) {

                // Fire event
                if ( ContentEvent.CREATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.CREATE, new ContentEvent(this, token, namespace, objectUri.toString(), revisionDescriptors, revisionDescriptor, revisionContent));

                // Invoke interceptors
                invokeInterceptors(token, revisionDescriptors,
                                   revisionDescriptor,
                                   revisionContent, PRE_STORE);
               
                if (revisionContent != null) {
                    // Storing the new revision contents
                    objectUri.getStore()
                        .createRevisionContent(objectUri, revisionDescriptor,
                                               revisionContent);
                }
                // Now creating the revision desriptor in the store
                revisionDescriptor.setModificationDate(revisionDescriptor.getCreationDate());
                revisionDescriptor.setModificationUser(
                    securityHelper.getPrincipal(token).getPath().lastSegment());
                objectUri.getStore()
                    .createRevisionDescriptor(objectUri, revisionDescriptor);
               
            } else {
               
                try { {
                        // merge the new received properties into the
                        // revisionDescriptor
                       
                        // We update the descriptor's properties
                        NodeRevisionDescriptor oldRevisionDescriptor =
                            objectUri.getStore()
                            .retrieveRevisionDescriptor
                            (objectUri, newRevisionNumber);
                        Enumeration newPropertiesList =
                            revisionDescriptor.enumerateProperties();
                        while (newPropertiesList.hasMoreElements()) {
                            oldRevisionDescriptor
                                .setProperty((NodeProperty) newPropertiesList
                                                 .nextElement() );
                        }
                       
                        // now use the merged revision descriptor
                        revisionDescriptor = oldRevisionDescriptor;
                    } // end of merge

                    // Fire event
                    if ( ContentEvent.CREATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.CREATE, new ContentEvent(this, token, namespace, objectUri.toString(), revisionDescriptors, revisionDescriptor, revisionContent));

                    // Invoke interceptors
                    invokeInterceptors(token, revisionDescriptors,
                                       revisionDescriptor,
                                       revisionContent, PRE_STORE);
                   
                    if (revisionContent != null) {
                        // Storing the new revision contents
                        try {
                            objectUri.getStore()
                                .storeRevisionContent(objectUri,
                                                      revisionDescriptor,
                                                      revisionContent);
                        } catch (RevisionNotFoundException e) {
                            objectUri.getStore()
                                .createRevisionContent(objectUri,
                                                       revisionDescriptor,
                                                       revisionContent);
                        }
                    }
                   
                    revisionDescriptor.setModificationDate(revisionDescriptor.getCreationDate());
                    revisionDescriptor.setModificationUser(
                        securityHelper.getPrincipal(token).getPath().lastSegment());
                    objectUri.getStore()
                        .storeRevisionDescriptor
                        (objectUri, revisionDescriptor);
                   
                } catch (RevisionDescriptorNotFoundException e) {
                    // Should NEVER happen.
                    // Basically, it would mean that there is no initial
                    // revision, which is incorrect since the object
                    // HAS revisions.

                    // Fire event
                    if ( ContentEvent.CREATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.CREATE, new ContentEvent(this, token, namespace, objectUri.toString(), revisionDescriptors, revisionDescriptor, revisionContent));

                    // Invoke interceptors
                    invokeInterceptors(token, revisionDescriptors,
                                       revisionDescriptor,
                                       revisionContent, PRE_STORE);
View Full Code Here

            (branchName, branchedRevisionNumber);
        revisionDescriptors.addSuccessor
            (basedOnRevisionNumber, branchedRevisionNumber);
       
        // Fire event
        if ( ContentEvent.FORK.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.FORK, new ContentEvent(this, token, namespace, strUri, revisionDescriptors));

        // Invoke interceptors
        invokeInterceptors(token, revisionDescriptors,
                           basedOnRevisionDescriptor,
                           basedOnRevisionContent, PRE_STORE);
View Full Code Here

        revisionDescriptors.addSuccessor
            (branchLatestRevisionNumber, newRevisionNumber);
        revisionDescriptors.setLatestRevision(mainBranch, newRevisionNumber);
       
        // Fire event
        if ( ContentEvent.MERGE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.MERGE, new ContentEvent(this, token, namespace, objectUri.toString(), revisionDescriptors, newRevisionDescriptor, revisionContent));

        // Invoke interceptors
        invokeInterceptors(token, revisionDescriptors, newRevisionDescriptor,
                           revisionContent, PRE_STORE);
       
View Full Code Here

        // Retrieve the revision table
        NodeRevisionDescriptors revisionDescriptors =
            objectUri.getStore().retrieveRevisionDescriptors(objectUri);

        // Fire event
        if ( revisionDescriptor.getRevisionNumber() != NodeRevisionNumber.HIDDEN_0_0 && ContentEvent.STORE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.STORE, new ContentEvent(this, token, namespace, objectUri.toString(), revisionDescriptors, revisionDescriptor, revisionContent));

        // Invoke interceptors
        invokeInterceptors(token, revisionDescriptors, revisionDescriptor,
                           revisionContent, PRE_STORE);
       
View Full Code Here

                             namespaceConfig.getRemoveRevisionContentAction());
       
        Uri objectUri = namespace.getUri(token, revisionDescriptors.getUri());

        // Fire event
        if ( ContentEvent.REMOVE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.REMOVE, new ContentEvent(this, token, namespace, objectUri.toString(), revisionDescriptors));

        objectUri.getStore().removeRevisionDescriptors(objectUri);
       
        // Invoke interceptors
        invokeInterceptors(token, revisionDescriptors, null, null,
View Full Code Here

        NodeRevisionDescriptor revisionDescriptor =
            objectUri.getStore().retrieveRevisionDescriptor
            (objectUri, revisionNumber);

        // Fire event
        if ( revisionNumber != NodeRevisionNumber.HIDDEN_0_0 && ContentEvent.REMOVE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.REMOVE, new ContentEvent(this, token, namespace, objectUri.toString(), revisionDescriptor));

        // Invoke interceptors
        invokeInterceptors(token, null, revisionDescriptor, null, PRE_REMOVE);
       
        objectUri.getStore().removeRevisionContent
View Full Code Here

        // Initialize the branch name in the new descriptor
        newRevisionDescriptor.setBranchName
            (realOldRevisionDescriptor.getBranchName());

        // Fire event
        if ( ContentEvent.CREATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.CREATE, new ContentEvent(this, token, namespace, objectUri.toString(), revisionDescriptors, newRevisionDescriptor, revisionContent));

        // Invoke interceptors
        invokeInterceptors(token, revisionDescriptors, newRevisionDescriptor,
                           revisionContent, PRE_STORE);
       
View Full Code Here

            branchName = "version-history";
        }
        revisionDescriptor.setBranchName(branchName);

        // Fire event
        if ( revisionDescriptor.getRevisionNumber() != NodeRevisionNumber.HIDDEN_0_0 && ContentEvent.CREATE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(ContentEvent.CREATE, new ContentEvent(this, token, namespace, objectUri.toString(), revisionDescriptors, revisionDescriptor));

        // Invoke interceptors
        invokeInterceptors(token, revisionDescriptors, revisionDescriptor,
                           null, PRE_STORE);
       
View Full Code Here

TOP

Related Classes of org.apache.slide.event.ContentEvent$Fork

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.