svn commit: r938933 - /ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r938933 - /ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java

lektran
Author: lektran
Date: Wed Apr 28 11:27:05 2010
New Revision: 938933

URL: http://svn.apache.org/viewvc?rev=938933&view=rev
Log:
The following deprecated classes, constructors or methods have been removed:
org.ofbiz.workeffort.workeffort.getWorkEffort(PageContext, String, String, String, String, String, String)
org.ofbiz.workeffort.workeffort.getMonthWorkEffortEvents(PageContext, String)
org.ofbiz.workeffort.workeffort.getActivityContext(PageContext, String)
org.ofbiz.workeffort.workeffort.getActivityContext(PageContext, String, String)

Modified:
    ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java

Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java?rev=938933&r1=938932&r2=938933&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java (original)
+++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java Wed Apr 28 11:27:05 2010
@@ -51,122 +51,6 @@ public class WorkEffortWorker {
 
     public static final String module = WorkEffortWorker.class.getName();
 
-    /** @deprecated */
-    @Deprecated
-    public static void getWorkEffort(PageContext pageContext, String workEffortIdAttrName, String workEffortAttrName, String partyAssignsAttrName,
-        String canViewAttrName, String tryEntityAttrName, String currentStatusAttrName) {
-        Delegator delegator = (Delegator) pageContext.getRequest().getAttribute("delegator");
-        Security security = (Security) pageContext.getRequest().getAttribute("security");
-        GenericValue userLogin = (GenericValue) pageContext.getSession().getAttribute("userLogin");
-
-        String workEffortId = pageContext.getRequest().getParameter("workEffortId");
-
-        // if there was no parameter, check the request attribute, this may be a newly created entity
-        if (workEffortId == null)
-            workEffortId = (String) pageContext.getRequest().getAttribute("workEffortId");
-
-        GenericValue workEffort = null;
-
-        try {
-            workEffort = delegator.findOne("WorkEffort", false, "workEffortId", workEffortId);
-        } catch (GenericEntityException e) {
-            Debug.logWarning(e, module);
-        }
-
-        Boolean canView = null;
-        Collection<GenericValue> workEffortPartyAssignments = null;
-        Boolean tryEntity = null;
-        GenericValue currentStatus = null;
-
-        if (workEffort == null) {
-            tryEntity = Boolean.FALSE;
-            canView = Boolean.TRUE;
-
-            String statusId = pageContext.getRequest().getParameter("currentStatusId");
-
-            if (UtilValidate.isNotEmpty(statusId)) {
-                try {
-                    currentStatus = delegator.findByPrimaryKeyCache("StatusItem", UtilMisc.toMap("statusId", statusId));
-                } catch (GenericEntityException e) {
-                    Debug.logWarning(e, module);
-                }
-            }
-        } else {
-            // get a collection of workEffortPartyAssignments, if empty then this user CANNOT view the event, unless they have permission to view all
-            if (userLogin != null && userLogin.get("partyId") != null && workEffortId != null) {
-                try {
-                    workEffortPartyAssignments =
-                            delegator.findByAnd("WorkEffortPartyAssignment", UtilMisc.toMap("workEffortId", workEffortId, "partyId", userLogin.get("partyId")));
-                } catch (GenericEntityException e) {
-                    Debug.logWarning(e, module);
-                }
-            }
-            canView = (UtilValidate.isNotEmpty(workEffortPartyAssignments)) ? Boolean.TRUE : Boolean.FALSE;
-            if (!canView.booleanValue() && security.hasEntityPermission("WORKEFFORTMGR", "_VIEW", pageContext.getSession())) {
-                canView = Boolean.TRUE;
-            }
-
-            tryEntity = Boolean.TRUE;
-
-            if (workEffort.get("currentStatusId") != null) {
-                try {
-                    currentStatus = delegator.findByPrimaryKeyCache("StatusItem", UtilMisc.toMap("statusId", workEffort.get("currentStatusId")));
-                } catch (GenericEntityException e) {
-                    Debug.logWarning(e, module);
-                }
-            }
-        }
-
-        // if there was an error message, don't get values from entity
-        if (pageContext.getRequest().getAttribute("_ERROR_MESSAGE_") != null) {
-            tryEntity = Boolean.FALSE;
-        }
-
-        if (workEffortId != null)
-            pageContext.setAttribute(workEffortIdAttrName, workEffortId);
-        if (workEffort != null)
-            pageContext.setAttribute(workEffortAttrName, workEffort);
-        if (canView != null)
-            pageContext.setAttribute(canViewAttrName, canView);
-        if (workEffortPartyAssignments != null)
-            pageContext.setAttribute(partyAssignsAttrName, workEffortPartyAssignments);
-        if (tryEntity != null)
-            pageContext.setAttribute(tryEntityAttrName, tryEntity);
-        if (currentStatus != null)
-            pageContext.setAttribute(currentStatusAttrName, currentStatus);
-    }
-
-    /** @deprecated */
-    @Deprecated
-    public static void getMonthWorkEffortEvents(PageContext pageContext, String attributeName) {}
-
-    /** @deprecated */
-    @Deprecated
-    public static void getActivityContext(PageContext pageContext, String workEffortId) {
-        getActivityContext(pageContext, workEffortId, "activityContext");
-    }
-
-    /** @deprecated */
-    @Deprecated
-    public static void getActivityContext(PageContext pageContext, String workEffortId, String attribute) {
-        LocalDispatcher dispatcher = (LocalDispatcher) pageContext.getRequest().getAttribute("dispatcher");
-        GenericValue userLogin = (GenericValue) pageContext.getSession().getAttribute("userLogin");
-        Map<String, Object> svcCtx = UtilMisc.toMap("workEffortId", workEffortId, "userLogin", userLogin);
-        Map<String, Object> result = null;
-
-        try {
-            result = dispatcher.runSync("wfGetActivityContext", svcCtx);
-        } catch (GenericServiceException e) {
-            Debug.logError(e, module);
-        }
-        if (result != null && result.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_ERROR))
-            Debug.logError((String) result.get(ModelService.ERROR_MESSAGE), module);
-        if (result != null && result.containsKey("activityContext")) {
-            Object aC = UtilGenerics.checkMap(result.get("activityContext"));
-            pageContext.setAttribute(attribute, aC);
-        }
-    }
-
     public static List<GenericValue> getLowestLevelWorkEfforts(Delegator delegator, String workEffortId, String workEffortAssocTypeId) {
         return getLowestLevelWorkEfforts(delegator, workEffortId, workEffortAssocTypeId, "workEffortIdFrom", "workEffortIdTo");
     }