Package com.dotmarketing.business

Examples of com.dotmarketing.business.DotStateException


  }

  public void createBaseFileAssetFields(Structure structure) throws DotDataException, DotStateException {
    if (structure == null || !InodeUtils.isSet(structure.getInode())) {
      throw new DotStateException("Cannot create base fileasset fields on a structure that doesn't exist");
    }
    if (structure.getStructureType() != Structure.STRUCTURE_TYPE_FILEASSET) {
      throw new DotStateException("Cannot create base fileasset fields on a structure that is not a file asset");
    }
    Field field = new Field(HOST_FOLDER_FIELD_NAME, Field.FieldType.HOST_OR_FOLDER, Field.DataType.TEXT, structure, true, false, true, 1,
        "", "", "", true, false, true);

    field.setVelocityVarName(HOST_FOLDER_FIELD);
View Full Code Here


    FieldsCache.clearCache();
  }

  public FileAsset fromContentlet(Contentlet con) throws DotStateException {
    if (con == null || con.getStructure().getStructureType() != Structure.STRUCTURE_TYPE_FILEASSET) {
      throw new DotStateException("Contentlet : " + con.getInode() + " is not a FileAsset");
    }

    FileAsset fa = new FileAsset();
    fa.setStructureInode(con.getStructureInode());
    try {
      contAPI.copyProperties((Contentlet) fa, con.getMap());
    } catch (Exception e) {
      throw new DotStateException("File Copy Failed :" + e.getMessage(), e);
    }
    fa.setHost(con.getHost());
    if(UtilMethods.isSet(con.getFolder())){
      try{
        Identifier ident = APILocator.getIdentifierAPI().find(con);
View Full Code Here

  }

  public void saveStep(WorkflowStep step) throws DotDataException, AlreadyExistException {

    if (!UtilMethods.isSet(step.getName()) || !UtilMethods.isSet(step.getSchemeId())) {
      throw new DotStateException("Step name and Scheme are required");
    }
    wfac.saveStep(step);

  }
View Full Code Here

   * is in
   */
  public List<WorkflowAction> findAvailableActions(Contentlet contentlet, User user) throws DotDataException,
  DotSecurityException {
    if(contentlet == null || contentlet.getStructure() ==null){
      throw new DotStateException("content is null");
    }
    List<WorkflowAction> actions= new ArrayList<WorkflowAction>();
    if("Host".equals(contentlet.getStructure().getVelocityVarName())){
      return actions;
    }
View Full Code Here

  public static void reload(Application app) {
    container = new ServletContainer(app);
    try {
      container.init(servletConfig);
    } catch (ServletException e) {
      throw new DotStateException(e.getMessage(), e);
    }
  }
View Full Code Here

   */
  public static String getRealPath(String relativePath){
   
    if(Config.CONTEXT ==null){
      Logger.fatal(FileUtil.class, "Config.CONTEXT not initialized with a servlet context, dying");
      throw new DotStateException("Config.CONTEXT not initialized with a servlet context, dying");
    }
    String ret = Config.CONTEXT.getRealPath(relativePath)
    if(ret !=null) return ret;
    String base = Config.CONTEXT.getRealPath("/");
    base = (base.lastIndexOf(File.separatorChar) == base.length()-1) ?  base.substring(0, base.lastIndexOf(File.separatorChar)):base;
View Full Code Here

                        File file  = (File) APILocator.getVersionableAPI().findWorkingVersion(id, APILocator.getUserAPI().getSystemUser(), false);
                        PublishFactory.publishAsset(file, user, false, isNewVersion);
                    }
                } catch ( Exception ex ) {
                    Logger.debug( this, ex.getMessage(), ex );
                    throw new DotStateException( "Problem occurred while publishing file", ex );
                }
            }
        }

        // gets all not live file children
        List<File> files = getRelatedFiles(contentlet, user, false);
        for (File file : files) {
            Logger.debug(this, "*****I'm a Contentlet -- Publishing my File Child=" + file.getInode());
            try {
                PublishFactory.publishAsset(file, user, false, isNewVersion);
            } catch (DotSecurityException e) {
                Logger.debug(this, "User has permissions to publish the content = " + contentlet.getIdentifier()
                        + " but not the related file = " + file.getIdentifier());
            } catch (Exception e) {
                throw new DotStateException("Problem occured while publishing file");
            }
        }

        // gets all not live link children
        Logger.debug(this, "IM HERE BEFORE PUBLISHING LINKS FOR A CONTENTLET!!!!!!!");
        List<Link> links = getRelatedLinks(contentlet, user, false);
        for (Link link : links) {
            Logger.debug(this, "*****I'm a Contentlet -- Publishing my Link Child=" + link.getInode());
            try {
                PublishFactory.publishAsset(link, user, false, isNewVersion);
            } catch (DotSecurityException e) {
                Logger.debug(this, "User has permissions to publish the content = " + contentlet.getIdentifier()
                        + " but not the related link = " + link.getIdentifier());
                throw new DotStateException("Problem occured while publishing link");
            } catch (Exception e) {
                throw new DotStateException("Problem occured while publishing file");
            }
        }

        // writes the contentlet object to a file
        indexAPI.addContentToIndex(contentlet);
View Full Code Here

TOP

Related Classes of com.dotmarketing.business.DotStateException

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.