Package org.opoo.press

Examples of org.opoo.press.SiteConfig


    throw new UnsupportedOperationException("deploy(File, Repository)");
  }
 
  @SuppressWarnings("unchecked")
  private Repository getRepository(Site site) throws MojoExecutionException, MojoFailureException{
    SiteConfig config = site.getConfig();
   
    Object server = config.get("deploy_server");
    if(server == null){
      throw new MojoFailureException("Deploy server not found in config.yml");
    }
   
    String serverId = null;
    Map<String,String> repo = null;
    if(server instanceof Map){
      repo = (Map<String, String>) server;
    }else if(server instanceof String){
      serverId = (String) server;
      repo = (Map<String, String>) config.get(serverId);
      if(repo == null){
        throw new MojoFailureException("Deploy server not found: " + server);
      }
    }else{
      throw new MojoFailureException("Deploy server not found in config.yml");
View Full Code Here


  }
 
 
  private boolean titlecase;
  public TitleCaseModel(Site site){
    SiteConfig config = site.getConfig();
    titlecase = config.get("titlecase", false);
  }
View Full Code Here

    }
   
    //Add import i18n messages template.
    configuration.addAutoImport("i18n", "i18n/messages.ftl");
   
    SiteConfig config = site.getConfig();
    List<String> autoIncludeTemplates = (List<String>) config.get("auto_include_templates");
    if(autoIncludeTemplates != null && !autoIncludeTemplates.isEmpty()){
      for(String template: autoIncludeTemplates){
        configuration.addAutoInclude(template);
        log.info("Add auto include: " + template);
      }
    }
   
    Map<String,String> autoImportTemplates = (Map<String, String>) config.get("auto_import_templates");
    if(autoImportTemplates != null && !autoImportTemplates.isEmpty()){
      for(Map.Entry<String, String> en: autoImportTemplates.entrySet()){
        configuration.addAutoImport(en.getKey(), en.getValue());
        log.info("Add auto import: " + en.getKey() + " -> " + en.getValue());
      }
View Full Code Here

  /* (non-Javadoc)
   * @see org.opoo.press.Initializable#initialize(org.opoo.press.Site)
   */
  @Override
  public void initialize(Site site) {
    SiteConfig map = site.getConfig();
    String highlighterClassName = (String) map.get("highlighter");
    if(highlighterClassName == null){
      log.warn("This converter might be need a Highlighter.");
    }else{
      highlighter = (Highlighter) ClassUtils.newInstance(highlighterClassName, site);
      config = Configuration.builder()
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  @Override
  public void initialize(Registry registry) {
    Site site = registry.getSite();
    SiteConfig config = site.getConfig();
    List<String> converterNames = (List<String>) config.get("converters");
    List<String> generatorNames = (List<String>) config.get("generators");
    List<String> siteFilters = (List<String>) config.get("siteFilters");
   
    if(converterNames != null && !converterNames.isEmpty()){
      for(String converterName: converterNames){
        Converter c = (Converter) ClassUtils.newInstance(converterName, site);
        registry.registerConverter(c);
View Full Code Here

    if(lastBuildTime <= 0L){
      log.info("No last generate time, regenerate site.");
      return true;
    }
   
    SiteConfig config = site.getConfig();
    File configFile = config.getConfigFile();
   
    //config file
    if(configFile.lastModified() > lastBuildTime){
      if(log.isInfoEnabled()){
        log.info("Config file has been changed after time '" + format(lastBuildTime) + "', regenerate site.");
View Full Code Here

TOP

Related Classes of org.opoo.press.SiteConfig

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.