Removed unused files from the Content component.

git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@479020 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacopo Cappellato
2006-11-24 22:06:43 +00:00
parent 2e215bd8df
commit 3d76086ce4
6 changed files with 0 additions and 401 deletions
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<page>
<template>lookup</template>
<property name="title">Lookup Layout</property>
<property name="formDefFile">/layout/LayoutForms.xml</property>
<property name="singleFormName">lookupDataResourceContent</property>
<property name="listFormName">listLookupDataResourceContent</property>
<property name="mruFormName">listLookupDataResourceContent</property>
<property name="subMenu">/layout/layout_menu.ftl</property>
<property name="headerItem">Layout</property>
<property name="entityName">DataResourceContentView</property>
<property name="listName">entityList</property>
<property name="permission">CONTENTMGR</property>
<property name="permissionType">simple</property>
<page-action name="/includes/findprep.bsh"/>
<page-action name="/includes/mruprep.bsh"/>
<page-action name="/includes/pagelistprep.bsh"/>
<content-action name="/layout/lookupprep.bsh"/>
</page>