All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.xava.detail.jsp Maven / Gradle / Ivy

<%@ 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"%>





<%!
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 "
" + openDiv(view); } private String closeDivForFrame(View view) { if (view.isFrame()) return closeDiv(view); return closeDiv(view) + "
"; } private String openDiv(View view) { if (view.isFlowLayout()) return ""; return view.isFrame()?"
":""; } private String closeDiv(View view) { if (view.isFlowLayout()) return ""; return view.isFrame()?"
":""; } %> <% 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)?50: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() %> <%=label%> <%=style.getFrameTitleEndDecoration() %> <%=style.getFrameActionsStartDecoration()%> <% String frameId = Ids.decorate(request, "frame_" + view.getPropertyPrefix() + p.getName()); String frameActionsURL = "frameActions.jsp?frameId=" + frameId + "&closed=" + view.isFrameClosed(frameId); %> <%=style.getFrameActionsEndDecoration()%> <%@ include file="propertyActionsExt.jsp"%> <%=style.getFrameHeaderEndDecoration() %> <%=style.getFrameContentStartDecoration(frameId + "content", view.isFrameClosed(frameId))%> <% } // END MetaProperty With Frame else if (hasFrame) { %> <%=closeDivForFrame(view)%>
<% } %> <% if (withFrame) { // IF MetaProperty With Frame %> <%=style.getFrameContentEndDecoration() %> <%=openDivForFrame(view)%> <% } // END IF MetaProperty With Frame else if (hasFrame) { %>
<%=openDivForFrame(view)%> <% } first = false; } // END IF Not Properties Separator else { // IF Properties Separator if (!it.hasNext()) break; first = true; %>
<% } // 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"; %> <% 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() %> <%=label%> <% if (!ref.isAggregate()) { %> <% } %> <%=style.getFrameTitleEndDecoration() %> <%=style.getFrameActionsStartDecoration()%> <% String frameId = Ids.decorate(request, "frame_" + view.getPropertyPrefix() + ref.getName()); String frameActionsURL = "frameActions.jsp?frameId=" + frameId + "&closed=" + view.isFrameClosed(frameId); %> <%=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 %> <% 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"; %> <%=style.getFrameTitleEndDecoration()%> <%=style.getFrameActionsStartDecoration()%> <% String frameActionsURL = "frameActions.jsp?frameId=" + frameId + "&closed=" + view.isFrameClosed(frameId); %> <%=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() + "."; %>
'/>">
<% 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); if (view.isFlowLayout() && view.isVariousMembersInSameLine(group)) frameWidth = 50; %> <%=closeDivForFrame(view)%> <% if (view.isFlowLayout() && view.isVariousMembersInSameLine(group) && view.isFirstInLine(group)) { %>
<% } %> <%=style.getFrameHeaderStartDecoration(frameWidth)%> <%=style.getFrameTitleStartDecoration()%> <% String labelId = Ids.decorate(request, "label_" + view.getPropertyPrefix() + group.getName()); String labelGroup = org.openxava.util.Is.empty(subview.getTitle()) ? group.getLabel(request) : subview.getTitle();%> <%=labelGroup%> <%=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); %> <%=style.getFrameActionsEndDecoration()%> <%=style.getFrameHeaderEndDecoration()%> <%=style.getFrameContentStartDecoration(frameId + "content", view.isFrameClosed(frameId)) %> <% if (view.isFlowLayout()) { %>
<% } %> <% if (view.isFlowLayout()) { %>
<% } %> <%=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 %>
'/>" class="<%=style.getSections()%>">
<% } %>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy