This commit is contained in:
Socrates
2020-05-26 10:29:34 +02:00
commit 9ed0f2a056
1162 changed files with 162062 additions and 0 deletions

56
web/META-INF/context.xml Normal file
View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context reloadable="true">
<JarScanner scanClassPath="false" />
<!--
To define the access to your database uncomment the corresponding one
from the below configurations. If you don't find the yours, look in
internet for the JDBC URL and driver class for your database and define
your own Resource entry.
You have to adapt the URL to match your server, and maybe the port.
You have to define the correct user name and password for your database.
Moreover, you have to copy the JDBC driver (a jar file) corresponding to
your database, to the lib folder of your Tomcat, or if you're in development
add the jar to your project Java Build Path using Eclipse:
Right button on your project > Properties > Java Build Path > Libraries
-->
<!-- HSQLDB -->
<Resource name="jdbc/BabydatenbankDS" auth="Container" type="javax.sql.DataSource"
maxTotal="20" maxIdle="5" maxWaitMillis="10000"
username="sa" password="" driverClassName="org.hsqldb.jdbcDriver"
url="jdbc:hsqldb:hsql://localhost:1666"/>
<!-- MySQL
<Resource name="jdbc/BabydatenbankDS" auth="Container" type="javax.sql.DataSource"
maxTotal="20" maxIdle="5" maxWaitMillis="10000"
username="root" password="" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/"/>
-->
<!-- PostgreSQL
<Resource name="jdbc/BabydatenbankDS" auth="Container" type="javax.sql.DataSource"
maxTotal="20" maxIdle="5" maxWaitMillis="10000"
username="postgres" password="" driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost/"/>
-->
<!-- Oracle
<Resource name="jdbc/BabydatenbankDS" auth="Container" type="javax.sql.DataSource"
maxTotal="20" maxIdle="5" maxWaitMillis="10000"
username="user" password="" driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@localhost:1521:XE"/>
-->
<!-- AS/400
<Resource name="jdbc/BabydatenbankDS" auth="Container" type="javax.sql.DataSource"
maxTotal="20" maxIdle="5" maxWaitMillis="10000"
username="user" password="" driverClassName="org.hibernate.dialect.DB2400Dialect"
url="jdbc:as400:localhost"/>
-->
</Context>

1
web/WEB-INF/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/classes/

42
web/WEB-INF/dwr.xml Normal file
View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://directwebremoting.org/schema/dwr20.dtd">
<dwr>
<allow>
<create creator="new" javascript="Module">
<param name="class" value="org.openxava.web.dwr.Module"/>
</create>
<create creator="new" javascript="Tab">
<param name="class" value="org.openxava.web.dwr.Tab"/>
</create>
<create creator="new" javascript="View">
<param name="class" value="org.openxava.web.dwr.View"/>
</create>
<create creator="new" javascript="Modules">
<param name="class" value="com.openxava.naviox.web.dwr.Modules"/>
</create>
<create creator="new" javascript="Folders">
<param name="class" value="com.openxava.naviox.web.dwr.Folders"/>
</create>
<create creator="new" javascript="PhoneList">
<param name="class" value="com.openxava.phone.web.dwr.PhoneList"/>
</create>
<create creator="new" javascript="Discussion">
<param name="class" value="org.openxava.web.dwr.Discussion"/>
</create>
<convert converter="bean" match="org.openxava.web.dwr.Result"/>
<convert converter="bean" match="org.openxava.web.dwr.StrokeAction"/>
</allow>
</dwr>

Binary file not shown.

Binary file not shown.

99
web/WEB-INF/fonts/LICENSE Normal file
View File

@@ -0,0 +1,99 @@
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below)
Bitstream Vera Fonts Copyright
------------------------------
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
a trademark of Bitstream, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of the fonts accompanying this license ("Fonts") and associated
documentation files (the "Font Software"), to reproduce and distribute the
Font Software, including without limitation the rights to use, copy, merge,
publish, distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to the
following conditions:
The above copyright and trademark notices and this permission notice shall
be included in all copies of one or more of the Font Software typefaces.
The Font Software may be modified, altered, or added to, and in particular
the designs of glyphs or characters in the Fonts may be modified and
additional glyphs or characters may be added to the Fonts, only if the fonts
are renamed to names not containing either the words "Bitstream" or the word
"Vera".
This License becomes null and void to the extent applicable to Fonts or Font
Software that has been modified and is distributed under the "Bitstream
Vera" names.
The Font Software may be sold as part of a larger software package but no
copy of one or more of the Font Software typefaces may be sold by itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
FONT SOFTWARE.
Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font Software
without prior written authorization from the Gnome Foundation or Bitstream
Inc., respectively. For further information, contact: fonts at gnome dot
org.
Arev Fonts Copyright
------------------------------
Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the fonts accompanying this license ("Fonts") and
associated documentation files (the "Font Software"), to reproduce
and distribute the modifications to the Bitstream Vera Font Software,
including without limitation the rights to use, copy, merge, publish,
distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to
the following conditions:
The above copyright and trademark notices and this permission notice
shall be included in all copies of one or more of the Font Software
typefaces.
The Font Software may be modified, altered, or added to, and in
particular the designs of glyphs or characters in the Fonts may be
modified and additional glyphs or characters may be added to the
Fonts, only if the fonts are renamed to names not containing either
the words "Tavmjong Bah" or the word "Arev".
This License becomes null and void to the extent applicable to Fonts
or Font Software that has been modified and is distributed under the
"Tavmjong Bah Arev" names.
The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Except as contained in this notice, the name of Tavmjong Bah shall not
be used in advertising or otherwise to promote the sale, use or other
dealings in this Font Software without prior written authorization
from Tavmjong Bah. For further information, contact: tavmjong @ free
. fr.
$Id: LICENSE,v 1.5 2011-06-17 11:37:00 javierpaniza Exp $

Binary file not shown.

BIN
web/WEB-INF/lib/addons.jar Normal file

Binary file not shown.

BIN
web/WEB-INF/lib/antlr.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
web/WEB-INF/lib/dom4j.jar Normal file

Binary file not shown.

BIN
web/WEB-INF/lib/dsn.jar Normal file

Binary file not shown.

BIN
web/WEB-INF/lib/dwr.jar Normal file

Binary file not shown.

BIN
web/WEB-INF/lib/ejb.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
web/WEB-INF/lib/imap.jar Normal file

Binary file not shown.

BIN
web/WEB-INF/lib/itext.jar Normal file

Binary file not shown.

BIN
web/WEB-INF/lib/jandex.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
web/WEB-INF/lib/jpa.jar Normal file

Binary file not shown.

BIN
web/WEB-INF/lib/jsoup.jar Normal file

Binary file not shown.

BIN
web/WEB-INF/lib/jstl.jar Normal file

Binary file not shown.

BIN
web/WEB-INF/lib/jta.jar Normal file

Binary file not shown.

BIN
web/WEB-INF/lib/mailapi.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
web/WEB-INF/lib/poi.jar Normal file

Binary file not shown.

BIN
web/WEB-INF/lib/pop3.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
web/WEB-INF/lib/smtp.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

200
web/WEB-INF/openxava.tld Normal file
View File

@@ -0,0 +1,200 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>OpenXava</shortname>
<uri></uri>
<info>OpenXava tag library</info>
<tag>
<name>link</name>
<tagclass>org.openxava.web.taglib.LinkTag</tagclass>
<bodycontent>JSP</bodycontent>
<info>JavaScript link to execute xava action</info>
<attribute>
<name>action</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>argv</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>cssClass</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>cssStyle</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>button</name>
<tagclass>org.openxava.web.taglib.ButtonTag</tagclass>
<bodycontent>empty</bodycontent>
<info>JavaScript button to execute xava action</info>
<attribute>
<name>action</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>image</name>
<tagclass>org.openxava.web.taglib.ImageTag</tagclass>
<bodycontent>empty</bodycontent>
<info>JavaScript image to execute xava action</info>
<attribute>
<name>action</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>argv</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>cssClass</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>cssStyle</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>action</name>
<tagclass>org.openxava.web.taglib.ActionTag</tagclass>
<bodycontent>JSP</bodycontent>
<info>Link or Image with javascript to execute a xava action</info>
<attribute>
<name>action</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>argv</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>editor</name>
<tagclass>org.openxava.web.taglib.EditorTag</tagclass>
<bodycontent>empty</bodycontent>
<info>Display the appropriate editor for the specified property</info>
<attribute>
<name>property</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>editable</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>throwPropertyChanged</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>message</name>
<tagclass>org.openxava.web.taglib.MessageTag</tagclass>
<bodycontent>empty</bodycontent>
<info>Shows the message from key using XavaResources class for obtaining translation</info>
<attribute>
<name>key</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>param</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>param1</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>param2</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>param3</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>param4</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>intParam</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>label</name>
<tagclass>org.openxava.web.taglib.LabelTag</tagclass>
<bodycontent>empty</bodycontent>
<info>Shows the label from key using Labels class for obtaining translation</info>
<attribute>
<name>key</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>descriptionsList</name>
<tagclass>org.openxava.web.taglib.DescriptionsListTag</tagclass>
<bodycontent>empty</bodycontent>
<info>Display a reference in descriptions list (combo) format</info>
<attribute>
<name>reference</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>readOnlyAsLabel</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>id</name>
<tagclass>org.openxava.web.taglib.IdTag</tagclass>
<bodycontent>empty</bodycontent>
<info>Generates an id suitable for HTML parts. Used internally by OpenXava</info>
<attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>

212
web/WEB-INF/web.xml Normal file
View File

