Package de.innovationgate.webgate.api.locking

Examples of de.innovationgate.webgate.api.locking.ResourceIsLockedException


            }
        }
       
        // check lock
        if (getLockStatus() == Lock.LOCKED_BY_FOREIGN_OBJECT) {
            throw new ResourceIsLockedException("The document you try to save is locked. You should obtain the lock first by using 'document.lock()'. Saving aborted.");
        }
    }
View Full Code Here


        List docsToDropCache = new ArrayList();
        String contentType = null;
        if (document != null) {
            // check document lock
            if (document.getLockStatus() == Lock.LOCKED_BY_FOREIGN_OBJECT) {
                throw new ResourceIsLockedException("Unable to remove document. Document is locked.");
            }

            // check child locks of document for current session context
            if (getLockManager().foreignChildLocksExists(document, getSessionContext())) {
                throw new ResourceIsLockedException("Unable to remove document. Child objects of the object you want to remove are locked.");
            }

            // Collect document whose cache should be cleared when deletion was
            // successful
            if (document instanceof WGContent) {
View Full Code Here

     * @throws WGAPIException If the user may not create the document. The exception informs about the reason.
     */
    public void performContentCreationCheck(WGStructEntry entry, WGLanguage language) throws WGAPIException, ResourceIsLockedException, WGAuthorisationException, WGIllegalStateException {
        // check entry lock
        if (entry != null && entry.getLockStatus() == Lock.LOCKED_BY_FOREIGN_OBJECT) {
            throw new ResourceIsLockedException("Unable to create content. Given structentry is locked.");
        }

        if (getSessionContext().getAccessLevel() < WGDatabase.ACCESSLEVEL_AUTHOR) {
            throw new WGAuthorisationException("You are not authorized to create content in this database");
        }
View Full Code Here

            throw new WGIllegalDataException("The parent document is from a different database");
        }
       
        // check parent lock
        if (parent.getLockStatus() == Lock.LOCKED_BY_FOREIGN_OBJECT) {
            throw new ResourceIsLockedException("Unable to create structentry. Parent (structentry or area) is locked.");
        }

        if (!parent.isSaved()) {
            throw new WGIllegalStateException("Parent object of this struct entry (either struct entry or area) has not yet been saved");
        }
View Full Code Here

            throw new WGClosedSessionException();
        }

        // check db lock
        if (getLockStatus() == Lock.LOCKED_BY_FOREIGN_OBJECT) {
            throw new ResourceIsLockedException("Unable to create userprofile. Database is locked.");
        }

        if (getSessionContext().getAccessLevel() < ACCESSLEVEL_AUTHOR) {
            if (!(readerProfileCreation && getSessionContext().getAccessLevel() >= ACCESSLEVEL_READER)) {
                throw new WGAuthorisationException("User is not allowed to create user profiles in this database");
View Full Code Here

    private WGDocumentCore createDesignDocumentCore(int type, String name, String mediaKey) throws WGAPIException {

        // check db lock
        if (getLockStatus() == Lock.LOCKED_BY_FOREIGN_OBJECT) {
            throw new ResourceIsLockedException("Unable to create designobject with name '" + name + "'. Database is locked.");
        }

        if (designProvider != null && designProvider.providesType(type) && !isMetadataModule(type, name)) {
            return designProvider.createDesignDocument(type, name, mediaKey);
        }
View Full Code Here

            throw new WGAuthorisationException("The content type of the struct cannot be used at the target position");
        }

        // check lock status of entry to move
        if (entry.getLockStatus() == Lock.LOCKED_BY_FOREIGN_OBJECT) {
            throw new ResourceIsLockedException("Cannot move structentry. Given entry is locked.");
        }

        // check lock status of newParent
        if (newParent.getLockStatus() == Lock.LOCKED_BY_FOREIGN_OBJECT) {
            throw new ResourceIsLockedException("Cannot move structentry. New parentEntry is locked.");
        }
       
        // Check edit rights for all documents in moved page hierarchy
        entry.performSubtreeModificationCheck();
       
View Full Code Here

     * @throws WGAPIException If the creation for the given data would fail
     */
    public void performDesignCreationCheck(int type, String name, String mediaKey) throws WGAPIException {
       
        if (getLockStatus() == Lock.LOCKED_BY_FOREIGN_OBJECT) {
            throw new ResourceIsLockedException("Unable to create design document. Database is locked.");
        }
       
        if (!getSessionContext().isDesigner()) {
            throw new WGAuthorisationException("You are not authorized to create design documents in this database");
        }
View Full Code Here

            throw new WGClosedSessionException();
        }

        // check db lock
        if (getLockStatus() == Lock.LOCKED_BY_FOREIGN_OBJECT) {
            throw new ResourceIsLockedException("Unable to create copy of '" + original.getClass().getName() + "'. Database is locked.");
        }

        if (!original.mayEditDocument()) {
            throw new WGAuthorisationException("You are not allowed to create this kind of design document in this database");
        }
View Full Code Here

TOP

Related Classes of de.innovationgate.webgate.api.locking.ResourceIsLockedException

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.