From: John W. <jwe...@us...> - 2003-07-30 21:32:43
|
Update of /cvsroot/dlese/dlese-tools-project/src/org/dlese/dpc/index/reader In directory sc8-pr-cvs1:/tmp/cvs-serv28573/dlese-tools-project/src/org/dlese/dpc/index/reader Modified Files: DleseAnnoDocReader.java ItemDocReader.java Log Message: updated annotation display and logic to reflect the post-usability test UI changes; other UI changes to the brief display and reviews display Index: DleseAnnoDocReader.java =================================================================== RCS file: /cvsroot/dlese/dlese-tools-project/src/org/dlese/dpc/index/reader/DleseAnnoDocReader.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** DleseAnnoDocReader.java 29 Jul 2003 19:39:23 -0000 1.11 --- DleseAnnoDocReader.java 30 Jul 2003 20:52:20 -0000 1.12 *************** *** 157,161 **** --- 157,209 ---- return (status.length() == 0 || status.matches(".*completed")); } + + public String getIsCompleted() { + if(isCompleted()) + return "true"; + else + return "false"; + } + public boolean isCompleted() { + String status = getStatus().toLowerCase(); + return (status.length() == 0 || status.matches(".*completed")); + } + + public boolean isAudioInProgress() { + String status = getStatus(); + return status.equals("Audio annotation in progress"); + } + + public String getIsAudioInProgress() { + if(isAudioInProgress()) + return "true"; + else + return "false"; + } + + public boolean isTextInProgress() { + String status = getStatus(); + return status.equals("Text annotation in progress"); + } + + public String getIsTextInProgress() { + if(isTextInProgress()) + return "true"; + else + return "false"; + } + + public boolean isGraphicalInProgress() { + String status = getStatus(); + return status.equals("Graphical annotation in progress"); + } + + public String getIsGraphicalInProgress() { + if(isGraphicalInProgress()) + return "true"; + else + return "false"; + } + /** Index: ItemDocReader.java =================================================================== RCS file: /cvsroot/dlese/dlese-tools-project/src/org/dlese/dpc/index/reader/ItemDocReader.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** ItemDocReader.java 28 Jul 2003 04:44:56 -0000 1.9 --- ItemDocReader.java 30 Jul 2003 20:52:20 -0000 1.10 *************** *** 59,63 **** private Document multiDoc = null; private RepositoryManager rm = null; ! //private String originalAssosIds = ""; --- 59,67 ---- private Document multiDoc = null; private RepositoryManager rm = null; ! private HashMap completedAnnosByType = null; ! private ArrayList completedAnnos = null; ! private HashMap inProgressAnnosByStatus = null; ! private int numCompletedAnnos = 0; ! private int numInProgressAnnos = 0; //private String originalAssosIds = ""; *************** *** 886,890 **** } ! /** * Gets the ResultDocs for all annotations that refer to this resource. --- 890,896 ---- } ! ! // ---------------- Annotations display, etc. -------------------------- ! /** * Gets the ResultDocs for all annotations that refer to this resource. *************** *** 916,920 **** } ! prtln("getAnnotationResultDocs() index query"); annotationResultDocs = recordDataService.getDleseAnnoResultDocs((String[]) allIds.toArray(new String[]{})); return annotationResultDocs; --- 922,926 ---- } ! //prtln("getAnnotationResultDocs() index query"); annotationResultDocs = recordDataService.getDleseAnnoResultDocs((String[]) allIds.toArray(new String[]{})); return annotationResultDocs; *************** *** 924,928 **** --- 930,1109 ---- } } + + public boolean hasCompletedAnno() + { + initAnnosByType(); + return !completedAnnosByType.isEmpty(); + } + public String getHasCompletedAnno() + { + if(hasCompletedAnno()) + return "true"; + else + return "false"; + } + + public String getNumCompletedAnnos() + { + initAnnosByType(); + return Integer.toString(numCompletedAnnos); + } + + public String getNumInProgressAnnos() + { + initAnnosByType(); + return Integer.toString(numInProgressAnnos); + } + + public String getNumTextInProgressAnnos() + { + prtln("getNumTextInProgressAnnos() returning: " + numTextInProgress); + initAnnosByType(); + return Integer.toString(numTextInProgress); + } + + public String getNumAudioInProgressAnnos() + { + initAnnosByType(); + return Integer.toString(numAudioInProgress); + } + + public String getNumGraphicalInProgressAnnos() + { + initAnnosByType(); + return Integer.toString(numGraphicalInProgress); + } + + + public boolean hasCompletedAnnoOfType(String type) + { + initAnnosByType(); + return completedAnnosByType.containsKey(type); + } + + public ArrayList getCompletedAnnosOfType(String type) + { + initAnnosByType(); + ArrayList list = (ArrayList)completedAnnosByType.get(type); + if(list == null) + list = new ArrayList(); + return list; + } + + public String getHasInProgressAnno() + { + if(hasInProgressAnno()) + return "true"; + else + return "false"; + } + + public boolean hasInProgressAnno() + { + initAnnosByType(); + return !inProgressAnnosByStatus.isEmpty(); + } + + public boolean hasInProgressAnnoOfStatus(String type) + { + initAnnosByType(); + return inProgressAnnosByStatus.containsKey(type); + } + + public ArrayList getInProgressAnnosOfStatus(String type) + { + initAnnosByType(); + ArrayList list = (ArrayList)inProgressAnnosByStatus.get(type); + if(list == null) + list = new ArrayList(); + return list; + } + + private int numAudioInProgress = 0; + private int numGraphicalInProgress = 0; + private int numTextInProgress = 0; + + private void initAnnosByType() + { + if(completedAnnosByType != null) + return; + completedAnnosByType = new HashMap(); + inProgressAnnosByStatus = new HashMap(); + completedAnnos = new ArrayList(); + ResultDoc[] annoResults = getAnnotationResultDocs(); + if(annoResults == null) + return; + ArrayList annoList; + boolean isCompleted; + for( int i = 0; i < annoResults.length; i++){ + DleseAnnoDocReader annoDocReader = (DleseAnnoDocReader)annoResults[i].getDocReader(); + String annoType = annoDocReader.getType(); + String annoStatus = annoDocReader.getStatus(); + isCompleted = annoDocReader.isCompleted(); + + if(isCompleted){ + numCompletedAnnos++; + annoList = (ArrayList)completedAnnosByType.get(annoType); + completedAnnos.add(annoDocReader); + } + else{ + if(annoDocReader.isTextInProgress()) + numTextInProgress++; + if(annoDocReader.isAudioInProgress()) + numAudioInProgress++; + if(annoDocReader.isGraphicalInProgress()) + numGraphicalInProgress++; + numInProgressAnnos++; + annoList = (ArrayList)inProgressAnnosByStatus.get(annoStatus); + } + if(annoList == null) + annoList = new ArrayList(); + annoList.add(annoDocReader); + if(isCompleted) + completedAnnosByType.put( annoType,annoList); + else + inProgressAnnosByStatus.put( annoStatus,annoList); + } + } + + public ArrayList getTextAnnosInProgress() { + return getInProgressAnnosOfStatus("Text annotation in progress"); + } + + public ArrayList getAudioAnnosInProgress() { + return getInProgressAnnosOfStatus("Audio annotation in progress"); + } + + public ArrayList getGraphicalAnnosInProgress() { + return getInProgressAnnosOfStatus("Graphical annotation in progress"); + } + + public ArrayList getCompletedAnnos() { + initAnnosByType(); + + return completedAnnos; + } + + + public ArrayList getCompletedReviews() { + return getCompletedAnnosOfType("Review"); + } + + public ArrayList getCompletedTeachingTips() { + return getCompletedAnnosOfType("Teaching tip"); + } + + public ArrayList getCompletedEditorSummaries() { + return getCompletedAnnosOfType("Editor's summary"); + } + + public ArrayList getCompletedChallengingSituations() { + return getCompletedAnnosOfType("Information on challenging teaching and learning situations"); + } + + public ArrayList getCompletedAverageScores() { + return getCompletedAnnosOfType("Average scores of aggregated indices"); + } } |