@@ -0,0 +1,212 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
DO NOT EDIT THIS FILE.
To add your own servlets, listeners and filters use the servlet
annotations @WebServlet, @WebFilter and @WebListener.
If you want to add your own resources add them in resources.xml file in WEB-INF.
resources.xml must be in WEB-INF and can have several <resource-ref> elements.
For backward compatibility we still support the use of servlets.xml, filters.xml and listeners.xml:
If you want to add your own servlets add them in servlets.xml file.
servlets.xml must be in WEB-INF and can have several <servlet> and <servlet-mapping>.
If you want to add filters add them in filters.xml file in WEB-INF.
filters.xml must be in WEB-INF and can have several <filter> and <filter-mapping>.
If you want to add filters add them in listeners.xml file in WEB-INF.
filters.xml must be in WEB-INF and can have several <listener>.
-->
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>OpenXava Application</display-name>
<!-- Addons filters begin -->
<filter>
<filter-name>naviox</filter-name>
<filter-class>com.openxava.naviox.web.NaviOXFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>naviox</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>naviox</filter-name>
<url-pattern>/modules/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>naviox</filter-name>
<url-pattern>/phone/index.jsp</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>naviox</filter-name>
<servlet-name>naviox</servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>naviox</filter-name>
<servlet-name>module</servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>naviox</filter-name>
<servlet-name>phone</servlet-name>
</filter-mapping>
<!-- Addons filters end -->
<!-- Apart of these servlets OpenXava has more servlets defined in code with @WebServlet -->
<servlet>
<servlet-name>images</servlet-name>
<servlet-class>org.openxava.web.servlets.ImagesServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>gallery</servlet-name>
<servlet-class>org.openxava.web.servlets.GalleryServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>jasperReport</servlet-name>
<servlet-class>org.openxava.web.servlets.JasperReportServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>generatePDFReport</servlet-name>
<servlet-class>org.openxava.web.servlets.GenerateReportServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>generateExcelReport</servlet-name>
<servlet-class>org.openxava.web.servlets.GenerateReportServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>generateCustomReport</servlet-name>
<servlet-class>org.openxava.web.servlets.GenerateCustomReportServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>generateSimpleHTMLReport</servlet-name>
<servlet-class>org.openxava.web.servlets.GenerateSimpleHTMLReportServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>generateConcatReport</servlet-name>
<servlet-class>org.openxava.web.servlets.GenerateConcatReportServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>generateCustomXLSReport</servlet-name>
<servlet-class>org.openxava.web.servlets.ReportXLSServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>files</servlet-name>
<servlet-class>org.openxava.web.servlets.FilesServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>naviox</servlet-name>
<servlet-class>com.openxava.naviox.web.NaviOXServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>phone</servlet-name>
<servlet-class>com.openxava.phone.web.PhoneServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>organization</servlet-name>
<servlet-class>com.openxava.naviox.web.OrganizationServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>dwrInvoker</servlet-name>
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>crossDomainSessionSecurity</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>12</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>naviox</servlet-name>
<url-pattern>/modules/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>images</servlet-name>
<url-pattern>/xava/ximage</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>images</servlet-name>
<url-pattern>/ximage</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>gallery</servlet-name>
<url-pattern>/xava/gallery</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>jasperReport</servlet-name>
<url-pattern>/xava/jasperReport</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>generatePDFReport</servlet-name>
<url-pattern>/xava/list.pdf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>generateExcelReport</servlet-name>
<url-pattern>/xava/list.csv</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>generateExcelReport</servlet-name>
<url-pattern>/xava/list.xls</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>generateCustomReport</servlet-name>
<url-pattern>/xava/report.pdf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>generateSimpleHTMLReport</servlet-name>
<url-pattern>/xava/report.html</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>generateConcatReport</servlet-name>
<url-pattern>/xava/concatReport.pdf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>generateCustomXLSReport</servlet-name>
<url-pattern>/xava/report.xls</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>files</servlet-name>
<url-pattern>/xava/xfile</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>naviox</servlet-name>
<url-pattern>/m/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>phone</servlet-name>
<url-pattern>/p/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>organization</servlet-name>
<url-pattern>/o/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dwrInvoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<mime-mapping>
<extension>jnlp</extension>
<mime-type>application/x-java-jnlp-file</mime-type>
</mime-mapping>
</web-app>

25
web/index.jsp Normal file
View File

@@ -0,0 +1,25 @@
<%@page import="com.openxava.naviox.util.Organizations"%>
<%@page import="org.openxava.web.Browsers"%>
<%@page import="org.openxava.util.Users"%>
<jsp:useBean id="modules" class="com.openxava.naviox.Modules" scope="session"/>
<%
Users.setCurrent(request);
if (Users.getCurrent() != null || Organizations.getCurrent(request) != null) {
String module = Users.getCurrent() == null?"SignIn":modules.getCurrent(request);
String url = Browsers.isMobile(request) && !"Index".equals(modules.getCurrent(request))?"phone":"m/" + module;
%>
<script type="text/javascript">
window.location="<%=url%>";
</script>
<%
}
else {
%>
<jsp:include page="naviox/welcome.jsp"/>
<%
}
%>

View File

@@ -0,0 +1,52 @@
<%@ include file="../../xava/imports.jsp"%>
<%@ page import="org.openxava.model.meta.MetaProperty" %>
<%@ page import="org.openxava.view.View" %>
<%@ page import="org.openxava.application.meta.MetaApplications" %>
<%@ page import="org.openxava.application.meta.MetaModule" %>
<%@ page import="org.openxava.controller.meta.MetaControllers" %>
<%@ page import="org.openxava.controller.meta.MetaController" %>
<%@ page import="org.openxava.controller.meta.MetaAction" %>
<jsp:useBean id="style" class="org.openxava.web.style.Style" scope="request"/>
<jsp:useBean id="context" class="org.openxava.controller.ModuleContext" scope="session"/>
<%@ include file="commonDefinitions.jsp" %>
<table width="100%"><tr>
<%
java.util.Collection actions = java.util.Arrays.asList(fvalues);
int i=0;
for (Object ocontroller: module.getControllersNames()) {
MetaController controller = MetaControllers.getMetaController((String) ocontroller);
for (Object oaction: controller.getAllNotHiddenMetaActionsRecursive()) {
MetaAction action = (MetaAction) oaction;
if (action.getMetaController().getName().equals("Navigation")) continue;
String checked = actions.contains(action.getQualifiedName())?"checked='true'":"";
%>
<td>
<INPUT name="<%=propertyKey%>" type="checkbox" class="<%=style.getEditor()%>"
tabindex="1"
value="<%=action.getQualifiedName()%>"
<%=checked%>
<%=disabled%>
<%=script%>
/>
<%=action.getLabel()%>
<% if (++i % 4 == 0) { %></tr><tr><% } %>
</td>
<%
}
}
%>
<%@ include file="collectionActions.jsp" %>
</tr></table>
<%
if (!editable) {
for (i=0; i<fvalues.length; i++) {
%>
<input type="hidden" name="<%=propertyKey%>" value="<%=fvalues[i]%>">
<%
}
}
%>

View File

@@ -0,0 +1,79 @@
<%@ page import="org.openxava.model.meta.MetaModel" %>
<%@ page import="org.openxava.model.meta.MetaMember" %>
<%@ page import="org.openxava.view.meta.MetaCollectionView"%>
<%@ page import="org.openxava.view.meta.MetaView"%>
<%@ page import="org.openxava.util.Is" %>
<%@ page import="org.openxava.util.Labels"%>
<%@ page import="org.openxava.util.Strings"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.Collection"%>
<%@ page import="java.util.Iterator"%>
<%
String viewName = module.getViewName();
MetaModel model = MetaModel.get(module.getModelName());
java.util.Collection<String> collectionNames = model.getColectionsNames();
MetaView metaView = viewName == null ? model.getMetaViewByDefault() : model.getMetaView(viewName);
for (String collectionName : collectionNames) {
MetaCollectionView mcv = metaView.getMetaCollectionView(collectionName);
if (mcv == null) continue;
String prefix = collectionName + ":";
String collectionLabel = Labels.get(collectionName) + ": ";
Collection<String> actionNames = new ArrayList<String>();
actionNames.add(prefix + (Is.emptyString(mcv.getNewActionName()) ? "Collection.new" : mcv.getNewActionName()));
actionNames.add(prefix + (Is.emptyString(mcv.getAddActionName()) ? "Collection.add" : mcv.getAddActionName()));
actionNames.add(prefix + (Is.emptyString(mcv.getHideActionName()) ? "Collection.hideDetail" : mcv.getHideActionName()));
actionNames.add(prefix + (Is.emptyString(mcv.getSaveActionName()) ? "Collection.save" : mcv.getSaveActionName())); // saveAndStay?
actionNames.add(prefix + (Is.emptyString(mcv.getRemoveActionName()) ? "Collection.remove" : mcv.getRemoveActionName()));
actionNames.add(prefix + (Is.emptyString(mcv.getEditActionName()) ? "Collection.edit" : mcv.getEditActionName()));
actionNames.add(prefix + (Is.emptyString(mcv.getRemoveSelectedActionName()) ? "Collection.removeSelected" : mcv.getRemoveSelectedActionName()));
if (!Is.emptyString(mcv.getOnSelectElementActionName())) actionNames.add(prefix + mcv.getOnSelectElementActionName());
for (String listAction : (Collection<String>) mcv.getActionsListNames()) actionNames.add(prefix + listAction);
MetaController controller = MetaControllers.getMetaController("DefaultListActionsForCollections");
for (Iterator<MetaAction> it = controller.getAllMetaActions().iterator(); it.hasNext();) {
MetaAction action = it.next();
if (action.isHidden()) continue;
actionNames.add(prefix + action.getQualifiedName());
}
for (String subController : (Collection<String>) mcv.getSubcontrollersListNames()) {
controller = MetaControllers.getMetaController(subController);
for (Iterator<MetaAction> it = controller.getAllMetaActions().iterator(); it.hasNext();) {
MetaAction action = it.next();
if (action.isHidden()) continue;
actionNames.add(prefix + action.getQualifiedName());
}
}
for (String rowAction : (Collection<String>) mcv.getActionsRowNames()) actionNames.add(prefix + rowAction);
controller = MetaControllers.getMetaController("DefaultRowActionsForCollections");
for (Iterator<MetaAction> it = controller.getAllMetaActions().iterator(); it.hasNext();) {
MetaAction action = it.next();
if (action.isHidden()) continue;
actionNames.add(prefix + action.getQualifiedName());
}
for (String detailAction : (Collection<String>) mcv.getActionsDetailNames()) actionNames.add(prefix + detailAction);
for (String actionName : actionNames) {
String checked = actions.contains(actionName)?"checked='true'":"";
%>
<td>
<INPUT name="<%=propertyKey%>" type="checkbox" class="<%=style.getEditor()%>"
tabindex="1"
value="<%=actionName%>"
<%=checked%>
<%=disabled%>
<%=script%>
/>
<%=collectionLabel + Labels.get(Strings.change(actionName, prefix, ""))%>
<% if (++i % 4 == 0) { %></tr><tr><% } %>
</td>
<% }
}
%>

View File

@@ -0,0 +1,17 @@
<%
String propertyKey = request.getParameter("propertyKey");
String [] fvalues = (String []) request.getAttribute(propertyKey + ".fvalue");
boolean editable="true".equals(request.getParameter("editable"));
String disabled=editable?"":"disabled";
String script = request.getParameter("script");
String agent = (String) request.getAttribute("xava.portlet.user-agent");
if (null != agent && agent.indexOf("MSIE")>=0) {
script = org.openxava.util.Strings.change(script, "onchange", "onclick");
}
String viewObject = request.getParameter("viewObject");
viewObject = (viewObject == null || viewObject.equals(""))?"xava_view":viewObject;
View view = (View) context.get(request, viewObject);
String moduleName = view.getValueString("module.name");
String applicationName = request.getParameter("application");
MetaModule module = MetaApplications.getMetaApplication(applicationName).getMetaModule(moduleName);
%>

