01: /*
02: *
03: * Copyright (c) 2004 SourceTap - www.sourcetap.com
04: *
05: * The contents of this file are subject to the SourceTap Public License
06: * ("License"); You may not use this file except in compliance with the
07: * License. You may obtain a copy of the License at http://www.sourcetap.com/license.htm
08: * Software distributed under the License is distributed on an "AS IS" basis,
09: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
10: * the specific language governing rights and limitations under the License.
11: *
12: * The above copyright notice and this permission notice shall be included
13: * in all copies or substantial portions of the Software.
14: *
15: */
16:
17: package com.sourcetap.sfa.party;
18:
19: import java.util.ArrayList;
20: import java.util.HashMap;
21: import java.util.List;
22:
23: import org.ofbiz.base.util.Debug;
24: import org.ofbiz.base.util.UtilMisc;
25: import org.ofbiz.entity.GenericDelegator;
26: import org.ofbiz.entity.GenericEntityException;
27: import org.ofbiz.entity.condition.EntityCondition;
28: import org.ofbiz.entity.condition.EntityConditionList;
29: import org.ofbiz.entity.condition.EntityExpr;
30: import org.ofbiz.entity.condition.EntityOperator;
31:
32: import com.sourcetap.sfa.ui.UICache;
33: import com.sourcetap.sfa.ui.UIWebScreenSection;
34: import com.sourcetap.sfa.util.UserInfo;
35:
36: /**
37: * DOCUMENT ME!
38: *
39: */
40: public class PartyIdentifierSelectWSS extends UIWebScreenSection {
41: public static final String module = PartyIdentifierSelectWSS.class
42: .getName();
43:
44: public PartyIdentifierSelectWSS(UserInfo userInfo,
45: String screenName, String sectionName,
46: GenericDelegator delegator, UICache uiCache)
47: throws GenericEntityException {
48: super (userInfo, screenName, sectionName, delegator, uiCache);
49: }
50:
51: /**
52: * DOCUMENT ME!
53: *
54: * @param useQueryParameterValueMap
55: * @param listedEntityName
56: * @param userInfo
57: * @param delegator
58: *
59: * @return
60: */
61: public List getEligibleEntityList(
62: HashMap useQueryParameterValueMap, String listedEntityName,
63: UserInfo userInfo, GenericDelegator delegator) {
64:
65: EntityCondition condition = new EntityConditionList(UtilMisc
66: .toList(new EntityExpr("codeTypeId",
67: EntityOperator.EQUALS, "IDENTIFIER_TYPE")),
68: EntityOperator.AND);
69:
70: try {
71: return delegator.findByCondition("Code", condition, null,
72: UtilMisc.toList("codeValue"));
73: } catch (Exception e) {
74: Debug.logError(
75: "An error occurred while getting account identifier select values:"
76: + e.getLocalizedMessage(), module);
77:
78: return new ArrayList();
79: }
80: }
81: }
|