Changeset 805
- Timestamp:
- 05/16/11 00:22:40 (2 years ago)
- Location:
- raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model
- Files:
-
- 5 edited
-
event/event.hbm.xml (modified) (1 diff)
-
report/AggregatorGraphModel.java (modified) (2 diffs)
-
resource/ResourceMetadata.java (modified) (3 diffs)
-
wsmodel/Capabilities.java (modified) (3 diffs)
-
wsmodel/StatisticParameters.java (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/event/event.hbm.xml
r800 r805 12 12 <id name="persistantId" column="persistantId" type="long" 13 13 unsaved-value="0"> 14 < generator class="native">14 <!-- <generator class="native"> 15 15 <param name="sequence">hib_entity_seq</param> 16 </generator> 16 </generator> --> 17 <generator class="hilo"> 18 19 </generator> 17 20 </id> 18 21 -
raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/report/AggregatorGraphModel.java
r696 r805 3 3 import java.io.Serializable; 4 4 import java.util.ArrayList; 5 import java.util.Arrays; 6 import java.util.Collections; 5 7 import java.util.List; 6 7 8 8 9 9 /* … … 12 12 */ 13 13 14 public class AggregatorGraphModel implements Serializable {14 public class AggregatorGraphModel implements Serializable { 15 15 16 /** Class logger */ 17 private static final long serialVersionUID = 5372664739350074383L; 18 19 /** The list of <code>String</code> labels for the groups*/ 20 private List<String> groupLabels; 21 22 /** The list of <code>String</code> labels for each series*/ 23 private List<String> seriesLabels; 24 25 /** The list of <code>Double</code> values assigned to each series */ 26 private List<List<Double>> chartValues; 16 /** Class logger */ 17 private static final long serialVersionUID = 5372664739350074383L; 27 18 28 /** A class that holds presentation information for this graph model*/29 private Presentation presentation;19 /** The list of <code>String</code> labels for the groups */ 20 private List<String> groupLabels; 30 21 31 public AggregatorGraphModel(){ 32 seriesLabels= new ArrayList<String>(); 33 } 22 /** The list of <code>String</code> labels for each series */ 23 private List<String> seriesLabels; 34 24 25 /** The list of <code>Double</code> values assigned to each series */ 26 private List<List<Double>> chartValues; 35 27 36 public List<String> getGroupLabels() { 37 return groupLabels;28 /** A class that holds presentation information for this graph model */ 29 private Presentation presentation; 38 30 39 } 31 public AggregatorGraphModel() { 32 seriesLabels = new ArrayList<String>(); 33 } 40 34 41 public void addGroupLabel(String label){ 42 if (getGroupLabels()==null)setGroupLabels(new ArrayList<String>()); 43 getGroupLabels().add(label); 44 } 35 public List<String> getGroupLabels() { 36 return groupLabels; 45 37 46 public void addSeriesLabel(String label){ 47 if (getSeriesLabels()==null)setSeriesLabels(new ArrayList<String>()); 48 getSeriesLabels().add(label); 49 } 38 } 50 39 40 public void addGroupLabel(String label) { 41 if (getGroupLabels() == null) 42 setGroupLabels(new ArrayList<String>()); 43 getGroupLabels().add(label); 44 } 51 45 52 public List<String> getSeriesLabels() { 53 return seriesLabels; 46 public void addSeriesLabel(String label) { 47 if (getSeriesLabels() == null) 48 setSeriesLabels(new ArrayList<String>()); 49 getSeriesLabels().add(label); 50 } 54 51 55 } 52 public void sortGroupLabelsAlphabetically() { 53 Collections.sort(groupLabels); 56 54 57 public void addGroupValue(List<Double> values){ 58 if (chartValues==null) setChartValues(new ArrayList<List<Double>>()); 59 chartValues.add(values); 60 } 55 } 61 56 57 public List<String> getSeriesLabels() { 58 return seriesLabels; 62 59 63 public List<List<Double>> getYValues() { 64 return chartValues; 65 } 60 } 66 61 67 public void setYValues(List<List<Double>> values) { 62 public void addGroupValue(List<Double> values) { 63 if (chartValues == null) 64 setChartValues(new ArrayList<List<Double>>()); 65 chartValues.add(values); 66 } 68 67 69 } 68 public List<List<Double>> getYValues() { 69 return chartValues; 70 } 70 71 72 public void setYValues(List<List<Double>> values) { 71 73 72 public void setGroupLabels(List<String> groupLabels) { 73 this.groupLabels = groupLabels; 74 } 74 } 75 75 76 public void setSeriesLabels(List<String> seriesLabels) {77 this.seriesLabels = seriesLabels;78 }76 public void setGroupLabels(List<String> groupLabels) { 77 this.groupLabels = groupLabels; 78 } 79 79 80 public void setChartValues(List<List<Double>> chartValues) {81 this.chartValues = chartValues;82 }80 public void setSeriesLabels(List<String> seriesLabels) { 81 this.seriesLabels = seriesLabels; 82 } 83 83 84 public List<List<Double>> getChartValues() {85 returnchartValues;86 }84 public void setChartValues(List<List<Double>> chartValues) { 85 this.chartValues = chartValues; 86 } 87 87 88 public void setPresentation(Presentation presentation) {89 this.presentation = presentation;90 }88 public List<List<Double>> getChartValues() { 89 return chartValues; 90 } 91 91 92 public Presentation getPresentation() {93 returnpresentation;94 }92 public void setPresentation(Presentation presentation) { 93 this.presentation = presentation; 94 } 95 95 96 public Presentation getPresentation() { 97 return presentation; 98 } 96 99 97 100 } -
raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/resource/ResourceMetadata.java
r759 r805 1 1 package uk.ac.cardiff.model.resource; 2 2 3 public class ResourceMetadata { 3 import java.io.Serializable; 4 5 import org.slf4j.Logger; 6 import org.slf4j.LoggerFactory; 7 8 9 public class ResourceMetadata implements Serializable{ 10 11 /** Class logger. */ 12 private final Logger log = LoggerFactory.getLogger(ResourceMetadata.class); 13 14 /** Generated Serial UID */ 15 private static final long serialVersionUID = -6007311260031942309L; 4 16 5 17 /** Identifier for hibernate. */ … … 14 26 /** Whether this resourceId represents a resource external to the organisation. */ 15 27 private boolean external; 28 29 30 public String getInternalExternal(){ 31 if (internal==true){ 32 return "Internal"; 33 } 34 else if (external==true){ 35 return "External"; 36 } 37 return "Unknown"; 38 } 39 40 public void setInternalExternal(String option){ 41 if (option.equals("Internal")){ 42 internal = true; 43 external = false; 44 } 45 else if (option.equals("External")){ 46 internal = false; 47 external = true; 48 } 49 else{ 50 internal = false; 51 external = true; 52 } 53 } 54 55 public int getResourceCategory() { 56 if (internal==true){ 57 return 1; 58 } 59 else if (external==true){ 60 return 2; 61 } 62 return 0; 63 } 64 65 public void setResourceCategory(int resourceCategory){ 66 67 } 68 69 public String toString(){ 70 StringBuilder sb = new StringBuilder(); 71 sb.append(this.getClass().getName()); 72 sb.append("["); 73 sb.append(persistantId); 74 sb.append(":"); 75 sb.append(resourceId); 76 sb.append(":"); 77 sb.append(internal); 78 sb.append(":"); 79 sb.append(external); 80 sb.append("]"); 81 return sb.toString(); 82 83 } 16 84 17 85 /** … … 70 138 return persistantId; 71 139 } 140 141 72 142 73 143 -
raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/wsmodel/Capabilities.java
r747 r805 8 8 9 9 import uk.ac.cardiff.model.ServiceMetadata; 10 import uk.ac.cardiff.model.resource.ResourceMetadata; 10 11 11 12 … … 25 26 private ServiceMetadata metadata; 26 27 private SuggestionValues suggestionValues; 28 private List<ResourceMetadata> resourceMetadata; 27 29 28 30 private int numberOfEntries; … … 104 106 } 105 107 108 /** 109 * @param resourceMetadata the resourceMetadata to set 110 */ 111 public void setResourceMetadata(List<ResourceMetadata> resourceMetadata) { 112 this.resourceMetadata = resourceMetadata; 113 } 114 115 /** 116 * @return the resourceMetadata 117 */ 118 public List<ResourceMetadata> getResourceMetadata() { 119 return resourceMetadata; 120 } 121 106 122 107 123 -
raptor-information-model/trunk/src/main/java/uk/ac/cardiff/model/wsmodel/StatisticParameters.java
r743 r805 52 52 private DateTime endTime; 53 53 54 /** Its important that these dates (used for display in t rinidad) are kept in sync with the54 /** Its important that these dates (used for display in the view) are kept in sync with the 55 55 * Joda DateTime classes above*/ 56 56 private Date startTimeJava; 57 57 private Date endTimeJava; 58 59 public enum ResourceCategory{ 60 /** For resources that are internal to the organisation*/ 61 INTERNAL(new int[]{1}), 62 /** For resources that are external to the organisation*/ 63 EXTERNAL(new int[]{2}), 64 /** For all resource categories */ 65 ALL(new int[]{1,2}); 66 67 private int[] resourceIdCategory; 68 69 ResourceCategory(int[] resourceIdCategory){ 70 this.resourceIdCategory = resourceIdCategory; 71 } 72 73 /** 74 * @return the resourceIdCategory 75 */ 76 public int[] getResourceIdCategory() { 77 return resourceIdCategory; 78 } 79 80 /** 81 * Returns a <code>String</code> value that represents 82 * an IN SQL operator which specifies the resourceIdCategory(s) 83 * for this <code>ResourceCategory</code> for use in SQL WHERE clauses 84 * 85 * @return an SQL IN clause 86 */ 87 public String getSql() { 88 StringBuilder sb = new StringBuilder(); 89 sb.append("in ("); 90 for (int i=0; i < resourceIdCategory.length; i++){ 91 sb.append(resourceIdCategory[i]); 92 if (i < resourceIdCategory.length-1){ 93 sb.append(","); 94 } 95 } 96 sb.append(")"); 97 return sb.toString(); 98 } 99 } 100 101 private ResourceCategory resourceCategory; 58 102 59 103 /** either system or user types */ … … 109 153 private List<Series> series; 110 154 155 /** Default constructor. */ 111 156 public StatisticParameters(){ 112 157 presentation = new Presentation(); … … 115 160 presentation.setyAxisLabel(""); 116 161 setSeries(new ArrayList<Series>()); 162 resourceCategory = ResourceCategory.ALL; 117 163 } 118 164 … … 397 443 } 398 444 399 445 /** 446 * @param resourceCategory the resourceCategory to set 447 */ 448 public void setResourceCategory(ResourceCategory resourceCategory) { 449 this.resourceCategory = resourceCategory; 450 } 451 452 /** 453 * @return the resourceCategory 454 */ 455 public ResourceCategory getResourceCategory() { 456 return resourceCategory; 457 } 458 459 public void setResourceCategoryString(String resourceCategory){ 460 for (ResourceCategory type : ResourceCategory.values()){ 461 if (type.toString().equals(resourceCategory)){ 462 this.resourceCategory = type; 463 } 464 } 465 } 466 467 public String getResourceCategoryString(){ 468 return resourceCategory.toString(); 469 } 400 470 401 471
Note: See TracChangeset
for help on using the changeset viewer.
