Package com.dotmarketing.portlets.contentlet.model

Examples of com.dotmarketing.portlets.contentlet.model.Contentlet


        Identifier ident = APILocator.getIdentifierAPI().find(versionable);
        if(ident==null || !UtilMethods.isSet(ident.getId()) || !UtilMethods.isSet(ident.getAssetType()))
            return false;
        String liveInode;
        if(ident.getAssetType().equals("contentlet")) {
            Contentlet cont = (Contentlet)versionable;
            ContentletVersionInfo info = vfac.getContentletVersionInfo(cont.getIdentifier(), cont.getLanguageId());
            if(info ==null || !UtilMethods.isSet(info.getIdentifier()))
                throw new DotStateException("No version info. Call setWorking first "+ident.getId());
            liveInode=info.getLiveInode();
        }
        else {
View Full Code Here


    public boolean isLocked(Versionable ver) throws DotDataException, DotStateException, DotSecurityException {
        if(!UtilMethods.isSet(ver) || !InodeUtils.isSet(ver.getVersionId()))
            return false;
        Identifier ident = APILocator.getIdentifierAPI().find(ver.getVersionId());
        if(ident.getAssetType().equals("contentlet")) {
            Contentlet cont=(Contentlet)ver;
            ContentletVersionInfo info = vfac.getContentletVersionInfo(cont.getIdentifier(),cont.getLanguageId());
            if(!UtilMethods.isSet(info.getIdentifier()))
                throw new DotStateException("No version info. Call setWorking first");
            return info.isLocked();
        }
        else {
View Full Code Here

        Identifier ident = APILocator.getIdentifierAPI().find(versionable);
        if(ident==null || !UtilMethods.isSet(ident.getId()) || !UtilMethods.isSet(ident.getAssetType()))
            return false;
        String workingInode;
        if(ident.getAssetType().equals("contentlet")) {
            Contentlet cont = (Contentlet)versionable;
            ContentletVersionInfo info=vfac.getContentletVersionInfo(cont.getIdentifier(), cont.getLanguageId());
            if(info ==null || !UtilMethods.isSet(info.getIdentifier()))
                throw new DotStateException("No version info. Call setWorking first");
            workingInode=info.getWorkingInode();
        }
        else {
View Full Code Here

        if ( !UtilMethods.isSet( ver.getLiveInode() ) ) {
            throw new DotStateException( "No live version Contentlet. Call setLive first" );
        }

        Contentlet liveContentlet = APILocator.getContentletAPI().find( ver.getLiveInode(), APILocator.getUserAPI().getSystemUser(), false );
        if ( liveContentlet == null || !UtilMethods.isSet( liveContentlet.getIdentifier() ) ) {
            throw new DotStateException( "No live version Contentlet. Call setLive first" );
        }

        //Get the structure for this contentlet
        Structure structure = StructureCache.getStructureByInode( liveContentlet.getStructureInode() );

        if(contentlet.getMap().get(Contentlet.DONT_VALIDATE_ME) == null){
          if ( UtilMethods.isSet( structure.getExpireDateVar() ) ) {//Verify if the structure have a Expire Date Field set
                if ( UtilMethods.isSet( ident.getSysExpireDate() ) && ident.getSysExpireDate().after( new Date() ) ) {
                    throw new PublishStateException( "message.contentlet.unpublish.expired" );
View Full Code Here

    public void setDeleted(Versionable ver, boolean deleted) throws DotDataException, DotStateException, DotSecurityException {
        if(!UtilMethods.isSet(ver.getVersionId()))
            throw new DotStateException("invalid identifier");
        Identifier ident = APILocator.getIdentifierAPI().find(ver.getVersionId());
        if(ident.getAssetType().equals("contentlet")) {
            Contentlet cont=(Contentlet)ver;
            ContentletVersionInfo info = vfac.getContentletVersionInfo(cont.getIdentifier(),cont.getLanguageId());
            if(!UtilMethods.isSet(info.getIdentifier()))
                throw new DotStateException("No version info. Call setWorking first");
            info.setDeleted(deleted);
            vfac.saveContentletVersionInfo(info, true);
        }
View Full Code Here

        }

        Identifier ident = APILocator.getIdentifierAPI().find( versionable );
        if ( ident.getAssetType().equals( "contentlet" ) ) {

            Contentlet cont = (Contentlet) versionable;
            ContentletVersionInfo info = vfac.getContentletVersionInfo( cont.getIdentifier(), cont.getLanguageId() );
            if ( info == null || !UtilMethods.isSet( info.getIdentifier() ) ) {
                throw new DotStateException( "No version info. Call setWorking first" );
            }

            //Get the structure for this contentlet
            Structure structure = StructureCache.getStructureByInode( cont.getStructureInode() );

            if ( UtilMethods.isSet( structure.getPublishDateVar() ) ) {//Verify if the structure have a Publish Date Field set
                if ( UtilMethods.isSet( ident.getSysPublishDate() ) && ident.getSysPublishDate().after( new Date() ) ) {
                    throw new PublishStateException( "message.contentlet.publish.future.date" );
                }
View Full Code Here

    public void setLocked(Versionable ver, boolean locked, User user) throws DotDataException, DotStateException, DotSecurityException {
        if(!UtilMethods.isSet(ver.getVersionId()))
            throw new DotStateException("invalid identifier");
        Identifier ident = APILocator.getIdentifierAPI().find(ver.getVersionId());
        if(ident.getAssetType().equals("contentlet")) {
            Contentlet cont=(Contentlet)ver;
            ContentletVersionInfo info = vfac.getContentletVersionInfo(cont.getIdentifier(),cont.getLanguageId());
            if(!UtilMethods.isSet(info.getIdentifier()))
                throw new DotStateException("No version info. Call setWorking first");
            if(locked)
                info.setLocked(user.getUserId());
            else
View Full Code Here

    public void setWorking(Versionable versionable) throws DotDataException, DotStateException, DotSecurityException {
        if(!UtilMethods.isSet(versionable) || !UtilMethods.isSet(versionable.getVersionId()))
            throw new DotStateException("invalid identifier");
        Identifier ident = APILocator.getIdentifierAPI().find(versionable);
        if(ident.getAssetType().equals("contentlet")) {
            Contentlet cont = (Contentlet)versionable;
            ContentletVersionInfo info = vfac.getContentletVersionInfo(cont.getIdentifier(), cont.getLanguageId());
            if(info ==null || !UtilMethods.isSet(info.getIdentifier())) {
                // Not yet created
                info = vfac.createContentletVersionInfo(ident, cont.getLanguageId(), versionable.getInode());
            }
            else {
                info.setWorkingInode(versionable.getInode());
                vfac.saveContentletVersionInfo(info, true);
            }
View Full Code Here

        if(!UtilMethods.isSet(ver.getVersionId()))
            throw new DotStateException("invalid identifier");
        Identifier ident = APILocator.getIdentifierAPI().find(ver.getVersionId());
        String userId;
        if(ident.getAssetType().equals("contentlet")) {
            Contentlet cont=(Contentlet)ver;
            ContentletVersionInfo vinfo=vfac.getContentletVersionInfo(cont.getIdentifier(),cont.getLanguageId());
            userId=vinfo.getLockedBy();
        }
        else {
            VersionInfo vinfo=vfac.getVersionInfo(ver.getVersionId());
            userId=vinfo.getLockedBy();
View Full Code Here

        if(!UtilMethods.isSet(ver.getVersionId()))
            throw new DotStateException("invalid identifier");
        Identifier ident = APILocator.getIdentifierAPI().find(ver.getVersionId());
        Date date;
        if(ident.getAssetType().equals("contentlet")) {
            Contentlet cont=(Contentlet)ver;
            ContentletVersionInfo vinfo=vfac.getContentletVersionInfo(cont.getIdentifier(),cont.getLanguageId());
            date=vinfo.getLockedOn();
        }
        else {
            VersionInfo vinfo=vfac.getVersionInfo(ident.getId());
            date=vinfo.getLockedOn();
View Full Code Here

TOP

Related Classes of com.dotmarketing.portlets.contentlet.model.Contentlet

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.