View File

@@ -0,0 +1,54 @@
<%@ include file="../../xava/imports.jsp"%>
<%@ page import="org.openxava.model.meta.MetaProperty" %>
<%@ page import="org.openxava.model.meta.MetaModel" %>
<%@ page import="org.openxava.model.meta.MetaMember" %>
<%@ page import="org.openxava.view.View" %>
<%@ page import="org.openxava.application.meta.MetaApplications" %>
<%@ page import="org.openxava.controller.meta.MetaControllers" %>
<%@ page import="org.openxava.application.meta.MetaModule"%>
<%@ page import="org.openxava.controller.meta.MetaAction" %>
<%@ page import="org.openxava.util.Labels" %>
<jsp:useBean id="style" class="org.openxava.web.style.Style" scope="request"/>
<jsp:useBean id="context" class="org.openxava.controller.ModuleContext" scope="session"><%@page import="org.openxava.controller.meta.MetaController"%></jsp:useBean>
<%@ include file="commonDefinitions.jsp" %>
<input type="hidden" name="<%=propertyKey%>" value="<%=module.getModelName()%>">
<table width="100%"><tr>
<%
java.util.Collection members = java.util.Arrays.asList(fvalues);
int i=0;
boolean excludeReadOnly = "true".equalsIgnoreCase(request.getParameter("excludeReadOnly"));
MetaModel model = MetaModel.get(module.getModelName());
for (String memberName: model.getMembersNamesNestingAggregates()) {
MetaMember member = model.getMetaMember(memberName);
if (member.isHidden()) continue;
if (excludeReadOnly && member instanceof MetaProperty && ((MetaProperty) member).isReadOnly()) continue;
String checked = members.contains(memberName)?"checked='true'":"";
%>
<td>
<INPUT name="<%=propertyKey%>" type="checkbox" class="<%=style.getEditor()%>"
tabindex="1"
value="<%=memberName%>"
<%=checked%>
<%=disabled%>
<%=script%>
/>
<%=Labels.getQualified(memberName)%>
<% if (++i % 5 == 0) { %></tr><tr><% } %>
</td>
<%
}
%>
</tr></table>
<%
if (!editable) {
for (i=1; i<fvalues.length; i++) {
%>
<input type="hidden" name="<%=propertyKey%>" value="<%=fvalues[i]%>">
<%
}
}
%>

View File

@@ -0,0 +1,13 @@
<%@ page import="org.openxava.util.Is" %>
<%
String propertyKey = request.getParameter("propertyKey");
String fvalue = (String) request.getAttribute(propertyKey + ".fvalue");
if (!Is.emptyString(fvalue)) {
String url = request.getContextPath() + fvalue;
%>
<a href="<%=url%>"><%=url%></a>
<%
}
%>
<input type="hidden" name="<%=propertyKey%>" value="<%=fvalue%>">

View File

@@ -0,0 +1,9 @@
<%@ include file="../../xava/imports.jsp"%>
<p class="privacy-policy">
<xava:message key="privacy_policy"/>
</p>
<div class="accept-privacy-policy">
<jsp:include page="../../xava/editors/booleanEditor.jsp"/> <xava:message key="accept_privacy_policy"/>
</div>

View File

@@ -0,0 +1,6 @@
<%@include file="../xava/imports.jsp"%>
<div id="first_steps">
<i class="mdi mdi-reply"></i>
<p><xava:message key="first_steps_prompt"/></p>
</div>

View File

@@ -0,0 +1,12 @@
<%
if ("true".equals(request.getParameter("fixedModules"))) {
modulesList = modules.getFixedModules(request);
}
else if ("true".equals(request.getParameter("bookmarkModules"))) {
modulesList = modules.getBookmarkModules(request);
bookmarkModules = true;
}
else {
modulesList = modules.getRegularModules(request);
}
%>

BIN
web/naviox/images/right.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

116
web/naviox/index.jsp Normal file
View File

@@ -0,0 +1,116 @@
<%Servlets.setCharacterEncoding(request, response);%>
<%@include file="../xava/imports.jsp"%>
<%@page import="org.openxava.web.servlets.Servlets"%>
<%@page import="org.openxava.util.Locales"%>
<%@page import="org.openxava.util.XavaPreferences"%>
<%@page import="org.openxava.web.style.XavaStyle"%>
<%@page import="org.openxava.web.style.Themes"%>
<%@page import="com.openxava.naviox.util.Organizations"%>
<%@page import="org.openxava.util.Users"%>
<%@page import="com.openxava.naviox.util.NaviOXPreferences"%>
<%@page import="org.openxava.util.Is"%>
<jsp:useBean id="context" class="org.openxava.controller.ModuleContext" scope="session"/>
<jsp:useBean id="modules" class="com.openxava.naviox.Modules" scope="session"/>
<%
String windowId = context.getWindowId(request);
context.setCurrentWindowId(windowId);
String app = request.getParameter("application");
String module = context.getCurrentModule(request);
Locales.setCurrent(request);
modules.setCurrent(request.getParameter("application"), request.getParameter("module"));
String oxVersion = org.openxava.controller.ModuleManager.getVersion();
String title = (String) request.getAttribute("naviox.pageTitle");
if (title == null) title = modules.getCurrentModuleDescription(request);
boolean hasModules = modules.hasModules(request);
org.openxava.controller.ModuleManager manager = (org.openxava.controller.ModuleManager) context
.get(app, module, "manager", "org.openxava.controller.ModuleManager");
manager.setSession(session);
manager.setApplicationName(request.getParameter("application"));
manager.setModuleName(module); // In order to show the correct description in head
%>
<!DOCTYPE html>
<head>
<title><%=title%></title>
<link href="<%=request.getContextPath()%>/xava/style/layout.css?ox=<%=oxVersion%>" rel="stylesheet" type="text/css">
<link href="<%=request.getContextPath()%>/xava/style/<%=Themes.getCSS(request)%>?ox=<%=oxVersion%>" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/xava/style/materialdesignicons.css?ox=<%=oxVersion%>">
<script type='text/javascript' src='<%=request.getContextPath()%>/xava/js/dwr-engine.js?ox=<%=oxVersion%>'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Modules.js?ox=<%=oxVersion%>'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Folders.js?ox=<%=oxVersion%>'></script>
</head>
<body <%=XavaStyle.getBodyClass(request)%>>
<div id="main">
<% if (hasModules) { %>
<jsp:include page="leftMenu.jsp"/>
<% } %>
<div class="module-wrapper">
<div id="module_header">
<%String moduleTitle = hasModules?modules.getCurrentModuleLabel():modules.getCurrentModuleDescription(request);%>
<span id="module_title"><%=moduleTitle%></span>
<a href="javascript:naviox.bookmark()" title="<xava:message key='<%=modules.isCurrentBookmarked(request)?"unbookmark_module":"bookmark_module"%>'/>">
<i id="bookmark" class='mdi mdi-star<%=modules.isCurrentBookmarked(request)?"":"-outline"%>'></i>
</a>
<div id="sign_in_out">
<%
if (Is.emptyString(NaviOXPreferences.getInstance().getAutologinUser())) {
String userName = Users.getCurrent();
String currentModule = request.getParameter("module");
boolean showSignIn = userName == null && !currentModule.equals("SignIn");
if (showSignIn) {
String selected = "SignIn".equals(currentModule)?"selected":"";
%>
<a href="<%=request.getContextPath()%>/m/SignIn" class="sign-in <%=selected%>">
<xava:message key="signin"/>
</a>
<%
}
if (userName != null) {
String organization = Organizations.getCurrent(request);
if (organization == null) organization = "";
%>
<a href="<%=request.getContextPath()%>/naviox/signOut.jsp?organization=<%=organization%>" class="sign-in"><xava:message key="signout"/> (<%=userName%>)</a>
<%
}
}
%>
</div>
</div>
<% if ("SignIn".equals(module)) { %>
<jsp:include page='signIn.jsp'/>
<% } else { %>
<div id="module">
<jsp:include page='<%="../xava/module.jsp?application=" + app + "&module=" + module + "&htmlHead=false"%>'/>
</div>
<% } %>
</div>
</div>
<%@include file="indexExt.jsp"%>
<script type='text/javascript' src='<%=request.getContextPath()%>/naviox/js/naviox.js?ox=<%=oxVersion%>'></script>
<script>
$(function() {
naviox.lockSessionMilliseconds = <%=com.openxava.naviox.model.Configuration.getInstance().getLockSessionMilliseconds()%>;
naviox.application = "<%=app%>";
naviox.module = "<%=module%>";
naviox.locked = <%=context.get(request, "naviox_locked")%>;
naviox.init();
});
</script>
</body>
</html>

4
web/naviox/indexExt.jsp Normal file
View File

@@ -0,0 +1,4 @@
<%--
Put here HTML to include at the end of the main page (index.jsp).
You can use CSS to put these elements in any part of the page.
--%>

143
web/naviox/js/naviox.js Normal file
View File

@@ -0,0 +1,143 @@
if (naviox == null) var naviox = {};
naviox.init = function() {
naviox.watchSearch();
if (naviox.locked) {
naviox.lockUser();
}
else if (naviox.lockSessionMilliseconds > 0) {
naviox.watchForIdleUser();
openxava.postRefreshPage = naviox.watchForIdleUser;
}
$('#modules_list_core').css('height', 'calc(100vh - ' + $('#modules_list_top').height() + 'px)');
}
naviox.watchForIdleUser = function() {
clearTimeout(naviox.idleWatcher);
naviox.idleWatcher = setTimeout(naviox.lockUser, naviox.lockSessionMilliseconds);
}
naviox.lockUser = function() {
openxava.executeAction(naviox.application, naviox.module, '', false, "SessionLocker.lock");
}
naviox.watchSearch = function() {
jQuery( "#search_modules_text" ).typeWatch({
callback: naviox.filterModules,
wait:500,
highlight:true,
captureLength:0
});
$( "#search_modules_text" ).keyup(function() {
if ($(this).val() == "") naviox.displayModulesList();
});
}
naviox.bookmark = function() {
var bookmark = $('#bookmark');
var bookmarkClass = bookmark.attr('class');
if (naviox.changeBookmark(bookmark, bookmarkClass, "star-outline", "star")) {
Modules.bookmarkCurrentModule();
}
else if (naviox.changeBookmark(bookmark, bookmarkClass, "star", "star-outline")) {
Modules.unbookmarkCurrentModule();
}
}
naviox.changeBookmark = function(bookmark, bookmarkClass, from, to) {
if (bookmarkClass == "mdi mdi-" + from) {
bookmark.attr('class', "mdi mdi-" + to);
return true;
}
return false;
}
naviox.filterModules = function() {
Modules.filter($("#search_modules_text").val(), naviox.refreshSearchModulesList);
}
naviox.displayModulesList = function() {
Modules.displayModulesList(naviox.refreshModulesList);
}
naviox.displayAllModulesList = function(searchWord) {
Modules.displayAllModulesList(searchWord, naviox.refreshModulesList);
}
naviox.goFolder = function(folderOid) {
Folders.goFolder(folderOid, naviox.refreshFolderModulesList);
}
naviox.goBack = function(folderOid) {
Folders.goBack(naviox.refreshFolderBackModulesList);
}
naviox.refreshModulesList = function(modulesList) {
if (modulesList == null) {
window.location=openxava.location="..";
return;
}
$('#modules_list_core').html(modulesList);
$('#modules_list_header').show();
$('#modules_list_search_header').hide();
}
naviox.refreshSearchModulesList = function(modulesList) {
if (modulesList == null) {
window.location=openxava.location="..";
return;
}
$('#modules_list_core').html(modulesList);
$('#modules_list_header').hide();
$('#modules_list_search_header').show();
}
naviox.refreshFolderModulesList = function(modulesList) {
if (modulesList == null) {
window.location=openxava.location="../m/SignIn";
return;
}
$('#modules_list_content').append("<td></td>");
$('#modules_list_content').children().last().html(modulesList);
$('.modules-list-header').width($(window).width());
var box = $('#modules_list_box');
box.animate({
left: -box.outerWidth() / 2
},
function() {
$('#modules_list_content').children().first().remove();
box.css("left", "0");
naviox.watchSearch();
$('.modules-list-header').css("width", "100%");
}
);
}
naviox.refreshFolderBackModulesList = function(modulesList) {
if (modulesList == null) {
window.location=openxava.location="..";
return;
}
$('#modules_list_content').prepend("<td></td>");
var box = $('#modules_list_box');
box.css("left", "-" + box.outerWidth() + "px");
$('#modules_list_content').children().first().html(modulesList);
$('.modules-list-header').width($(window).width());
box.animate({
left: 0
},
function() {
$('#modules_list_content').children().last().remove();
naviox.watchSearch();
$('.modules-list-header').css("width", "100%");
}
);
}

63
web/naviox/leftMenu.jsp Normal file
View File

@@ -0,0 +1,63 @@
<%@page import="org.openxava.util.Users"%>
<%@include file="../xava/imports.jsp"%>
<jsp:useBean id="modules" class="com.openxava.naviox.Modules" scope="session"/>
<div id="modules_list">
<div id="modules_list_top">
<div id="application_title">
<div id="application_name">
<%=modules.getApplicationLabel(request)%>
</div>
<div id="organization_name">
<% String organizationName = modules.getOrganizationName(request); %>
<%=organizationName%>
<%@ include file="organizationNameExt.jsp"%>
</div>
</div>
<% if (Users.getCurrent() != null && modules.showsIndexLink()) { %>
<a href="<%=request.getContextPath()%>/m/Index">
<div id='organizations_index' class='<%="Index".equals(request.getParameter("module"))?"selected":""%>'>
<i class="mdi mdi-apps"></i>
<xava:label key="myOrganizations"/>
</div>
</a>
<% } %>
<jsp:include page="selectModules.jsp">
<jsp:param name="fixedModules" value="true"/>
</jsp:include>
<jsp:include page="selectModules.jsp">
<jsp:param name="bookmarkModules" value="true"/>
</jsp:include>
<% if (modules.showsSearchModules(request)) { %>
<div id="search_modules">
<input id="search_modules_text" type="text" size="38" placeholder='<xava:message key="search_modules"/>'/>
</div>
<% } %>
</div>
<div id="modules_list_outbox">
<table id="modules_list_box">
<tr id="modules_list_content">
<td>
<jsp:include page="modulesMenu.jsp"/>
</td>
</tr>
</table>
</div>
</div>

View File

@@ -0,0 +1 @@
<jsp:include page="selectModules.jsp"/>

View File

@@ -0,0 +1,5 @@
<%@include file="../xava/imports.jsp"%>
<div id="modules_list_core">
<jsp:include page="modulesList.jsp"/>
</div>

View File

@@ -0,0 +1,3 @@
<%--
Put here HTML to include just after the organization name.
--%>

View File

@@ -0,0 +1,67 @@
<%@include file="../xava/imports.jsp"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Collection"%>
<%@page import="org.openxava.util.Is"%>
<%@page import="org.openxava.util.Strings"%>
<%@page import="org.openxava.application.meta.MetaModule"%>
<jsp:useBean id="modules" class="com.openxava.naviox.Modules" scope="session"/>
<%
String searchWord = request.getParameter("searchWord");
searchWord = searchWord == null?"":Strings.removeAccents(searchWord.toLowerCase());
Collection modulesList = null;
boolean bookmarkModules = false;
%>
<%@ include file="getModulesList.jsp" %>
<%
String smodulesLimit = request.getParameter("modulesLimit");
int modulesLimit = smodulesLimit == null?30:Integer.parseInt(smodulesLimit);
int counter = 0;
boolean loadMore = false;
for (Iterator it= modulesList.iterator(); it.hasNext();) {
if (counter == modulesLimit) {
loadMore = true;
break;
}
MetaModule module = (MetaModule) it.next();
String selected = module.getName().equals(modules.getCurrent(request))?"selected":"";
String label = module.getLabel(request.getLocale());
String description = module.getDescription(request.getLocale());
String normalizedLabel = Strings.removeAccents(label.toLowerCase());
String normalizedDescription = Strings.removeAccents(description.toLowerCase());
if (!Is.emptyString(searchWord) && !normalizedLabel.contains(searchWord) && !normalizedDescription.contains(searchWord)) continue;
counter++;
%>
<a href="<%=modules.getModuleURI(request, module)%>?init=true" title="<%=description%>"> <%-- href with the URL in order right mouse button works to add in another tab --%>
<div id="<%=module.getName()%>_module" class="module-row <%=selected%>" onclick="$('#<%=module.getName()%>_loading').show()">
<div class="module-name">
<%=label%>
<% if (bookmarkModules) { %>
<i class="mdi mdi-star bookmark-decoration"></i>
<% } %>
<i id="<%=module.getName()%>_loading" class="mdi mdi-autorenew module-loading spin" style="float: right; display:none;"></i>
</div>
</div>
</a>
<%
}
if (loadMore) {
%>
<a href="javascript:naviox.displayAllModulesList('<%=searchWord%>')">
<div id="more_modules" class="module-row" onclick="$('#loading_more_modules').show(); $('#load_more_modules').hide();">
<span id="loading_more_modules" style="display:none;">
<xava:message key="loading"/>...
<i class="mdi mdi-autorenew module-loading spin" style="float: right;"></i>
</span>
<span id="load_more_modules">
<xava:message key="load_more_modules"/>...
</span>
</div>
</a>
<%
}
%>

7
web/naviox/signIn.jsp Normal file
View File

@@ -0,0 +1,7 @@
<%
String app = request.getParameter("application");
%>
<div id="sign_in_box">
<jsp:include page='<%="../xava/module.jsp?application=" + app + "&module=SignIn"%>'/>
</div>

20
web/naviox/signOut.jsp Normal file
View File

@@ -0,0 +1,20 @@
<%@page import="org.openxava.controller.ModuleManager"%>
<%@page import="com.openxava.naviox.model.Configuration"%>
<%@page import="com.openxava.naviox.util.NaviOXPreferences"%>
<%
StringBuilder base = new StringBuilder("..");
if (!Configuration.getInstance().isSharedUsersBetweenOrganizations()
&&
!NaviOXPreferences.getInstance().isShowOrganizationOnSignIn()
&&
!"".equals(request.getParameter("organization")))
{
base.append("/o/").append(request.getParameter("organization"));
}
session.invalidate();
%>
<script type="text/javascript">
window.location="<%=String.format("%s/m/SignIn", base)%>";
</script>

14
web/naviox/userJoin.jsp Normal file
View File

@@ -0,0 +1,14 @@
<%@include file="../xava/imports.jsp"%>
<%@page import="com.openxava.naviox.util.Organizations"%>
<%-- To put your own text add entries in the i18n messages files of your project --%>
<%
String organization = Organizations.getCurrent(request);
%>
<div id="user_join">
<xava:message key="user_join_question" param="<%=organization%>"/>
</div>

53
web/naviox/welcome.jsp Normal file
View File

@@ -0,0 +1,53 @@
<%@include file="../xava/imports.jsp"%>
<%@page import="org.openxava.application.meta.MetaApplications"%>
<%@page import="org.openxava.application.meta.MetaApplication"%>
<%@page import="org.openxava.util.Locales"%>
<%@page import="org.openxava.web.style.XavaStyle"%>
<%@page import="org.openxava.util.XavaPreferences"%>
<%@page import="org.openxava.web.Browsers"%>
<%-- To put your own text add entries in the i18n messages files of your project
In MyApplication-labels_en.properties:
MyApplication=My application
MyApplication[description]=My application does this and that
In MyApplication-messages_en.properties:
welcome_point1=This is a additional explanatory line
--%>
<%
MetaApplication metaApplication = MetaApplications.getMainMetaApplication();
Locales.setCurrent(request);
String oxVersion = org.openxava.controller.ModuleManager.getVersion();
String title = (String) request.getAttribute("naviox.pageTitle");
if (title == null) title = metaApplication.getLabel();
%>
<!DOCTYPE html>
<head>
<title><%=title%></title>
<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>
<link href="<%=request.getContextPath()%>/xava/style/<%=XavaPreferences.getInstance().getStyleCSS()%>?ox=<%=oxVersion%>" rel="stylesheet" type="text/css">
<% if (Browsers.isIE(request)) { %>
<script type='text/javascript' src="<%=request.getContextPath()%>/xava/js/css-vars-ponyfill.js?ox=<%=oxVersion%>"></script>
<script type='text/javascript'>cssVars({ }); </script>
<% } %>
</head>
<body id="welcome" <%=XavaStyle.getBodyClass(request)%>>
<h1><%=metaApplication.getLabel()%></h1>
<p><%=metaApplication.getDescription()%></p>
<p><xava:message key="welcome_point1"/></p>
<p id="signin_tip"><xava:message key="signin_tip"/></p>
<div class="ox-bottom-buttons">
<input type="hidden">
<input type="button" tabindex="1" onclick="window.location='m/SignIn'" value="<xava:label key='SignIn'/>">
</div>
</body>

