001: /*
002: * $Id: lookupParams.java,v 1.3 2004/02/16 11:16:04 jacopo Exp $
003: *
004: * Copyright (c) 2003 The Open For Business Project - www.ofbiz.org
005: *
006: * Permission is hereby granted, free of charge, to any person obtaining a
007: * copy of this software and associated documentation files (the "Software"),
008: * to deal in the Software without restriction, including without limitation
009: * the rights to use, copy, modify, merge, publish, distribute, sublicense,
010: * and/or sell copies of the Software, and to permit persons to whom the
011: * Software is furnished to do so, subject to the following conditions:
012: *
013: * The above copyright notice and this permission notice shall be included
014: * in all copies or substantial portions of the Software.
015: *
016: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
017: * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
018: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
019: * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
020: * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
021: * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
022: * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
023: */
024: package org.ofbiz.manufacturing;
025:
026: import java.util.Map;
027: import java.util.HashMap;
028:
029: import javax.servlet.http.HttpServletRequest;
030: import javax.servlet.http.HttpServletResponse;
031: import javax.servlet.http.HttpSession;
032:
033: import org.ofbiz.base.util.Debug;
034: import org.ofbiz.base.util.UtilMisc;
035:
036: /**
037: * Product Information Related Events
038: *
039: * @author <a href="mailto:holivier@nereide.biz">Olivier Heintz</a>
040: * @version $Revision: 1.3 $
041: * @since 3.0
042: */
043: public class lookupParams {
044:
045: public static final String module = lookupParams.class.getName();
046:
047: /** Set up parameters to be able to start the generic lockup to have LookupRoutingTask
048: *@param request The HTTPRequest object for the current request
049: *@param response The HTTPResponse object for the current request
050: *@return String specifying the exit status of this event
051: */
052: public static String lookupRouting(HttpServletRequest request,
053: HttpServletResponse response) {
054:
055: HttpSession session = ((HttpServletRequest) request)
056: .getSession();
057: Map paramLookup = (Map) session.getAttribute("paramLookup");
058: if (paramLookup == null
059: || !"LookupRouting".equals(paramLookup
060: .get("lookupName"))) {
061: if (paramLookup == null) {
062: paramLookup = new HashMap();
063: session.setAttribute("paramLookup", paramLookup);
064: } else
065: paramLookup.clear();
066: paramLookup.put("lookupName", "LookupRouting");
067: paramLookup.put("titleProperty", "PageTitleLookupRouting");
068: paramLookup.put("formDefFile",
069: "/lookup/FieldLookupForms.xml");
070: paramLookup.put("singleFormName", "lookupRouting");
071: paramLookup.put("listFormName", "listLookupRouting");
072: paramLookup.put("entityName", "WorkEffort");
073: // paramLookup.put("listName","entityList");
074: paramLookup.put("viewSize", "10");
075: paramLookup.put("permission", "MANUFACTURING");
076: paramLookup.put("permissionType", "simple");
077: paramLookup.put("initialConstraint", UtilMisc.toMap(
078: "workEffortTypeId", "ROUTING", "fixedAssetId_op",
079: "equals"));
080: }
081: return "success";
082: }
083:
084: /** Set up parameters to be able to start the generic lockup to have LookupRoutingTask
085: *@param request The HTTPRequest object for the current request
086: *@param response The HTTPResponse object for the current request
087: *@return String specifying the exit status of this event
088: */
089: public static String lookupRoutingTask(HttpServletRequest request,
090: HttpServletResponse response) {
091:
092: HttpSession session = ((HttpServletRequest) request)
093: .getSession();
094: Map paramLookup = (Map) session.getAttribute("paramLookup");
095: if (paramLookup == null
096: || !"LookupRoutingTask".equals(paramLookup
097: .get("lookupName"))) {
098: if (paramLookup == null) {
099: paramLookup = new HashMap();
100: session.setAttribute("paramLookup", paramLookup);
101: } else
102: paramLookup.clear();
103: paramLookup.put("lookupName", "LookupRoutingTask");
104: paramLookup.put("titleProperty",
105: "PageTitleLookupRoutingTask");
106: paramLookup.put("formDefFile",
107: "/lookup/FieldLookupForms.xml");
108: paramLookup.put("singleFormName", "lookupRoutingTask");
109: paramLookup.put("listFormName", "listLookupRoutingTask");
110: paramLookup.put("entityName", "WorkEffort");
111: // paramLookup.put("listName","entityList");
112: paramLookup.put("viewSize", "10");
113: paramLookup.put("permission", "MANUFACTURING");
114: paramLookup.put("permissionType", "simple");
115: paramLookup.put("initialConstraint", UtilMisc.toMap(
116: "workEffortTypeId", "ROU_TASK", "fixedAssetId_op",
117: "equals"));
118: }
119: return "success";
120: }
121:
122: /** Set up parameters to be able to start the generic lockup to have LookupProduct
123: *@param request The HTTPRequest object for the current request
124: *@param response The HTTPResponse object for the current request
125: *@return String specifying the exit status of this event
126: */
127: public static String lookupProduct(HttpServletRequest request,
128: HttpServletResponse response) {
129:
130: HttpSession session = ((HttpServletRequest) request)
131: .getSession();
132: Map paramLookup = (Map) session.getAttribute("paramLookup");
133: if (paramLookup == null
134: || !"LookupProduct".equals(paramLookup
135: .get("lookupName"))) {
136: if (paramLookup == null) {
137: paramLookup = new HashMap();
138: session.setAttribute("paramLookup", paramLookup);
139: } else
140: paramLookup.clear();
141: paramLookup.put("lookupName", "LookupProduct");
142: paramLookup.put("titleProperty", "PageTitleLookupProduct");
143: paramLookup.put("formDefFile",
144: "/lookup/FieldLookupForms.xml");
145: paramLookup.put("singleFormName", "lookupProduct");
146: paramLookup.put("listFormName", "listLookupProduct");
147: paramLookup.put("entityName", "Product");
148: // paramLookup.put("listName","entityList");
149: paramLookup.put("viewSize", "10");
150: paramLookup.put("permission", "MANUFACTURING");
151: paramLookup.put("permissionType", "simple");
152: }
153:
154: return "success";
155: }
156:
157: /** Set up parameters to be able to start the generic lockup to have LookupVirtualProduct
158: *@param request The HTTPRequest object for the current request
159: *@param response The HTTPResponse object for the current request
160: *@return String specifying the exit status of this event
161: */
162: public static String lookupVirtualProduct(
163: HttpServletRequest request, HttpServletResponse response) {
164:
165: HttpSession session = ((HttpServletRequest) request)
166: .getSession();
167: Map paramLookup = (Map) session.getAttribute("paramLookup");
168: if (paramLookup == null
169: || !"LookupVirtualProduct".equals(paramLookup
170: .get("lookupName"))) {
171: if (paramLookup == null) {
172: paramLookup = new HashMap();
173: session.setAttribute("paramLookup", paramLookup);
174: } else
175: paramLookup.clear();
176: paramLookup.put("lookupName", "LookupVirtualProduct");
177: paramLookup.put("titleProperty",
178: "PageTitleLookupVirtualProducts");
179: paramLookup.put("formDefFile", "/bom/BomForms.xml");
180: paramLookup.put("singleFormName", "lookupVirtualProduct");
181: paramLookup.put("listFormName", "listLookupVirtualProduct");
182: paramLookup.put("entityName", "Product");
183: // paramLookup.put("listName","entityList");
184: paramLookup.put("viewSize", "10");
185: paramLookup.put("permission", "MANUFACTURING");
186: paramLookup.put("permissionType", "simple");
187: paramLookup.put("initialConstraint", UtilMisc.toMap(
188: "isVirtual", "Y", "isVirtual_op", "equals"));
189: }
190:
191: return "success";
192: }
193: }
|