2
Fork 0

Refactored internal api

This commit is contained in:
Willem Cazander 2012-06-04 22:49:12 +02:00
parent 3f31bb8a3a
commit 6ccd763d1f
361 changed files with 23049 additions and 4498 deletions

View file

@ -20,7 +20,7 @@
</resources>
</build>
<dependencies>
<!-- Vasc dep -->
<!-- All is on provided because we run in embedded mode without class loader isolation -->
<dependency>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-frontend-web-jsf</artifactId>
@ -28,37 +28,45 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.forwardfire.vasc.demo</groupId>
<artifactId>vasc-demo-tech-core</artifactId>
<groupId>net.forwardfire.vasc</groupId>
<artifactId>vasc-backend-metamodel</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<!-- Web tech deps -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>${javaee-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
<version>1.1.15.B1</version>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>${javax.faces.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>provided</scope>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-components-ui</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>1.2_12</version>
<scope>provided</scope>
<groupId>net.jawr</groupId>
<artifactId>jawr</artifactId>
<version>${jawr.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>1.2_12</version>
<scope>provided</scope>
<groupId>de.tudarmstadt.ukp.wikipedia</groupId>
<artifactId>de.tudarmstadt.ukp.wikipedia.api</artifactId>
<version>0.9.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-servlet</artifactId>
<version>${rewrite-servlet.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View file

@ -0,0 +1,46 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.demo.tech.web.beans;
import javax.faces.context.FacesContext;
/**
* ContextPathController removes the / from application.contextPath so root and non-root deployments work correct.
* This a workaround of bug in servlet impl or jsf impl.
*
* @author Willem Cazander
* @version 1.0 May 16, 2012
*/
//@ManagedBean(name="contextPathController",eager=true)
//@ApplicationScoped
public class ContextPathController {
public String getRootPath() {
FacesContext context = FacesContext.getCurrentInstance();
String contextPath = context.getExternalContext().getRequestContextPath();
if (contextPath.endsWith("/")==false) {
return contextPath;
}
return contextPath.substring(0,contextPath.length()-1);
}
}

View file

@ -6,8 +6,7 @@ import java.util.List;
import javax.faces.model.SelectItem;
import net.forwardfire.vasc.core.VascController;
import net.forwardfire.vasc.core.entry.VascEntryExporter;
import net.forwardfire.vasc.demo.tech.core.DemoVascControllerProvider;
import net.forwardfire.vasc.impl.jndi.JndiVascControllerProvider;
public class ExportController {
@ -17,15 +16,25 @@ public class ExportController {
private VascController vascController = null;
public ExportController() {
DemoVascControllerProvider provider = new DemoVascControllerProvider();
vascController = provider.getVascController();
try {
JndiVascControllerProvider p = new JndiVascControllerProvider();
p.setJndiName("java:comp/env/vasc/DemoVascController");
vascController = p.getVascController();
} catch (Exception e) {
e.printStackTrace();
}
}
public List<SelectItem> getEntryIdSelectItems() {
List<SelectItem> result = new ArrayList<SelectItem>();
for (String entryId:vascController.getVascEntryController().getVascEntryIds()) {
SelectItem i = new SelectItem();
i.setLabel(entryId);
String label = entryId;
while (label.length()>40) {
label = label.substring(10);
}
i.setLabel("..."+label);
i.setDescription(entryId);
i.setValue(entryId);
result.add(i);
}
@ -34,10 +43,10 @@ public class ExportController {
public List<SelectItem> getExportTypeSelectItems() {
List<SelectItem> result = new ArrayList<SelectItem>();
for (VascEntryExporter ex:vascController.getVascEntryConfigController().getVascEntryExporters()) {
for (String exportId:vascController.getVascEntryConfigController().getVascEntryExporterIds()) {
SelectItem i = new SelectItem();
i.setLabel(ex.getId());
i.setValue(ex.getId());
i.setLabel(exportId);
i.setValue(exportId);
result.add(i);
}
return result;
@ -46,7 +55,7 @@ public class ExportController {
public String getBuildExportUrl() {
StringBuilder buff = new StringBuilder();
if (exportTree) {
buff.append("export-tree/");
buff.append("export/");
buff.append(getEntryId());
buff.append('/');
buff.append(getExportType());
@ -101,6 +110,4 @@ public class ExportController {
public void setExportTree(boolean exportTree) {
this.exportTree = exportTree;
}
}

View file

@ -22,8 +22,13 @@
package net.forwardfire.vasc.demo.tech.web.beans;
import java.io.IOException;
import java.io.Serializable;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.servlet.http.HttpSession;
import net.forwardfire.vasc.demo.tech.web.models.WebUser;
/**
@ -34,39 +39,69 @@ import net.forwardfire.vasc.demo.tech.web.models.WebUser;
public class UserController implements Serializable {
private static final long serialVersionUID = 1L;
private WebUser webUser = null;
static public final String WEB_USER_SESSION_KEY = "webUser";
public void loginFilter() {
public String getWebUserName() {
WebUser user = getWebUser();
if (user!=null) {
return user.getFullName();
}
return "No-name";
}
public WebUser getWebUser() {
WebUser user = (WebUser)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(WEB_USER_SESSION_KEY);
if (user!=null) {
return user;
}
if (isUserLoggedin()==false) {
try {
FacesContext.getCurrentInstance().getExternalContext().redirect("/demo/html/auth/error.jsf");
} catch (IOException ioe) {
throw new RuntimeException("Could not redirect user to login-form.: "+ioe.getMessage(),ioe);
}
}
HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(true);
session.setMaxInactiveInterval(20*60); // 20 minutes.
// fetch user info and settings/etc/etc from db.
user = new WebUser();
user.setId(123l);
user.setFullName(FacesContext.getCurrentInstance().getExternalContext().getRemoteUser());
user.setLoginName(FacesContext.getCurrentInstance().getExternalContext().getRemoteUser());
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(WEB_USER_SESSION_KEY, user);
return user;
}
public void logoutAction(ActionEvent event) {
HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(true);
session.invalidate();
try {
//logUser = loginManager.getUser();
//logRightRoles = loginManager.getClientRoles();
webUser = new WebUser();
webUser.setLoginName( "test123");
webUser.setFullName( "test1234567890");
} catch (Exception e) {
throw new RuntimeException(e);
FacesContext.getCurrentInstance().getExternalContext().redirect("/demo/html/auth/logout.jsf");
} catch (IOException ioe) {
throw new RuntimeException("Could not redirect user to login-form.: "+ioe.getMessage(),ioe);
}
}
public void logoutFilter() {
webUser = null;
//logRightRoles = null;
public boolean hasUserPrincipal() {
return FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal()!=null;
}
public boolean hasUserRole(String role) {
return FacesContext.getCurrentInstance().getExternalContext().isUserInRole(role);
}
public boolean isUserLoggedin() {
if (webUser==null) {
return false;
}
return true;
return hasUserRole("login");
}
public WebUser getUser() {
return webUser;
public boolean isRoleUserLogin() {
return hasUserRole("login");
}
//public List<LogRightRole> getRightRoles() {
// return logRightRoles;
//}
public boolean isRoleUserAdmin() {
return hasUserRole("admin");
}
}

View file

@ -0,0 +1,137 @@
package net.forwardfire.vasc.demo.tech.web.faces;
import java.io.InputStream;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicReference;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.PreRenderViewEvent;
import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
import org.richfaces.resource.ResourceKey;
import com.sun.faces.renderkit.html_basic.ScriptRenderer;
import com.sun.faces.renderkit.html_basic.StylesheetRenderer;
/**
* <p>
* Satisfies that links for selected RichFaces won't be put to renderer view.
* </p>
*
* <p>
* Resource which should not be loaded are selected by condition in {@link #shouldNotBeLoaded(ResourceKey, String)}.
* </p>
*
* @author Lukas Fryc
*/
public class NoneLoadStyleResourceEventListener implements SystemEventListener {
private static final String STATIC_MAPPING_FILE = "META-INF/richfaces/staticResourceMapping/Static.properties";
private AtomicReference<Properties> propertiesRef = new AtomicReference<Properties>();
public void processEvent(SystemEvent event) throws AbortProcessingException {
if (event instanceof PreRenderViewEvent) {
putSelectedResourceKeysToContextMap();
}
}
public boolean isListenerForSource(Object source) {
return source instanceof UIViewRoot;
}
/**
* <p>
* Adds all keys of resources which meets {@link #shouldNotBeLoaded(ResourceKey, String)} condition to context map.
* </p>
*
* <p>
* Adding resource key to context map ensures that {@link ScriptRenderer} {@link StylesheetRenderer} won't render the link
* to page.
* </p>
*/
private void putSelectedResourceKeysToContextMap() {
FacesContext facesContext = FacesContext.getCurrentInstance();
loadStaticResourceMappingProperties();
for (Entry<Object, Object> entry : propertiesRef.get().entrySet()) {
ResourceKey resourceKey = ResourceKey.create((String) entry.getKey());
if (shouldNotBeLoaded(resourceKey)) {
putResourceKeyToContextMap(facesContext, resourceKey);
}
}
}
/**
* Loads configuration of static resource mapping which lists all RichFaces resources.
*/
private void loadStaticResourceMappingProperties() {
if (propertiesRef.get() == null) {
Properties loadedProperties = new Properties();
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(STATIC_MAPPING_FILE);
try {
loadedProperties.load(inputStream);
} catch (Exception e) {
throw new RuntimeException("Unable to load resource-mapping configuration file", e);
}
propertiesRef.compareAndSet(null, loadedProperties);
}
}
/**
* <p>
* Adds resource key to context map.
* </p>
*
* <p>
* Adding resource key to context map ensures that {@link ScriptRenderer} {@link StylesheetRenderer} won't render the link
* to page.
* </p>
*
* @param facesContext the current {@link FacesContext} instance
* @param resourceKey the key of the resource
*/
private void putResourceKeyToContextMap(FacesContext facesContext, ResourceKey resourceKey) {
Map<Object, Object> contextMap = facesContext.getAttributes();
String resourceName = resourceKey.getResourceName();
String libraryName = resourceKey.getLibraryName();
String key = resourceName + libraryName;
if (!contextMap.containsKey(key)) { // stylesheets (with this name + library) will not be rendered multiple
// times per request
contextMap.put(key, Boolean.TRUE);
}
if (libraryName == null || libraryName.isEmpty()) { // also store this in the context map with library as
// "null"
libraryName = "null";
key = resourceName + libraryName;
if (!contextMap.containsKey(key)) {
contextMap.put(key, Boolean.TRUE);
}
}
}
/**
* Returns true if given resourceKey should not be loaded for current view.
*
* @param resourceKey the key of the resource
* @return true if given resourceKey should not be loaded for current view; false otherwise
*/
private boolean shouldNotBeLoaded(ResourceKey resourceKey) {
String resourceName = resourceKey.getResourceName();
return resourceName.endsWith(".js") || resourceName.endsWith(".css") || resourceName.endsWith(".ecss");
}
}

View file

@ -0,0 +1,103 @@
package net.forwardfire.vasc.demo.tech.web.faces;
import javax.servlet.ServletContext;
import org.ocpsoft.rewrite.config.And;
import org.ocpsoft.rewrite.config.Condition;
import org.ocpsoft.rewrite.config.Configuration;
import org.ocpsoft.rewrite.config.ConfigurationBuilder;
import org.ocpsoft.rewrite.config.Direction;
import org.ocpsoft.rewrite.config.Operation;
import org.ocpsoft.rewrite.context.EvaluationContext;
import org.ocpsoft.rewrite.event.Rewrite;
import org.ocpsoft.rewrite.servlet.config.Forward;
import org.ocpsoft.rewrite.servlet.config.HttpCondition;
import org.ocpsoft.rewrite.servlet.config.HttpConfigurationProvider;
import org.ocpsoft.rewrite.servlet.config.Path;
import org.ocpsoft.rewrite.servlet.config.Redirect;
import org.ocpsoft.rewrite.servlet.config.rule.Join;
import org.ocpsoft.rewrite.servlet.http.event.HttpServletRewrite;
public class UrlRewriteConfigurationProvider extends HttpConfigurationProvider {
public Configuration getConfiguration(ServletContext context) {
HttpCondition authUser = new HttpCondition() {
@Override
public boolean evaluateHttp(HttpServletRewrite httpRewrite,EvaluationContext context) {
return httpRewrite.getRequest().getUserPrincipal()!=null;
}
};
HttpCondition authUserAdmin = new HttpCondition() {
@Override
public boolean evaluateHttp(HttpServletRewrite httpRewrite,EvaluationContext context) {
return httpRewrite.getRequest().isUserInRole("admin");
}
};
return ConfigurationBuilder.begin()
.addRule(Join.path("/yoyo").to("/html/index.jsf"))
.defineRule()
.when(Direction.isInbound().
and(Path.matches("/login")).
andNot(authUser)
).
perform(
Redirect.temporary("/html/user/index.jsf")
)
.defineRule()
.when(Direction.isInbound().
and(Path.matches("/login")).
and(authUser)
).
perform(
Forward.to("/html/user/index.jsf")
)
.defineRule()
.when(Direction.isInbound().
and(Path.matches("/home")).
andNot(authUser)
).
perform(
Forward.to("/html/index.jsf")
)
.defineRule()
.when(Direction.isInbound().
and(Path.matches("/home")).
and(authUserAdmin)
).
perform(
Forward.to("/html/admin/index.jsf")
)
.defineRule()
.when(Direction.isInbound().
and(Path.matches("/home")).
and(authUser)
).
perform(
Forward.to("/html/user/index.jsf")
)
;
/*
.addRule(Join.path("/").to("/pages/loggedOffHome.xhtml")
.when(loggedIn)
.defineRule()
.when(Direction.isInbound()
.and(Path.matches("/(signup|login)")
.andNot(loggedIn)))
.perform(Redirect.temporary(context.getContextPath() + "/"));
*/
}
public int priority() {
return 0;
}
}

View file

@ -0,0 +1,212 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.demo.tech.web.menu;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import net.forwardfire.vasc.demo.tech.web.beans.UserController;
import net.forwardfire.vasc.demo.tech.web.menu.model.VascMenu;
import net.forwardfire.vasc.demo.tech.web.menu.model.VascMenuType;
/**
* MenuController Shows the menu for the user.
*
* @author Willem Cazander
* @version 1.0 May 19, 2012
*/
public class MenuController implements Serializable {
private static final long serialVersionUID = -6820749860984575869L;
private List<VascMenu> userVascMenu = null;
private VascMenuComparator vascMenuComparator = null;
private UserController userController = null;
public List<VascMenu> fetchVascMenu() {
//if (userVascMenu!=null) {
// return userVascMenu;
//}
vascMenuComparator = new VascMenuComparator();
userVascMenu = new ArrayList<VascMenu>(50);
/*
MetaModelDataContextJndiDataSource dsFactory = new MetaModelDataContextJndiDataSource();
dsFactory.setJndiName("java:comp/env/jdbc/vascDemoDS");
DataContext ds = dsFactory.getDataContext();
Table table = ds.getDefaultSchema().getTableByName("vasc_menu");
DataSet data = ds.query().from(table).select(table.getColumns()).execute();
List<VascMenu> result = new ArrayList<VascMenu>(50);
Iterator<Row> i = data.iterator();
while (i.hasNext()) {
Row row = i.next();
}*/
Connection connection = null;
try {
DataSource ds = getDataSource("java:comp/env/jdbc/DemoManagerDataDS");
connection = ds.getConnection();
Statement s = connection.createStatement();
s.execute("SELECT * FROM VASC_MENU");
ResultSet rs = s.getResultSet();
//int cols = rs.getMetaData().getColumnCount();
while (rs.next()) {
VascMenu menu = new VascMenu();
menu.setId(rs.getInt(1));
menu.setHref(rs.getString(2));
menu.setTitle(rs.getString(3));
menu.setTarget(rs.getString(4));
menu.setActive(rs.getBoolean(5));
menu.setRoles(rs.getString(6));
menu.setMenuOrder(rs.getInt(7));
menu.setMenuType(VascMenuType.valueOf(rs.getString(8)));
if (filterVascMenuRoles(menu)==false) {
continue;
}
userVascMenu.add(menu);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (connection!=null) {
try {
connection.close();
} catch (Exception e) {
}
}
}
return userVascMenu;
}
private DataSource getDataSource(String name) throws SQLException {
try {
Context initialContext = new InitialContext();
DataSource datasource = (DataSource)initialContext.lookup(name);
if ( datasource == null ) {
throw new SQLException("Cannot lookup datasource: "+name);
}
return datasource;
} catch ( NamingException e ) {
throw new SQLException("Cannot get connection " + e,e);
}
}
private boolean filterVascMenuRoles(VascMenu menu) {
if (menu.getActive()!=null && menu.getActive()==false) {
return false;
}
if (menu.getRoles()!=null && menu.getRoles().isEmpty()==false) {
String[] roles = menu.getRoles().split(",");
for (String role:roles) {
if (role.isEmpty()) {
continue;
}
if (userController.hasUserRole(role)==false) {
return false;
}
}
}
return true;
}
private List<VascMenu> getMenuFiltered(VascMenuType type) {
if (type==null) {
throw new NullPointerException("Can't filter on null type.");
}
List<VascMenu> result = new ArrayList<VascMenu>(15);
for (VascMenu menu:fetchVascMenu()) {
if (type.equals(menu.getMenuType())) {
result.add(menu);
}
}
Collections.sort(result,vascMenuComparator);
return result;
}
public List<VascMenu> getMenuBarLeft() {
return getMenuFiltered(VascMenuType.BAR_LEFT);
}
public List<VascMenu> getMenuBarRight() {
return getMenuFiltered(VascMenuType.BAR_RIGHT);
}
public List<VascMenu> getMenuBarBottom() {
return getMenuFiltered(VascMenuType.BAR_BOTTOM);
}
public List<VascMenu> getMenuPageIndex() {
return getMenuFiltered(VascMenuType.PAGE_INDEX);
}
public List<VascMenu> getMenuPageUserLeft() {
return getMenuFiltered(VascMenuType.PAGE_USER_LEFT);
}
public List<VascMenu> getMenuPageUserRight() {
return getMenuFiltered(VascMenuType.PAGE_USER_RIGHT);
}
public List<VascMenu> getMenuPageAdmin() {
return getMenuFiltered(VascMenuType.PAGE_ADMIN);
}
public List<VascMenu> getMenu0() {
return getMenuFiltered(VascMenuType.MENU0);
}
public List<VascMenu> getMenu1() {
return getMenuFiltered(VascMenuType.MENU1);
}
public List<VascMenu> getMenu2() {
return getMenuFiltered(VascMenuType.MENU2);
}
/**
* @return the userController
*/
public UserController getUserController() {
return userController;
}
/**
* @param userController the userController to set
*/
public void setUserController(UserController userController) {
this.userController = userController;
}
}

View file

@ -0,0 +1,50 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.demo.tech.web.menu;
import java.io.Serializable;
import java.util.Comparator;
import net.forwardfire.vasc.demo.tech.web.menu.model.VascMenu;
/**
* VascMenuComparator orders the menu items.
*
* @author Willem Cazander
* @version 1.0 May 19, 2012
*/
public class VascMenuComparator implements Serializable,Comparator<VascMenu> {
private static final long serialVersionUID = 386631856823832371L;
public int compare(VascMenu m1, VascMenu m2) {
if (m1.getMenuOrder()==null) {
return 1;
}
if (m2.getMenuOrder()==null) {
return -1;
}
return m1.getMenuOrder().compareTo(m2.getMenuOrder());
}
}

View file

@ -0,0 +1,153 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.demo.tech.web.menu.model;
/**
* VascMenu stores menu item information.
*
* @author Willem Cazander
* @version 1.0 May 19, 2012
*/
public class VascMenu {
private Integer id = null;
private String href = null;
private String title = null;
private String target = null;
private Boolean active = null;
private String roles = null;
private Integer menuOrder = null;
private VascMenuType menuType = null;
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the href
*/
public String getHref() {
return href;
}
/**
* @param href the href to set
*/
public void setHref(String href) {
this.href = href;
}
/**
* @return the title
*/
public String getTitle() {
return title;
}
/**
* @param title the title to set
*/
public void setTitle(String title) {
this.title = title;
}
/**
* @return the target
*/
public String getTarget() {
return target;
}
/**
* @param target the target to set
*/
public void setTarget(String target) {
this.target = target;
}
/**
* @return the active
*/
public Boolean getActive() {
return active;
}
/**
* @param active the active to set
*/
public void setActive(Boolean active) {
this.active = active;
}
/**
* @return the roles
*/
public String getRoles() {
return roles;
}
/**
* @param roles the roles to set
*/
public void setRoles(String roles) {
this.roles = roles;
}
/**
* @return the menuOrder
*/
public Integer getMenuOrder() {
return menuOrder;
}
/**
* @param menuOrder the menuOrder to set
*/
public void setMenuOrder(Integer menuOrder) {
this.menuOrder = menuOrder;
}
/**
* @return the menuType
*/
public VascMenuType getMenuType() {
return menuType;
}
/**
* @param menuType the menuType to set
*/
public void setMenuType(VascMenuType menuType) {
this.menuType = menuType;
}
}

View file

@ -0,0 +1,46 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.demo.tech.web.menu.model;
/**
* VascMenuType defines all menu lists on page.
*
* @author Willem Cazander
* @version 1.0 May 26, 2012
*/
public enum VascMenuType {
BAR_LEFT,
BAR_RIGHT,
BAR_BOTTOM,
MENU0,
MENU1,
MENU2,
PAGE_INDEX,
PAGE_USER_LEFT,
PAGE_USER_RIGHT,
PAGE_ADMIN,
PAGE_HELP
}

View file

@ -1,16 +1,24 @@
package net.forwardfire.vasc.demo.tech.web.models;
import java.util.ArrayList;
import java.util.List;
public class WebUser {
private Long id = null;
private String loginName = null;
private String fullName = null;
private List<String> groups = null;
public WebUser() {
groups = new ArrayList<String>(20);
/**
* @return the id
*/
public Long getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Long id) {
this.id = id;
}
/**
@ -40,11 +48,4 @@ public class WebUser {
public void setFullName(String fullName) {
this.fullName = fullName;
}
/**
* @return the groups
*/
public List<String> getGroups() {
return groups;
}
}

View file

@ -0,0 +1,167 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.demo.tech.web.pages;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import net.forwardfire.vasc.demo.tech.web.beans.UserController;
import net.forwardfire.vasc.demo.tech.web.menu.VascMenuComparator;
/**
* MenuController Shows the menu for the user.
*
* @author Willem Cazander
* @version 1.0 May 19, 2012
*/
public class VascPageController implements Serializable {
private static final long serialVersionUID = -6820749860984575869L;
//private List<VascMenu> userVascMenu = null;
//private VascMenuComparator vascMenuComparator = null;
private UserController userController = null;
/*
public List<VascMenu> fetchVascPage() {
vascMenuComparator = new VascMenuComparator();
userVascMenu = new ArrayList<VascMenu>(50);
Connection connection = null;
try {
DataSource ds = getDataSource("java:comp/env/jdbc/DemoManagerDataDS");
connection = ds.getConnection();
Statement s = connection.createStatement();
s.execute("SELECT * FROM VASC_MENU");
ResultSet rs = s.getResultSet();
//int cols = rs.getMetaData().getColumnCount();
while (rs.next()) {
VascMenu menu = new VascMenu();
menu.setId(rs.getInt(1));
menu.setHref(rs.getString(2));
menu.setTitle(rs.getString(3));
menu.setTarget(rs.getString(4));
menu.setActive(rs.getBoolean(5));
menu.setRoles(rs.getString(6));
menu.setMenuOrder(rs.getInt(7));
menu.setMenuType(VascMenuType.valueOf(rs.getString(8)));
if (filterVascMenuRoles(menu)==false) {
continue;
}
userVascMenu.add(menu);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (connection!=null) {
try {
connection.close();
} catch (Exception e) {
}
}
}
return userVascMenu;
}
private DataSource getDataSource(String name) throws SQLException {
try {
Context initialContext = new InitialContext();
DataSource datasource = (DataSource)initialContext.lookup(name);
if ( datasource == null ) {
throw new SQLException("Cannot lookup datasource: "+name);
}
return datasource;
} catch ( NamingException e ) {
throw new SQLException("Cannot get connection " + e,e);
}
}
private boolean filterVascMenuRoles(VascMenu menu) {
if (menu.getActive()!=null && menu.getActive()==false) {
return false;
}
if (menu.getRoles()!=null && menu.getRoles().isEmpty()==false) {
String[] roles = menu.getRoles().split(",");
for (String role:roles) {
if (role.isEmpty()) {
continue;
}
if (userController.hasUserRole(role)==false) {
return false;
}
}
}
return true;
}
private List<VascMenu> getMenuFiltered(VascMenuType type) {
if (type==null) {
throw new NullPointerException("Can't filter on null type.");
}
List<VascMenu> result = new ArrayList<VascMenu>(15);
for (VascMenu menu:fetchVascMenu()) {
if (type.equals(menu.getMenuType())) {
result.add(menu);
}
}
Collections.sort(result,vascMenuComparator);
return result;
}
public List<VascMenu> getMenuBarLeft() {
return getMenuFiltered(VascMenuType.BAR_LEFT);
}
public List<VascMenu> getMenuBarRight() {
return getMenuFiltered(VascMenuType.BAR_RIGHT);
}
*/
/**
* @return the userController
*/
public UserController getUserController() {
return userController;
}
/**
* @param userController the userController to set
*/
public void setUserController(UserController userController) {
this.userController = userController;
}
}

View file

@ -0,0 +1,139 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.demo.tech.web.pages.model;
/**
* VascPage stores dynamic page information.
*
* @author Willem Cazander
* @version 1.0 May 31, 2012
*/
public class VascPage {
private Integer id = null;
private String slug = null;
private String title = null;
private Boolean i18nKey = null;
private Boolean active = null;
private Boolean sitemap = null;
private String roles = null;
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the slug
*/
public String getSlug() {
return slug;
}
/**
* @param slug the slug to set
*/
public void setSlug(String slug) {
this.slug = slug;
}
/**
* @return the title
*/
public String getTitle() {
return title;
}
/**
* @param title the title to set
*/
public void setTitle(String title) {
this.title = title;
}
/**
* @return the i18nKey
*/
public Boolean getI18nKey() {
return i18nKey;
}
/**
* @param i18nKey the i18nKey to set
*/
public void setI18nKey(Boolean i18nKey) {
this.i18nKey = i18nKey;
}
/**
* @return the active
*/
public Boolean getActive() {
return active;
}
/**
* @param active the active to set
*/
public void setActive(Boolean active) {
this.active = active;
}
/**
* @return the sitemap
*/
public Boolean getSitemap() {
return sitemap;
}
/**
* @param sitemap the sitemap to set
*/
public void setSiteMap(Boolean sitemap) {
this.sitemap = sitemap;
}
/**
* @return the roles
*/
public String getRoles() {
return roles;
}
/**
* @param roles the roles to set
*/
public void setRoles(String roles) {
this.roles = roles;
}
}

View file

@ -0,0 +1,185 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.demo.tech.web.pages.model;
/**
* VascPage stores dynamic page part data.
*
* @author Willem Cazander
* @version 1.0 May 31, 2012
*/
public class VascPagePart {
private Integer id = null;
private VascPage vascPage = null;
private String title = null;
private String text = null;
private Boolean i18nKey = null;
private Boolean active = null;
private Boolean sitemap = null;
private Integer partOrder = null;
private VascPagePartType partType = null;
private String roles = null;
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the vascPage
*/
public VascPage getVascPage() {
return vascPage;
}
/**
* @param vascPage the vascPage to set
*/
public void setVascPage(VascPage vascPage) {
this.vascPage = vascPage;
}
/**
* @return the title
*/
public String getTitle() {
return title;
}
/**
* @param title the title to set
*/
public void setTitle(String title) {
this.title = title;
}
/**
* @return the text
*/
public String getText() {
return text;
}
/**
* @param text the text to set
*/
public void setText(String text) {
this.text = text;
}
/**
* @return the i18nKey
*/
public Boolean getI18nKey() {
return i18nKey;
}
/**
* @param i18nKey the i18nKey to set
*/
public void setI18nKey(Boolean i18nKey) {
this.i18nKey = i18nKey;
}
/**
* @return the active
*/
public Boolean getActive() {
return active;
}
/**
* @param active the active to set
*/
public void setActive(Boolean active) {
this.active = active;
}
/**
* @return the sitemap
*/
public Boolean getSitemap() {
return sitemap;
}
/**
* @param sitemap the sitemap to set
*/
public void setSitemap(Boolean sitemap) {
this.sitemap = sitemap;
}
/**
* @return the partOrder
*/
public Integer getPartOrder() {
return partOrder;
}
/**
* @param partOrder the partOrder to set
*/
public void setPartOrder(Integer partOrder) {
this.partOrder = partOrder;
}
/**
* @return the partType
*/
public VascPagePartType getPartType() {
return partType;
}
/**
* @param partType the partType to set
*/
public void setPartType(VascPagePartType partType) {
this.partType = partType;
}
/**
* @return the roles
*/
public String getRoles() {
return roles;
}
/**
* @param roles the roles to set
*/
public void setRoles(String roles) {
this.roles = roles;
}
}

View file

@ -0,0 +1,36 @@
/*
* Copyright 2009-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.demo.tech.web.pages.model;
/**
* VascPagePartType defines value type of text.
*
* @author Willem Cazander
* @version 1.0 May 31, 2012
*/
public enum VascPagePartType {
HTML,
PRE,
WIKI
}

View file

@ -0,0 +1,34 @@
package net.forwardfire.vasc.demo.tech.web.servlets;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(name="testServlet",value={"/test"})
public class TestServlet extends HttpServlet {
private static final long serialVersionUID = -7624183395089913214L;
/**
* Prints test
* @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse response) throws ServletException, IOException {
try {
StringBuffer buf = new StringBuffer();
buf.append("test");
PrintWriter out = response.getWriter();
out.append(buf.toString());
out.flush();
} catch (Exception e) {
e.printStackTrace();
}
}
}

View file

@ -0,0 +1,87 @@
#
# Vasc Tech Demo Jawr config file.
#
# Takes care of our js and css of this web site.
#
# Common jawr properties
jawr.gzip.on=true
jawr.gzip.ie6.on=false
jawr.charset.name=UTF-8
jawr.debug.overrideKey=jawr_debug
jawr.config.reload.refreshKey=jawr_refresh
# Development mode flags
jawr.debug.on=true
jawr.config.reload.interval=3
#
# Define common js properties
#
jawr.js.bundle.basedir=/js
#jawr.js.bundle.factory.bundlepostprocessors=YUI,license
# Define js bundle mappings
jawr.js.bundle.names=map_default,map_vasc,map_wiki,map_skin
jawr.js.bundle.map_default.id=/jawr/default.js
jawr.js.bundle.map_default.composite=true
jawr.js.bundle.map_default.child.names=richfaces
jawr.js.bundle.map_vasc.id=/jawr/vasc.js
jawr.js.bundle.map_vasc.composite=true
jawr.js.bundle.map_vasc.child.names=richfaces,vasc
jawr.js.bundle.map_wiki.id=/jawr/wiki.js
jawr.js.bundle.map_wiki.composite=true
jawr.js.bundle.map_wiki.child.names=richfaces,richfaces-ckeditor
jawr.js.bundle.map_skin.id=/jawr/skin.js
jawr.js.bundle.map_skin.composite=true
jawr.js.bundle.map_skin.child.names=richfaces,skin-switcher
# Define js bundle resources
jawr.js.bundle.skin-switcher.mappings=skinSwitcher:switcher.js
jawr.js.bundle.vasc.mappings=/js/vasc-jsf.js
jawr.js.bundle.richfaces.mappings=\
jar:/META-INF/resources/jquery.js,\
jar:/META-INF/resources/jquery.focus.js,\
jar:/META-INF/resources/jquery.position.js,\
jar:/META-INF/resources/richfaces.js,\
jar:/META-INF/resources/richfaces-base-component.js,\
jar:/META-INF/resources/richfaces-utils.js,\
jar:/META-INF/resources/richfaces-queue.js,\
jar:/META-INF/resources/richfaces-event.js,\
jar:/META-INF/resources/richfaces-selection.js,\
jar:/META-INF/resources/richfaces-jsf-event.js,\
jar:/META-INF/resources/richfaces-jsf-log.js
jawr.js.bundle.richfaces-atmosphere.mappings=\
jar:/META-INF/resources/net.java.dev.atmosphere/jquery-atmosphere.js
jawr.js.bundle.richfaces-ckeditor.mappings=\
jar:/META-INF/resources/org.richfaces.ckeditor/ckeditor.js
#
# Define common css properties
#
jawr.css.bundle.basedir=/css
jawr.csslinks.flavor=xhtml_ext
jawr.css.skin.default.root.dirs=/css/skins/default
# Define css bundle mappings
jawr.css.bundle.names=map_default
jawr.css.bundle.map_default.id=/jawr/default.css
jawr.css.bundle.map_default.composite=true
jawr.css.bundle.map_default.child.names=html,skin
# Define css bundles resources
jawr.css.bundle.html.mappings=/css/html.css
jawr.css.bundle.skin.mappings=\
skin:/css/skins/default/layout.css,\
skin:/css/skins/default/style.css,\
skin:/css/skins/default/richfaces.css,\
skin:/css/skins/default/vasc-jsf.css,\
skin:/css/skins/default/theme.css

View file

@ -0,0 +1 @@
net.forwardfire.vasc.demo.tech.web.faces.UrlRewriteConfigurationProvider

View file

@ -0,0 +1,65 @@
<?xml version="1.0"?>
<faces-config version="2.0" metadata-complete="false"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
>
<application>
<resource-bundle>
<base-name>net.forwardfire.vasc.lib.i18n.bundle.RootApplicationBundle</base-name>
<var>i18n</var>
</resource-bundle>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
<system-event-listener>
<system-event-listener-class>net.forwardfire.vasc.demo.tech.web.faces.NoneLoadStyleResourceEventListener</system-event-listener-class>
<system-event-class>javax.faces.event.PreRenderViewEvent</system-event-class>
</system-event-listener>
</application>
<managed-bean>
<description>Fixes the context path for root vs non-root deployments.</description>
<managed-bean-name>contextPathController</managed-bean-name>
<managed-bean-class>net.forwardfire.vasc.demo.tech.web.beans.ContextPathController</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
<managed-bean>
<description>Controls the Users</description>
<managed-bean-name>userController</managed-bean-name>
<managed-bean-class>net.forwardfire.vasc.demo.tech.web.beans.UserController</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
<managed-bean>
<description>Controls the display of the dynamic menus.</description>
<managed-bean-name>menuController</managed-bean-name>
<managed-bean-class>net.forwardfire.vasc.demo.tech.web.menu.MenuController</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>userController</property-name>
<value>#{userController}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>Controls Vasc Export Url Generator</description>
<managed-bean-name>exportController</managed-bean-name>
<managed-bean-class>net.forwardfire.vasc.demo.tech.web.beans.ExportController</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<!-- This should be in jawr jar file faces so it gets automatic done. -->
<component>
<component-type>jawr.JavascriptBundle</component-type>
<component-class>net.jawr.web.taglib.jsf.JavascriptBundleTag</component-class>
</component>
<component>
<component-type>jawr.CSSBundle</component-type>
<component-class>net.jawr.web.taglib.jsf.CSSBundleTag</component-class>
</component>
</faces-config>

View file

@ -0,0 +1,18 @@
<ui:composition template="/WEB-INF/template/page-no-js.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<ui:define name="page_title">
<ui:insert name="error_title"/>
</ui:define>
<ui:define name="page_content">
<ui:insert name="error_title">
<rich:panel style="width: 315px">
<ui:insert name="error_text"/>
</rich:panel>
</ui:insert>
</ui:define>
</ui:composition>

View file

@ -0,0 +1,3 @@
<ui:composition template="/WEB-INF/template/structure/main.xhtml" xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:define name="main_head_js"/>
</ui:composition>

View file

@ -0,0 +1,7 @@
<ui:composition template="/WEB-INF/template/structure/main.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
>
</ui:composition>

View file

@ -0,0 +1,7 @@
<ui:composition template="/WEB-INF/template/structure/main.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
>
</ui:composition>

View file

@ -0,0 +1,307 @@
<ui:composition template="/WEB-INF/template/structure/main.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:jawr="https://jawr.dev.java.net/jsf/facelets"
xmlns:v="http://vasc.forwardfire.net/vasc.tld"
>
<ui:define name="page_title">
<h:outputText value="#{i18n[requestScopeVascEntry.name]}" />
</ui:define>
<ui:define name="main_head_js">
<jawr:script src="/jawr/vasc.js" />
</ui:define>
<ui:define name="page_content">
<v:vascEntry entrySupportVar="entrySupport"
tableRecordVar="tableRecord"
injectEditFieldsId="injectEditFieldsId"
injectTableOptionsId="itoi"
injectTableColumnsId="itci"
disableLinkColumns="true"
>
<f:facet name="deleteView" >
<h:panelGroup>
<!-- <h1><h:outputText value="#{entrySupport.i18nMap[entrySupport.vascEntry.name]}"/></h1> -->
<p>
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.deleteDescription]}" escape="false">
<f:param value="#{entrySupport.selectedDisplayName}" />
</h:outputFormat>
</p>
<h:form>
<h:commandButton actionListener="#{entrySupport.deleteAction}" value="#{entrySupport.i18nMap['vasc.action.deleteRowAction.name']}"/>
<h:commandButton actionListener="#{entrySupport.cancelAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.cancel']}" />
</h:form>
</h:panelGroup>
</f:facet>
<f:facet name="exportView" >
<h:panelGroup>
<!-- <h1><h:outputText value="#{entrySupport.i18nMap[entrySupport.vascEntry.name]}"/></h1> -->
<p>
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.exportDescription]}" escape="false">
<f:param value="#{entrySupport.vascEntry.name}" />
</h:outputFormat>
</p>
<h:form>
<h:commandButton actionListener="#{entrySupport.cancelAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.cancel']}" />
</h:form>
</h:panelGroup>
</f:facet>
<f:facet name="editView" >
<h:panelGroup>
<!-- <h1><h:outputText value="#{entrySupport.i18nMap[entrySupport.vascEntry.name]}"/></h1> -->
<p>
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.editDescription]}" escape="false" rendered="#{!entrySupport.vascEntry.vascFrontendController.vascEntryState.editCreate}">
<f:param value="#{entrySupport.vascEntry.name}" />
</h:outputFormat>
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.createDescription]}" escape="false" rendered="#{entrySupport.vascEntry.vascFrontendController.vascEntryState.editCreate}">
<f:param value="#{entrySupport.vascEntry.name}" />
</h:outputFormat>
</p>
<h:form>
<ul class="actionboxtab">
<li><a class="active"><h:outputText value="#{entrySupport.i18nMap['vasc.action.editRowAction.name']}"/></a></li>
<ui:repeat var="link" value="#{entrySupport.vascLinkEntriesEditTab}" rendered="#{!entrySupport.vascEntry.vascFrontendController.vascEntryState.editCreate}">
<li><h:commandLink actionListener="#{entrySupport.linkEditAction}" value="#{entrySupport.i18nMap[link.name]}" type="#{link.id}"/></li>
</ui:repeat>
</ul>
<h:panelGrid columns="1" styleClass="actionbox">
<h:outputText value="&amp;nbsp;&amp;nbsp;" escape="false"/>
</h:panelGrid>
</h:form>
<br/>
<h:form>
<h:panelGrid columns="3" id="injectEditFieldsId" styleClass="actionbox"/>
<p>
<h:commandButton actionListener="#{entrySupport.saveAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.save']}"/>
<h:commandButton actionListener="#{entrySupport.cancelAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.cancel']}" />
</p>
</h:form>
</h:panelGroup>
</f:facet>
<f:facet name="listView" >
<h:panelGroup>
<!-- <h1><h:outputText value="#{entrySupport.i18nMap[entrySupport.vascEntry.name]}"/></h1> -->
<p>
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.listDescription]}" escape="false">
<f:param value="#{entrySupport.vascEntry.name}" />
</h:outputFormat>
</p>
<h:form>
<p><!-- rendered="{entrySupport.vascEntry.vascAdminCreate}" -->
<h:commandButton actionListener="#{entrySupport.addAction}"
value="#{entrySupport.i18nMap['vasc.action.addRowAction.name']}"
title="#{entrySupport.i18nMap['vasc.action.addRowAction.description']}"
/>
<h:commandButton actionListener="#{entrySupport.backAction}"
rendered="#{entrySupport.renderBackAction}"
value="#{entrySupport.i18nMap['generic.vasc.jsf.action.back']}"
/>
</p>
</h:form>
<h:form>
<rich:dataTable id="itci" var="tableRecord" value="#{entrySupport.tableDataModel}" rowClasses="odd,even">
<f:facet name="header">
<rich:columnGroup>
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left">
<ul class="actionboxtab">
<li>
<h:panelGroup rendered="#{!entrySupport.renderBackAction}">
<a class="active"><h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.listOption.header']}"/></a>
</h:panelGroup>
<h:commandLink actionListener="#{entrySupport.backEditAction}" value="#{entrySupport.i18nMap['vasc.action.editRowAction.name']}" rendered="#{entrySupport.renderBackEditAction}"/>
</li>
<ui:repeat var="link" value="#{entrySupport.vascLinkEntriesEditTabParentState}">
<li><h:commandLink actionListener="#{entrySupport.linkListAction}" value="#{entrySupport.i18nMap[link.name]}" type="#{link.id}" styleClass="#{link.vascEntryId==entrySupport.vascEntry.id?'active':''}"/></li>
</ui:repeat>
</ul>
<h:panelGrid columns="1" styleClass="actionbox">
<h:panelGrid columns="2" id="itoi"/>
<h:panelGroup>
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.listOption.search']}"/>
<h:inputText value="#{entrySupport.searchString}"/>
<h:commandButton actionListener="#{entrySupport.searchAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.listOption.sumbit']}"/>
</h:panelGroup>
</h:panelGrid>
</rich:column>
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left" breakRowBefore="true">
<ul class="paging">
<li class="paging_atstart">
<h:commandLink rendered="#{entrySupport.hasPagePreviousAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.previous']}"
actionListener="#{entrySupport.pagePreviousAction}"/>
<h:outputText rendered="#{!entrySupport.hasPagePreviousAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.previous']}" />
</li>
<ui:repeat var="page" value="#{entrySupport.tablePagesDataModel}" rendered="#{!entrySupport.hasExtendedPageMode}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
<h:panelGroup rendered="#{entrySupport.hasExtendedPageMode}">
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedBegin}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
<h:panelGroup rendered="#{entrySupport.hasExtendedPageModeCenter}">
<li><span class="text">...</span></li>
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedCenter}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
</h:panelGroup>
<li><span class="text">...</span></li>
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedEnd}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
</h:panelGroup>
<li class="paging_atend">
<h:commandLink rendered="#{entrySupport.hasPageNextAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.next']}"
actionListener="#{entrySupport.pageNextAction}"/>
<h:outputText rendered="#{!entrySupport.hasPageNextAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.next']}" />
</li>
</ul>
</rich:column>
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left" breakRowBefore="true">
<h:panelGroup styleClass="table_options_top">
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.rows']}" />
<h:inputText required="false" value="#{entrySupport.vascEntry.vascFrontendController.vascEntryState.vascBackendState.pageSize}" size="4"/>
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.pagerDirect']}" />
<h:selectOneMenu onchange="javascript:this.form.submit(); return false;" value="#{entrySupport.selectedDirectPage}" valueChangeListener="#{entrySupport.processDirectPageChange}">
<f:selectItems value="#{entrySupport.directPageItems}" />
</h:selectOneMenu>
<img src="#{facesContext.externalContext.requestContextPath}/img/icon_download.png" alt="#{entrySupport.i18nMap['generic.vasc.jsf.table.download.img']}" width="15" height="15" /><h:outputText value="&amp;nbsp;&amp;nbsp;" escape="false"/>
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.downloadDirect']}" />
<h:selectOneMenu onchange="javascript:this.form.submit(); return false;" value="#{entrySupport.selectedExporterAction}" valueChangeListener="#{entrySupport.processDirectDownloadChange}">
<f:selectItems value="#{entrySupport.globalExportItems}" />
</h:selectOneMenu>
<img src="#{facesContext.externalContext.requestContextPath}/img/icon_print.png" alt="#{entrySupport.i18nMap['generic.vasc.jsf.table.printer.img']}" width="15" height="15" /><h:outputText value="&amp;nbsp;&amp;nbsp;" escape="false"/>
<h:outputFormat value="#{entrySupport.i18nMap['generic.vasc.jsf.table.resultText']}">
<f:param value="#{entrySupport.pageStartCount}" />
<f:param value="#{entrySupport.pageStopCount}" />
<f:param value="#{entrySupport.pageTotalRecordCount}" />
</h:outputFormat>
</h:panelGroup>
</rich:column>
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left" breakRowBefore="true" rendered="#{entrySupport.hasMultiRowActions}">
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.multiAction.selectAll']}"/>
<h:selectBooleanCheckbox id="selectAllBox" required="false" onchange="javascript:selectAllCheckboxes(this);return false;" value="#{entrySupport.selectAllValue}"/>
<h:outputText value="&amp;nbsp;&amp;nbsp;" escape="false"/>
<h:selectOneMenu id="multiAction" required="false" value="#{entrySupport.selectedMultiRowAction}" onchange="javascript:this.form.submit(); return false;" valueChangeListener="#{entrySupport.processMultiRowActionChange}">
<f:selectItems value="#{entrySupport.multiRowActionItems}" />
</h:selectOneMenu>
</rich:column>
<rich:column colspan="#{entrySupport.totalFieldColumnCount}" breakRowBefore="true">
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.tableHeader.fields']}" styleClass="table_sub_header"/>
</rich:column>
<rich:column colspan="#{entrySupport.totalLinkColumnCount}" rendered="#{entrySupport.totalLinkColumnCount != 0}">
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.tableHeader.links']}" styleClass="table_sub_header"/>
</rich:column>
<rich:column colspan="#{entrySupport.totalActionColumnCount}" rendered="#{entrySupport.totalActionColumnCount != 0}">
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.tableHeader.actions']}" styleClass="table_sub_header"/>
</rich:column>
</rich:columnGroup>
</f:facet>
<f:facet name="footer">
<rich:columnGroup>
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left">
<h:panelGroup styleClass="table_options_bottom">
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.rows']}" />
<h:inputText required="false" value="#{entrySupport.vascEntry.vascFrontendController.vascEntryState.vascBackendState.pageSize}" size="4"/>
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.pagerDirect']}" />
<h:selectOneMenu onchange="javascript:this.form.submit(); return false;" value="#{entrySupport.selectedDirectPage}" valueChangeListener="#{entrySupport.processDirectPageChange}">
<f:selectItems value="#{entrySupport.directPageItems}" />
</h:selectOneMenu>
<img src="#{facesContext.externalContext.requestContextPath}/img/icon_download.png" alt="#{entrySupport.i18nMap['generic.vasc.jsf.table.download.img']}" width="15" height="15" /><h:outputText value="&amp;nbsp;&amp;nbsp;" escape="false"/>
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.downloadDirect']}" />
<h:selectOneMenu onchange="javascript:this.form.submit(); return false;" value="#{entrySupport.selectedExporterAction}" valueChangeListener="#{entrySupport.processDirectDownloadChange}">
<f:selectItems value="#{entrySupport.globalExportItems}" />
</h:selectOneMenu>
<img src="#{facesContext.externalContext.requestContextPath}/img/icon_print.png" alt="#{entrySupport.i18nMap['generic.vasc.jsf.table.printer.img']}" width="15" height="15" /><h:outputText value="&amp;nbsp;&amp;nbsp;" escape="false"/>
<h:outputFormat value="#{entrySupport.i18nMap['generic.vasc.jsf.table.resultText']}">
<f:param value="#{entrySupport.pageStartCount}" />
<f:param value="#{entrySupport.pageStopCount}" />
<f:param value="#{entrySupport.pageTotalRecordCount}" />
</h:outputFormat>
</h:panelGroup>
</rich:column>
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left" breakRowBefore="true">
<ul class="paging">
<li class="paging_atstart">
<h:commandLink rendered="#{entrySupport.hasPagePreviousAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.previous']}"
actionListener="#{entrySupport.pagePreviousAction}"/>
<h:outputText rendered="#{!entrySupport.hasPagePreviousAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.previous']}" />
</li>
<ui:repeat var="page" value="#{entrySupport.tablePagesDataModel}" rendered="#{!entrySupport.hasExtendedPageMode}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
<h:panelGroup rendered="#{entrySupport.hasExtendedPageMode}">
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedBegin}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
<h:panelGroup rendered="#{entrySupport.hasExtendedPageModeCenter}">
<li><span class="text">...</span></li>
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedCenter}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
</h:panelGroup>
<li><span class="text">...</span></li>
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedEnd}">
<li>
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
</li>
</ui:repeat>
</h:panelGroup>
<li class="paging_atend">
<h:commandLink rendered="#{entrySupport.hasPageNextAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.next']}"
actionListener="#{entrySupport.pageNextAction}"/>
<h:outputText rendered="#{!entrySupport.hasPageNextAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.next']}" />
</li>
</ul>
</rich:column>
</rich:columnGroup>
</f:facet>
</rich:dataTable>
</h:form>
<h:form>
<p> <!-- rendered="{entrySupport.vascEntry.vascAdminCreate}" -->
<h:commandButton actionListener="#{entrySupport.addAction}"
value="#{entrySupport.i18nMap['vasc.action.addRowAction.name']}"
title="#{entrySupport.i18nMap['vasc.action.addRowAction.description']}"/>
</p>
</h:form>
</h:panelGroup>
</f:facet>
</v:vascEntry>
</ui:define>
</ui:composition>

View file

@ -0,0 +1,18 @@
<ui:composition template="/WEB-INF/template/structure/main.xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:jawr="https://jawr.dev.java.net/jsf/facelets"
>
<ui:define name="page_title">
<h:outputText value="#{vascPageController.pageTitle}" />
</ui:define>
<ui:insert name="main_head_js">
<jawr:script src="/jawr/wiki.js" />
</ui:insert>
<ui:define name="page_content">
<ui:repeat var="part" value="#{vascPageController.pageParts}">
<h2><h:outputText value="#{part.title}"/></h2>
<h:outputText value="#{vascPageController.renderContent(part)}" escape="false"/>
</ui:repeat>
</ui:define>
</ui:composition>

View file

@ -0,0 +1,52 @@
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<div id="body-deco-logo">
<div id="body-deco-logo-div">
<span>
<h:outputLink rendered="#{facesContext.externalContext.isUserInRole('login') == false}" value="#{contextPathController.rootPath}/html/index.jsf">
<img src="#{contextPathController.rootPath}/img/logo.png" alt="#{i18n['Application.web.header.logo.alt']}" />
</h:outputLink>
<h:outputLink rendered="#{facesContext.externalContext.isUserInRole('login') == true}" value="#{contextPathController.rootPath}/html/user/index.jsf">
<img src="#{contextPathController.rootPath}/img/logo.png" alt="#{i18n['Application.web.header.logo.alt']}" />
</h:outputLink>
</span>
</div>
</div>
<div id="body-deco-menu">
<div id="body-deco-menu0-div">
<h4>
<span><h:outputText value="menu0"/></span>
</h4>
<ul>
<ui:repeat var="menuEntry" value="#{menuController.menu0}">
<li><a href="#{contextPathController.rootPath}#{menuEntry.href}" title="#{menuEntry.title}" target="#{menuEntry.target}">#{menuEntry.title}</a></li>
</ui:repeat>
</ul>
</div>
<div id="body-deco-menu1-div">
<h4>
<span><h:outputText value="menu1"/></span>
</h4>
<ul>
<ui:repeat var="menuEntry" value="#{menuController.menu1}">
<li><a href="#{contextPathController.rootPath}#{menuEntry.href}" title="#{menuEntry.title}" target="#{menuEntry.target}">#{menuEntry.title}</a></li>
</ui:repeat>
</ul>
</div>
<div id="body-deco-menu2-div">
<h4>
<span><h:outputText value="menu2"/></span>
</h4>
<ul>
<ui:repeat var="menuEntry" value="#{menuController.menu2}">
<li><a href="#{contextPathController.rootPath}#{menuEntry.href}" title="#{menuEntry.title}" target="#{menuEntry.target}">#{menuEntry.title}</a></li>
</ui:repeat>
</ul>
</div>
</div>
</ui:composition>

View file

@ -0,0 +1,27 @@
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<div id="body-footer">
<div id="body-footer-text">
<span><h:outputText value="#{i18n['Application.web.footer.center']}"/></span>
</div>
<div id="body-footer-menu">
<span>
<h:outputText value="- "/>
<ui:repeat var="menuEntry" value="#{menuController.menuBarBottom}">
<a href="#{contextPathController.rootPath}#{menuEntry.href}" title="#{menuEntry.title}" target="#{menuEntry.target}">#{menuEntry.title}</a><h:outputText value=" - "/>
</ui:repeat>
</span>
</div>
<div id="body-footer-copyright">
<span><h:outputText escape="false" value="#{i18n['Application.web.footer.left']}"/></span>
</div>
<div id="body-footer-version">
<span><h:outputText escape="false" value="#{i18n['Application.web.footer.right']}"/></span>
</div>
</div>
</ui:composition>

View file

@ -0,0 +1,36 @@
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<div id="page-header">
<div id="page-header-left">
<ui:repeat var="menuEntry" value="#{menuController.menuBarLeft}">
<a href="#{contextPathController.rootPath}#{menuEntry.href}" title="#{menuEntry.title}" target="#{menuEntry.target}">#{menuEntry.title}</a>
</ui:repeat>
</div>
<div id="page-header-right">
<ui:repeat var="menuEntry" value="#{menuController.menuBarRight}">
<a href="#{contextPathController.rootPath}#{menuEntry.href}" title="#{menuEntry.title}" target="#{menuEntry.target}">#{menuEntry.title}</a>
</ui:repeat>
</div>
<div id="page-header-info">
<div id="page-header-info-body">
<h:form>
<h:outputLink rendered="#{facesContext.externalContext.isUserInRole('login') == false}" value="#{contextPathController.rootPath}/html/user/index.jsf">
<h:outputText value="#{i18n['Application.web.header.login']}"/>
</h:outputLink>
<h:panelGroup rendered="#{facesContext.externalContext.isUserInRole('login') == true}">
<h:commandLink actionListener="#{userController.logoutAction}">
<h:outputText value="#{i18n['Application.web.header.logout']}"/>
</h:commandLink>
<h:outputText value=" - "/>
<h:outputText value="#{userController.webUserName}"/>
</h:panelGroup>
</h:form>
</div>
</div>
</div>
</ui:composition>

View file

@ -0,0 +1,30 @@
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<f:view>
<div id="body-view">
<ui:insert name="main_body_header">
<ui:include src="/WEB-INF/template/structure/main-body-header.xhtml"/>
</ui:insert>
<ui:insert name="main_body_content">
<div id="body-content">
<h1><ui:insert name="page_title"/></h1>
<h:messages globalOnly="true" />
<ui:insert name="page_content"/>
<ui:insert name="main_body_footer">
<ui:include src="/WEB-INF/template/structure/main-body-footer.xhtml"/>
</ui:insert>
<ui:insert name="main_body_decorator">
<ui:include src="/WEB-INF/template/structure/main-body-decorator.xhtml"/>
</ui:insert>
</div>
</ui:insert>
</div>
<div id="themeDiv1"><span></span></div><div id="themeDiv2"><span></span></div><div id="themeDiv3"><span></span></div>
<div id="themeDiv4"><span></span></div><div id="themeDiv5"><span></span></div><div id="themeDiv6"><span></span></div>
</f:view>
</ui:composition>

View file

@ -0,0 +1,28 @@
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:jawr="https://jawr.dev.java.net/jsf/facelets"
>
<ui:insert name="main_head_content_type">
<meta http-equiv="content-type" content="application/xhtml+xml;charset=UTF-8" />
</ui:insert>
<ui:insert name="main_head_meta">
<meta name="robots" content="#{i18n['Application.web.meta.robots']}"/>
<meta name="description" content="#{i18n['Application.web.meta.description']}"/>
<meta name="keywords" content="#{i18n['Application.web.meta.keywords']}"/>
</ui:insert>
<title>
<ui:insert name="main_head_title">
<ui:insert name="page_title"/>
</ui:insert>
</title>
<ui:insert name="main_head_css">
<jawr:style src="/jawr/default.css" media="all" displayAlternate="false"/>
</ui:insert>
<ui:insert name="main_head_js">
<jawr:script src="/jawr/default.js" />
</ui:insert>
</ui:composition>

View file

@ -0,0 +1,18 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
>
<h:head>
<ui:insert name="main_head">
<ui:include src="/WEB-INF/template/structure/main-head.xhtml"/>
</ui:insert>
</h:head>
<body>
<ui:insert name="main_body">
<ui:include src="/WEB-INF/template/structure/main-body.xhtml"/>
</ui:insert>
</body>
</html>

View file

@ -1,84 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
<web-app version="3.0" metadata-complete="false"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<!-- http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd -->
<display-name>Vasc Demo Tech Web Application</display-name>
<welcome-file-list>
<welcome-file>/jsp/index_jsp.jsp</welcome-file>
<welcome-file>/html/index.jsf</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>4</session-timeout>
<!-- An 4min session, we increase it after login to 20min. -->
</session-config>
<security-constraint>
<web-resource-collection>
<web-resource-name>XHTML</web-resource-name>
<url-pattern>*.xhtml</url-pattern>
</web-resource-collection>
<web-resource-collection>
<web-resource-name>Include files</web-resource-name>
<description>No direct access to include files.</description>
<url-pattern>/jsp/includes/*</url-pattern>
<http-method>POST</http-method>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<description>No direct browser access to include files.</description>
<role-name>inaccessible</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<!--
<security-constraint>
<display-name>User Required</display-name>
<web-resource-collection>
<web-resource-name>User pages</web-resource-name>
<url-pattern>/jsp/user/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<display-name>Admin User Required</display-name>
<web-resource-collection>
<web-resource-name>Admin pages</web-resource-name>
<url-pattern>/jsp/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin-company</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<display-name>Sytem User Required</display-name>
<web-resource-collection>
<web-resource-name>System pages</web-resource-name>
<url-pattern>/jsp/system/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin-system</role-name>
</auth-constraint>
</security-constraint>
-->
<login-config>
<auth-method>FORM</auth-method>
<realm-name>VascDemoSecurity</realm-name>
<form-login-config>
<form-login-page>/jsp/login/login.jsf</form-login-page>
<form-error-page>/jsp/login/login-error.jsf</form-error-page>
</form-login-config>
</login-config>
<security-role>
<security-role>
<role-name>user</role-name>
</security-role>
<security-role>
@ -91,6 +26,83 @@
<role-name>inaccessible</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>Protect Resources</web-resource-name>
<url-pattern>*.xhtml</url-pattern>
</web-resource-collection>
<auth-constraint/>
</security-constraint>
<security-constraint>
<display-name>User Required</display-name>
<web-resource-collection>
<web-resource-name>User pages</web-resource-name>
<url-pattern>/html/user/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>login</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<display-name>Admin User Required</display-name>
<web-resource-collection>
<web-resource-name>Admin pages</web-resource-name>
<url-pattern>/html/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>VascDemoSecurity</realm-name>
<form-login-config>
<form-login-page>/html/auth/login.jsf</form-login-page>
<form-error-page>/html/auth/error.jsf</form-error-page>
</form-login-config>
</login-config>
<error-page>
<error-code>400</error-code>
<location>/html/error/status/400-bad-request.jsf</location>
</error-page>
<error-page>
<error-code>401</error-code>
<location>/html/error/status/401-unauthorized.jsf</location>
</error-page>
<error-page>
<error-code>403</error-code>
<location>/html/error/status/403-forbidden.jsf</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/html/error/status/404-not-found.jsf</location>
</error-page>
<error-page>
<error-code>405</error-code>
<location>/html/error/status/405-method-not-allowed.jsf</location>
</error-page>
<error-page>
<error-code>414</error-code>
<location>/html/error/status/414-request-uri-too-long.jsf</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/html/error/status/500-internal-error.jsf</location>
</error-page>
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/html/error/view-expired.jsf</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/html/error/throwable.jsf</location>
</error-page>
<!-- =============== USER CONFIG ===================================
<filter>
<display-name>User Filter</display-name>
@ -105,39 +117,19 @@
</filter-mapping>
-->
<!-- =============== JSF CONFIG =================================== -->
<!-- =============== CONFIG =================================== -->
<!-- JSF 2.0 -->
<context-param>
<description>
Comma separated list of URIs of (additional) faces
config files.(e.g./WEB-INF/my-config.xml) See JSF1.0 PRD 2,10.3.2
</description>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces.xml</param-value>
<param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
<param-value>false</param-value> <!-- workaround for custum view handlers ? -->
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>facelets.REFRESH_PERIOD</param-name>
<param-value>2</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<servlet>
<description>The JSF Servlet</description>
<servlet-name>facesServlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
@ -146,100 +138,121 @@
<servlet-name>facesServlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<!-- Plugin our own richfaces skin -->
<!-- Richfaces -->
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>vasc-demo-tech</param-value>
<param-name>org.richfaces.enableControlSkinning</param-name>
<param-value>false</param-value>
</context-param>
<!-- Jawr -->
<!-- Making the RichFaces skin spread to standard HTML controls -->
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>enable</param-value>
</context-param>
<servlet>
<servlet-name>JsServlet</servlet-name>
<servlet-class>net.jawr.web.servlet.JawrServlet</servlet-class>
<init-param>
<param-name>configLocation</param-name>
<param-value>/META-INF/jawr.properties</param-value>
</init-param>
<init-param>
<param-name>mapping</param-name>
<param-value>/_js/</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>CssServlet</servlet-name>
<servlet-class>net.jawr.web.servlet.JawrServlet</servlet-class>
<init-param>
<param-name>configLocation</param-name>
<param-value>/META-INF/jawr.properties</param-value>
</init-param>
<init-param>
<param-name>mapping</param-name>
<param-value>/_css/</param-value>
</init-param>
<init-param>
<param-name>type</param-name>
<param-value>css</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>JsServlet</servlet-name>
<url-pattern>/_js/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>CssServlet</servlet-name>
<url-pattern>/_css/*</url-pattern>
</servlet-mapping>
<!-- Defining and mapping the RichFaces filter -->
<filter>
<display-name>RichFaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>facesServlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<!-- =============== VASC CONFIG =================================== -->
<!-- Vasc -->
<filter>
<display-name>VASC Filter</display-name>
<filter-name>vascFilter</filter-name>
<filter-class>net.forwardfire.vasc.frontend.web.jsf.VascRequestFacesFilter</filter-class>
<init-param>
<param-name>templateFile</param-name>
<param-value>/jsp/includes/vasc-template.jsf</param-value>
<param-value>/WEB-INF/template/page-vasc.jsf</param-value>
</init-param>
<init-param>
<param-name>resourceBundle</param-name>
<param-value>net.forwardfire.vasc.lib.i18n.bundle.RootApplicationBundle</param-value>
<param-name>vascControllerProvider</param-name>
<param-value>java:comp/env/vasc/DemoVascController@net.forwardfire.vasc.impl.jndi.JndiVascControllerProvider</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>vascFilter</filter-name>
<url-pattern>/vasc/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<!-- <dispatcher>FORWARD</dispatcher> -->
</filter-mapping>
<servlet>
<servlet-name>vascExportServlet</servlet-name>
<servlet-class>net.forwardfire.vasc.frontend.web.export.VascExportServlet</servlet-class>
<init-param>
<param-name>vascControllerProvider</param-name>
<param-value>net.forwardfire.vasc.demo.tech.core.DemoVascControllerProvider</param-value>
<param-value>java:comp/env/vasc/DemoVascController@net.forwardfire.vasc.impl.jndi.JndiVascControllerProvider</param-value>
</init-param>
<load-on-startup>4</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>vascExportServlet</servlet-name>
<url-pattern>/export</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>vascExportServletTree</servlet-name>
<servlet-class>net.forwardfire.vasc.frontend.web.export.VascExportServlet</servlet-class>
<init-param>
<param-name>vascControllerProvider</param-name>
<param-value>net.forwardfire.vasc.demo.tech.core.DemoVascControllerProvider</param-value>
</init-param>
<init-param>
<param-name>exportTree</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>vascExportServletTree</servlet-name>
<url-pattern>/export-tree/*</url-pattern>
<servlet-name>vascExportServlet</servlet-name>
<url-pattern>/export/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>vascCXFServlet</servlet-name>
<servlet-class>net.forwardfire.vasc.frontend.cxf.server.web.VascCXFServlet</servlet-class>
<init-param>
<param-name>vascControllerProvider</param-name>
<param-value>net.forwardfire.vasc.demo.tech.core.DemoVascControllerProvider</param-value>
<param-value>java:comp/env/vasc/DemoVascController@net.forwardfire.vasc.impl.jndi.JndiVascControllerProvider</param-value>
</init-param>
<load-on-startup>5</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>vascCXFServlet</servlet-name>
<url-pattern>/cxf/*</url-pattern>
</servlet-mapping>
<!-- Debug
<servlet>
<servlet-name>testServlet</servlet-name>
<servlet-class>net.forwardfire.vasc.demo.tech.web.servlets.TestServlet</servlet-class>
<load-on-startup>6</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>testServlet</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
-->
</web-app>

View file

@ -0,0 +1,19 @@
* {
margin:0px;
padding:0px;
}
ul {
margin-left:1em;
padding-left:1em;
}
a {
text-decoration:none;
}
object, embed {
outline:0;
}

View file

@ -1,18 +1,7 @@
/* HTML STYLES */
* {
margin:0px;
padding:0px;
}
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
color: #000000;
margin: 0px;
padding: 0px;
background-color:white;
color:#000000;
background-color:#FFFFFF;
}
h1 {
@ -22,26 +11,19 @@ h1 {
}
h2 {
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
border-radius:3px;
display:block;
font-size:1.0em;
font-weight:bold;
padding:10px 10px 10px 10px;
}
a {
color:#004DEB;
text-decoration:underline;
}
p {
margin:10px 10px 10px 10px;
}
img {
border: none;
border:none;
vertical-align: middle;
}
@ -49,42 +31,13 @@ ul {
margin-left:10px;
}
a {
text-decoration:underline;
}
/* DIVS */
#page_wrap{
margin:10px;
margin-top:0px;
float:none;
}
#page_header{
height:80px;
font-size:18px;
border-bottom:1px solid #DDCCCC;
position:relative;
}
#page_header a img{
border:none;
padding-right:10px;
vertical-align:middle;
}
#page_content {
margin-top:5px;
}
#page_footer {
margin-top:35px;
padding: 5px;
font-size: 12px;
border-color:#e5e5e5;
border-style:solid;
border-width:1px 1px 1px 1px;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
}
/* MENU */
@ -139,88 +92,6 @@ ul {
}
.actionbox{
background-color:#DDCCCC;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
border:none;
-moz-border-radius-topleft:0;
-webkit-border-top-left-radius:0;
-khtml-border-radius-topleft:0;
clear:both;
padding:3px 0 3px 3px;
display:block;
}
.actionbox label{display:inline;}
ul.actionboxtab{margin:0;padding:0;}
ul.actionboxtab li{list-style-type:none;float:left;margin:0;padding:0;}
ul.actionboxtab li a {
border:solid 1px #ddd;
border-bottom-width:0;
-moz-border-radius-topleft:3px;
-moz-border-radius-topright:3px;
-khtml-border-radius-topright:3px;
-webkit-border-top-left-radius:3px;
-webkit-border-top-right-radius:3px;
-khtml-border-radius-topleft:3px;
font-weight:700;
display:block;
margin-right:5px;color:#000;
padding:3px 15px;
}
ul.actionboxtab li a.active{background-color:#DDCCCC;border:solid 1px #DDCCCC;text-decoration:none;}
ul.actionboxtab li a:hover{background-color:#DDCCCC;border:solid 1px #DDCCCC;text-decoration:none;}
td.tableactions{border-bottom-color:#bbb;text-align:left;}
ul.paging{
clear:both;
margin-bottom:5px;
margin-top:5px;
display:block;
float:left;
padding-top:3px;
padding-bottom:3px;
width:100%;
list-style:none;
}
ul.paging li,ul.paging span{float:left;margin:0 2px 0 2px;}
.paging_thispage{font-weight:700;padding:0 6px;}
ul.paging .paging_atstart{margin-right:10px;}ul.paging .paging_atend{margin-left:10px;}
ul.paging .paging_atstart a,ul.paging .nolink.paging_atstart{
padding-left:15px;
}
ul.paging .paging_atend a,ul.paging .nolink.paging_atend{
padding-right:15px;
}
ul.paging .paging_next{
margin-left:20px;
border:1px solid #DDD;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
padding:2px 6px;
}
ul.paging .paging_prev{
margin-right:20px;
border:1px solid #DDD;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
padding:2px 6px;
}
ul.paging a,ul.paging .paging_link{
border:1px solid #DDD;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-khtml-border-radius:3px;
padding:2px 6px;
}
ul.paging .paging_break{
font-weight:700;padding:2px 6px;
}
@ -311,50 +182,9 @@ table.table5 tr:nth-child(even) {
}
.rich-table-subheader {
background-color:#DDCCCC;
border-top: 1px solid #C0C0C0;
border-left: 1px solid #C0C0C0;
}
.rich-table {
border-top: none;
border-left: none;
}
.rich-table-row {
border-left: 1px solid #C0C0C0;
}
.rich-table-headercell,.rich-table-footercell {
background-color: #FFF;
border: none;
padding-left: 0px;
padding-right: 0px;
font-weight: none;
}
.rich-table-thead {
border: none;
}
.rich-table-header {
background: none;
}
.homepage_stats {
margin-top:10px;
margin-bottom:10px;
}
.homepage_stats_big {
color:#004DEB;
margin-top:5px;
margin-bottom:5px;
font-size: 20px;
display:block;
font-weight: normal;
}
/* MESSAGES */
@ -436,41 +266,7 @@ table.table5 tr:nth-child(even) {
/* LOGINBOX */
/* Text styles */
.text_justify {
text-align:justify;
}
.text_left {
text-align:left;
}
.text_right {
text-align:right;
}
.text_center {
text-align:center;
}
.text_middle {
vertical-align:middle!important;
}
.text_top {
vertical-align:top;
}
/* OTHER STYLES */
.no_wrap {
white-space: nowrap;
}
.no_border {
border:none;
}
/*

View file

@ -0,0 +1,54 @@
body {
margin: 10px;
}
#body-content {
margin: 10px auto;
padding: 10px;
}
#page-header {
height: 1.5em;
}
#page-header-left {
float:left;
}
#page-header-info {
float:right;
padding-right: 20%;
}
#page-header-right {
float:right;
}
#page-header-left,#page-header-right {
padding-top: 10px;
}
#body-footer {
text-align: center;
padding: 5px;
margin-left:20em;
margin-right:20em;
margin-top:1em;
}
#body-deco-logo {
position: absolute;
right: 20px;
top: 50px;
}
#body-deco-menu {
position: absolute;
right: 20px;
top: 150px;
}

View file

@ -0,0 +1,34 @@
.rf-p {
padding: 10px;
}
.rf-p-hdr {
padding-bottom: 10px;
}
.rf-p-b {
}
.rf-dt-shdr {
}
.rf-dt {
}
.rf-dt-r {
}
.rf-dt-hdr {
}
.rf-dt-hdr-c,.rf-dt-ftr-c {
}
.rf-dt-thd {
}

View file

@ -0,0 +1,34 @@
.text-justify {
text-align:justify;
}
.text-left {
text-align:left;
}
.text-right {
text-align:right;
}
.text-center {
text-align:center;
}
.text-middle {
vertical-align:middle!important;
}
.text-top {
vertical-align:top;
}
.no-wrap {
white-space: nowrap;
}
.no-border {
border:none;
}

View file

@ -0,0 +1,170 @@
body {
font-size:85%;
font-family: Georgia, serif;
color: #462102;
background-image: url(/demo/img/skin/default/body-bg.jpg);
}
#body-content {
border: 1px solid #ccc;
background-image: url(/demo/img/skin/default/body-view-bg.png);
}
#page-header-left a,#page-header-right a,#page-header-info-body {
padding:10px;
padding-bottom:5px;
}
#page-header-left a,#page-header-right a,#page-header-info-body {
background-color:#DDCCCC;
font-weight:bold;
border-top-left-radius:5px;
border-top-right-radius:5px;
}
#body-footer {
border-color:#e5e5e5;
border-style:solid;
border-width:1px 1px 1px 1px;
border-radius:3px;
}
h1 {
padding: 0;
font-style: italic;
color: #2d1100;
font-size: xx-large;
}
h2 {
font-style: italic;
float: right;
margin-top: -45px;
padding: 10px;
color: #2d1100;
}
h3 {
font-family: Georgia, serif;
color: #2d1100;
font-style: italic;
margin-top: 20px;
margin-bottom: 5px;
}
h3 span {
border-top-left-radius:5px;
border-left: 1px solid #BBBBBB;
border-top: 1px solid #BBBBBB;
padding-top:2px;
padding-left:5px;
padding-right: 40px;
padding-bottom: 4x;
}
/*
#summary {
float: left;
width: 200px;
margin-right: 15px;
text-align: center;
border: 1px solid #ccc;
padding: 5px;
font-family: Georgia, serif;
font-style: italic;
}
*/
#body-deco-logo {
}
#body-deco-menu {
padding:10px;
}
#body-deco-logo-div,#body-deco-menu0-div,#body-deco-menu1-div,#body-deco-menu2-div {
/*
font: 10px verdana, sans-serif;
padding: 10px;
margin-top: 130px;
width: 130px;
border: 1px solid #ccc;
background-image: url(../../../img/skin/default/wrapper2.png);
*/
}
#body-deco-menu {
border-radius:5px;
border: 1px solid #BBBBBB;
}
.rf-p {
border-radius:5px;
border: 1px solid #BBBBBB;
margin: 5px;
padding: 0px;
}
.rf-p-hdr {
padding:5px;
border-bottom: 1px solid #BBBBBB;
font-weight:bold;
}
.rf-p-b {
padding-top:10px;
padding-left:5px;
padding-bottom:10px;
padding-right:5px;
}
input,textarea,select{
padding: 3px;
background: none repeat scroll 0 0 transparent;
border: 2px solid rgba(66, 60, 24, 0.6);
border-radius:3px;
margin-right: 5px;
margin-bottom: 2px;
}
input:hover,textarea:hover,select:hover{
border: 2px solid rgba(200, 224, 64, 0.6);
}
.even {
background-color:rgba(170, 180, 60, 0.6);
}
.odd {
background-color:rgba(210, 230, 120, 0.6);
}
#page-header-left a,#page-header-right a,#page-header-info-body,.rf-dt-shdr-c a,.table_sub_header {
background-color:rgba(218, 247, 82, 0.6);
}
.table_options_bottom, .table_options_top, .actionbox, ul.actionboxtab li a.active,.rf-p-hdr {
background-color:rgba(200, 224, 64, 0.6);
}
ul.actionboxtab li a:hover,#page-header-left a:hover,#page-header-right a:hover,#page-header-info-body:hover {
background-color:rgba(165, 182, 33, 0.6);
}

View file

@ -0,0 +1,168 @@
.actionbox{
background-color:#DDCCCC;
border-radius:3px;
border-top-left-radius:0;
border:none;
clear:both;
padding:3px 0 3px 3px;
/* display:block; */
}
.actionbox label{display:inline;}
ul.actionboxtab{margin:0;padding:0;}
ul.actionboxtab li{list-style-type:none;float:left;margin:0;padding:0;}
ul.actionboxtab li a {
background-color:rgba(218, 247, 82, 0.6);
border-bottom-width:0;
border-top-left-radius:3px;
border-top-right-radius:3px;
font-weight:700;
display:block;
margin-right:5px;color:#000;
padding:3px 15px;
}
ul.actionboxtab li a.active{background-color:#DDCCCC;text-decoration:none;}
ul.actionboxtab li a:hover{background-color:#DDCCCC;text-decoration:none;}
td.tableactions{border-bottom-color:#bbb;text-align:left;}
ul.paging{
clear:both;
margin-bottom:5px;
margin-top:5px;
display:block;
float:left;
padding-top:3px;
padding-bottom:3px;
width:100%;
list-style:none;
}
ul.paging li,ul.paging span{float:left;margin:0 2px 0 2px;}
.paging_thispage{font-weight:700;padding:0 6px;}
ul.paging .paging_atstart{margin-right:10px;}ul.paging .paging_atend{margin-left:10px;}
ul.paging .paging_atstart a,ul.paging .nolink.paging_atstart{
padding-left:15px;
}
ul.paging .paging_atend a,ul.paging .nolink.paging_atend{
padding-right:15px;
}
ul.paging .paging_next{
margin-left:20px;
border:1px solid #DDD;
border-radius:3px;
padding:2px 6px;
}
ul.paging .paging_prev{
margin-right:20px;
border:1px solid #DDD;
border-radius:3px;
padding:2px 6px;
}
ul.paging a,ul.paging .paging_link{
border:1px solid #DDD;
border-radius:3px;
padding:2px 6px;
}
ul.paging .paging_break{
font-weight:700;padding:2px 6px;
}
.rf-dt-shdr {
border-top:1px solid #BBBBBB;
}
.rf-dt-shdr-c a {
background-color:rgba(233, 233, 233, 0.6);
border-bottom-left-radius:5px;
border-bottom-right-radius:5px;
border-left: 1px solid #BBBBBB;
border-right: 1px solid #BBBBBB;
border-bottom: 1px solid #BBBBBB;
padding-left:5px;
padding-right:5px;
padding-bottom:2px;
display: block;
}
.rf-dt-shdr-c {
font-size:14px;
font-weight:700;
padding-top:0px;
padding-bottom:5px;
}
.rf-dt {
border-collapse:collapse;
}
.rf-dt-r {
}
.rf-dt-c {
padding:3px 7px 2px 7px;
border-left: 1px solid #BBBBBB;
border-right: 1px solid #BBBBBB;
}
.rf-dt-hdr {
background: none;
}
.rf-dt-hdr-c,.rf-dt-ftr-c {
/* background-color: #FFF; */
border: none;
padding-left: 0px;
padding-right: 0px;
font-weight: none;
}
.rf-dt-thd {
border: none;
}
.table_options_top {
border-top-left-radius:3px;
border-top-right-radius:3px;
background-color:#DDCCCC;
font-size:12px;
font-weight:700;
padding:6px 15px;
display: block;
}
.table_options_bottom {
border-bottom-left-radius:3px;
border-bottom-right-radius:3px;
background-color:#DDCCCC;
font-size:12px;
font-weight:700;
padding:6px 15px;
margin-top:5px;
display: block;
}
.table_sub_header {
border-top-left-radius:5px;
border-top-right-radius:5px;
background-color:rgba(233, 233, 233, 0.6);
border-top:1px solid #BBBBBB;
border-left:1px solid #BBBBBB;
border-right:1px solid #BBBBBB;
display:block;
font-size:14px;
font-weight:700;
margin-left:0px;
margin-right:0px;
margin-top:2px;
padding-top:2px;
text-align:center;
}

View file

@ -0,0 +1,5 @@
body {
color: #00FF00;
}

View file

@ -0,0 +1,42 @@
<ui:composition template="/WEB-INF/template/page-user.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<ui:define name="page_title">Debug Style</ui:define>
<ui:define name="page_content">
<div>
<h3><span><h:outputText value="Debug Css Styles" /></span></h3>
<p>Here all css styles should be showed to tune.</p>
</div>
<div>
<h1><span><h:outputText value="This is h1" /></span></h1>
<p>Sample text</p>
</div>
<div>
<h2><span><h:outputText value="This is h2" /></span></h2>
<p>Sample text</p>
</div>
<div>
<h3><span><h:outputText value="This is h3" /></span></h3>
<p>Sample text</p>
</div>
<div>
<h4><span><h:outputText value="This is h4" /></span></h4>
<p>Sample text</p>
</div>
<div>
<h5><span><h:outputText value="This is h5" /></span></h5>
<p>Sample text</p>
</div>
<div>
<h6><span><h:outputText value="This is h6" /></span></h6>
<p>Sample text</p>
</div>
<div>
<h1><span>etc</span></h1>
</div>
</ui:define>
</ui:composition>

View file

@ -0,0 +1,45 @@
<ui:composition template="/WEB-INF/template/page-user.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<ui:define name="page_title">Debug Tools</ui:define>
<ui:define name="page_content">
<div>
<h3><span><h:outputText value="Vasc Demo Admin" /></span></h3>
<p>Here is is possible to edit all editable tables.</p>
<p>
<h:outputLink value="#{contextPathController.rootPath}/vasc/VascEntry/list.jsf"><h:outputText value="VascEnties"/></h:outputLink>
</p>
</div>
<div>
<h3><span><h:outputText value="Jndi" /></span></h3>
<p>Check all resources in jndi tree's.</p>
<p>
<ul>
<li><h:outputLink value="#{contextPathController.rootPath}/debug/jndi/view"><h:outputText value="Jndi Tree "/></h:outputLink></li>
<li><h:outputLink value="#{contextPathController.rootPath}/debug/jndi/view/global"><h:outputText value="Jndi Tree Global"/></h:outputLink></li>
</ul>
</p>
</div>
<div>
<h3><span><h:outputText value="Jdbc" /></span></h3>
<p>Raw access to the embedded db.</p>
<p>
<h:outputLink value="#{contextPathController.rootPath}/debug/jdbc/console/"><h:outputText value="(H2) Jdbc Console"/></h:outputLink>
</p>
</div>
<div>
<h3><span><h:outputText value="Logback" /></span></h3>
<p>Status servlet of logback.</p>
<p>
<ul>
<li><h:outputLink value="#{contextPathController.rootPath}/debug/logback/status/access"><h:outputText value="Access Log Status"/></h:outputLink></li>
<li><h:outputLink value="#{contextPathController.rootPath}/debug/logback/status/classic"><h:outputText value="Server Log Status"/></h:outputLink></li>
</ul>
</p>
</div>
</ui:define>
</ui:composition>

View file

@ -0,0 +1,63 @@
<ui:composition template="/WEB-INF/template/page-user.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<ui:define name="page_title">Admin Index</ui:define>
<ui:define name="page_content">
<h:panelGrid columns="4" id="grid" width="100%">
<rich:panel>
<f:facet name="header">
<h:outputText value="Vasc Admin" />
</f:facet>
<p>Manage you data.</p>
<ul>
<ui:repeat var="menuEntry" value="#{menuController.menuPageAdmin}">
<li><a href="#{contextPathController.rootPath}#{menuEntry.href}" title="#{menuEntry.title}" target="#{menuEntry.target}">#{menuEntry.title}</a></li>
</ui:repeat>
</ul>
</rich:panel>
<rich:panel>
<f:facet name="header">
<h:outputText value="Export Servlet" />
</f:facet>
<h:form>
<h:panelGrid columns="2" width="100%">
<h:outputText value="Entry:"/>
<h:selectOneMenu value="#{exportController.entryId}" onchange="javascript:this.form.submit(); return false;">
<f:selectItems value="#{exportController.entryIdSelectItems}"/>
</h:selectOneMenu>
<h:outputText value="Type:"/>
<h:selectOneMenu value="#{exportController.exportType}" onchange="javascript:this.form.submit(); return false;">
<f:selectItems value="#{exportController.exportTypeSelectItems}"/>
</h:selectOneMenu>
<h:outputText value="tree-url:"/>
<h:selectBooleanCheckbox value="#{exportController.exportTree}" onchange="javascript:this.form.submit(); return false;"/>
</h:panelGrid>
<h:panelGrid columns="2" width="100%">
<h:outputText value="Url:"/>
<h:outputLink value="#{facesContext.externalContext.requestContextPath}/#{exportController.buildExportUrl}">
<h:outputText value="#{facesContext.externalContext.requestContextPath}/#{exportController.buildExportUrl}"/>
</h:outputLink>
</h:panelGrid>
</h:form>
</rich:panel>
<rich:panel>
<f:facet name="header">
<h:outputText value="WebService Servlet" />
</f:facet>
<h:outputText value="todo" />
</rich:panel>
<rich:panel>
<f:facet name="header">
<h:outputText value="WebStart" />
</f:facet>
<h:outputText value="todo" />
</rich:panel>
</h:panelGrid>
</ui:define>
</ui:composition>

View file

@ -0,0 +1,11 @@
<ui:composition template="/WEB-INF/template/page-no-js.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
>
<ui:define name="page_title">Error</ui:define>
<ui:define name="page_content">
<h:outputText value="Could not login" />
</ui:define>
</ui:composition>

View file

@ -0,0 +1,11 @@
<ui:composition template="/WEB-INF/template/page-no-js.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
>
<ui:define name="page_title">Forgot</ui:define>
<ui:define name="page_content">
<h:outputText value="Could forgot my login, send it to me" />
</ui:define>
</ui:composition>

View file

@ -0,0 +1,26 @@
<ui:composition template="/WEB-INF/template/page-public.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
>
<ui:define name="page_title">Login</ui:define>
<ui:define name="page_content">
<form method="post" action="j_security_check" id="j_security_check">
<h:panelGrid columns="2">
<h:column><h:outputText value="Username:" /></h:column>
<h:column><input type="text" name="j_username" id="j_username"/></h:column>
<h:column><h:outputText value="Password:" /></h:column>
<h:column><input type="password" name="j_password" id="j_password"/></h:column>
</h:panelGrid>
<input type="submit" value="Login"/>
</form>
<h:outputLink value="#{contextPathController.rootPath}/html/auth/forgot.jsf">
<h:outputText value="Forgot my login." />
</h:outputLink>
<script>
document.getElementById('j_security_check:j_username').focus();
</script>
</ui:define>
</ui:composition>

View file

@ -0,0 +1,11 @@
<ui:composition template="/WEB-INF/template/page-no-js.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
>
<ui:define name="page_title">Logout</ui:define>
<ui:define name="page_content">
<h:outputText value="Succesfully logged out." />
</ui:define>
</ui:composition>

View file

@ -0,0 +1,7 @@
<ui:composition template="/WEB-INF/template/page-error.xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
>
<ui:define name="error_title"> <h:outputText value="#{i18n['web.error.status.400.title']}" /></ui:define>
<ui:define name="error_text"> <h:outputText value="#{i18n['web.error.status.400.text']}" /></ui:define>
</ui:composition>

View file

@ -0,0 +1,7 @@
<ui:composition template="/WEB-INF/template/page-error.xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
>
<ui:define name="error_title"> <h:outputText value="#{i18n['web.error.status.404.title']}" /></ui:define>
<ui:define name="error_text"> <h:outputText value="#{i18n['web.error.status.404.text']}" /></ui:define>
</ui:composition>

View file

@ -0,0 +1,7 @@
<ui:composition template="/WEB-INF/template/page-error.xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
>
<ui:define name="error_title"> <h:outputText value="#{i18n['web.error.view-expired.title']}" /></ui:define>
<ui:define name="error_text"> <h:outputText value="#{i18n['web.error.view-expired.text']}" /></ui:define>
</ui:composition>

View file

@ -0,0 +1,29 @@
<ui:composition template="/WEB-INF/template/page-public.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<ui:define name="page_title">Index</ui:define>
<ui:define name="page_content">
<h:panelGrid columns="2" id="grid" width="100%">
<rich:panel rendered="#{not empty menuController.menuPageIndex}" >
<f:facet name="header">
<h:outputText value="Pages" />
</f:facet>
<ul>
<ui:repeat var="menuEntry" value="#{menuController.menuPageIndex}">
<li><a href="#{contextPathController.rootPath}#{menuEntry.href}" title="#{menuEntry.title}" target="#{menuEntry.target}">#{menuEntry.title}</a></li>
</ui:repeat>
</ul>
</rich:panel>
<rich:panel>
<f:facet name="header">
<h:outputText value="Welcome" />
</f:facet>
<h:outputText value="todo" />
</rich:panel>
</h:panelGrid>
</ui:define>
</ui:composition>

View file

@ -0,0 +1,33 @@
<ui:composition template="/WEB-INF/template/page-user.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
>
<ui:define name="page_title">User Index</ui:define>
<ui:define name="page_content">
<h:panelGrid columns="2" id="grid" width="100%">
<rich:panel rendered="#{not empty menuController.menuPageUserLeft}" >
<f:facet name="header">
<h:outputText value="Pages" />
</f:facet>
<ul>
<ui:repeat var="menuEntry" value="#{menuController.menuPageUserLeft}">
<li><a href="#{contextPathController.rootPath}#{menuEntry.href}" title="#{menuEntry.title}" target="#{menuEntry.target}">#{menuEntry.title}</a></li>
</ui:repeat>
</ul>
</rich:panel>
<rich:panel rendered="#{not empty menuController.menuPageUserRight}" >
<f:facet name="header">
<h:outputText value="Pages" />
</f:facet>
<ul>
<ui:repeat var="menuEntry" value="#{menuController.menuPageUserRight}">
<li><a href="#{contextPathController.rootPath}#{menuEntry.href}" title="#{menuEntry.title}" target="#{menuEntry.target}">#{menuEntry.title}</a></li>
</ui:repeat>
</ul>
</rich:panel>
</h:panelGrid>
</ui:define>
</ui:composition>

View file

@ -0,0 +1,26 @@
<ui:composition template="/WEB-INF/template/page-user.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:jawr="https://jawr.dev.java.net/jsf/facelets"
>
<ui:define name="main_head_js">
<jawr:script src="/jawr/skin.js" />
</ui:define>
<ui:define name="page_title">Skins</ui:define>
<ui:define name="page_content">
<rich:panel>
<f:facet name="header">
<h:outputText value="Select skin" />
</f:facet>
<select name="theme" id="skinSwicther" onchange="JAWR.skin.switchToStyle(this.value);">
<option value="default">Default</option>
<option value="pink">Pink Skin</option>
<option value="green">Green Skin</option>
</select>
</rich:panel>
</ui:define>
</ui:composition>

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View file

@ -0,0 +1,10 @@
function selectAllCheckboxes(x) {
for (var i=0,l=x.form.length; i<l; i++) {
if (x.form[i].type == 'checkbox' && (!x.form[i].disabled) && x!=x.form[i] ) {
x.form[i].checked=!x.form[i].checked;
}
}
}