Source Code Cross Referenced for ActivityContactAvailableSelect.java in  » ERP-CRM-Financial » SourceTap-CRM » com » sourcetap » sfa » activity » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » SourceTap CRM » com.sourcetap.sfa.activity 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * 
003:         * Copyright (c) 2004 SourceTap - www.sourcetap.com
004:         *
005:         *  The contents of this file are subject to the SourceTap Public License 
006:         * ("License"); You may not use this file except in compliance with the 
007:         * License. You may obtain a copy of the License at http://www.sourcetap.com/license.htm
008:         * Software distributed under the License is distributed on an  "AS IS"  basis,
009:         * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
010:         * the specific language governing rights and limitations under the License.
011:         *
012:         * The above copyright notice and this permission notice shall be included
013:         * in all copies or substantial portions of the Software.
014:         *
015:         */
016:
017:        package com.sourcetap.sfa.activity;
018:
019:        import java.util.ArrayList;
020:        import java.util.List;
021:        import java.util.Map;
022:
023:        import org.ofbiz.base.util.Debug;
024:        import org.ofbiz.entity.GenericDelegator;
025:        import org.ofbiz.entity.GenericEntityException;
026:        import org.ofbiz.entity.GenericPK;
027:        import org.ofbiz.entity.GenericValue;
028:        import org.ofbiz.entity.condition.EntityCondition;
029:        import org.ofbiz.entity.condition.EntityExpr;
030:        import org.ofbiz.entity.condition.EntityOperator;
031:
032:        import com.sourcetap.sfa.security.SecurityLinkInfo;
033:        import com.sourcetap.sfa.security.SecurityWrapper;
034:        import com.sourcetap.sfa.ui.UIDropDown;
035:        import com.sourcetap.sfa.util.UserInfo;
036:
037:        /**
038:         * DOCUMENT ME!
039:         *
040:         */
041:        public class ActivityContactAvailableSelect extends UIDropDown {
042:            public static final String module = ActivityContactAvailableSelect.class
043:                    .getName();
044:
045:            public ActivityContactAvailableSelect() {
046:            }
047:
048:            /**
049:             * DOCUMENT ME!
050:             *
051:             * @param delegator 
052:             * @param filterValues 
053:             * @param userInfo 
054:             *
055:             * @return 
056:             */
057:            public List getDropDownValues(GenericDelegator delegator,
058:                    Map filterValues, UserInfo userInfo) {
059:                // See if the account ID was passed in the parameter map. If so, use that account ID.  Otherwise, use the
060:                // account ID from the activity.
061:                String accountId = "";
062:
063:                if (filterValues.containsKey("accountId")) {
064:                    accountId = (String) filterValues.get("accountId");
065:
066:                    Debug
067:                            .logVerbose(
068:                                    "-->[ActivityContactAvailableSelect.getDropDownValues] Account ID passed in parameters: "
069:                                            + accountId, module);
070:                } else {
071:                    if (!filterValues.containsKey("activityId")) {
072:                        Debug
073:                                .logWarning(
074:                                        "[ActivityContactAvailableSelect.getDropDownValues] Neither account ID nor activity ID are included in the query parameters. Can't get eligible contacts.",
075:                                        module);
076:
077:                        return new ArrayList();
078:                    }
079:
080:                    // Get the account ID for this activity.
081:                    String activityId = (String) filterValues.get("activityId");
082:                    GenericPK activityPK = new GenericPK(delegator
083:                            .getModelEntity("Activity"));
084:                    activityPK.set("activityId", activityId);
085:
086:                    GenericValue activityGV = null;
087:
088:                    try {
089:                        activityGV = delegator.findByPrimaryKey(activityPK);
090:                    } catch (GenericEntityException e) {
091:                        Debug
092:                                .logError(
093:                                        "[ActivityContactAvailableSelect.getDropDownValues] Error retrieving the activity: ",
094:                                        module);
095:                        Debug.logError(e.getLocalizedMessage(), module);
096:
097:                        return new ArrayList();
098:                    }
099:
100:                    accountId = (activityGV.getString("accountId") == null) ? ""
101:                            : activityGV.getString("accountId");
102:
103:                    Debug
104:                            .logVerbose(
105:                                    "-->[ActivityContactAvailableSelect.getDropDownValues] Account ID from activity: "
106:                                            + accountId, module);
107:                }
108:
109:                // Get a list of all eligible contacts.
110:                ArrayList orderBy = new ArrayList();
111:                orderBy.add("lastName");
112:                orderBy.add("firstName");
113:
114:                EntityCondition condition = null;
115:                if ((accountId != null) && (accountId.length() > 0)
116:                        && (!accountId.equals("null"))) {
117:                    condition = new EntityExpr("accountId",
118:                            EntityOperator.EQUALS, accountId);
119:
120:                    Debug
121:                            .logVerbose(
122:                                    "-->[ActivityContactAvailableSelect.getDropDownValues] Adding entity clause for account ID: "
123:                                            + accountId, module);
124:                }
125:
126:                try {
127:                    return SecurityWrapper.findByCondition("Contact",
128:                            condition, orderBy, userInfo, new SecurityLinkInfo(
129:                                    "Account", "accountId", true), delegator);
130:                } catch (GenericEntityException e) {
131:                    Debug
132:                            .logError(
133:                                    "[ActivityContactAvailableSelect.getDropDownValues] Error retrieving the contacts: ",
134:                                    module);
135:                    Debug.logError(e.getLocalizedMessage(), module);
136:
137:                    return new ArrayList();
138:                }
139:            }
140:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.