Package org.opoo.press

Examples of org.opoo.press.Site$BuildInfo


    if(indexOfAny > -1){
      ext = name.substring(indexOfAny);
      name = name.substring(0, indexOfAny);
    }
   
    Site siteObject = siteManager.createSite(site);
    String filename = processPostFileName(siteObject, sentDate, name, ext);
    File postFile = new File(siteObject.getSource(), filename);
   
    File tempFile = prepareTempFile(content, sentDate, title);
    FileUtils.copyFile(tempFile, postFile);
    FileUtils.deleteQuietly(tempFile);
   
View Full Code Here


      throws MojoExecutionException, MojoFailureException {
    if(StringUtils.isBlank(title)){
      throw new MojoFailureException("'title' is required, use '-Dtitle=title'");
    }

    Site site = siteManager.createSite(siteDir);

    try {
      siteManager.newPost(site, title, name, isDraft, format);
    } catch (Exception e) {
      throw new MojoFailureException(e.getMessage());
View Full Code Here

      throws MojoExecutionException, MojoFailureException {
    if(StringUtils.isBlank(title)){
      throw new MojoFailureException("'title' is required, use '-Dtitle=title'");
    }
   
    Site site = siteManager.createSite(siteDir);
    try {
      siteManager.newPage(site, title, name, format);
    } catch (Exception e) {
      throw new MojoFailureException(e.getMessage());
    }
View Full Code Here

    props.put("content_replacements", entries);
    props.put("file", file.getAbsoluteFile());

    WordPressImporter importer = new WordPressImporter();
    try {
      Site site = siteManager.createSite(siteDir);
      importer.doImport(site, props);
    } catch (ImportException e) {
      throw new MojoFailureException(e.getMessage());
    }
  }
View Full Code Here

    if(siteDir == null || !siteDir.exists()){
      getLog().info("Site not installed, skipping clean.");
      return;
    }
   
    Site site = siteManager.createSite(siteDir);
    try {
      siteManager.clean(site);
    } catch (Exception e) {
      throw new MojoFailureException(e.getMessage());
    }
View Full Code Here

        props.put(name, value);
      }
    }
   
    try {
      Site site = siteManager.createSite(siteDir);
      siteManager.doImport(site, importerName, props);
    } catch (ImportException e) {
      throw new MojoFailureException(e.getMessage());
    } catch (Exception e) {
      throw new MojoFailureException(e.getMessage());
View Full Code Here

    config.put("show_drafts", showDrafts());
    config.put("debug", getLog().isDebugEnabled());
    config.put("op.generate.skip", skipGenerate);
    config.put("op.install.skip", skipInstall);
    config.put("op.sass.compile.skip", skipSassCompile);
    Site site = siteManager.createSite(siteDir, config);
   
    //System.out.println("Site extra: " + config);
    //System.out.println("Site show drafts: " + site.showDrafts());
   
    if(skipGenerate){
View Full Code Here

  private void initCategories(List<String> stringCategories) {
    if(stringCategories == null || stringCategories.isEmpty()){
      return;
    }
    Site site = getSite();
    for(String stringCategory: stringCategories){
      Category category = site.getCategory(stringCategory);
      if(category == null){
        String nicename = site.toNicename(stringCategory);
        category = new CategoryImpl(nicename, stringCategory, site);
        //add to site categories
        site.getCategories().add(category);
      }
      category.getPosts().add(this);
      this.categories.add(category);
    }
  }
View Full Code Here

 
  private void initTags(List<String> stringTags) {
    if(stringTags == null || stringTags.isEmpty()){
      return;
    }
    Site site = getSite();
    for(String stringTag: stringTags){
      Tag tag = site.getTag(stringTag);
      if(tag == null){
        String slug = site.toSlug(stringTag);
        tag = new TagImpl(slug, stringTag, site);
        //add to site tags list
        site.getTags().add(tag);
      }
      tag.getPosts().add(this);
      this.tags.add(tag);
    }
  }
View Full Code Here

   * @see org.opoo.press.Plugin#initialize(org.opoo.press.Registry)
   */
  @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()){
View Full Code Here

TOP

Related Classes of org.opoo.press.Site$BuildInfo

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.