Package org.jahia.data.templates

Examples of org.jahia.data.templates.JahiaTemplatesPackage


            File[] dirs = templatesRoot.listFiles((FileFilter) DirectoryFileFilter.DIRECTORY);

            List<JahiaTemplatesPackage> remaining = new LinkedList<JahiaTemplatesPackage>();

            for (int i = 0; i < dirs.length; i++) {
                JahiaTemplatesPackage packageHandler = getPackage(dirs[i]);
                if (packageHandler != null) {
                    remaining.add(packageHandler);
                }
            }
View Full Code Here


                + templatePackageRegistry.getAvailablePackagesCount() + " template packages.");
    }

    public JahiaTemplatesPackage getPackage(File templateDir) {
        logger.debug("Reading the templates set under " + templateDir);
        JahiaTemplatesPackage pkg = JahiaTemplatesPackageHandler.build(templateDir);
        if (pkg != null) {
            logger.debug("Template package found: " + pkg.getName());
            if (isValidPackage(pkg)) {
                return pkg;
            }
        } else {
            logger.warn("Unable to read template package from the directory " + templateDir);
View Full Code Here

            File webInfFolder = new File(tmplRootFolder, "WEB-INF");
            if (webInfFolder.exists() && webInfFolder.list().length == 0) {
                webInfFolder.delete();
            }

            JahiaTemplatesPackage pack = JahiaTemplatesPackageHandler.build(tmplRootFolder);
            if (!pack.getInitialImports().isEmpty()) {
                initialImports.add(pack);
            }

            logger.info("Package '" + packageName + "' successfully deployed");
        }
View Full Code Here

        Properties props = new Properties();

        JahiaSite site = new JahiaSite(siteId, node.getProperty("j:title").getString(), node.getProperty("j:serverName").getString(),
                node.getName(), node.getProperty("j:description").getString(), props, node.getPath());
        Value s = node.getProperty("j:templatesSet").getValue();
        final JahiaTemplatesPackage aPackage = ServicesRegistry.getInstance().getJahiaTemplateManagerService()
                .getTemplatePackageByFileName(s.getString());
        if (aPackage != null) {
            site.setTemplatePackageName(aPackage.getName());
        }

        List<String> installedModules = new ArrayList<String>();
        Value[] modules = node.getProperty("j:installedModules").getValues();
        for (Value module : modules) {
View Full Code Here

                        if (site != null) {
                            // try template set error page considering inheritance
                            JahiaTemplateManagerService templateService = ServicesRegistry
                                    .getInstance()
                                    .getJahiaTemplateManagerService();
                            JahiaTemplatesPackage pkg = templateService
                                    .getTemplatePackage(site
                                            .getTemplatePackageName());
                            if (pkg != null) {
                                pathToCheck = pkg.getRootFolderPath()
                                        + "/errors/" + page;
                                path = getServletContext().getResource(
                                        pathToCheck) != null ? pathToCheck
                                        : null;
                                if (null == path) {
                                    pathToCheck = pkg.getRootFolderPath()
                                            + "/errors/error.jsp";
                                    path = getServletContext().getResource(
                                            pathToCheck) != null ? pathToCheck
                                            : null;
                                }
View Full Code Here

TOP

Related Classes of org.jahia.data.templates.JahiaTemplatesPackage

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.