diff --git a/applications/content/webapp/content/WEB-INF/actions/includes/findprep.bsh b/applications/content/webapp/content/WEB-INF/actions/includes/findprep.bsh deleted file mode 100644 index 111eedde1b..0000000000 --- a/applications/content/webapp/content/WEB-INF/actions/includes/findprep.bsh +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2001-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -/** - * Calls performFind service to return an EntityListIterator of the - * entities found from the parameter map selection criteria. - * Also builds a query form wrapper. - */ - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; - -import org.ofbiz.base.util.*; -import org.ofbiz.entity.*; -import org.ofbiz.entity.util.*; -import org.ofbiz.security.*; -import org.ofbiz.service.*; -import org.ofbiz.entity.model.*; -import org.ofbiz.widget.html.*; -import org.ofbiz.widget.form.*; -import org.ofbiz.base.util.BshUtil; -import bsh.EvalError; - - -import java.util.ListIterator; -import javax.servlet.*; -import javax.servlet.http.*; - -LocalDispatcher dispatcher = (LocalDispatcher)request.getAttribute("dispatcher"); - -inputFields = UtilHttp.getParameterMap(request); -entityName = page.getProperty("entityName"); -formDefFile = page.getProperty("formDefFile"); -singleFormName = page.getProperty("singleFormName"); - -HashMap inMap = new HashMap(); -inMap.put("entityName", entityName); - -//preload the query -staticConditionsStr = page.getProperty("staticConditions"); -if (staticConditionsStr != null && staticConditionsStr.length() > 0) { - String [] staticConditions = BshUtil.eval("String [] cond=" - + staticConditionsStr + "; return cond;",new HashMap()); - for(int i=0; i < staticConditions.length; i += 2) { - inputFields.put(staticConditions[i], staticConditions[i+1]); - } -} -Debug.logInfo("inputFields:"+ inputFields, ""); -inMap.put("inputFields", inputFields); -Map result = null; -try { - result = dispatcher.runSync("performFind", inMap); -} catch (GenericServiceException e) { - request.setAttribute("_ERROR_MESSAGE_", "ERROR: Error in findLookup service. " + e.getMessage() + ")"); - Debug.log(e, "findprep.bsh"); - return "error"; -} - -listIt = (ListIterator)result.get("listIt"); -request.setAttribute("listIt", listIt); - -String queryString = UtilHttp.urlEncodeArgs(inputFields); -context.put("queryString", queryString); -context.put("entityName", entityName); - -HtmlFormWrapper queryWrapper = new HtmlFormWrapper(formDefFile, - singleFormName, request, response); -context.put("queryWrapper", queryWrapper); - diff --git a/applications/content/webapp/content/WEB-INF/actions/includes/mruprep.bsh b/applications/content/webapp/content/WEB-INF/actions/includes/mruprep.bsh deleted file mode 100644 index e56baf85dd..0000000000 --- a/applications/content/webapp/content/WEB-INF/actions/includes/mruprep.bsh +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2001-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -/** - * Builds a list of most recently used EntityValues from a session-kept cache - * for the "current" entity. It also builds a listFormWrapper. - * This is used in popup lookup pages. - */ - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; - -import org.ofbiz.base.util.*; -import org.ofbiz.entity.*; -import org.ofbiz.security.*; -import org.ofbiz.service.*; -import org.ofbiz.entity.model.*; -import org.ofbiz.widget.html.*; -import org.ofbiz.widget.form.*; -import org.ofbiz.base.util.collections.LifoSet; - - -import javax.servlet.*; -import javax.servlet.http.*; - - -GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator"); -entityName = page.getProperty("entityName"); -lookupCaches = (Map) session.getAttribute("lookupCaches"); -org.ofbiz.base.util.Debug.logInfo("entityName:" + entityName, ""); -org.ofbiz.base.util.Debug.logInfo("in mruprep.bsh, lookupCaches:" + lookupCaches, ""); -if(lookupCaches == null){ - lookupCaches = new HashMap(); - session.setAttribute("lookupCaches", lookupCaches); -} -cacheEntityName = entityName; -Debug.logInfo("index:" + entityName.indexOf("DataResource") , ""); -if (UtilValidate.isNotEmpty(entityName) && entityName.indexOf("DataResource") >= 0) { - cacheEntityName = "DataResourceContentView"; - dataResourceTypeId = request.getParameter("drDataResourceTypeId"); - if (UtilValidate.isNotEmpty(dataResourceTypeId)) { - cacheEntityName += "_" + dataResourceTypeId; - if (cacheEntityName.indexOf("ELECTRONIC_TEXT") >= 0) { - mimeTypeId = request.getParameter("drMimeTypeId"); - if (UtilValidate.isNotEmpty(mimeTypeId)) { - cacheEntityName += "_" + mimeTypeId; - } - } - } -} - -Debug.logInfo("cacheEntityName:" + cacheEntityName, "mruprep"); -lifoSet = (LifoSet) lookupCaches.get(cacheEntityName); -Debug.logInfo("lifoSet:" + lifoSet, "mruprep"); - -if (lifoSet == null) { - lifoSet = new LifoSet(10); - lookupCaches.put(cacheEntityName, lifoSet); -} - -LinkedList mruList = new LinkedList(); -int sz = lifoSet.size(); -GenericValue gv = null; -GenericPK pk = null; -GenericPK pk2 = null; - -lsIter = lifoSet.iterator(); -while (lsIter.hasNext()) { - pk = lsIter.next(); - gv = delegator.findByPrimaryKey(pk); - if (gv != null) mruList.add(gv); -} - -String formDefFile = page.getProperty("formDefFile"); -String mruFormName = page.getProperty("mruFormName"); -HtmlFormWrapper mruWrapper = new HtmlFormWrapper(formDefFile, mruFormName, request, response); -mruWrapper.putInContext("mruList", mruList); -Debug.logInfo("mruList:" + mruList, ""); - -context.put("mruWrapper", mruWrapper); - diff --git a/applications/content/webapp/content/WEB-INF/actions/includes/staticfind.bsh b/applications/content/webapp/content/WEB-INF/actions/includes/staticfind.bsh deleted file mode 100644 index 84ef23ea7b..0000000000 --- a/applications/content/webapp/content/WEB-INF/actions/includes/staticfind.bsh +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2001-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -/** - * Calls performFind service to return an EntityListIterator of the - * entities found from the parameter map selection criteria. - * Also builds a query form wrapper. - */ - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; - -import org.ofbiz.base.util.*; -import org.ofbiz.entity.*; -import org.ofbiz.entity.util.*; -import org.ofbiz.security.*; -import org.ofbiz.service.*; -import org.ofbiz.entity.model.*; -import org.ofbiz.widget.html.*; -import org.ofbiz.widget.form.*; -import org.ofbiz.base.util.BshUtil; -import bsh.EvalError; - - -import java.util.ListIterator; -import javax.servlet.*; -import javax.servlet.http.*; - -LocalDispatcher dispatcher = (LocalDispatcher)request.getAttribute("dispatcher"); - -entityName = page.getProperty("entityName"); - -HashMap inMap = new HashMap(); -inMap.put("entityName", entityName); - -//preload the query -staticConditionsStr = page.getProperty("staticConditions"); -inputFields = new HashMap(); -if (staticConditionsStr != null && staticConditionsStr.length() > 0) { - String [] staticConditions = BshUtil.eval("String [] cond=" - + staticConditionsStr + "; return cond;",new HashMap()); - for(int i=0; i < staticConditions.length; i += 2) { - inputFields.put(staticConditions[i], staticConditions[i+1]); - } -} -Debug.logInfo("in staticfind.bsh, inputFields:"+ inputFields, ""); -inMap.put("inputFields", inputFields); -Map result = null; -try { - result = dispatcher.runSync("performFind", inMap ); -} catch (GenericServiceException e) { - request.setAttribute("_ERROR_MESSAGE_", "ERROR: Error in findLookup service. " + e.getMessage() + ")"); - Debug.log(e, "findprep.bsh"); - return "error"; -} - -listIt = (ListIterator)result.get("listIt"); -request.setAttribute("listIt", listIt); - - diff --git a/applications/content/webapp/content/WEB-INF/actions/layout/addcontentidto.bsh b/applications/content/webapp/content/WEB-INF/actions/layout/addcontentidto.bsh deleted file mode 100644 index c56c71ea98..0000000000 --- a/applications/content/webapp/content/WEB-INF/actions/layout/addcontentidto.bsh +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2001-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ -/** - * This is a hack of includes/pagelistprep.bsh, whose only change is to - * add the "contentIdTo" field/value to the passed structures. - */ - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; - -import org.ofbiz.base.util.*; -import org.ofbiz.entity.*; -import org.ofbiz.entity.condition.*; -import org.ofbiz.entity.util.*; -import org.ofbiz.security.*; -import org.ofbiz.service.*; -import org.ofbiz.entity.model.*; -import org.ofbiz.widget.html.*; -import org.ofbiz.widget.form.*; - - -import java.util.ListIterator; -import javax.servlet.*; -import javax.servlet.http.*; - -delegator = (GenericDelegator) request.getAttribute("delegator"); - -formDefFile = page.getProperty("formDefFile"); -listFormName = page.getProperty("listFormName"); -entityName = page.getProperty("entityName"); -contentIdTo = page.getProperty("contentIdTo"); -paramMap = UtilHttp.getParameterMap(request); -if (UtilValidate.isEmpty(contentIdTo)) - contentIdTo = request.getAttribute("contentIdTo"); -if (UtilValidate.isEmpty(contentIdTo)) - contentIdTo = paramMap.get("contentIdTo"); -Debug.logInfo("in addcontentidto, contentIdTo:" + contentIdTo, ""); -htmlListWrapper = context.get("listWrapper"); -htmlListWrapper.putInContext("contentIdTo", contentIdTo); - diff --git a/applications/content/webapp/content/WEB-INF/actions/layout/lookupprep.bsh b/applications/content/webapp/content/WEB-INF/actions/layout/lookupprep.bsh deleted file mode 100644 index 38a6806e13..0000000000 --- a/applications/content/webapp/content/WEB-INF/actions/layout/lookupprep.bsh +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2001-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ - -import org.ofbiz.widget.html.*; -import org.ofbiz.base.util.*; - -listWrapper = (HtmlFormWrapper)context.get("listWrapper"); -mruWrapper = (HtmlFormWrapper)context.get("mruWrapper"); -queryWrapper = (HtmlFormWrapper)context.get("queryWrapper"); -contentIdTo = page.getProperty("contentIdTo"); -paramMap = UtilHttp.getParameterMap(request); -if (UtilValidate.isEmpty(contentIdTo)) - contentIdTo = request.getAttribute("contentIdTo"); -if (UtilValidate.isEmpty(contentIdTo)) - contentIdTo = paramMap.get("contentIdTo"); -Debug.logInfo("in lookupprep, contentIdTo:" + contentIdTo, ""); - -org.ofbiz.base.util.Debug.logInfo("in lookupprep, contentIdTo:" + contentIdTo, ""); -listWrapper.putInContext("contentIdTo", contentIdTo); -mruWrapper.putInContext("contentIdTo", contentIdTo); -queryWrapper.putInContext("contentIdTo", contentIdTo); - -mapKey = (String)request.getParameter("mapKey"); -listWrapper.putInContext("mapKey", mapKey); -mruWrapper.putInContext("mapKey", mapKey); -queryWrapper.putInContext("mapKey", mapKey); - diff --git a/applications/content/webapp/content/WEB-INF/pagedefs/layout/LookupSubContent.xml b/applications/content/webapp/content/WEB-INF/pagedefs/layout/LookupSubContent.xml deleted file mode 100644 index c1b2296de3..0000000000 --- a/applications/content/webapp/content/WEB-INF/pagedefs/layout/LookupSubContent.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Lookup Layout - /layout/LayoutForms.xml - lookupDataResourceContent - listLookupDataResourceContent - listLookupDataResourceContent - /layout/layout_menu.ftl - Layout - DataResourceContentView - entityList - CONTENTMGR - simple - - - - -