Refactored demo section to single app layout.
This commit is contained in:
parent
b3635cf64d
commit
4bd244f4e5
337 changed files with 1630 additions and 1883 deletions
|
|
@ -0,0 +1,84 @@
|
|||
package net.forwardfire.vasc.demo.tech.ejb3;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.RolesAllowed;
|
||||
import javax.ejb.SessionContext;
|
||||
import javax.ejb.Stateless;
|
||||
|
||||
import net.forwardfire.vasc.demo.tech.domain.user.ClientUserControllerLocal;
|
||||
import net.forwardfire.vasc.demo.tech.domain.user.ClientUserControllerRemote;
|
||||
import net.forwardfire.vasc.lib.i18n.bundle.RootApplicationBundle;
|
||||
|
||||
@Stateless(name="clientUserController")
|
||||
public class ClientUserControllerImpl implements ClientUserControllerLocal,ClientUserControllerRemote {
|
||||
|
||||
@Resource
|
||||
private SessionContext session;
|
||||
|
||||
/**
|
||||
* Tests for the login role
|
||||
*/
|
||||
@RolesAllowed("login")
|
||||
public String doClientLogin() {
|
||||
|
||||
String name = session.getCallerPrincipal().getName();
|
||||
return name;
|
||||
|
||||
/*
|
||||
User u = null;
|
||||
try {
|
||||
u = getUser();
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException("Could not lookup showplanner user from username: "+session.getCallerPrincipal().getName());
|
||||
}
|
||||
UserSession us = new UserSession();
|
||||
us.setLoginDate(new Date());
|
||||
us.setLogoutDate(null); // set when doing doClientLogout();
|
||||
|
||||
try {
|
||||
Query q2 = xtesManager.getQuery("users.xml", "getUserSessionStatusByStatusKey");
|
||||
q2.setQueryParameter("status_key", "success");
|
||||
q2.setProperty("limit", 1);
|
||||
UserSessionStatus userSessionStatus = (UserSessionStatus)xtesManager.executeObject(q2);
|
||||
us.setUserSessionStatus(userSessionStatus);
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException("Could not lookup session status of success.");
|
||||
}
|
||||
|
||||
// current_time_in_secs + str_to_int(username)*10E20
|
||||
long timeSS = us.getLoginDate().getTime();
|
||||
int userSS = hashUserName(u.getUsername());
|
||||
int modSS = 10230;
|
||||
long sessionId = timeSS+userSS*modSS;
|
||||
us.setSessionId(sessionId);
|
||||
//System.out.println("Created sessionId: timeSS: "+timeSS+" userSS: "+userSS+" modSS: "+modSS);
|
||||
|
||||
us.setUser(u);
|
||||
entityManager.persist(us);
|
||||
return u.getUsername();
|
||||
*/
|
||||
}
|
||||
|
||||
public Map<String,String> getResourceBundle(Locale locale) {
|
||||
ResourceBundle bundle = ResourceBundle.getBundle(RootApplicationBundle.class.getName(), locale);
|
||||
if (bundle instanceof RootApplicationBundle) {
|
||||
RootApplicationBundle appBundle = (RootApplicationBundle)bundle;
|
||||
return appBundle.getBundleData();
|
||||
}
|
||||
throw new IllegalStateException("Loaded bundle: "+bundle+" is not RootApplicationBundle.");
|
||||
}
|
||||
|
||||
public List<Locale> getResourceBundleLocales() {
|
||||
ResourceBundle bundle = ResourceBundle.getBundle(RootApplicationBundle.class.getName());
|
||||
if (bundle instanceof RootApplicationBundle) {
|
||||
RootApplicationBundle appBundle = (RootApplicationBundle)bundle;
|
||||
return appBundle.getApplicationSupportedLocales();
|
||||
}
|
||||
throw new IllegalStateException("Loaded bundle: "+bundle+" is not RootApplicationBundle.");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,213 @@
|
|||
/*
|
||||
* 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.ejb3;
|
||||
|
||||
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.annotation.Resource;
|
||||
import javax.ejb.SessionContext;
|
||||
import javax.naming.Context;
|
||||
import javax.naming.InitialContext;
|
||||
import javax.naming.NamingException;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import net.forwardfire.vasc.core.VascController;
|
||||
import net.forwardfire.vasc.core.VascEntry;
|
||||
import net.forwardfire.vasc.core.VascEntryAccessType;
|
||||
import net.forwardfire.vasc.core.VascEntryGroup;
|
||||
import net.forwardfire.vasc.demo.tech.domain.menu.VascMenuControllerLocal;
|
||||
import net.forwardfire.vasc.demo.tech.domain.menu.VascMenuControllerRemote;
|
||||
import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenu;
|
||||
import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenuGroup;
|
||||
import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenuWeb;
|
||||
import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenuWebComparator;
|
||||
import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenuWebType;
|
||||
|
||||
/**
|
||||
* MenuController Shows the menu for the user.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 May 19, 2012
|
||||
*/
|
||||
public class VascMenuControllerImpl implements VascMenuControllerLocal,VascMenuControllerRemote {
|
||||
|
||||
private VascMenuWebComparator vascMenuWebComparator = null;
|
||||
|
||||
@Resource
|
||||
private SessionContext session;
|
||||
|
||||
public VascMenuControllerImpl() {
|
||||
vascMenuWebComparator = new VascMenuWebComparator();
|
||||
}
|
||||
|
||||
public List<VascMenuWeb> fetchVascMenuWeb() {
|
||||
List<VascMenuWeb> result = new ArrayList<VascMenuWeb>(50);
|
||||
Connection connection = null;
|
||||
try {
|
||||
DataSource ds = getDataSource("openejb:Resource/jdbc/DemoManagerDataDS");
|
||||
connection = ds.getConnection();
|
||||
Statement s = connection.createStatement();
|
||||
s.execute("SELECT * FROM VASC_MENU_WEB");
|
||||
ResultSet rs = s.getResultSet();
|
||||
//int cols = rs.getMetaData().getColumnCount();
|
||||
while (rs.next()) {
|
||||
VascMenuWeb menu = new VascMenuWeb();
|
||||
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(VascMenuWebType.valueOf(rs.getString(8)));
|
||||
if (filterVascMenuRoles(menu.getActive(),menu.getRoles())==false) {
|
||||
continue;
|
||||
}
|
||||
result.add(menu);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (connection!=null) {
|
||||
try {
|
||||
connection.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
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(Boolean active,String roles) {
|
||||
if (active!=null && active==false) {
|
||||
return false;
|
||||
}
|
||||
if (roles!=null && roles.isEmpty()==false) {
|
||||
String[] rolesArray = roles.split(",");
|
||||
for (String role:rolesArray) {
|
||||
if (role.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (session.isCallerInRole(role)==false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public List<VascMenuGroup> getFilteredMenuGroup() {
|
||||
|
||||
VascController vc = null;
|
||||
try {
|
||||
Context initialContext = new InitialContext();
|
||||
vc = (VascController)initialContext.lookup("openejb:Resource/vasc/server-tech");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
List<VascMenuGroup> result = new ArrayList<VascMenuGroup>(20);
|
||||
for (String groupdId:vc.getVascEntryController().getVascEntryGroupIds()) {
|
||||
VascEntryGroup veg = vc.getVascEntryController().getVascEntryGroupById(groupdId);
|
||||
if (filterVascMenuRoles(veg.getView(),veg.getRolesView())==false) {
|
||||
continue;
|
||||
}
|
||||
VascMenuGroup group = new VascMenuGroup();
|
||||
group.setId(veg.getId());
|
||||
group.setTitleKey(veg.getName());
|
||||
group.setMenus(getFilteredMenu(group.getId()));
|
||||
result.add(group);
|
||||
}
|
||||
// Collections.sort(result,vascMenuGroupComparator);
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<VascMenu> getFilteredMenu(String groupId) {
|
||||
if (groupId==null) {
|
||||
throw new NullPointerException("Can't filter on null groupId.");
|
||||
}
|
||||
VascController vc = null;
|
||||
try {
|
||||
Context initialContext = new InitialContext();
|
||||
vc = (VascController)initialContext.lookup("openejb:Resource/vasc/server-tech");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
List<VascMenu> result = new ArrayList<VascMenu>(15);
|
||||
for (String vascEntryId:vc.getVascEntryController().getVascEntryByGroupId(groupId)) {
|
||||
VascEntry ve = vc.getVascEntryController().getVascEntryById(vascEntryId);
|
||||
if (ve.getAccessType()!=null && (
|
||||
ve.getAccessType()==VascEntryAccessType.ENTRY_LINK |
|
||||
ve.getAccessType()==VascEntryAccessType.ENTRY_LIST
|
||||
)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (filterVascMenuRoles(ve.getView(),ve.getRolesView())==false) {
|
||||
continue;
|
||||
}
|
||||
VascMenu menu = new VascMenu();
|
||||
menu.setVascEntryId(ve.getId());
|
||||
menu.setVascGroupId(ve.getVascGroupId());
|
||||
menu.setTitleKey(ve.getName());
|
||||
result.add(menu);
|
||||
}
|
||||
// Collections.sort(result,vascMenuComparator);
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<VascMenuWeb> getFilteredMenuWeb(VascMenuWebType type) {
|
||||
if (type==null) {
|
||||
throw new NullPointerException("Can't filter on null type.");
|
||||
}
|
||||
List<VascMenuWeb> result = new ArrayList<VascMenuWeb>(15);
|
||||
for (VascMenuWeb menu:fetchVascMenuWeb()) {
|
||||
if (type.equals(menu.getMenuType())) {
|
||||
result.add(menu);
|
||||
}
|
||||
}
|
||||
Collections.sort(result,vascMenuWebComparator);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
package net.forwardfire.vasc.demo.tech.web.beans;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.faces.model.SelectItem;
|
||||
|
||||
import net.forwardfire.vasc.core.VascController;
|
||||
import net.forwardfire.vasc.impl.jndi.JndiVascControllerProvider;
|
||||
|
||||
public class ExportController {
|
||||
|
||||
private String entryId = "VascEntry";
|
||||
private String exportType = "xml";
|
||||
private boolean exportTree = true;
|
||||
private VascController vascController = null;
|
||||
|
||||
public ExportController() {
|
||||
try {
|
||||
JndiVascControllerProvider p = new JndiVascControllerProvider();
|
||||
p.setJndiName("java:comp/env/vasc/server-tech");
|
||||
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();
|
||||
String label = entryId;
|
||||
while (label.length()>40) {
|
||||
label = label.substring(10);
|
||||
}
|
||||
i.setLabel("..."+label);
|
||||
i.setDescription(entryId);
|
||||
i.setValue(entryId);
|
||||
result.add(i);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<SelectItem> getExportTypeSelectItems() {
|
||||
List<SelectItem> result = new ArrayList<SelectItem>();
|
||||
for (String exportId:vascController.getVascEntryConfigController().getVascEntryExporterIds()) {
|
||||
SelectItem i = new SelectItem();
|
||||
i.setLabel(exportId);
|
||||
i.setValue(exportId);
|
||||
result.add(i);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getBuildExportUrl() {
|
||||
StringBuilder buff = new StringBuilder();
|
||||
if (exportTree) {
|
||||
buff.append("export/");
|
||||
buff.append(getEntryId());
|
||||
buff.append('/');
|
||||
buff.append(getExportType());
|
||||
} else {
|
||||
buff.append("export");
|
||||
buff.append("?ve=");
|
||||
buff.append(getEntryId());
|
||||
buff.append("&et=");
|
||||
buff.append(getExportType());
|
||||
}
|
||||
return buff.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the entryId
|
||||
*/
|
||||
public String getEntryId() {
|
||||
return entryId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param entryId the entryId to set
|
||||
*/
|
||||
public void setEntryId(String entryId) {
|
||||
this.entryId = entryId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the exportType
|
||||
*/
|
||||
public String getExportType() {
|
||||
return exportType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param exportType the exportType to set
|
||||
*/
|
||||
public void setExportType(String exportType) {
|
||||
this.exportType = exportType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the exportTree
|
||||
*/
|
||||
public boolean isExportTree() {
|
||||
return exportTree;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param exportTree the exportTree to set
|
||||
*/
|
||||
public void setExportTree(boolean exportTree) {
|
||||
this.exportTree = exportTree;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
* 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 java.util.Collection;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
/**
|
||||
* I18nController wraps to root application bundle to skip jsf cache.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Jan 7, 2013
|
||||
*/
|
||||
public class I18nController implements Map<String,String> {
|
||||
|
||||
public ResourceBundle getBundle() {
|
||||
Locale locale = null;
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
locale = context.getApplication().getDefaultLocale();
|
||||
ResourceBundle bundle = ResourceBundle.getBundle("net.forwardfire.vasc.lib.i18n.bundle.RootApplicationBundle", locale);
|
||||
return bundle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsKey(Object key) {
|
||||
return getBundle().containsKey((String)key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsValue(Object value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<java.util.Map.Entry<String, String>> entrySet() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String get(Object key) {
|
||||
return getBundle().getString((String)key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> keySet() {
|
||||
return getBundle().keySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String put(String key, String value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putAll(Map<? extends String, ? extends String> arg0) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String remove(Object key) {
|
||||
return (String)key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return getBundle().keySet().size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> values() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
/*
|
||||
* 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 java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import javax.naming.InitialContext;
|
||||
import javax.naming.NamingException;
|
||||
|
||||
import net.forwardfire.vasc.demo.tech.domain.menu.VascMenuController;
|
||||
import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenuGroup;
|
||||
import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenuWeb;
|
||||
import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenuWebType;
|
||||
|
||||
/**
|
||||
* 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 UserController userController = null;
|
||||
private VascMenuController vascMenuController = null;
|
||||
|
||||
private void init() {
|
||||
// RM ME
|
||||
if (vascMenuController==null) {
|
||||
try {
|
||||
InitialContext ctx = new InitialContext();
|
||||
vascMenuController = (VascMenuController)ctx.lookup("java:app/demo/vascMenuController");
|
||||
} catch (NamingException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<VascMenuWeb> getMenuFiltered(VascMenuWebType type) {
|
||||
init();
|
||||
return vascMenuController.getFilteredMenuWeb(type);
|
||||
}
|
||||
|
||||
public List<VascMenuGroup> getVascMenuGroup() {
|
||||
init();
|
||||
List<VascMenuGroup> result = vascMenuController.getFilteredMenuGroup();
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<VascMenuWeb> getMenuBarLeft() {
|
||||
return getMenuFiltered(VascMenuWebType.BAR_LEFT);
|
||||
}
|
||||
|
||||
public List<VascMenuWeb> getMenuBarRight() {
|
||||
return getMenuFiltered(VascMenuWebType.BAR_RIGHT);
|
||||
}
|
||||
|
||||
public List<VascMenuWeb> getMenuBarBottom() {
|
||||
return getMenuFiltered(VascMenuWebType.BAR_BOTTOM);
|
||||
}
|
||||
|
||||
public List<VascMenuWeb> getMenuPageIndex() {
|
||||
return getMenuFiltered(VascMenuWebType.PAGE_INDEX);
|
||||
}
|
||||
|
||||
public List<VascMenuWeb> getMenuPageUserLeft() {
|
||||
return getMenuFiltered(VascMenuWebType.PAGE_USER_LEFT);
|
||||
}
|
||||
|
||||
public List<VascMenuWeb> getMenuPageUserRight() {
|
||||
return getMenuFiltered(VascMenuWebType.PAGE_USER_RIGHT);
|
||||
}
|
||||
|
||||
public List<VascMenuWeb> getMenuPageAdmin() {
|
||||
return getMenuFiltered(VascMenuWebType.PAGE_ADMIN);
|
||||
}
|
||||
|
||||
public List<VascMenuWeb> getMainMenu0() {
|
||||
return getMenuFiltered(VascMenuWebType.MAIN_MENU_0);
|
||||
}
|
||||
|
||||
public List<VascMenuWeb> getMainMenu1() {
|
||||
return getMenuFiltered(VascMenuWebType.MAIN_MENU_1);
|
||||
}
|
||||
|
||||
public List<VascMenuWeb> getMainMenu2() {
|
||||
return getMenuFiltered(VascMenuWebType.MAIN_MENU_2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the userController
|
||||
*/
|
||||
public UserController getUserController() {
|
||||
return userController;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param userController the userController to set
|
||||
*/
|
||||
public void setUserController(UserController userController) {
|
||||
this.userController = userController;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
/*
|
||||
* 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 java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.event.ActionEvent;
|
||||
import javax.naming.Context;
|
||||
import javax.naming.InitialContext;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import net.forwardfire.vasc.demo.tech.domain.user.ClientUserController;
|
||||
import net.forwardfire.vasc.demo.tech.web.models.WebUser;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Nov 1, 2009
|
||||
*/
|
||||
public class UserController implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
static public final String WEB_USER_SESSION_KEY = "webUser";
|
||||
|
||||
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);
|
||||
|
||||
/*
|
||||
try {
|
||||
Properties properties = new Properties();
|
||||
properties.setProperty (Context.INITIAL_CONTEXT_FACTORY,"org.apache.openejb.client.LocalInitialContextFactory");
|
||||
InitialContext ic = new InitialContext(properties);
|
||||
Object object = ic.lookup("java:app/demo/vascServiceManager");
|
||||
System.out.println("ob: "+object);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
InitialContext ic = new InitialContext();
|
||||
LoginUserController object = (LoginUserController)ic.lookup("java:app/demo/loginUserController");
|
||||
System.out.println("ob: "+object);
|
||||
System.out.println("login: "+object.doClientLogin());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
*/
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
public void logoutAction(ActionEvent event) {
|
||||
HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(true);
|
||||
session.invalidate();
|
||||
try {
|
||||
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 boolean hasUserPrincipal() {
|
||||
return FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal()!=null;
|
||||
}
|
||||
|
||||
public boolean hasUserRole(String role) {
|
||||
return FacesContext.getCurrentInstance().getExternalContext().isUserInRole(role);
|
||||
}
|
||||
|
||||
public boolean isUserLoggedin() {
|
||||
return hasUserRole("login");
|
||||
}
|
||||
|
||||
public boolean isRoleUserLogin() {
|
||||
return hasUserRole("login");
|
||||
}
|
||||
|
||||
public boolean isRoleUserAdmin() {
|
||||
return hasUserRole("admin");
|
||||
}
|
||||
}
|
||||
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package net.forwardfire.vasc.demo.tech.web.models;
|
||||
|
||||
|
||||
public class WebUser {
|
||||
|
||||
private Long id = null;
|
||||
private String loginName = null;
|
||||
private String fullName = null;
|
||||
|
||||
/**
|
||||
* @return the id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id the id to set
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the loginName
|
||||
*/
|
||||
public String getLoginName() {
|
||||
return loginName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param loginName the loginName to set
|
||||
*/
|
||||
public void setLoginName(String loginName) {
|
||||
this.loginName = loginName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the fullName
|
||||
*/
|
||||
public String getFullName() {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fullName the fullName to set
|
||||
*/
|
||||
public void setFullName(String fullName) {
|
||||
this.fullName = fullName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,280 @@
|
|||
/*
|
||||
* 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.lang.reflect.Method;
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.naming.Context;
|
||||
import javax.naming.InitialContext;
|
||||
import javax.naming.NamingException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import de.tudarmstadt.ukp.wikipedia.parser.ParsedPage;
|
||||
import de.tudarmstadt.ukp.wikipedia.parser.Section;
|
||||
import de.tudarmstadt.ukp.wikipedia.parser.html.HtmlWriter;
|
||||
import de.tudarmstadt.ukp.wikipedia.parser.mediawiki.MediaWikiParser;
|
||||
import de.tudarmstadt.ukp.wikipedia.parser.mediawiki.MediaWikiParserFactory;
|
||||
|
||||
import net.forwardfire.vasc.demo.tech.web.beans.UserController;
|
||||
import net.forwardfire.vasc.demo.tech.web.pages.model.VascPage;
|
||||
import net.forwardfire.vasc.demo.tech.web.pages.model.VascPagePart;
|
||||
import net.forwardfire.vasc.demo.tech.web.pages.model.VascPagePartType;
|
||||
|
||||
/**
|
||||
* VascPageController very hacky page context controller.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 May 19, 2012
|
||||
*/
|
||||
public class VascPageController implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6820749860984575869L;
|
||||
private UserController userController = null;
|
||||
private VascPage page = null;
|
||||
|
||||
public VascPage fetchVascPage(String slug) {
|
||||
VascPage result = null;
|
||||
Connection connection = null;
|
||||
try {
|
||||
DataSource ds = getDataSource("java:comp/env/jdbc/DemoManagerDataDS");
|
||||
connection = ds.getConnection();
|
||||
Statement s = connection.createStatement();
|
||||
s.execute("SELECT * FROM VASC_PAGE WHERE SLUG='"+slug+"'"); // bad so redo ..
|
||||
ResultSet rs = s.getResultSet();
|
||||
if (rs.next()) {
|
||||
result = new VascPage();
|
||||
result.setId(rs.getInt(1));
|
||||
result.setSlug(rs.getString(2));
|
||||
result.setTitle(rs.getString(3));
|
||||
result.setActive(rs.getBoolean(4));
|
||||
result.setSitemap(rs.getBoolean(5));
|
||||
result.setRoles(rs.getString(6));
|
||||
/*
|
||||
menu.setMenuOrder(rs.getInt(7));
|
||||
menu.setMenuType(VascMenuType.valueOf(rs.getString(8)));
|
||||
if (filterVascMenuRoles(menu)==false) {
|
||||
continue;
|
||||
}*/
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (connection!=null) {
|
||||
try {
|
||||
connection.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<VascPagePart> fetchVascPageParts(int pageId) {
|
||||
List<VascPagePart> result = new ArrayList<VascPagePart>(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_PAGE_PART WHERE PAGE_ID="+pageId); // bad
|
||||
ResultSet rs = s.getResultSet();
|
||||
while (rs.next()) {
|
||||
VascPagePart menu = new VascPagePart();
|
||||
menu.setId(rs.getInt(1));
|
||||
menu.setPageId(rs.getInt(2));
|
||||
menu.setTitle(rs.getString(3));
|
||||
menu.setText(rs.getString(4));
|
||||
menu.setActive(rs.getBoolean(5));
|
||||
menu.setSitemap(rs.getBoolean(6));
|
||||
menu.setPartOrder(rs.getInt(7));
|
||||
menu.setPartType(VascPagePartType.valueOf(rs.getString(8)));
|
||||
menu.setRoles(rs.getString(9));
|
||||
/*
|
||||
menu.setMenuOrder(rs.getInt(7));
|
||||
menu.setMenuType(VascMenuType.valueOf(rs.getString(8)));
|
||||
if (filterVascMenuRoles(menu)==false) {
|
||||
continue;
|
||||
}*/
|
||||
result.add(menu);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (connection!=null) {
|
||||
try {
|
||||
connection.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
*/
|
||||
|
||||
public VascPage getPage() {
|
||||
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
String pageId = (String)((ServletRequest)context.getExternalContext().getRequest()).getAttribute("pageId");
|
||||
|
||||
if (pageId==null) {
|
||||
return null; // todo send somewhere
|
||||
}
|
||||
if (page!=null && page.getSlug().equals(pageId)) {
|
||||
return page;
|
||||
}
|
||||
|
||||
page = fetchVascPage(pageId);
|
||||
page.getPageParts().addAll(fetchVascPageParts(page.getId()));
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
public String renderContent(VascPagePart part) {
|
||||
if (part==null) {
|
||||
return "";
|
||||
}
|
||||
if (VascPagePartType.HTML.equals(part.getPartType())) {
|
||||
return part.getText();
|
||||
} else if (VascPagePartType.PRE.equals(part.getPartType())) {
|
||||
return "<pre>"+part.getText()+"</pre>\n";
|
||||
} else {
|
||||
MediaWikiParserFactory pf = new MediaWikiParserFactory();
|
||||
MediaWikiParser parser = pf.createParser();
|
||||
ParsedPage page = parser.parse(part.getText());
|
||||
String result = FixedHtmlWriter.parsedPageToHtml(page);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
static class FixedHtmlWriter extends HtmlWriter {
|
||||
public static String parsedPageToHtml( ParsedPage pp ){
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
||||
if( pp != null ) {
|
||||
//Title
|
||||
result.append(
|
||||
"<table class=\"ParsedPage\">\n"+
|
||||
"<tr><th class=\"ParsedPage\">ParsedPage: \n" +
|
||||
pp.getName()+
|
||||
"</th></tr>\n");
|
||||
|
||||
//Sections
|
||||
result.append(
|
||||
"<tr><td class=\"ParsedPage\">\n" );
|
||||
for( Section s: pp.getSections() ) {
|
||||
result.append( invokePrivate("sectionToHtml",s));
|
||||
}
|
||||
result.append(
|
||||
"</td></tr>\n");
|
||||
|
||||
//Categories
|
||||
if( pp.getCategoryElement()!= null ){
|
||||
result.append("<tr><td class=\"ParsedPage\">\n");
|
||||
result.append("Categories:\n" + invokePrivate("contentElementToHtml",pp.getCategoryElement() ));
|
||||
result.append("</td></tr>\n");
|
||||
}
|
||||
|
||||
//Languages
|
||||
if( pp.getLanguagesElement()!= null ){
|
||||
result.append("<tr><td class=\"ParsedPage\">\n");
|
||||
result.append("Languages:\n" + invokePrivate("contentElementToHtml",pp.getLanguagesElement() ));
|
||||
result.append("</td></tr>\n");
|
||||
}
|
||||
|
||||
//Finalize
|
||||
result.append("</table>\n");
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
static private String invokePrivate(String method,Object arg) {
|
||||
for (Method m:FixedHtmlWriter.class.getDeclaredMethods()) {
|
||||
if (m.getName().equals(method)) {
|
||||
m.setAccessible(true);
|
||||
try {
|
||||
return (String)m.invoke(null, arg);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the userController
|
||||
*/
|
||||
public UserController getUserController() {
|
||||
return userController;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param userController the userController to set
|
||||
*/
|
||||
public void setUserController(UserController userController) {
|
||||
this.userController = userController;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
/*
|
||||
* 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.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.faces.FactoryFinder;
|
||||
import javax.faces.application.ViewExpiredException;
|
||||
import javax.faces.component.UIViewRoot;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.context.FacesContextFactory;
|
||||
import javax.faces.lifecycle.Lifecycle;
|
||||
import javax.faces.lifecycle.LifecycleFactory;
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* VascPageServket
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Nov 29, 2012
|
||||
*/
|
||||
public class VascPageFilter implements Filter {
|
||||
|
||||
|
||||
private Logger logger = null;
|
||||
private String templateFile = null;
|
||||
private ServletContext servletContext = null;
|
||||
|
||||
/**
|
||||
* @see javax.servlet.Filter#destroy()
|
||||
*/
|
||||
public void destroy() {
|
||||
servletContext = null;
|
||||
templateFile = null;
|
||||
logger = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
|
||||
*/
|
||||
public void init(FilterConfig config) throws ServletException {
|
||||
logger = Logger.getLogger(VascPageFilter.class.getName());
|
||||
servletContext = config.getServletContext();
|
||||
templateFile = config.getInitParameter("templateFile");
|
||||
if (templateFile==null) {
|
||||
throw new ServletException("No templateFile init-param found.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
|
||||
*/
|
||||
public void doFilter(ServletRequest servletRequest,ServletResponse servletResponse,FilterChain chain) throws IOException, ServletException {
|
||||
|
||||
HttpServletRequest request = (HttpServletRequest)servletRequest;
|
||||
HttpServletResponse response = (HttpServletResponse)servletResponse;
|
||||
|
||||
// request info
|
||||
String path = request.getRequestURI();
|
||||
String v = "/page/";
|
||||
if (path.contains(v)) {
|
||||
path = path.substring(path.indexOf(v)+v.length());
|
||||
}
|
||||
|
||||
// stuff to fill
|
||||
String pageId = null;
|
||||
String actionName = null;
|
||||
String actionRecordId = null;
|
||||
|
||||
// parse request info
|
||||
//path = path.substring(1); // rm /
|
||||
int index = path.indexOf("/"); // check next /
|
||||
String actionString = null;
|
||||
if (index>0) {
|
||||
actionString = path.substring(index+1);
|
||||
pageId = path.substring(0,index);
|
||||
} else {
|
||||
pageId = path;
|
||||
}
|
||||
|
||||
if (actionString!=null) {
|
||||
index = actionString.indexOf("/");
|
||||
String recordString = null;
|
||||
if (index>0) {
|
||||
recordString = actionString.substring(index+1);
|
||||
actionName = actionString.substring(0,index);
|
||||
} else {
|
||||
actionName = actionString;
|
||||
}
|
||||
if (recordString!=null) {
|
||||
actionRecordId = recordString;
|
||||
}
|
||||
}
|
||||
|
||||
//log
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.log(Level.FINE,"pageId="+pageId+" actionName="+actionName+" actionRecordId="+actionRecordId);
|
||||
}
|
||||
|
||||
// Acquire the FacesContext instance for this request
|
||||
FacesContext facesContext = FacesContext.getCurrentInstance();
|
||||
if (facesContext == null) {
|
||||
FacesContextFactory facesContextFactory = (FacesContextFactory)FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
|
||||
LifecycleFactory lifecycleFactory = (LifecycleFactory)FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
|
||||
Lifecycle lifecycle = lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
|
||||
|
||||
facesContext = facesContextFactory.getFacesContext(servletContext, request, response, lifecycle);
|
||||
ProtectedFacesContext.setFacesContextAsCurrentInstance(facesContext);
|
||||
|
||||
UIViewRoot viewRoot = facesContext.getApplication().getViewHandler().createView(facesContext,pageId+actionName);
|
||||
facesContext.setViewRoot(viewRoot);
|
||||
}
|
||||
|
||||
// add to request attributes
|
||||
request.setAttribute("pageId", pageId);
|
||||
|
||||
// And dispatch to the vasc template file.
|
||||
try {
|
||||
request.getRequestDispatcher(templateFile).forward(request, response);
|
||||
} catch (ViewExpiredException e) {
|
||||
response.sendRedirect(request.getRequestURL().toString()); // lets try again
|
||||
}
|
||||
}
|
||||
|
||||
private abstract static class ProtectedFacesContext extends FacesContext {
|
||||
protected static void setFacesContextAsCurrentInstance(FacesContext facesContext) {
|
||||
FacesContext.setCurrentInstance(facesContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
* 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;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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 active = null;
|
||||
private Boolean sitemap = null;
|
||||
private String roles = null;
|
||||
private List<VascPagePart> pageParts = new ArrayList<VascPagePart>();
|
||||
|
||||
/**
|
||||
* @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 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the pageParts
|
||||
*/
|
||||
public List<VascPagePart> getPageParts() {
|
||||
return pageParts;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param pageParts the pageParts to set
|
||||
*/
|
||||
public void setPageParts(List<VascPagePart> pageParts) {
|
||||
this.pageParts = pageParts;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
/*
|
||||
* 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 Integer pageId = null;
|
||||
private String title = null;
|
||||
private String text = 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 pageId
|
||||
*/
|
||||
public Integer getPageId() {
|
||||
return pageId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param pageId the pageId to set
|
||||
*/
|
||||
public void setPageId(Integer pageId) {
|
||||
this.pageId = pageId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<ejb-jar 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/ejb-jar_3_0.xsd"
|
||||
version="3.0">
|
||||
<!--
|
||||
<enterprise-beans>
|
||||
<session>
|
||||
<ejb-name>loginUserController</ejb-name>
|
||||
<business-local>net.forwardfire.vasc.demo.tech.web.ejb3.LoginUserController$ILocal</business-local>
|
||||
<business-remote>net.forwardfire.vasc.demo.tech.web.ejb3.LoginUserController$ILocal</business-remote>
|
||||
<ejb-class>net.forwardfire.vasc.demo.tech.web.ejb3.LoginUserControllerImpl</ejb-class>
|
||||
<session-type>Stateless</session-type>
|
||||
<transaction-type>Container</transaction-type>
|
||||
</session>
|
||||
</enterprise-beans>
|
||||
-->
|
||||
</ejb-jar>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
|
||||
<properties>
|
||||
<comment>
|
||||
Files to load
|
||||
</comment>
|
||||
<entry key="vascController">openejb:Resource/vasc/server-tech</entry>
|
||||
</properties>
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
#
|
||||
# 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/javax.faces/jsf.js,\
|
||||
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,\
|
||||
jar:/META-INF/resources/org.richfaces/datatable.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
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
net.forwardfire.vasc.demo.tech.web.faces.UrlRewriteConfigurationProvider
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<ejb-jar 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/ejb-jar_3_0.xsd"
|
||||
version="3.0">
|
||||
<enterprise-beans>
|
||||
<session>
|
||||
<ejb-name>vascServiceManager</ejb-name>
|
||||
<business-local>net.forwardfire.vasc.ejb3.VascServiceManagerLocal</business-local>
|
||||
<business-remote>net.forwardfire.vasc.ejb3.VascServiceManagerRemote</business-remote>
|
||||
<ejb-class>net.forwardfire.vasc.ejb3.VascServiceManagerImpl</ejb-class>
|
||||
<session-type>Stateless</session-type>
|
||||
<transaction-type>Container</transaction-type>
|
||||
</session>
|
||||
<session>
|
||||
<ejb-name>clientUserController</ejb-name>
|
||||
<business-local>net.forwardfire.vasc.demo.tech.domain.user.ClientUserControllerLocal</business-local>
|
||||
<business-remote>net.forwardfire.vasc.demo.tech.domain.user.ClientUserControllerRemote</business-remote>
|
||||
<ejb-class>net.forwardfire.vasc.demo.tech.ejb3.ClientUserControllerImpl</ejb-class>
|
||||
<session-type>Stateless</session-type>
|
||||
<transaction-type>Container</transaction-type>
|
||||
</session>
|
||||
<session>
|
||||
<ejb-name>vascMenuController</ejb-name>
|
||||
<business-local>net.forwardfire.vasc.demo.tech.domain.menu.VascMenuControllerLocal</business-local>
|
||||
<business-remote>net.forwardfire.vasc.demo.tech.domain.menu.VascMenuControllerRemote</business-remote>
|
||||
<ejb-class>net.forwardfire.vasc.demo.tech.ejb3.VascMenuControllerImpl</ejb-class>
|
||||
<session-type>Stateless</session-type>
|
||||
<transaction-type>Container</transaction-type>
|
||||
</session>
|
||||
</enterprise-beans>
|
||||
</ejb-jar>
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
<?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>
|
||||
<!-- moved to I18nController because of hard caching resources in jsf impl.
|
||||
<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>I18n map bean as workaround for jsf caching.</description>
|
||||
<managed-bean-name>i18n</managed-bean-name>
|
||||
<managed-bean-class>net.forwardfire.vasc.demo.tech.web.beans.I18nController</managed-bean-class>
|
||||
<managed-bean-scope>application</managed-bean-scope>
|
||||
</managed-bean>
|
||||
|
||||
<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.beans.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 the Pages</description>
|
||||
<managed-bean-name>pageController</managed-bean-name>
|
||||
<managed-bean-class>net.forwardfire.vasc.demo.tech.web.pages.VascPageController</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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -0,0 +1,323 @@
|
|||
<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>
|
||||
<p class="vascButtons">
|
||||
<h:commandButton onclick="document.getElementById('ef:save').click();return false;" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.save']}"/>
|
||||
<h:commandButton onclick="document.getElementById('ef:cancel').click();return false;" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.cancel']}" />
|
||||
</p>
|
||||
</h:form>
|
||||
<h:form>
|
||||
<div class="actiontab">
|
||||
<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>
|
||||
<div class="actiontabline"/>
|
||||
</div>
|
||||
<!--
|
||||
<h:panelGrid columns="1" styleClass="actionbox">
|
||||
<h:outputText value="&nbsp;&nbsp;" escape="false"/>
|
||||
</h:panelGrid>
|
||||
-->
|
||||
</h:form>
|
||||
<h:form id="ef">
|
||||
<h:panelGrid columns="3" id="injectEditFieldsId" styleClass="vascEditBox"/>
|
||||
<p class="vascButtons">
|
||||
<h:commandButton id="save" actionListener="#{entrySupport.saveAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.save']}"/>
|
||||
<h:commandButton id="cancel" 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 class="vascButtons"><!-- 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">
|
||||
<div class="actiontab">
|
||||
<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>
|
||||
<div class="actiontabline"/>
|
||||
</div>
|
||||
<h:panelGrid columns="1" styleClass="actionbox">
|
||||
<h:panelGrid id="itoi" columns="2" columnClasses="itoiOption,itoiOptionValue"/>
|
||||
<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="&nbsp;&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="&nbsp;&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}">
|
||||
<div class="vascSelectAll">
|
||||
<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="&nbsp;&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>
|
||||
</div>
|
||||
</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="&nbsp;&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="&nbsp;&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 class="vascButtons"> <!-- 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:panelGroup>
|
||||
</f:facet>
|
||||
</v:vascEntry>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<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="#{pageController.page.title}" />
|
||||
</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="#{pageController.page.pageParts}">
|
||||
<h2><h:outputText value="#{part.title}"/></h2>
|
||||
<p>
|
||||
<!--
|
||||
<h:outputText value="#{pageController.renderContent(part)}" escape="false"/>
|
||||
-->
|
||||
</p>
|
||||
</ui:repeat>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<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"
|
||||
>
|
||||
<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>
|
||||
</ui:composition>
|
||||
|
|
@ -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"
|
||||
>
|
||||
<div id="body-footer">
|
||||
<div id="body-footer-content">
|
||||
<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>
|
||||
</div>
|
||||
</ui:composition>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<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"
|
||||
>
|
||||
<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>
|
||||
</ui:composition>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<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"
|
||||
>
|
||||
<div id="page-body-login">
|
||||
<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>
|
||||
</ui:composition>
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
<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"
|
||||
>
|
||||
<div id="body-deco-menu">
|
||||
<h:panelGroup rendered="#{not empty menuController.mainMenu0}">
|
||||
<div class="body-deco-menu-group">
|
||||
<h4>
|
||||
<span><h:outputText value="#{i18n['menu.mainMenu0.title']}"/></span>
|
||||
</h4>
|
||||
<ul>
|
||||
<ui:repeat var="menu" value="#{menuController.mainMenu0}">
|
||||
<li><a href="#{contextPathController.rootPath}#{menu.href}" target="#{menu.target}" title="#{menu.title}">#{menu.title}</a></li>
|
||||
</ui:repeat>
|
||||
</ul>
|
||||
</div>
|
||||
</h:panelGroup>
|
||||
<h:panelGroup rendered="#{not empty menuController.mainMenu1}">
|
||||
<div class="body-deco-menu-group">
|
||||
<h4>
|
||||
<span><h:outputText value="#{i18n['menu.mainMenu1.title']}"/></span>
|
||||
</h4>
|
||||
<ul>
|
||||
<ui:repeat var="menu" value="#{menuController.mainMenu1}">
|
||||
<li><a href="#{contextPathController.rootPath}#{menu.href}" target="#{menu.target}" title="#{menu.title}">#{menu.title}</a></li>
|
||||
</ui:repeat>
|
||||
</ul>
|
||||
</div>
|
||||
</h:panelGroup>
|
||||
<h:panelGroup rendered="#{not empty menuController.mainMenu2}">
|
||||
<div class="body-deco-menu-group">
|
||||
<h4>
|
||||
<span><h:outputText value="#{i18n['menu.mainMenu2.title']}"/></span>
|
||||
</h4>
|
||||
<ul>
|
||||
<ui:repeat var="menu" value="#{menuController.mainMenu2}">
|
||||
<li><a href="#{contextPathController.rootPath}#{menu.href}" target="#{menu.target}" title="#{menu.title}">#{menu.title}</a></li>
|
||||
</ui:repeat>
|
||||
</ul>
|
||||
</div>
|
||||
</h:panelGroup>
|
||||
<ui:repeat var="menuGroup" value="#{menuController.vascMenuGroup}">
|
||||
<div class="body-deco-menu-group">
|
||||
<h4>
|
||||
<span><h:outputText value="#{i18n[menuGroup.titleKey]}"/></span>
|
||||
</h4>
|
||||
<ul>
|
||||
<ui:repeat var="menu" value="#{menuGroup.menus}">
|
||||
<li><a href="#{contextPathController.rootPath}/vasc/#{menu.vascEntryId}/list.jsf" title="#{i18n[menu.titleKey]}">#{i18n[menu.titleKey]}</a></li>
|
||||
</ui:repeat>
|
||||
</ul>
|
||||
</div>
|
||||
</ui:repeat>
|
||||
</div>
|
||||
</ui:composition>
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<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"
|
||||
>
|
||||
<f:view>
|
||||
<div id="body-view">
|
||||
<ui:insert name="main_body_login">
|
||||
<ui:include src="/WEB-INF/template/structure/main-body-login.xhtml"/>
|
||||
</ui:insert>
|
||||
<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-container">
|
||||
<ui:insert name="main_body_menu">
|
||||
<ui:include src="/WEB-INF/template/structure/main-body-menu.xhtml"/>
|
||||
</ui:insert>
|
||||
<ui:insert name="main_body_decorator">
|
||||
<ui:include src="/WEB-INF/template/structure/main-body-decorator.xhtml"/>
|
||||
</ui:insert>
|
||||
<div id="body-content">
|
||||
<h1><ui:insert name="page_title"/></h1>
|
||||
<h:messages globalOnly="true" />
|
||||
<ui:insert name="page_content"/>
|
||||
</div>
|
||||
<ui:insert name="main_body_footer">
|
||||
<ui:include src="/WEB-INF/template/structure/main-body-footer.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>
|
||||
|
|
@ -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: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>
|
||||
<ui:insert name="main_head_icon">
|
||||
<link rel="icon" href="#{contextPathController.rootPath}/img/favicon.ico"/>
|
||||
</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>
|
||||
|
|
@ -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>
|
||||
305
vasc-demo/vasc-demo-tech-web/src/main/webapp/WEB-INF/web.xml
Normal file
305
vasc-demo/vasc-demo-tech-web/src/main/webapp/WEB-INF/web.xml
Normal file
|
|
@ -0,0 +1,305 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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_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>/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-role>
|
||||
<role-name>user</role-name>
|
||||
</security-role>
|
||||
<security-role>
|
||||
<role-name>admin-company</role-name>
|
||||
</security-role>
|
||||
<security-role>
|
||||
<role-name>admin-system</role-name>
|
||||
</security-role>
|
||||
<security-role>
|
||||
<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>
|
||||
<filter-name>userFilter</filter-name>
|
||||
<filter-class>net.forwardfire.vasc.demo.tech.web.filters.UserFilter</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>userFilter</filter-name>
|
||||
<servlet-name>facesServlet</servlet-name>
|
||||
<dispatcher>REQUEST</dispatcher>
|
||||
</filter-mapping>
|
||||
-->
|
||||
|
||||
<!-- =============== CONFIG =================================== -->
|
||||
|
||||
<!-- JSF 2.0 -->
|
||||
<listener>
|
||||
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<context-param>
|
||||
<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.FACELETS_SKIP_COMMENTS</param-name>
|
||||
<param-value>true</param-value>
|
||||
</context-param>
|
||||
<servlet>
|
||||
<servlet-name>facesServlet</servlet-name>
|
||||
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>facesServlet</servlet-name>
|
||||
<url-pattern>*.jsf</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<!-- Richfaces -->
|
||||
|
||||
<context-param>
|
||||
<param-name>org.richfaces.enableControlSkinning</param-name>
|
||||
<param-value>false</param-value>
|
||||
</context-param>
|
||||
|
||||
<!-- Jawr -->
|
||||
|
||||
<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>
|
||||
|
||||
<!-- 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>/WEB-INF/template/page-vasc.jsf</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>vascControllerProvider</param-name>
|
||||
<param-value>java:comp/env/vasc/server-tech@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>
|
||||
</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>java:comp/env/vasc/server-tech@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-mapping>
|
||||
<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>java:comp/env/vasc/server-tech@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>
|
||||
|
||||
|
||||
<!-- Page Filter -->
|
||||
<filter>
|
||||
<display-name>Page Filter</display-name>
|
||||
<filter-name>pageFilter</filter-name>
|
||||
<filter-class>net.forwardfire.vasc.demo.tech.web.pages.VascPageFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>templateFile</param-name>
|
||||
<param-value>/WEB-INF/template/page-wiki.jsf</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>pageFilter</filter-name>
|
||||
<url-pattern>/page/*</url-pattern>
|
||||
<dispatcher>REQUEST</dispatcher>
|
||||
</filter-mapping>
|
||||
|
||||
<!-- Add header tags -->
|
||||
|
||||
<filter>
|
||||
<filter-name>ExpiresFilter</filter-name>
|
||||
<filter-class>org.apache.catalina.filters.ExpiresFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>ExpiresExcludedResponseStatusCodes</param-name>
|
||||
<param-value>302, 304, 500, 503</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>ExpiresByType image</param-name>
|
||||
<param-value>access plus 10 weeks</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>ExpiresByType text/css</param-name>
|
||||
<param-value>access plus 10 weeks</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>ExpiresByType application/javascript</param-name>
|
||||
<param-value>access plus 10 weeks</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>ExpiresFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
<dispatcher>REQUEST</dispatcher>
|
||||
</filter-mapping>
|
||||
|
||||
<!-- Remote ejb -->
|
||||
|
||||
<servlet>
|
||||
<servlet-name>EjbServerServlet</servlet-name>
|
||||
<servlet-class>org.apache.openejb.server.httpd.ServerServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>EjbServerServlet</servlet-name>
|
||||
<url-pattern>/ejb/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
</web-app>
|
||||
19
vasc-demo/vasc-demo-tech-web/src/main/webapp/css/html.css
Normal file
19
vasc-demo/vasc-demo-tech-web/src/main/webapp/css/html.css
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
* {
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin-left:1em;
|
||||
padding-left:1em;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
object, embed {
|
||||
outline:0;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
|
||||
|
||||
body {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
#body-container {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#body-content {
|
||||
margin-left: 210px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#body-clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#page-header {
|
||||
height: 1.5em;
|
||||
}
|
||||
|
||||
#page-header-left {
|
||||
float:left;
|
||||
margin-left: 210px;
|
||||
}
|
||||
|
||||
#page-header-right {
|
||||
float:right;
|
||||
}
|
||||
|
||||
#page-header-left,#page-header-right {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
#page-body-login {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
#body-deco-logo {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 40px;
|
||||
}
|
||||
|
||||
#body-deco-menu {
|
||||
position: absolute;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
#body-footer {
|
||||
margin-left: 210px;
|
||||
}
|
||||
|
||||
#body-footer-content {
|
||||
padding: 5px;
|
||||
margin-left:20em;
|
||||
margin-right:20em;
|
||||
margin-top:1em;
|
||||
}
|
||||
|
|
@ -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 {
|
||||
}
|
||||
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
|
||||
|
||||
body {
|
||||
font-size:85%;
|
||||
font-family: Georgia, serif;
|
||||
color: #462102;
|
||||
background-image: url(/demo/img/skin/default/body-bg.jpg);
|
||||
}
|
||||
|
||||
#body-content {
|
||||
min-height: 400px;
|
||||
border: 1px solid #ccc;
|
||||
border-bottom-left-radius:5px;
|
||||
border-bottom-right-radius:5px;
|
||||
background-image: url(/demo/img/skin/default/body-view-bg.png);
|
||||
}
|
||||
|
||||
#page-body-login {
|
||||
text-align: center;
|
||||
height: 28px;
|
||||
width: 198px;
|
||||
padding-top: 7px;
|
||||
border: 1px solid #BBBBBB;
|
||||
border-top: none;
|
||||
border-bottom-left-radius:5px;
|
||||
border-bottom-right-radius:5px;
|
||||
background-image: url(/demo/img/skin/default/body-view-bg.png);
|
||||
}
|
||||
|
||||
#page-header-left a,#page-header-right a {
|
||||
padding:10px;
|
||||
padding-bottom:5px;
|
||||
}
|
||||
#page-header-left a,#page-header-right a {
|
||||
background-color:#DDCCCC;
|
||||
font-weight:bold;
|
||||
border-top-left-radius:5px;
|
||||
border-top-right-radius:5px;
|
||||
}
|
||||
#page-header-left a {
|
||||
margin-right: 3px;
|
||||
}
|
||||
#page-header-right a {
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
#body-footer {
|
||||
margin-top: 10px;
|
||||
border: 1px solid #BBBBBB;
|
||||
border-radius:5px;
|
||||
background-image: url(/demo/img/skin/default/body-view-bg.png);
|
||||
}
|
||||
|
||||
#body-footer-content {
|
||||
text-align:center;
|
||||
font-size:80%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
h1 {
|
||||
padding: 0;
|
||||
font-style: italic;
|
||||
color: #2d1100;
|
||||
font-size: xx-large;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-style: italic;
|
||||
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: 4px;
|
||||
}
|
||||
|
||||
.body-deco-menu-group {
|
||||
padding:5px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 10px;
|
||||
border-radius:5px;
|
||||
border: 1px solid #BBBBBB;
|
||||
background-image: url(/demo/img/skin/default/body-view-bg.png);
|
||||
}
|
||||
|
||||
.body-deco-menu-group ul {
|
||||
margin-left: 5px;
|
||||
padding-left: 0px;
|
||||
list-style:none;
|
||||
font-size:80%;
|
||||
}
|
||||
|
||||
.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,.vascEditBox, ul.actionboxtab li a.active,.rf-p-hdr,.actiontabline {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
|
||||
|
||||
.vascEditBox {
|
||||
background-color:#DDCCCC;
|
||||
border-radius:3px;
|
||||
border-top-left-radius:0;
|
||||
border:none;
|
||||
clear:both;
|
||||
padding-left:5px;
|
||||
padding-right:5px;
|
||||
padding-top:15px;
|
||||
padding-bottom:15px;
|
||||
}
|
||||
|
||||
.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;
|
||||
color:#000;
|
||||
margin-left:5px;
|
||||
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;}
|
||||
|
||||
|
||||
.itoiOption {
|
||||
text-align: right;
|
||||
padding: 1px;
|
||||
}
|
||||
.itoiOptionValue {
|
||||
text-align: left;
|
||||
padding: 1px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.vascButtons {
|
||||
padding: 5px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.actiontab {
|
||||
display:block;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.actiontabline {
|
||||
display:block;
|
||||
float:left;
|
||||
background-color:#DDCCCC;
|
||||
width:100%;
|
||||
height:5px;
|
||||
border-top-left-radius:3px;
|
||||
}
|
||||
|
||||
.vascSelectAll {
|
||||
padding-left: 5px;
|
||||
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: normal;
|
||||
}
|
||||
|
||||
.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:bold;
|
||||
padding:6px 15px;
|
||||
display: block;
|
||||
text-align:left;
|
||||
margin-bottom:5px;
|
||||
}
|
||||
|
||||
.table_options_bottom {
|
||||
border-bottom-left-radius:3px;
|
||||
border-bottom-right-radius:3px;
|
||||
background-color:#DDCCCC;
|
||||
font-size:12px;
|
||||
font-weight:bold;
|
||||
padding:6px 15px;
|
||||
display: block;
|
||||
text-align:left;
|
||||
margin-top:5px;
|
||||
}
|
||||
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
body {
|
||||
color: #00FF00;
|
||||
}
|
||||
|
||||
|
||||
|
||||
input:hover,textarea:hover,select:hover{
|
||||
border: 2px solid rgba(10, 224, 64, 0.6);
|
||||
}
|
||||
|
||||
.even {
|
||||
background-color:rgba(70, 18, 60, 0.6);
|
||||
}
|
||||
|
||||
.odd {
|
||||
background-color:rgba(180, 230, 12, 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(18, 247, 82, 0.6);
|
||||
}
|
||||
|
||||
.table_options_bottom, .table_options_top, .actionbox, ul.actionboxtab li a.active,.rf-p-hdr,.actiontabline {
|
||||
background-color:rgba(00, 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(65, 18, 33, 0.6);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
|
||||
/* No theme */
|
||||
|
||||
|
|
@ -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>
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
<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>
|
||||
<ul>
|
||||
<li><h:outputLink value="#{contextPathController.rootPath}/vasc/VascEntry/list.jsf"><h:outputText value="VascEnties"/></h:outputLink></li>
|
||||
<li><h:outputLink value="#{contextPathController.rootPath}/_css/default/jawr/default.css?refreshKey=jawr_refresh"><h:outputText value="Refresh JS/CSS"/></h:outputLink></li>
|
||||
<li><h:outputLink value="#{contextPathController.rootPath}/html/admin/debug-style.jsf"><h:outputText value="Debug Style"/></h:outputLink></li>
|
||||
</ul>
|
||||
</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/java"><h:outputText value="Jndi Tree Java"/></h:outputLink>
|
||||
-(<h:outputLink value="#{contextPathController.rootPath}/debug/jndi/view/java?type=text"><h:outputText value="text"/></h:outputLink>)
|
||||
</li>
|
||||
<li>
|
||||
<h:outputLink value="#{contextPathController.rootPath}/debug/jndi/view/global"><h:outputText value="Jndi Tree Global"/></h:outputLink>
|
||||
-(<h:outputLink value="#{contextPathController.rootPath}/debug/jndi/view/global?type=text"><h:outputText value="text"/></h:outputLink>)
|
||||
</li>
|
||||
<li>
|
||||
<h:outputLink value="#{contextPathController.rootPath}/debug/jndi/view/openejb"><h:outputText value="Jndi Tree OpenEjb"/></h:outputLink>
|
||||
-(<h:outputLink value="#{contextPathController.rootPath}/debug/jndi/view/openejb?type=text"><h:outputText value="text"/></h:outputLink>)
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3><span><h:outputText value="Jdbc" /></span></h3>
|
||||
<p>Raw access to the embedded db.</p>
|
||||
<p>
|
||||
<ul>
|
||||
<li>
|
||||
<h:outputLink value="#{contextPathController.rootPath}/debug/jdbc/console/"><h:outputText value="(H2) Jdbc Console"/></h:outputLink>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</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>
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
<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="2" id="grid" width="60%">
|
||||
<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>
|
||||
<br/>
|
||||
</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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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_username').focus();
|
||||
</script>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<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">
|
||||
<p>Welcome to the vasc tech demo.</p>
|
||||
<p>Please login to see more options.</p>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
|
|
@ -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>
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<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>
|
||||
<p>Select theme</p>
|
||||
<ul>
|
||||
<li><a href="/" onclick="JAWR.skin.switchToStyle('default');window.location.reload();return false;">Default</a></li>
|
||||
<li><a href="/" onclick="JAWR.skin.switchToStyle('notheme');window.location.reload();return false;">No Thema</a></li>
|
||||
<li><a href="/" onclick="JAWR.skin.switchToStyle('green');window.location.reload();return false;">Green</a></li>
|
||||
</ul>
|
||||
</rich:panel>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
BIN
vasc-demo/vasc-demo-tech-web/src/main/webapp/img/favicon.ico
Normal file
BIN
vasc-demo/vasc-demo-tech-web/src/main/webapp/img/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 258 B |
Binary file not shown.
|
After Width: | Height: | Size: 175 B |
BIN
vasc-demo/vasc-demo-tech-web/src/main/webapp/img/icon_print.png
Normal file
BIN
vasc-demo/vasc-demo-tech-web/src/main/webapp/img/icon_print.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 172 B |
BIN
vasc-demo/vasc-demo-tech-web/src/main/webapp/img/logo.png
Normal file
BIN
vasc-demo/vasc-demo-tech-web/src/main/webapp/img/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
10
vasc-demo/vasc-demo-tech-web/src/main/webapp/js/vasc-jsf.js
Normal file
10
vasc-demo/vasc-demo-tech-web/src/main/webapp/js/vasc-jsf.js
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue