test
This commit is contained in:
52
web/naviox/editors/actionsEditor.jsp
Normal file
52
web/naviox/editors/actionsEditor.jsp
Normal 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]%>">
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
79
web/naviox/editors/collectionActions.jsp
Normal file
79
web/naviox/editors/collectionActions.jsp
Normal 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>
|
||||
<% }
|
||||
|
||||
}
|
||||
%>
|
||||
17
web/naviox/editors/commonDefinitions.jsp
Normal file
17
web/naviox/editors/commonDefinitions.jsp
Normal 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);
|
||||
%>
|
||||
54
web/naviox/editors/membersEditor.jsp
Normal file
54
web/naviox/editors/membersEditor.jsp
Normal 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]%>">
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
13
web/naviox/editors/organizationUrlEditor.jsp
Normal file
13
web/naviox/editors/organizationUrlEditor.jsp
Normal 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%>">
|
||||
9
web/naviox/editors/privacyPolicyEditor.jsp
Normal file
9
web/naviox/editors/privacyPolicyEditor.jsp
Normal 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>
|
||||
Reference in New Issue
Block a user