From: <bob...@us...> - 2011-01-18 21:36:10
|
Revision: 14753 http://andromda.svn.sourceforge.net/andromda/?rev=14753&view=rev Author: bobfields Date: 2011-01-18 21:36:03 +0000 (Tue, 18 Jan 2011) Log Message: ----------- formatting fix, UML2 migration preps. Modified Paths: -------------- trunk/andromda-documentation/samples/timetracker/core/src/main/java/org/andromda/timetracker/service/TimeTrackingServiceImpl.java trunk/andromda-documentation/samples/timetracker/core/src/main/java/org/andromda/timetracker/service/UserServiceImpl.java trunk/andromda-documentation/samples/timetracker/core/src/test/java/org/andromda/timetracker/service/TimeTrackingServiceTest.java trunk/andromda-documentation/samples/timetracker/core/src/test/java/org/andromda/timetracker/service/UserServiceTest.java trunk/andromda-documentation/samples/timetracker/web/src/main/java/org/andromda/timetracker/web/timecardsearch/SearchControllerImpl.java trunk/andromda-documentation/samples/timetracker-ejb3/common/src/main/java/org/andromda/timetracker/security/PasswordEncoder.java Modified: trunk/andromda-documentation/samples/timetracker/core/src/main/java/org/andromda/timetracker/service/TimeTrackingServiceImpl.java =================================================================== --- trunk/andromda-documentation/samples/timetracker/core/src/main/java/org/andromda/timetracker/service/TimeTrackingServiceImpl.java 2011-01-18 21:34:22 UTC (rev 14752) +++ trunk/andromda-documentation/samples/timetracker/core/src/main/java/org/andromda/timetracker/service/TimeTrackingServiceImpl.java 2011-01-18 21:36:03 UTC (rev 14753) @@ -6,8 +6,8 @@ package org.andromda.timetracker.service; import java.util.List; -import org.andromda.timetracker.vo.TimecardSummaryVO; import org.andromda.timetracker.vo.TimecardSearchCriteriaVO; +import org.andromda.timetracker.vo.TimecardSummaryVO; /** * @see org.andromda.timetracker.service.TimeTrackingService @@ -18,7 +18,7 @@ /** * @see org.andromda.timetracker.service.TimeTrackingService#findTimecards(TimecardSearchCriteriaVO) */ - protected org.andromda.timetracker.vo.TimecardSummaryVO[] handleFindTimecards(TimecardSearchCriteriaVO criteria) + protected TimecardSummaryVO[] handleFindTimecards(TimecardSearchCriteriaVO criteria) throws Exception { List timecards = getTimecardDao().findByCriteria(criteria); Modified: trunk/andromda-documentation/samples/timetracker/core/src/main/java/org/andromda/timetracker/service/UserServiceImpl.java =================================================================== --- trunk/andromda-documentation/samples/timetracker/core/src/main/java/org/andromda/timetracker/service/UserServiceImpl.java 2011-01-18 21:34:22 UTC (rev 14752) +++ trunk/andromda-documentation/samples/timetracker/core/src/main/java/org/andromda/timetracker/service/UserServiceImpl.java 2011-01-18 21:36:03 UTC (rev 14753) @@ -19,7 +19,14 @@ /** * @see org.andromda.timetracker.service.UserService#getAllUsers() */ - protected org.andromda.timetracker.vo.UserVO[] handleGetAllUsers() + // Use this implementation for UML2 model with returnParameter * multiplicity + /*@SuppressWarnings("unchecked") + protected Collection<UserVO> handleGetAllUsers() + throws Exception + { + return (Collection<UserVO>) getUserDao().loadAll(UserDao.TRANSFORM_USERVO); + */ + protected UserVO[] handleGetAllUsers() throws Exception { Collection userVOs = getUserDao().loadAll(UserDao.TRANSFORM_USERVO); Modified: trunk/andromda-documentation/samples/timetracker/core/src/test/java/org/andromda/timetracker/service/TimeTrackingServiceTest.java =================================================================== --- trunk/andromda-documentation/samples/timetracker/core/src/test/java/org/andromda/timetracker/service/TimeTrackingServiceTest.java 2011-01-18 21:34:22 UTC (rev 14752) +++ trunk/andromda-documentation/samples/timetracker/core/src/test/java/org/andromda/timetracker/service/TimeTrackingServiceTest.java 2011-01-18 21:36:03 UTC (rev 14753) @@ -37,6 +37,7 @@ public void testFindAllTimecards() { logger.info("testFindAllTimecards:"); TimecardSearchCriteriaVO criteria = new TimecardSearchCriteriaVO(); + //Collection<? extends TimecardSummaryVO> timecards = timeTrackingService.findTimecards(criteria); TimecardSummaryVO[] timecards = timeTrackingService.findTimecards(criteria); logTimecards(timecards); } @@ -46,16 +47,20 @@ logger.info("testFindTimecardsForSubmitter:"); TimecardSearchCriteriaVO criteria = new TimecardSearchCriteriaVO(); criteria.setSubmitterId(new Long(1)); + //Collection<? extends TimecardSummaryVO> timecards = timeTrackingService.findTimecards(criteria); TimecardSummaryVO[] timecards = timeTrackingService.findTimecards(criteria); logTimecards(timecards); } - private void logTimecards(TimecardSummaryVO[] timecards) { - + private void logTimecards(TimecardSummaryVO[] timecards) + //private void logTimecards(Collection<? extends TimecardSummaryVO> timecards) + { Formatter formatter = new Formatter(); formatter.format(TimecardHdrFormat, "Submitter", "Approver", "Status", "Start Date"); logger.info(formatter.toString()); - for (int i = 0; i < timecards.length; i++) { + //for (TimecardSummaryVO timecard : timecards) + for (int i = 0; i < timecards.length; i++) + { formatter = new Formatter(); formatter.format( TimecardRowFormat, Modified: trunk/andromda-documentation/samples/timetracker/core/src/test/java/org/andromda/timetracker/service/UserServiceTest.java =================================================================== --- trunk/andromda-documentation/samples/timetracker/core/src/test/java/org/andromda/timetracker/service/UserServiceTest.java 2011-01-18 21:34:22 UTC (rev 14752) +++ trunk/andromda-documentation/samples/timetracker/core/src/test/java/org/andromda/timetracker/service/UserServiceTest.java 2011-01-18 21:36:03 UTC (rev 14753) @@ -36,6 +36,10 @@ for (int i=0; i<users.length; i++) { logger.info(users[i].getUsername()); + /*for (UserVO user : userService.getAllUsers()) + { + logger.info(user.getUsername()); + */ } } } \ No newline at end of file Modified: trunk/andromda-documentation/samples/timetracker/web/src/main/java/org/andromda/timetracker/web/timecardsearch/SearchControllerImpl.java =================================================================== --- trunk/andromda-documentation/samples/timetracker/web/src/main/java/org/andromda/timetracker/web/timecardsearch/SearchControllerImpl.java 2011-01-18 21:34:22 UTC (rev 14752) +++ trunk/andromda-documentation/samples/timetracker/web/src/main/java/org/andromda/timetracker/web/timecardsearch/SearchControllerImpl.java 2011-01-18 21:36:03 UTC (rev 14753) @@ -41,6 +41,8 @@ // Get list of users and add the "All" option at the top UserVO[] users = getUserService().getAllUsers(); Arrays.sort(users, new UserVOComparator()); + //List<UserVO> users = new ArrayList<UserVO>(getUserService().getAllUsers()); + //Collections.sort(users, new UserVOComparator()); List userList = new ArrayList(Arrays.asList(users)); userList.add(0, new UserVO(null, ALL_STRING, null, null)); @@ -69,7 +71,9 @@ form.getStartDateMaximumAsDate()); TimecardSummaryVO[] timecards = getTimeTrackingService().findTimecards(criteria); + //Collection<? extends TimecardSummaryVO> timecards = getTimeTrackingService().findTimecards(criteria); form.setTimecardSummaries(timecards); + //form.setTimecardSummaries((TimecardSummaryVO[]) timecards.toArray()); } public final void initializeTimecardId(ActionMapping mapping, InitializeTimecardIdForm form, HttpServletRequest request, HttpServletResponse response) throws Exception Modified: trunk/andromda-documentation/samples/timetracker-ejb3/common/src/main/java/org/andromda/timetracker/security/PasswordEncoder.java =================================================================== --- trunk/andromda-documentation/samples/timetracker-ejb3/common/src/main/java/org/andromda/timetracker/security/PasswordEncoder.java 2011-01-18 21:34:22 UTC (rev 14752) +++ trunk/andromda-documentation/samples/timetracker-ejb3/common/src/main/java/org/andromda/timetracker/security/PasswordEncoder.java 2011-01-18 21:36:03 UTC (rev 14753) @@ -13,6 +13,12 @@ */ public class PasswordEncoder { + /** + * @param plaintext + * @return new sun.misc.BASE64Encoder().encode(raw) + * @throws NoSuchAlgorithmException + * @throws UnsupportedEncodingException + */ public static String getMD5Base64EncodedPassword(String plaintext) throws NoSuchAlgorithmException, UnsupportedEncodingException { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |