Package com.liferay.maven.plugins.theme

Examples of com.liferay.maven.plugins.theme.Theme


        if (Validator.isNotNull(themeId) && !themeId.equals(id)) {
          continue;
        }

        Theme targetTheme = readTheme(themeElement);

        if (portalTheme) {
          mergePortalTheme(targetTheme);
        }
        else {
          File sourceLiferayLookAndFeelXml = new File(
            workDir, "WEB-INF/liferay-look-and-feel.xml");

          Theme sourceTheme = readTheme(
            parentThemeId, sourceLiferayLookAndFeelXml);

          mergeTheme(sourceTheme, targetTheme);
        }
      }
    }
    else {
      String id = PortalUtil.getJsSafePortletId(project.getArtifactId());

      Theme targetTheme = readTheme(id, null);

      if (portalTheme) {
        mergePortalTheme(targetTheme);
      }
      else {
        File sourceLiferayLookAndFeelXml = new File(
          workDir, "WEB-INF/liferay-look-and-feel.xml");

        Theme sourceTheme = readTheme(
          parentThemeId, sourceLiferayLookAndFeelXml);

        mergeTheme(sourceTheme, targetTheme);
      }
    }
View Full Code Here


    }

    File liferayLookAndFeelXml = new File(
      appServerPortalDir, "WEB-INF/liferay-look-and-feel.xml");

    Theme sourceTheme = readTheme(parentThemeId, liferayLookAndFeelXml);

    mergeTheme(appServerPortalDir, sourceTheme, targetTheme);
    mergeTheme(webappSourceDir, targetTheme, targetTheme);
  }
View Full Code Here

  }

  protected Theme readTheme(Element themeElement) {
    String id = themeElement.attributeValue("id");

    Theme theme = new Theme(id);

    ContextReplace themeContextReplace = new ContextReplace();

    themeContextReplace.addValue("themes-path", null);

    String rootPath = GetterUtil.getString(
      themeElement.elementText("root-path"), "/");

    rootPath = themeContextReplace.replace(rootPath);

    themeContextReplace.addValue("root-path", rootPath);

    theme.setRootPath(rootPath);

    String templatesPath = GetterUtil.getString(
      themeElement.elementText("templates-path"),
      rootPath.concat("/templates"));

    templatesPath = themeContextReplace.replace(templatesPath);
    templatesPath = StringUtil.safePath(templatesPath);

    themeContextReplace.addValue("templates-path", templatesPath);

    theme.setTemplatesPath(templatesPath);

    String cssPath = GetterUtil.getString(
      themeElement.elementText("css-path"), rootPath.concat("/css"));

    cssPath = themeContextReplace.replace(cssPath);
    cssPath = StringUtil.safePath(cssPath);

    themeContextReplace.addValue("css-path", cssPath);

    theme.setCssPath(cssPath);

    String imagesPath = GetterUtil.getString(
      themeElement.elementText("images-path"),
      rootPath.concat("/images"));

    imagesPath = themeContextReplace.replace(imagesPath);
    imagesPath = StringUtil.safePath(imagesPath);

    themeContextReplace.addValue("images-path", imagesPath);

    theme.setImagesPath(imagesPath);

    String javaScriptPath = GetterUtil.getString(
      themeElement.elementText("javascript-path"),
      rootPath.concat("/js"));

    javaScriptPath = themeContextReplace.replace(javaScriptPath);
    javaScriptPath = StringUtil.safePath(javaScriptPath);

    themeContextReplace.addValue("javascript-path", javaScriptPath);

    theme.setJavaScriptPath(javaScriptPath);

    String templateExtension = GetterUtil.getString(
      themeElement.elementText("template-extension"), themeType);

    theme.setTemplateExtension(templateExtension);

    return theme;
  }
View Full Code Here

        return readTheme(themeElement);
      }
    }

    Theme theme = new Theme(themeId);

    theme.setCssPath("/css");
    theme.setImagesPath("/images");
    theme.setJavaScriptPath("/js");
    theme.setRootPath("/");
    theme.setTemplateExtension(themeType);
    theme.setTemplatesPath("/templates");

    return theme;
  }
View Full Code Here

TOP

Related Classes of com.liferay.maven.plugins.theme.Theme

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.