1
web/phone/index.jsp Normal file
View File

@@ -0,0 +1 @@
<jsp:forward page="/p/SignIn"/>

View File

@@ -0,0 +1,11 @@
<%
String rowAction = request.getParameter("rowAction");
%>
<table><tr><td>
<jsp:include page="list.jsp">
<jsp:param name="rowAction" value="<%=rowAction%>"/>
<jsp:param name="onlyOneActionPerRow" value="true"/>
</jsp:include>
</span>
</td></tr></table>

53
web/xava/barButton.jsp Normal file
View File

@@ -0,0 +1,53 @@
<%@ include file="imports.jsp"%>
<%@page import="org.openxava.util.XavaPreferences"%>
<%@page import="org.openxava.util.Is"%>
<%@page import="org.openxava.controller.meta.MetaControllers"%>
<%@page import="org.openxava.controller.meta.MetaAction"%>
<jsp:useBean id="style" class="org.openxava.web.style.Style" scope="request"/>
<%
boolean showImages = style.isShowImageInButtonBarButton();
boolean showIcons = style.isUseIconsInsteadOfImages();
boolean showLabels = !showImages?true:XavaPreferences.getInstance().isShowLabelsForToolBarActions();
String actionName = request.getParameter("action");
String addSpaceWithoutImage = request.getParameter("addSpaceWithoutImage");
boolean addSpace = "true".equals(addSpaceWithoutImage);
if (!Is.emptyString(actionName)) {
MetaAction action = MetaControllers.getMetaAction(request.getParameter("action"));
String argv = request.getParameter("argv");
String label = action.getLabel(request);
%>
<% if (style.isUseStandardImageActionForOnlyImageActionOnButtonBar() && action.hasImage() && Is.emptyString(label)) { %>
<xava:image action='<%=action.getQualifiedName()%>' argv='<%=argv %>' cssClass='<%=style.getButtonBarImage()%>'/>
<% } else { %>
<span class="<%=style.getButtonBarButton()%>">
<xava:link action="<%=action.getQualifiedName()%>" argv='<%=argv %>'>
<%
boolean showLabel = (showLabels || !action.hasImage()) && !Is.emptyString(label);
boolean showImage = showImages && action.hasImage() || action.hasImage() && Is.emptyString(label);
boolean showIcon = action.hasIcon() && (showImages && (showIcons || !action.hasImage()) || Is.emptyString(label) && (showIcons || !action.hasImage()));
%>
<% if (showIcon) { %>
<i class="mdi mdi-<%=action.getIcon()%>"></i>
<% } else if (showImage) { %>
<span style="background: url(<%=request.getContextPath()%>/<%=style.getImagesFolder()%>/<%=action.getImage()%>) no-repeat 5px 50%;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>
<% } else if(addSpace) {%>
<span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>
<%
}
if (showLabel) { %>
<%=label%>
<% } %>
</xava:link>
<% } %>
</span>
<%
}
%>

View File

@@ -0,0 +1,50 @@
<%@ include file="imports.jsp"%>
<%@ page import="org.openxava.controller.meta.MetaAction" %>
<jsp:useBean id="context" class="org.openxava.controller.ModuleContext" scope="session"/>
<%
org.openxava.controller.ModuleManager manager = (org.openxava.controller.ModuleManager) context.get(request, "manager", "org.openxava.controller.ModuleManager");
manager.setSession(session);
if (manager.isBottomButtonsVisible()) {
boolean buttonBar = !"false".equalsIgnoreCase(request.getParameter("buttonBar"));
String mode = request.getParameter("xava_mode");
if (mode == null) mode = manager.getModeName();
String defaultAction = null;
if (org.openxava.util.XavaPreferences.getInstance().isShowDefaultActionInBottom() && manager.isDetailMode()) {
defaultAction = manager.getDefaultActionQualifiedName();
%>
<xava:button action="<%=defaultAction%>"/>
<%
}
%>
<%
java.util.Iterator it = manager.getMetaActions().iterator();
while (it.hasNext()) {
MetaAction action = (MetaAction) it.next();
if (!manager.actionApplies(action)) continue;
if (action.getQualifiedName().equals(defaultAction)) continue;
if (action.appliesToMode(mode) && (!buttonBar || !(action.hasImage() || action.hasIcon()))) {
%>
<xava:button action="<%=action.getQualifiedName()%>"/>
<%
}
}
%>
<%
MetaAction defaultMetaAction = manager.getDefaultMetaAction();
if (defaultMetaAction != null) {
%>
<button name="xava.DEFAULT_ACTION" type="submit"
onclick="openxava.executeAction('<%=request.getParameter("application")%>', '<%=request.getParameter("module")%>', '<%=defaultMetaAction.getConfirmMessage(request)%>', <%=defaultMetaAction.isConfirm()%>, '<%=manager.getDefaultActionQualifiedName()%>')"
style="padding: 0; border: none; background-color:transparent; size: 0"></button>
<%
}
%>
<% } // if (manager.isBottomButtonsVisible()) { %>

151
web/xava/buttonBar.jsp Normal file
View File

@@ -0,0 +1,151 @@
<%@ include file="imports.jsp"%>
<%@ page import="org.openxava.controller.meta.MetaAction" %>
<%@ page import="org.openxava.util.XavaPreferences"%>
<%@ page import="org.openxava.util.Is"%>
<%@ page import="org.openxava.controller.meta.MetaSubcontroller"%>
<%@ page import="java.util.Collection"%>
<%@ page import="org.openxava.web.Ids"%>
<%@ page import="org.openxava.util.EmailNotifications"%>
<%@ page import="org.openxava.controller.meta.MetaControllerElement"%>
<jsp:useBean id="context" class="org.openxava.controller.ModuleContext" scope="session"/>
<jsp:useBean id="style" class="org.openxava.web.style.Style" scope="request"/>
<%
org.openxava.controller.ModuleManager manager = (org.openxava.controller.ModuleManager) context.get(request, "manager", "org.openxava.controller.ModuleManager");
manager.setSession(session);
boolean onBottom = false;
String mode = request.getParameter("xava_mode");
if (mode == null) mode = manager.isSplitMode()?"detail":manager.getModeName();
boolean headerButtonBar = !manager.isSplitMode() || mode.equals("list");
boolean listFormats = !manager.isSplitMode() && mode.equals("list");
if (manager.isButtonBarVisible()) {
%>
<div class="<%=style.getButtonBar()%>">
<div id="<xava:id name='controllerElement'/>">
<span style="float: left">
<%
java.util.Stack previousViews = (java.util.Stack) context.get(request, "xava_previousViews");
if (manager.isDetailMode() && !manager.isDetailModeOnly() && previousViews.isEmpty()) {
%>
<jsp:include page="barButton.jsp">
<jsp:param name="action" value="<%=manager.getGoListAction()%>"/>
</jsp:include>
<%
}
Collection<MetaControllerElement> elements = manager.getMetaControllerElements();
for (MetaControllerElement element : elements){
if (!element.appliesToMode(mode)) continue;
if (element instanceof MetaAction){
MetaAction action = (MetaAction) element;
if (!manager.actionApplies(action)) continue;
if (action.hasImage() || action.hasIcon()) {
%>
<jsp:include page="barButton.jsp">
<jsp:param name="action" value="<%=action.getQualifiedName()%>"/>
</jsp:include>
<%
}
}
else if (element instanceof MetaSubcontroller){
MetaSubcontroller subcontroller = (MetaSubcontroller) element;
if (subcontroller.hasActionsInThisMode(mode)){
%>
<jsp:include page="subButton.jsp">
<jsp:param name="controller" value="<%=subcontroller.getControllerName()%>"/>
<jsp:param name="image" value="<%=subcontroller.getImage()%>"/>
<jsp:param name="icon" value="<%=subcontroller.getIcon()%>"/>
</jsp:include>
<%
}
}
}
%>
</span>
</div>
<div id="<xava:id name='modes'/>">
<span style="float: right">
<span style="float: left;" class="<%=style.getListFormats()%>">
<%
if (listFormats) {
String tabObject = request.getParameter("tabObject");
tabObject = (tabObject == null || tabObject.equals(""))?"xava_tab":tabObject;
org.openxava.tab.Tab tab = (org.openxava.tab.Tab) context.get(request, tabObject);
Collection<String> editors = org.openxava.web.WebEditors.getEditors(tab.getMetaTab());
if (editors.size() > 1) for (String editor: editors) {
String icon = org.openxava.web.WebEditors.getIcon(editor);
if (icon == null) continue;
String selected = editor.equals(tab.getEditor())?style.getSelectedListFormat():"";
if (Is.emptyString(editor)) editor = "__NONAME__";
%>
<xava:link action="ListFormat.select" argv='<%="editor=" + editor%>' cssClass="<%=selected%>">
<i class="mdi mdi-<%=icon%>" onclick="openxava.onSelectListFormat(event)" title="<%=org.openxava.util.Labels.get(editor)%>"></i>
</xava:link>
<%
}
}
%>
</span>
<%
if (EmailNotifications.isEnabled(manager.getModuleName())) {
if (EmailNotifications.isSubscribedCurrentUserToModule(manager.getModuleName())) {
%>
<span class="<%=style.getSubscribed()%>">
<xava:image action='EmailNotifications.unsubscribe'/>
</span>
<%
}
else {
%>
<span class="<%=style.getUnsubscribed()%>">
<xava:image action='EmailNotifications.subscribe'/>
</span>
<%
}
}
if (XavaPreferences.getInstance().isHelpAvailable() && style.isHelpAvailable()) {
String language = request.getLocale().getLanguage();
String href = XavaPreferences.getInstance().getHelpPrefix();
String suffix = XavaPreferences.getInstance().getHelpSuffix();
String target = XavaPreferences.getInstance().isHelpInNewWindow() ? "_blank" : "";
if (href.startsWith("http:") || href.startsWith("https:")) {
if (href.endsWith("_")) href = href + language;
if (!Is.emptyString(suffix)) href = href + suffix;
}
else {
href =
"/" + manager.getApplicationName() + "/" +
href +
manager.getModuleName() +
"_" + language +
suffix;
}
String helpImage = null;
if (style.getHelpImage() != null) helpImage = !style.getHelpImage().startsWith("/")?request.getContextPath() + "/" + style.getHelpImage():style.getHelpImage();
%>
<span class="<%=style.getHelp()%>">
<a href="<%=href%>" target="<%=target%>">
<% if (helpImage == null) { %>
<i class="mdi mdi-help-circle"></i>
<% } else { %>
<a href="<%=href%>" target="<%=target%>"><img src="<%=helpImage%>"/></a>
<% } %>
</a>
</span>
<%
}
%>
&nbsp;
</span>
</div> <!-- modes -->
</div>
<% } // end isButtonBarVisible %>

27
web/xava/collection.jsp Normal file
View File

@@ -0,0 +1,27 @@
<%@ include file="imports.jsp"%>
<jsp:useBean id="context" class="org.openxava.controller.ModuleContext" scope="session"/>
<jsp:useBean id="errors" class="org.openxava.util.Messages" scope="request"/>
<jsp:useBean id="style" class="org.openxava.web.style.Style" scope="request"/>
<%@ page import="org.openxava.model.meta.MetaCollection" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.Collection" %>
<%@ page import="java.util.Map" %>
<%@ page import="org.openxava.util.Maps" %>
<%@ page import="org.openxava.util.Is" %>
<%@ page import="org.openxava.util.XavaPreferences" %>
<%@ page import="org.openxava.view.View" %>
<%@ page import="org.openxava.model.meta.MetaProperty" %>
<%@ page import="org.openxava.model.meta.MetaReference" %>
<%@ page import="org.openxava.web.WebEditors" %>
<%
String collectionName = request.getParameter("collectionName");
String viewObject = request.getParameter("viewObject");
View view = (View) context.get(request, viewObject);
MetaCollection collection = view.getMetaModel().getMetaCollection(collectionName);
%>
<jsp:include page='<%="editors/" + WebEditors.getMetaEditorFor(collection, view.getViewName()).getUrl()%>'/>

View File

@@ -0,0 +1,83 @@
<%@ include file="imports.jsp"%>
<jsp:useBean id="context" class="org.openxava.controller.ModuleContext" scope="session"/>
<jsp:useBean id="errors" class="org.openxava.util.Messages" scope="request"/>
<jsp:useBean id="style" class="org.openxava.web.style.Style" scope="request"/>
<%@ page import="org.openxava.web.WebEditors"%>
<%@ page import="org.openxava.view.View" %>
<%@ page import="org.openxava.tab.Tab" %>
<%@ page import="org.openxava.util.XavaPreferences" %>
<%@ page import="org.openxava.util.XavaResources" %>
<%@ page import="org.openxava.model.meta.MetaProperty" %>
<%@ page import="org.openxava.web.Ids" %>
<%@ page import="org.openxava.web.Collections" %>
<%
String collectionName = request.getParameter("collectionName");
String viewObject = request.getParameter("viewObject");
View view = (View) context.get(request, viewObject);
View collectionView = view.getSubview(collectionName);
String viewName = viewObject + "_" + collectionName;
String frameId = Ids.decorate(request, "frame_" + view.getPropertyPrefix() + collectionName);
String hiddenStyle = view.isFrameClosed(frameId)?"":"style='display: none'";
if (!collectionView.isCollectionFromModel()) {
Tab tab = collectionView.getCollectionTab();
if (request.getAttribute(Tab.TAB_RESETED_PREFIX + tab) == null) {
String collectionId = Collections.id(request, collectionName);
String tabObject = Collections.tabObject(collectionId);
tab.setTabObject(tabObject);
tab.setRequest(request);
tab.setConditionParameters();
tab.reset();
request.setAttribute(Tab.TAB_RESETED_PREFIX + tab, Boolean.TRUE);
}
}
%>
<span <%=hiddenStyle%>>
(<%=collectionView.getCollectionSize()%>)
<%
if (collectionView.isCollectionEditable()) {
%>
<xava:image action='<%=collectionView.getNewCollectionElementAction()%>' argv='<%="viewObject="+viewName%>'/>
<%
}
%>
</span>
<span class="<%=style.getFrameTotals()%>" <%=hiddenStyle%>>
<%
int totalRows = collectionView.getCollectionTotalsCount();
int totalColumns = collectionView.getMetaPropertiesList().size();
for (int row=0; row<totalRows; row++) {
for (int column=0; column<totalColumns; column++) {
if (collectionView.hasCollectionTotal(row, column)) {
MetaProperty p = (MetaProperty) collectionView.getMetaPropertiesList().get(column);
String ftotal = WebEditors.format(request, p, collectionView.getCollectionTotal(row, column), errors, view.getViewName(), true);
%>
&nbsp;&nbsp;
<span class="<%=style.getFrameTotalsLabel()%>"><%=collectionView.getCollectionTotalLabel(row, column)%>:</span>
<span class="<%=style.getFrameTotalsValue()%>"><%=ftotal%></span>
<%
}
}
}
if (!collectionView.isCollectionFromModel() && XavaPreferences.getInstance().isSummationInList()) {
Tab tab = collectionView.getCollectionTab();
int totalTabColumns = tab.getMetaProperties().size();
for (int column=0; column<totalTabColumns; column++) {
if (!tab.isFixedTotal(column) && tab.hasTotal(column)) {
MetaProperty p = tab.getMetaProperty(column);
String ftotal = WebEditors.format(request, p, tab.getTotal(column), errors, view.getViewName(), true);
String label = XavaResources.getString(request, "sum_of", p.getLabel());
%>
&nbsp;&nbsp;
<span class="<%=style.getFrameTotalsLabel()%>"><%=label%>:</span>
<span class="<%=style.getFrameTotalsValue()%>"><%=ftotal%></span>
<%
}
}
}
%>
</span>

View File

View File

@@ -0,0 +1,160 @@
<%@ include file="imports.jsp"%>
<%@page import="org.openxava.controller.meta.MetaAction"%>
<%@page import="org.openxava.web.Ids"%>
<%@page import="org.openxava.controller.meta.MetaControllers"%>
<%@page import="org.openxava.util.Is"%>
<%@page import="org.openxava.web.Actions"%>
<%@page import="org.openxava.util.XavaPreferences"%>
<%
String tabObject = request.getParameter("tabObject");
tabObject = (tabObject == null || tabObject.equals(""))?"xava_tab":tabObject;
String onSelectCollectionElementAction = subview.getOnSelectCollectionElementAction();
String selectedRowStyle = style.getSelectedRowStyle();
String rowStyle = "border-bottom: 1px solid;";
MetaAction onSelectCollectionElementMetaAction = Is.empty(onSelectCollectionElementAction) ? null : MetaControllers.getMetaAction(onSelectCollectionElementAction);
boolean resizeColumns = style.allowsResizeColumns() && XavaPreferences.getInstance().isResizeColumns();
String browser = request.getHeader("user-agent");
boolean scrollSupported = !(browser != null && (browser.indexOf("MSIE 6") >= 0 || browser.indexOf("MSIE 7") >= 0));
String styleOverflow = org.openxava.web.Lists.getOverflow(browser, subview.getMetaPropertiesList());
boolean sortable = subview.isCollectionSortable();
%>
<% if (resizeColumns && scrollSupported) { %>
<div class="<xava:id name='collection_scroll'/>" style="<%=styleOverflow%>">
<% } %>
<table id="<xava:id name='<%=idCollection%>'/>" class="<%=style.getList()%>" <%=style.getListCellSpacing()%> style="<%=style.getListStyle()%>">
<% if (sortable) { %><tbody class="xava_sortable_row"><% } %>
<tr class="<%=style.getListHeader()%>">
<%
if (lineAction != null) {
%>
<th class=<%=style.getListHeaderCell()%>></th>
<%
}
%>
<th class=<%=style.getListHeaderCell()%> width="5">
<%
String actionOnClickAll = Actions.getActionOnClickAll(
request.getParameter("application"), request.getParameter("module"),
onSelectCollectionElementAction, idCollection, propertyPrefix,
selectedRowStyle, rowStyle, tabObject);
%>
<input type="checkbox" name="<xava:id name='xava_selected_all'/>" value="<%=propertyPrefix%>selected_all" <%=actionOnClickAll%> />
</th>
<%
// Heading
Iterator it = subview.getMetaPropertiesList().iterator();
for (int columnIndex=0; it.hasNext(); columnIndex++) {
MetaProperty p = (MetaProperty) it.next();
String label = p.getQualifiedLabel(request);
int columnWidth = subview.getCollectionColumnWidth(columnIndex);
String width = columnWidth<0 || !resizeColumns?"":"width: " + columnWidth + "px";
%>
<th class=<%=style.getListHeaderCell()%> style="padding-right: 0px">
<div id="<xava:id name='<%=idCollection%>'/>_col<%=columnIndex%>" class="<%=((resizeColumns)?("xava_resizable"):(""))%>" style="overflow: hidden; <%=width%>" >
<%if (resizeColumns) {%><nobr><%}%>
<%=label%>&nbsp;
<%if (resizeColumns) {%></nobr><%}%>
</div>
</th>
<%
}
%>
</tr>
<%
// Values
Collection aggregates = subview.getCollectionValues();
if (aggregates == null) aggregates = java.util.Collections.EMPTY_LIST;
Iterator itAggregates = aggregates.iterator();
for (int f=0; itAggregates.hasNext(); f++) {
Map row = (Map) itAggregates.next();
String cssClass=f%2==0?style.getListPair():style.getListOdd();
String cssCellClass=f%2==0?style.getListPairCell():style.getListOddCell();
String selectedClass = "";
if (f == subview.getCollectionEditingRow()) {
selectedClass = f%2==0?style.getListPairSelected():style.getListOddSelected();
cssClass = cssClass + " " + selectedClass;
if (style.isApplySelectedStyleToCellInList()) cssCellClass = cssCellClass + " " + selectedClass;
}
String idRow = Ids.decorate(request, propertyPrefix) + f;
String events=f%2==0?style.getListPairEvents():style.getListOddEvents();
%>
<tr id="<%=idRow%>" class="<%=cssClass%>" <%=events%> style="border-bottom: 1px solid;">
<%
if (lineAction != null) {
%>
<td class="<%=cssCellClass%>" style="vertical-align: middle;text-align: center;padding-right: 2px; <%=style.getListCellStyle()%>">
<nobr>
<%if (sortable) { %>
<i class="xava_handle mdi mdi-swap-vertical"></i>
<%}%>
<xava:action action="<%=lineAction%>" argv='<%="row="+f + ",viewObject="+viewName%>'/>
<%
if (style.isSeveralActionsPerRow())
for (java.util.Iterator itRowActions = subview.getRowActionsNames().iterator(); itRowActions.hasNext(); ) {
String rowAction = (String) itRowActions.next();
%>
<xava:action action='<%=rowAction%>' argv='<%="row=" + f + ",viewObject="+viewName%>'/>
<%
}
%>
</nobr>
</td>
<%
}
String actionOnClick = Actions.getActionOnClick(
request.getParameter("application"), request.getParameter("module"),
onSelectCollectionElementAction, f, viewName, idRow,
selectedRowStyle, rowStyle,
onSelectCollectionElementMetaAction, tabObject);
%>
<td class="<%=cssCellClass%>" width="5" style="<%=style.getListCellStyle()%>">
<input type="checkbox" name="<xava:id name='xava_selected'/>" value="<%=propertyPrefix%>__SELECTED__:<%=f%>" <%=actionOnClick%>/>
</td>
<%
it = subview.getMetaPropertiesList().iterator();
for (int columnIndex = 0; it.hasNext(); columnIndex++) {
MetaProperty p = (MetaProperty) it.next();
String align =p.isNumber() && !p.hasValidValues()?"vertical-align: middle;text-align: right; ":"vertical-align: middle; ";
String cellStyle = align + style.getListCellStyle();
int columnWidth = subview.getCollectionColumnWidth(columnIndex);
String width = columnWidth<0 || !resizeColumns?"":"width: " + columnWidth + "px";
String fvalue = null;
Object value = null;
String propertyName = p.getName();
value = Maps.getValueFromQualifiedName(row, propertyName);
fvalue = WebEditors.format(request, p, value, errors, view.getViewName(), true);
Object title = WebEditors.formatTitle(request, p, value, errors, view.getViewName(), true);
%>
<td class="<%=cssCellClass%>" style="<%=cellStyle%>; padding-right: 0px">
<% if (style.isRowLinkable()) { %>
<xava:link action="<%=lineAction%>" argv='<%="row="+f + ",viewObject="+viewName%>' cssStyle="text-decoration: none; outline: none">
<div title="<%=title%>" class="<xava:id name='tipable'/> <xava:id name='<%=idCollection%>'/>_col<%=columnIndex%>" style="overflow: hidden; <%=width%>">
<%if (resizeColumns) {%><nobr><%}%>
<%=fvalue%>&nbsp;
<%if (resizeColumns) {%></nobr><%}%>
</div>
</xava:link>
<% } else { %>
<div title="<%=title%>" class="<xava:id name='tipable'/> <xava:id name='<%=idCollection%>'/>_col<%=columnIndex%>" style="overflow: hidden; <%=width%>">
<%if (resizeColumns) {%><nobr><%}%>
<%=fvalue%>&nbsp;
<%if (resizeColumns) {%></nobr><%}%>
</div>
<% } %>
</td>
<%
}
}
%>
</tr>
<jsp:include page="collectionTotals.jsp" />
<% if (sortable) { %></tbody><% } %>
</table>
<% if (resizeColumns && scrollSupported) { %>
</div>
<% } %>

