Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
- */
- @Alias("faces")
- @RequiresFacet(FacesFacet.class)
- public class FacesPlugin implements Plugin
- {
- @Inject
- private Project project;
- @Command("project-stage")
- public void setProjectStage(@Option(name = "set") FacesProjectStage stage, PipeOut out)
- {
- ServletFacet srv = project.getFacet(ServletFacet.class);
- WebAppDescriptor config = srv.getConfig();
- if (stage == null)
- {
- ShellMessages.info(out, "Project stage is currently: " + config.getFacesProjectStage().getStage());
- }
- else
- {
- config.facesProjectStage(stage);
- srv.saveConfig(config);
- ShellMessages.success(out, "Faces PROJECT_STAGE updated to: " + stage.getStage());
- }
- }
- }
- /***********************************************************/
- ____ _____
- / ___| ___ __ _ _ __ ___ | ___|__ _ __ __ _ ___
- \___ \ / _ \/ _` | '_ ` _ \ | |_ / _ \| '__/ _` |/ _ \ \\
- ___) | __/ (_| | | | | | | | _| (_) | | | (_| | __/ //
- |____/ \___|\__,_|_| |_| |_| |_| \___/|_| \__, |\___|
- |___/
- [no-project] ~/Desktop $ cd example/
- [example] example $ faces project-stage
- ***INFO*** Project stage is currently: PRODUCTION
- [example] example $ faces project-stage --set DEVELOPMENT
- Wrote ~/Desktop/example/src/main/webapp/WEB-INF/web.xml
- ***SUCCESS*** Faces PROJECT_STAGE updated to: DEVELOPMENT
- [example] example $ cat ~/Desktop/example/src/main/webapp/WEB-INF/web.xml
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
- <display-name>example</display-name>
- <session-config>
- <session-timeout>30</session-timeout>
- </session-config>
- <welcome-file-list>
- <welcome-file>/index.html</welcome-file>
- </welcome-file-list>
- <context-param>
- <param-name>org.metawidget.faces.component.DONT_USE_PRERENDER_VIEW_EVENT</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
- <param-value>false</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.PROJECT_STAGE</param-name>
- <param-value>Development</param-value>
- </context-param>
- </web-app>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement