Author: doogie
Date: Fri Jul 8 00:38:14 2011 New Revision: 1144105 URL: http://svn.apache.org/viewvc?rev=1144105&view=rev Log: FORMATTING: Fix some bad formatting. Modified: ofbiz/trunk/specialpurpose/scrum/build.xml ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumEvents.java ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java Modified: ofbiz/trunk/specialpurpose/scrum/build.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/build.xml?rev=1144105&r1=1144104&r2=1144105&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/build.xml (original) +++ ofbiz/trunk/specialpurpose/scrum/build.xml Fri Jul 8 00:38:14 2011 @@ -103,4 +103,4 @@ <antcall target="revert-ofbiz-patches"/> <antcall target="apply-ofbiz-patches"/> </target> -</project> \ No newline at end of file +</project> Modified: ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumEvents.java?rev=1144105&r1=1144104&r2=1144105&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumEvents.java (original) +++ ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumEvents.java Fri Jul 8 00:38:14 2011 @@ -60,23 +60,18 @@ public class ScrumEvents { String partyId = userLogin.getString("partyId"); Timestamp now = UtilDateTime.nowTimestamp(); Timestamp weekStart = UtilDateTime.getWeekStart(now); - + if (UtilValidate.isEmpty(delegator)) { delegator = (Delegator) request.getAttribute("delegator"); } - + try { // should be scrum team or scrum master. - EntityConditionList<EntityExpr> exprOrs = EntityCondition.makeCondition(UtilMisc.toList( - EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, "SCRUM_TEAM"), - EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, "SCRUM_MASTER")), EntityOperator.OR); - EntityConditionList<EntityCondition> exprAnds = EntityCondition.makeCondition(UtilMisc.toList( - exprOrs, - EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, partyId)), - EntityOperator.AND); + EntityConditionList<EntityExpr> exprOrs = EntityCondition.makeCondition(UtilMisc.toList(EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, "SCRUM_TEAM"), EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, "SCRUM_MASTER")), EntityOperator.OR); + EntityConditionList<EntityCondition> exprAnds = EntityCondition.makeCondition(UtilMisc.toList(exprOrs, EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, partyId)), EntityOperator.AND); List<GenericValue> partyRoleList = delegator.findList("PartyRole", exprAnds, null, null, null, false); if (UtilValidate.isNotEmpty(partyRoleList)) { - List<GenericValue> timesheetList = delegator.findByAndCache("Timesheet", UtilMisc.toMap("partyId" , partyId, "statusId", "TIMESHEET_IN_PROCESS")); + List<GenericValue> timesheetList = delegator.findByAndCache("Timesheet", UtilMisc.toMap("partyId", partyId, "statusId", "TIMESHEET_IN_PROCESS")); if (UtilValidate.isNotEmpty(timesheetList)) { for (GenericValue timesheetMap : timesheetList) { String timesheetId = timesheetMap.getString("timesheetId"); @@ -88,11 +83,9 @@ public class ScrumEvents { //compare week and compare date if ((timesheetDate.compareTo(weekStart) <= 0) && (realTimeDate.compareTo(nowStartDate) < 0)) { //check time entry - List<GenericValue> timeEntryList = timesheetMap.getRelatedByAnd("TimeEntry" - , UtilMisc.toMap("partyId", partyId, "timesheetId",timesheetId, "fromDate",realTimeDate)); + List<GenericValue> timeEntryList = timesheetMap.getRelatedByAnd("TimeEntry", UtilMisc.toMap("partyId", partyId, "timesheetId",timesheetId, "fromDate",realTimeDate)); //check EmplLeave - List<GenericValue> emplLeaveList = delegator.findByAndCache("EmplLeave" - , UtilMisc.toMap("partyId", partyId, "fromDate",realTimeDate)); + List<GenericValue> emplLeaveList = delegator.findByAndCache("EmplLeave", UtilMisc.toMap("partyId", partyId, "fromDate", realTimeDate)); if (UtilValidate.isEmpty(timeEntryList) && UtilValidate.isEmpty(emplLeaveList)) { Map<String, Object> noEntryMap = FastMap.newInstance(); noEntryMap.put("timesheetId", timesheetId); @@ -119,8 +112,7 @@ public class ScrumEvents { } } Debug.logInfo("The following time sheet no time entry: [" + warningData + "]", module); - request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("scrumUiLabels", "ScrumTimesheetWarningMessage" - ,UtilMisc.toMap("warningMessage", warningData), UtilHttp.getLocale(request))); + request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("scrumUiLabels", "ScrumTimesheetWarningMessage", UtilMisc.toMap("warningMessage", warningData), UtilHttp.getLocale(request))); } return "success"; } Modified: ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java?rev=1144105&r1=1144104&r2=1144105&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java (original) +++ ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java Fri Jul 8 00:38:14 2011 @@ -51,7 +51,7 @@ public class ScrumServices { if (UtilValidate.isNotEmpty(communicationEvent)) { String subject = communicationEvent.getString("subject"); if (UtilValidate.isNotEmpty(subject)) { - int pdLocation = subject.indexOf("PD#"); + int pdLocation = subject.indexOf("PD#"); if (pdLocation > 0) { // scan until the first non digit character int nonDigitLocation = pdLocation + 3; @@ -85,11 +85,11 @@ public class ScrumServices { } } } - + } catch (GenericEntityException e) { return ServiceUtil.returnError("find by primary key error:" + e.toString()); } - + Map<String, Object> result = ServiceUtil.returnSuccess(); return result; } else { @@ -97,7 +97,7 @@ public class ScrumServices { return result; } } - + /** * viewScrumRevision * <p> @@ -117,36 +117,36 @@ public class ScrumServices { String diffMessage = ""; try { if (UtilValidate.isNotEmpty(repository) && UtilValidate.isNotEmpty(revision)) { - String logline = null; - String logCommand = "svn log -r"+revision+" "+repository; - Process logProcess = Runtime.getRuntime().exec(logCommand); - BufferedReader logIn = new BufferedReader(new InputStreamReader(logProcess.getInputStream())); - while ((logline = logIn.readLine()) != null) { + String logline = null; + String logCommand = "svn log -r" + revision + " " + repository; + Process logProcess = Runtime.getRuntime().exec(logCommand); + BufferedReader logIn = new BufferedReader(new InputStreamReader(logProcess.getInputStream())); + while ((logline = logIn.readLine()) != null) { logMessage += logline + "\n"; } - String diffline = null; - String diffCommand = "svn diff -r"+Integer.toString((Integer.parseInt(revision.trim()) - 1))+":"+revision+" "+repository; - Process diffProcess = Runtime.getRuntime().exec(diffCommand); - BufferedReader diffIn = new BufferedReader(new InputStreamReader(diffProcess.getInputStream())); - while ((diffline = diffIn.readLine()) != null) { - diffMessage += diffline + "\n"; - } + String diffline = null; + String diffCommand = "svn diff -r" + Integer.toString((Integer.parseInt(revision.trim()) - 1)) + ":" + revision + " " + repository; + Process diffProcess = Runtime.getRuntime().exec(diffCommand); + BufferedReader diffIn = new BufferedReader(new InputStreamReader(diffProcess.getInputStream())); + while ((diffline = diffIn.readLine()) != null) { + diffMessage += diffline + "\n"; + } } result.put("revision", revision); result.put("repository", repository); result.put("logMessage", logMessage); result.put("diffMessage", diffMessage); - } catch (IOException e) { + } catch (IOException e) { e.printStackTrace(); return ServiceUtil.returnError(e.getMessage()); } return result; } - + /** * retrieveMissingScrumRevision * <p> - * Use for retrieve the missing data of the Revision + * Use for retrieve the missing data of the Revision * * @param latestRevision The latest revision number * @param repositoryRoot The repository root url @@ -161,14 +161,14 @@ public class ScrumServices { Map<String, Object> result = ServiceUtil.returnSuccess(); try { if (UtilValidate.isNotEmpty(repositoryRoot) && UtilValidate.isNotEmpty(latestRevision)) { - Integer revision = Integer.parseInt(latestRevision.trim()); - for (int i = 1; i <= revision; i++) { - String logline = null; - List<String> logMessageList = FastList.newInstance(); - String logCommand = "svn log -r"+i+" "+repositoryRoot; - Process logProcess = Runtime.getRuntime().exec(logCommand); - BufferedReader logIn = new BufferedReader(new InputStreamReader(logProcess.getInputStream())); - while ((logline = logIn.readLine()) != null) { + Integer revision = Integer.parseInt(latestRevision.trim()); + for (int i = 1; i <= revision; i++) { + String logline = null; + List<String> logMessageList = FastList.newInstance(); + String logCommand = "svn log -r" + i + " " + repositoryRoot; + Process logProcess = Runtime.getRuntime().exec(logCommand); + BufferedReader logIn = new BufferedReader(new InputStreamReader(logProcess.getInputStream())); + while ((logline = logIn.readLine()) != null) { logMessageList.add(logline.toString().trim()); } if (UtilValidate.isNotEmpty(logMessageList)) { @@ -181,14 +181,14 @@ public class ScrumServices { String taskId = null; char[] taskInfoList = taskInfo.toCharArray(); int count = 0; - for(int j = 0; j < taskInfoList.length;j++) { - if(Character.isDigit(taskInfoList[j])) { + for (int j = 0; j < taskInfoList.length; j++) { + if (Character.isDigit(taskInfoList[j])) { count = count + 1; } else { count = 0; } if (count == 5) { - taskId = taskInfo.substring(j-4, j+1); + taskId = taskInfo.substring(j - 4, j + 1); } } String revisionLink = repositoryRoot.substring(repositoryRoot.lastIndexOf("svn/") + 4, repositoryRoot.length()) + "&revision=" + i; @@ -198,14 +198,14 @@ public class ScrumServices { List <GenericValue> workeffContentList = delegator.findByAnd("WorkEffortAndContentDataResource", UtilMisc.toMap("contentName",version.trim() ,"drObjectInfo", revisionLink.trim())); List<EntityCondition> exprsAnd = FastList.newInstance(); exprsAnd.add(EntityCondition.makeCondition("workEffortId", EntityOperator.EQUALS, taskId)); - + List<EntityCondition> exprsOr = FastList.newInstance(); exprsOr.add(EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "SCRUM_TASK_ERROR")); exprsOr.add(EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "SCRUM_TASK_TEST")); exprsOr.add(EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "SCRUM_TASK_IMPL")); exprsOr.add(EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "SCRUM_TASK_INST")); exprsAnd.add(EntityCondition.makeCondition(exprsOr, EntityOperator.OR)); - + List<GenericValue> workEffortList = delegator.findList("WorkEffort", EntityCondition.makeCondition(exprsAnd, EntityOperator.AND), null, null, null, false); if (UtilValidate.isEmpty(workeffContentList) && UtilValidate.isNotEmpty(workEffortList)) { Map inputMap = FastMap.newInstance(); @@ -220,9 +220,9 @@ public class ScrumServices { } } } - } + } } - } catch (IOException e) { + } catch (IOException e) { e.printStackTrace(); return ServiceUtil.returnError(e.getMessage()); } catch (GenericEntityException entityEx) { @@ -232,10 +232,10 @@ public class ScrumServices { serviceEx.printStackTrace(); return ServiceUtil.returnError(serviceEx.getMessage()); } - + return result; } - + /** * removeDuplicateScrumRevision * <p> |
Free forum by Nabble | Edit this page |