View File

@@ -0,0 +1,21 @@
<%
String tabObject = org.openxava.web.Collections.tabObject(idCollection);
org.openxava.tab.Tab tab = subview.getCollectionTab();
String tabPrefix = tabObject + "_";
tab.clearStyle();
int selectedRow = subview.getCollectionEditingRow();
if (selectedRow >= 0) {
String cssClass=selectedRow%2==0?style.getListPairSelected():style.getListOddSelected();
tab.setStyle(selectedRow, cssClass);
}
context.put(request, tabObject, tab);
// The list
%>
<jsp:include page="../list.jsp">
<jsp:param name="collection" value="<%=idCollection%>"/>
<jsp:param name="rowAction" value="<%=lineAction%>"/>
<jsp:param name="tabObject" value="<%=tabObject%>"/>
<jsp:param name="viewObject" value="<%=viewName%>"/>
</jsp:include>

85
web/xava/core.jsp Normal file
View File

@@ -0,0 +1,85 @@
<%@ include file="imports.jsp"%>
<jsp:useBean id="errors" class="org.openxava.util.Messages" scope="request"/>
<jsp:useBean id="messages" class="org.openxava.util.Messages" scope="request"/>
<jsp:useBean id="style" class="org.openxava.web.style.Style" scope="request"/>
<jsp:useBean id="context" class="org.openxava.controller.ModuleContext" scope="session"/>
<%
org.openxava.controller.ModuleManager manager = (org.openxava.controller.ModuleManager) context.get(request, "manager");
org.openxava.view.View view = (org.openxava.view.View) context.get(request, "xava_view");
boolean buttonBar = !"false".equalsIgnoreCase(request.getParameter("buttonBar"));
String focusPropertyId = manager.isListMode()?org.openxava.web.Lists.FOCUS_PROPERTY_ID:view.getFocusPropertyId();
%>
<form id="<xava:id name='form'/>" name="<xava:id name='form'/>"
method='POST' <%=manager.getEnctype()%>
<%=manager.getFormAction(request)%> style="display: inline;"
onsubmit="return false">
<%-- Here, and not at bottom of form, because if there are some erroneous
markup inside the view, then maybe these hidden fields are not found by javascript.
Concretely, if you put this hidden fields on bottom then InvoiceAmounts (from OpenXavaTest)
with Firefox 3 and Liferay 5.1.1, 5.1.2 and 5.2.2 produces a JavaScript error.
--%>
<INPUT type="hidden" name="<xava:id name='xava_action'/>" value=""/>
<INPUT type="hidden" name="<xava:id name='xava_action_argv'/>" value=""/>
<INPUT type="hidden" name="<xava:id name='xava_action_range'/>" value=""/>
<INPUT type="hidden" name="<xava:id name='xava_action_already_processed'/>" value=""/>
<INPUT type="hidden" name="<xava:id name='xava_action_application'/>" value="<%=request.getParameter("application")%>"/>
<INPUT type="hidden" name="<xava:id name='xava_action_module'/>" value="<%=request.getParameter("module")%>"/>
<INPUT type="hidden" name="<xava:id name='xava_changed_property'/>"/>
<INPUT type="hidden" id="<xava:id name='xava_current_focus'/>"
name="<xava:id name='xava_current_focus'/>"/>
<INPUT type="hidden" id="<xava:id name='xava_previous_focus'/>"
name="<xava:id name='xava_previous_focus'/>"/>
<INPUT type="hidden" name="<xava:id name='xava_focus_forward'/>"/>
<INPUT type="hidden" id="<xava:id name='xava_focus_property_id'/>"
name="<xava:id name='xava_focus_property_id'/>" value="<%=focusPropertyId%>"/>
<%
String listModeClass=manager.isListMode()?"class='" + style.getListMode() + "'":"";
%>
<div <%=listModeClass%> <%=style.getModuleSpacing()%>>
<% if (buttonBar) { %>
<div id='<xava:id name="button_bar"/>'>
<jsp:include page="buttonBar.jsp"/>
</div>
<% } %>
<div class="<%=style.getView()%>">
<% if (style.isShowModuleDescription() && !manager.isListMode()) { %>
<div class="<%=style.getModuleDescription()%>">
<%=manager.getModuleDescription()%>
</div>
<% } %>
<div id='<xava:id name="errors"/>' style="display: inline;">
<jsp:include page="errors.jsp"/>
</div>
<div id='<xava:id name="messages"/>' style="display: inline;">
<jsp:include page="messages.jsp"/>
</div>
<div id='<xava:id name="view"/>' <%=manager.isListMode()?"":("class='" + style.getDetail() + (view.isSimple()?" ox-simple-layout":"") + (view.isFlowLayout()?" ox-flow-layout":"") + "'")%> style='padding-top: 2px;'>
<jsp:include page='<%=manager.getViewURL()%>'/>
</div>
<%@include file="viewExt.jsp"%>
</div>
<% if (style.isSeparatorBeforeBottomButtons()) { %>
<div style="clear: both; padding-top: 2px;"></div>
<% } %>
<div id='<xava:id name="bottom_buttons"/>' class="<%=style.getBottomButtons()%>" style="<%=style.getBottomButtonsStyle()%>">
<jsp:include page="bottomButtons.jsp"/>
</div>
</div>
</form>

326
web/xava/detail.jsp Normal file
View File

@@ -0,0 +1,326 @@
<%@ include file="imports.jsp"%>
<%@ page import="java.util.Iterator" %>
<%@ page import="org.openxava.view.View" %>
<%@ page import="org.openxava.util.XavaPreferences" %>
<%@ page import="org.openxava.view.meta.MetaGroup" %>
<%@ page import="org.openxava.view.meta.PropertiesSeparator" %>
<%@ page import="org.openxava.model.meta.MetaProperty" %>
<%@ page import="org.openxava.model.meta.MetaReference" %>
<%@ page import="org.openxava.model.meta.MetaCollection" %>
<%@ page import="org.openxava.web.WebEditors" %>
<%@ page import="org.openxava.web.taglib.IdTag"%>
<%@ page import="org.openxava.web.Ids"%>
<%@ page import="org.openxava.model.meta.MetaMember"%>
<jsp:useBean id="errors" class="org.openxava.util.Messages" scope="request"/>
<jsp:useBean id="context" class="org.openxava.controller.ModuleContext" scope="session"/>
<jsp:useBean id="style" class="org.openxava.web.style.Style" scope="request"/>
<%!
private boolean hasFrame(MetaMember m, View view) {
if (m instanceof MetaProperty) {
return WebEditors.hasFrame((MetaProperty) m, view.getViewName());
}
if (m instanceof MetaReference) {
return !view.displayReferenceWithNoFrameEditor((MetaReference) m);
}
return true;
}
private String openDivForFrame(View view) {
if (view.isFrame()) return openDiv(view);
return "<div>" + openDiv(view);
}
private String closeDivForFrame(View view) {
if (view.isFrame()) return closeDiv(view);
return closeDiv(view) + "</div>";
}
private String openDiv(View view) {
if (view.isFlowLayout()) return "";
return view.isFrame()?"<div class='ox-layout-detail'>":"";
}
private String closeDiv(View view) {
if (view.isFlowLayout()) return "";
return view.isFrame()?"</div>":"";
}
%>
<%
String viewObject = request.getParameter("viewObject");
viewObject = (viewObject == null || viewObject.equals(""))?"xava_view":viewObject;
org.openxava.view.View view = (org.openxava.view.View) context.get(request, viewObject);
view.setViewObject(viewObject);
String propertyPrefix = request.getParameter("propertyPrefix");
String representsSection = request.getParameter("representsSection");
boolean isSection = "true".equalsIgnoreCase(representsSection);
propertyPrefix = (propertyPrefix == null || "null".equals(propertyPrefix))?"":propertyPrefix;
view.setPropertyPrefix(propertyPrefix);
boolean onlySections = view.hasSections() && view.getMetaMembers().isEmpty();
%>
<%
if (!onlySections) { // IF Not Only Sections
%>
<%=openDiv(view)%>
<%
Iterator it = view.getMetaMembers().iterator();
String sfirst = request.getParameter("first");
boolean first = !"false".equals(sfirst);
while (it.hasNext()) { // WHILE hasNext
MetaMember m = (MetaMember) it.next();
int frameWidth = view.isVariousMembersInSameLine(m)?0:100;
if (m instanceof MetaProperty) { // IF MetaProperty
MetaProperty p = (MetaProperty) m;
if (!PropertiesSeparator.INSTANCE.equals(m)) { // IF Not Properties Separator
boolean hasFrame = WebEditors.hasFrame(p, view.getViewName());
String propertyKey= Ids.decorate(
request.getParameter("application"),
request.getParameter("module"),
propertyPrefix + p.getName());
request.setAttribute(propertyKey, p);
String urlEditor = "editor.jsp" // in this way because websphere 6 has problems with jsp:param
+ "?propertyKey=" + propertyKey
+ "&first=" + first
+ "&hasFrame=" + hasFrame;
boolean withFrame = hasFrame &&
(!view.isSection() || view.getMetaMembers().size() > 1);
if (withFrame) { // IF MetaPropertt With Frame
String labelKey = Ids.decorate(
request.getParameter("application"),
request.getParameter("module"),
"label_" + propertyPrefix + p.getName());
String label = view.getLabelFor(p);
%>
<%=closeDivForFrame(view)%>
<%=style.getFrameHeaderStartDecoration(frameWidth) %>
<%=style.getFrameTitleStartDecoration() %>
<span id="<%=labelKey%>"><%=label%></span>
<%=style.getFrameTitleEndDecoration() %>
<%=style.getFrameActionsStartDecoration()%>
<%
String frameId = Ids.decorate(request, "frame_" + view.getPropertyPrefix() + p.getName());
String frameActionsURL = "frameActions.jsp?frameId=" + frameId +
"&closed=" + view.isFrameClosed(frameId);
%>
<jsp:include page='<%=frameActionsURL%>'/>
<%=style.getFrameActionsEndDecoration()%>
<%@ include file="propertyActionsExt.jsp"%>
<%=style.getFrameHeaderEndDecoration() %>
<%=style.getFrameContentStartDecoration(frameId + "content", view.isFrameClosed(frameId))%>
<%
} // END MetaProperty With Frame
%>
<jsp:include page="<%=urlEditor%>" />
<%
if (withFrame) { // IF MetaProperty With Frame
%>
<%=style.getFrameContentEndDecoration() %>
<%=openDivForFrame(view)%>
<%
} // END IF MetaProperty With Frame
first = false;
} // END IF Not Properties Separator
else { // IF Properties Separator
if (!it.hasNext()) break;
first = true;
%>
<div class="ox-layout-new-line"></div>
<%
} // END IF Properties Separator
} // END IF MetaProperty
else { // IF Not MetaProperty
if (m instanceof MetaReference) { // IF MetaReference
MetaReference ref = (MetaReference) m;
String referenceKey = Ids.decorate(
request.getParameter("application"),
request.getParameter("module"),
propertyPrefix + ref.getName());
request.setAttribute(referenceKey, ref);
if (view.displayReferenceWithNoFrameEditor(ref)) { // IF Display Reference Without Frame
String urlReferenceEditor = "reference.jsp" // in this way because websphere 6 has problems with jsp:param
+ "?referenceKey=" + referenceKey
+ "&first=" + first
+ "&frame=false&composite=false&onlyEditor=false";
%>
<jsp:include page="<%=urlReferenceEditor%>"/>
<%
first = false;
} // END IF Display MetaReference Without Frame
else { // IF Display MeteReference With Frame
String viewName = viewObject + "_" + ref.getName();
View subview = view.getSubview(ref.getName());
context.put(request, viewName, subview);
subview.setViewObject(viewName);
String propertyInReferencePrefix = propertyPrefix + ref.getName() + ".";
boolean withFrame = subview.displayWithFrame();
boolean firstForSubdetail = first || withFrame;
if (withFrame) { // IF MetaReference With Frame
String labelKey = Ids.decorate(
request.getParameter("application"),
request.getParameter("module"),
"label_" + propertyPrefix + ref.getName());
String label = view.getLabelFor(ref);
%>
<%=closeDivForFrame(view)%>
<%=style.getFrameHeaderStartDecoration(frameWidth) %>
<%=style.getFrameTitleStartDecoration() %>
<span id="<%=labelKey%>"><%=label%></span>
<% if (!ref.isAggregate()) { %>
<jsp:include page="referenceFrameHeader.jsp">
<jsp:param name="referenceName" value="<%=ref.getName()%>"/>
<jsp:param name="viewObject" value="<%=viewObject%>"/>
</jsp:include>
<% } %>
<%=style.getFrameTitleEndDecoration() %>
<%=style.getFrameActionsStartDecoration()%>
<%
String frameId = Ids.decorate(request, "frame_" + view.getPropertyPrefix() + ref.getName());
String frameActionsURL = "frameActions.jsp?frameId=" + frameId +
"&closed=" + view.isFrameClosed(frameId);
%>
<jsp:include page='<%=frameActionsURL%>'/>
<%=style.getFrameActionsEndDecoration()%>
<%@ include file="referenceFrameHeaderExt.jsp"%>
<%=style.getFrameHeaderEndDecoration() %>
<%=style.getFrameContentStartDecoration(frameId + "content", view.isFrameClosed(frameId)) %>
<%
} // END IF MetaReference With Frame
String urlReferenceEditor = null;
if (view.displayReferenceWithNotCompositeEditor(ref)) { // IF Display Reference Without Composite Editor
urlReferenceEditor = "reference.jsp" // in this way because websphere 6 has problems with jsp:param
+ "?referenceKey=" + referenceKey
+ "&onlyEditor=true&frame=true&composite=false"
+ "&first=" + first;
} // END IF Display Reference Without Composite Editor
else { // IF Display Reference With Composite Editor
urlReferenceEditor = "reference.jsp" // in this way because websphere 6 has problems with jsp:param
+ "?referenceKey=" + referenceKey
+ "&onlyEditor=true&frame=true&composite=true"
+ "&refViewObject=" + viewName
+ "&propertyPrefix=" + propertyInReferencePrefix
+ "&first=" + firstForSubdetail;
} // END IF Display Reference With Composite Editor
%>
<jsp:include page="<%=urlReferenceEditor%>"/>
<%
if (withFrame) { // IF MetaReference With Frame
%>
<%=style.getFrameContentEndDecoration() %>
<%=openDivForFrame(view)%>
<%
} // END IF MetaReference With Frame
} // END Display MetaReference With Frame
first = false;
} else if (m instanceof MetaCollection) { // IF MetaCollection
MetaCollection collection = (MetaCollection) m;
boolean withFrame = !view.isSection() || view.getMetaMembers().size() > 1;
boolean variousCollectionInLine = view.isVariousCollectionsInSameLine((MetaMember) m);
%>
<%=closeDivForFrame(view)%>
<%
if (withFrame) { // IF MetaCollection With Frame
%>
<%=style.getCollectionFrameHeaderStartDecoration(variousCollectionInLine?50:frameWidth)%>
<%=style.getFrameTitleStartDecoration()%>
<%=collection.getLabel(request) %>
<%
String frameId = Ids.decorate(request, "frame_" + view.getPropertyPrefix() + collection.getName());
String colletionHeaderId = frameId + "header";
%>
<span id="<xava:id name='<%=colletionHeaderId%>'/>">
<jsp:include page="collectionFrameHeader.jsp">
<jsp:param name="collectionName" value="<%=collection.getName()%>"/>
<jsp:param name="viewObject" value="<%=viewObject%>"/>
</jsp:include>
</span>
<%=style.getFrameTitleEndDecoration()%>
<%=style.getFrameActionsStartDecoration()%>
<%
String frameActionsURL = "frameActions.jsp?frameId=" + frameId +
"&closed=" + view.isFrameClosed(frameId);
%>
<jsp:include page='<%=frameActionsURL%>'/>
<%=style.getFrameActionsEndDecoration()%>
<%@ include file="collectionFrameHeaderExt.jsp"%>
<%=style.getFrameHeaderEndDecoration()%>
<%=style.getFrameContentStartDecoration(frameId + "content", view.isFrameClosed(frameId))%>
<%
} // END IF MetaCollection With Frame
%>
<%
String collectionPrefix = propertyPrefix == null?collection.getName() + ".":propertyPrefix + collection.getName() + ".";
%>
<div id="<xava:id name='<%="collection_" + collectionPrefix%>'/>">
<jsp:include page="collection.jsp">
<jsp:param name="collectionName" value="<%=collection.getName()%>"/>
<jsp:param name="viewObject" value="<%=viewObject%>"/>
</jsp:include>
</div>
<%
if (withFrame) { // IF MetaCollection With Frame
%>
<%=style.getFrameContentEndDecoration()%>
<%
} // END IF MetaCollection With Frame
%>
<%=openDivForFrame(view)%>
<%
} else if (m instanceof MetaGroup) { // IF MetaGroup
MetaGroup group = (MetaGroup) m;
String viewName = viewObject + "_" + group.getName();
View subview = view.getGroupView(group.getName());
context.put(request, viewName, subview);
%>
<%=closeDivForFrame(view)%>
<%=style.getFrameHeaderStartDecoration(frameWidth)%>
<%=style.getFrameTitleStartDecoration()%>
<% String labelId = Ids.decorate(request, "label_" + view.getPropertyPrefix() + group.getName()); %>
<span id="<%=labelId%>"><%=group.getLabel(request)%></span>
<%=style.getFrameTitleEndDecoration()%>
<%=style.getFrameActionsStartDecoration()%>
<%
String frameId = Ids.decorate(request, "frame_group_" + view.getPropertyPrefix() + group.getName());
String frameActionsURL = "frameActions.jsp?frameId=" + frameId +
"&closed=" + view.isFrameClosed(frameId);
%>
<jsp:include page='<%=frameActionsURL%>'/>
<%=style.getFrameActionsEndDecoration()%>
<%=style.getFrameHeaderEndDecoration()%>
<%=style.getFrameContentStartDecoration(frameId + "content", view.isFrameClosed(frameId)) %>
<% if (view.isFlowLayout()) { %>
<div class='ox-flow-layout'>
<% } %>
<jsp:include page="detail.jsp">
<jsp:param name="viewObject" value="<%=viewName%>" />
</jsp:include>
<% if (view.isFlowLayout()) { %>
</div>
<% } %>
<%=style.getFrameContentEndDecoration() %>
<%=openDivForFrame(view)%>
<%
} // END IF MetaGroup
} // END IF Not MetaProperty
} // END While hasNext
%>
<%=closeDiv(view)%>
<%
} // END if (!onlySections) {
%>
<%
if (view.hasSections()) { // IF Has Sections
%>
<div id="<xava:id name='<%="sections_" + viewObject%>'/>" class="<%=style.getSections()%>">
<jsp:include page="sections.jsp"/>
</div>
<%
}
%>

Some files were not shown because too many files have changed in this diff Show More