Package org.springframework.roo.project

Examples of org.springframework.roo.project.PathResolver


    private boolean isProjectAvailable() {
        return projectOperations.isFocusedProjectAvailable();
    }

    private boolean isControllerAvailable() {
        PathResolver pathResolver = projectOperations.getPathResolver();
        return fileManager.exists(pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "WEB-INF/views"))
                && !projectOperations.isFeatureInstalledInFocusedModule(FeatureNames.JSF)
                && fileManager.exists(pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "WEB-INF" + SEPARATOR + "spring" + SEPARATOR + "webmvc-config.xml"))
            && fileManager.exists(pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "WEB-INF" + SEPARATOR + "tags"));
    }
View Full Code Here


    }

    /** {@inheritDoc} */
  public void installTwitterBootstrap() {
        // Use PathResolver to get canonical resource names for a given artifact
        PathResolver pathResolver = projectOperations.getPathResolver();

        // Install
    copyDirectoryContents("images/*.*", pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "images"), true);
    copyDirectoryContents("styles/*.*", pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "styles"), true);
    copyDirectoryContents("WEB-INF/layouts/*.*", pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "WEB-INF" + SEPARATOR + "layouts"), true);
    copyDirectoryContents("WEB-INF/views/*.*", pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "WEB-INF" + SEPARATOR + "views"), true);
    copyDirectoryContents("WEB-INF/tags/form/*.*", pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "WEB-INF" + SEPARATOR + "tags" + SEPARATOR + "form"), true);
    copyDirectoryContents("WEB-INF/tags/form/fields/*.*", pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "WEB-INF" + SEPARATOR + "tags" + SEPARATOR + "form" + SEPARATOR + "fields"), true);
    copyDirectoryContents("WEB-INF/tags/menu/*.*", pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "WEB-INF" + SEPARATOR + "tags" + SEPARATOR + "menu"), true);
    copyDirectoryContents("WEB-INF/tags/util/*.*", pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "WEB-INF" + SEPARATOR + "tags" + SEPARATOR + "util"), true);
   
    // update menu
    String menuFileLocation = pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "WEB-INF" + SEPARATOR + "views" + SEPARATOR + "menu.jspx");
    final Document menu = XmlUtils.readXml(fileManager.getInputStream(menuFileLocation));
   
    // add class attribute
        if (XmlUtils.findFirstElement("//div[@id='menu']", menu.getDocumentElement()) != null) {
            final Element span = XmlUtils.findRequiredElement("//div[@id='menu']", menu.getDocumentElement());
            span.setAttribute("class", "well");
            fileManager.createOrUpdateTextFileIfRequired(menuFileLocation, XmlUtils.nodeToString(menu), false);
        }

        // TODO update layouts.xml
    String layoutsFileLocation = pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "WEB-INF" + SEPARATOR + "layouts" + SEPARATOR + "layouts.xml");
    final Document layouts = XmlUtils.readXml(fileManager.getInputStream(layoutsFileLocation));
   
    // TODO update footer
   
    // TODO update header
View Full Code Here

TOP

Related Classes of org.springframework.roo.project.PathResolver

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.