Changeset 556
- Timestamp:
- 06/29/10 12:21:22 (14 years ago)
- Location:
- VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistry.java
r531 r556 129 129 new VirtualCollectionValidator(); 130 130 validator.validate(vc); 131 132 131 try { 133 132 EntityManager em = datastore.getEntityManager(); -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/VirtualCollectionRegistryMarshaller.java
r503 r556 222 222 for (Resource resource : vc.getResources()) { 223 223 output.writeStartElement(NS_CMDI, "ResourceProxy"); 224 output.writeAttribute("id", resource.getIdForXml());224 output.writeAttribute("id", "r" + resource.getId()); 225 225 output.writeStartElement(NS_CMDI, "ResourceType"); 226 226 switch (resource.getType()) { … … 259 259 output.writeCharacters(df.format(vc.getCreationDate())); 260 260 output.writeEndElement(); // "CreationDate" element 261 output.writeStartElement(NS_CMDI, "Visibility");262 switch (vc.getVisibility()) {263 case ADVERTISED:264 output.writeCharacters("advertised");265 break;266 case NON_ADVERTISED:267 output.writeCharacters("non-advertised");268 break;269 } // switch270 output.writeEndElement(); // "Visibility" element271 if (vc.getOrigin() != null) {272 output.writeStartElement(NS_CMDI, "Origin");273 output.writeCharacters(vc.getOrigin());274 output.writeEndElement(); // "Visibility" element275 }276 261 if (vc.getCreator() != null) { 277 262 Creator creator = vc.getCreator(); … … 299 284 } 300 285 } 286 if (vc.getPurpose() != null) { 287 output.writeStartElement(NS_CMDI, "Purpose"); 288 switch (vc.getPurpose()) { 289 case RESEARCH: 290 output.writeCharacters("research"); 291 break; 292 case REFERENCE: 293 output.writeCharacters("reference"); 294 break; 295 case SAMPLE: 296 output.writeCharacters("sample"); 297 break; 298 case FUTURE_USE: 299 output.writeCharacters("future-use"); 300 break; 301 } // switch (purpose) 302 output.writeEndElement(); // "Purpose" element 303 } 304 if (vc.getReproducibility() != null) { 305 output.writeStartElement(NS_CMDI, "Reproducibility"); 306 switch (vc.getReproducibility()) { 307 case INTENDED: 308 output.writeCharacters("intended"); 309 break; 310 case FLUCTUATING: 311 output.writeCharacters("fluctuating"); 312 break; 313 case UNTENDED: 314 output.writeCharacters("untended"); 315 break; 316 } // switch (purpose) 317 output.writeEndElement(); // "Reproducibility" element 318 } 319 if (vc.getReproducibilityNotice() != null) { 320 output.writeStartElement(NS_CMDI, "ReproducibilityNotice"); 321 output.writeCharacters(vc.getReproducibilityNotice()); 322 output.writeEndElement(); // "ReproducibilityNotice" element 323 } 301 324 output.writeEndElement(); // "VirtualCollection" element 302 325 output.writeEndElement(); // "Components" element -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/Resource.java
r509 r556 11 11 import javax.xml.bind.annotation.XmlAccessType; 12 12 import javax.xml.bind.annotation.XmlAccessorType; 13 import javax.xml.bind.annotation.XmlAttribute;14 13 import javax.xml.bind.annotation.XmlElement; 15 import javax.xml.bind.annotation.XmlID;16 14 import javax.xml.bind.annotation.XmlType; 17 15 … … 50 48 } 51 49 52 @XmlID53 @XmlAttribute(name = "id")54 public String getIdForXml() {55 return "r" + id;56 }57 58 50 public void setType(ResourceType type) { 59 51 if (type == null) { … … 80 72 } 81 73 82 protected int getSignature() { 83 return new HashCodeBuilder(799, 51).append(type).append(ref) 84 .toHashCode(); 74 @Override 75 public boolean equals(Object other) { 76 if ((other != null) && (other instanceof Resource)) { 77 final Resource r = (Resource) other; 78 return r.type.equals(this.type) && r.ref.equals(this.ref); 79 } 80 return false; 81 } 82 83 @Override 84 public int hashCode() { 85 return new HashCodeBuilder(799, 51) 86 .append(type) 87 .append(ref) 88 .toHashCode(); 85 89 } 86 90 -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/VirtualCollection.java
r511 r556 2 2 3 3 import java.util.Date; 4 import java.util.HashMap;5 4 import java.util.LinkedHashSet; 6 5 import java.util.Set; … … 71 70 @XmlRootElement(name = "VirtualCollection") 72 71 @XmlAccessorType(XmlAccessType.NONE) 73 @XmlType(propOrder = { "name", "description", "creationDate", "visibility", 74 "type", "origin", "creator", "resources" }) 72 @XmlType(propOrder = { "name", "description", "creationDate", "type", 73 "creator", "purpose", "reproducibility", 74 "reproducibilityNotice", "resources", "generatedBy" }) 75 75 @XmlSeeAlso({ Creator.class, 76 GeneratedBy.class, 76 77 Resource.class, 77 78 PersistentIdentifier.class }) … … 91 92 DEAD 92 93 } // enum State 93 @XmlType(namespace = "urn:x-vcr:virtualcollection:visibility")94 @XmlEnum(String.class)95 public static enum Visibility {96 @XmlEnumValue("advertised")97 ADVERTISED,98 @XmlEnumValue("non-advertised")99 NON_ADVERTISED;100 } // enum Visibility101 94 @XmlType(namespace = "urn:x-vcr:virtualcollection:type") 102 95 @XmlEnum(String.class) … … 106 99 @XmlEnumValue("intensional") 107 100 INTENSIONAL 101 } 102 @XmlType(namespace = "urn:x-vcr:virtualcollection:purpose") 103 @XmlEnum(String.class) 104 public static enum Purpose { 105 @XmlEnumValue("research") 106 RESEARCH, 107 @XmlEnumValue("reference") 108 REFERENCE, 109 @XmlEnumValue("sample") 110 SAMPLE, 111 @XmlEnumValue("future-use") 112 FUTURE_USE 113 } 114 @XmlType(namespace = "urn:x-vcr:virtualcollection:reproducability") 115 @XmlEnum(String.class) 116 public static enum Reproducibility { 117 @XmlEnumValue("intended") 118 INTENDED, 119 @XmlEnumValue("fluctuating") 120 FLUCTUATING, 121 @XmlEnumValue("untended") 122 UNTENDED 108 123 } 109 124 @Id … … 135 150 @Temporal(TemporalType.DATE) 136 151 private Date creationDate; 137 @Column(name = "visibility")138 @Enumerated(EnumType.ORDINAL)139 private Visibility visibility = Visibility.ADVERTISED;140 152 @Column(name = "type") 141 153 @Enumerated(EnumType.ORDINAL) 142 154 private Type type = Type.EXTENSIONAL; 143 @Column(name = "origin")144 private String origin;145 155 @Embedded 146 156 private Creator creator; 157 @Column(name = "purpose") 158 @Enumerated(EnumType.ORDINAL) 159 private Purpose purpose; 160 @Column(name = "reproducibility") 161 @Enumerated(EnumType.ORDINAL) 162 private Reproducibility reproducibility; 163 @Column(name = "reproducibility_notice") 164 private String reproducibilityNotice; 147 165 @OneToMany(cascade = CascadeType.ALL, 148 fetch = FetchType.LAZY) 166 fetch = FetchType.LAZY, 167 orphanRemoval = true) 149 168 @JoinColumn(name = "vc_id", 150 169 nullable = false) 151 170 @OrderBy("id") 152 171 private Set<Resource> resources = new LinkedHashSet<Resource>(); 172 @Embedded 173 private GeneratedBy generatedby; 153 174 @Column(name = "created", 154 175 nullable = false, … … 259 280 } 260 281 261 public void setVisibility(Visibility visibility) {262 if (visibility == null) {263 throw new NullPointerException("visibility == null");264 }265 this.visibility = visibility;266 }267 268 @XmlElement(name = "Visibility")269 public Visibility getVisibility() {270 return visibility;271 }272 273 282 public void setType(Type style) { 274 283 if (style == null) { … … 283 292 } 284 293 285 public void setOrigin(String origin) {286 this.origin = origin;287 }288 289 @XmlElement(name = "Origin")290 public String getOrigin() {291 return origin;292 }293 294 294 public void setCreator(Creator creator) { 295 295 this.creator = creator; … … 301 301 } 302 302 303 public void setPurpose(Purpose purpose) { 304 this.purpose = purpose; 305 } 306 307 @XmlElement(name = "Purpose") 308 public Purpose getPurpose() { 309 return purpose; 310 } 311 312 public void setReproducibility(Reproducibility reproducibility) { 313 this.reproducibility = reproducibility; 314 } 315 316 @XmlElement(name = "Reproducability") 317 public Reproducibility getReproducibility() { 318 return reproducibility; 319 } 320 321 public void setReproducibilityNotice(String reproducibilityNotice) { 322 this.reproducibilityNotice = reproducibilityNotice; 323 } 324 325 @XmlElement(name = "ReproducibilityNotice") 326 public String getReproducibilityNotice() { 327 return reproducibilityNotice; 328 } 329 303 330 @XmlElementWrapper(name = "Resources") 304 @XmlElements({ @XmlElement(name = "Resource Proxy", type = Resource.class) })331 @XmlElements({ @XmlElement(name = "Resource", type = Resource.class) }) 305 332 public Set<Resource> getResources() { 306 333 return resources; 334 } 335 336 public void setGeneratedBy(GeneratedBy generatedby) { 337 this.generatedby = generatedby; 338 } 339 340 @XmlElement(name = "GeneratedBy") 341 public GeneratedBy getGeneratedBy() { 342 return generatedby; 307 343 } 308 344 … … 333 369 this.setDescription(vc.getDescription()); 334 370 this.setCreationDate(vc.getCreationDate()); 335 this.setVisibility(vc.getVisibility());336 371 this.setType(vc.getType()); 337 this.setOrigin(vc.getOrigin());338 372 Creator c = vc.getCreator(); 339 373 if (c != null) { … … 344 378 this.creator = null; 345 379 } 346 347 HashMap<Integer, Resource> old_res = 348 new HashMap<Integer, Resource>(this.resources.size()); 349 for (Resource r : this.resources) { 350 old_res.put(r.getSignature(), r); 351 352 } 353 HashMap<Integer, Resource> new_res = 354 new HashMap<Integer, Resource>(vc.getResources().size()); 355 for (Resource r : vc.getResources()) { 356 new_res.put(r.getSignature(), r); 357 } 358 for (Resource r : new_res.values()) { 359 if (!old_res.containsKey(r.getSignature())) { 360 resources.add(r); 361 } 362 } 363 for (Resource r : old_res.values()) { 364 if (!new_res.containsKey(r.getSignature())) { 365 resources.remove(r); 366 } 367 } 380 this.setPurpose(vc.getPurpose()); 381 this.setReproducibility(vc.getReproducibility()); 382 this.setReproducibilityNotice(vc.getReproducibilityNotice()); 383 384 // add all new resources to set 385 this.resources.addAll(vc.resources); 386 // purge all deleted members 387 this.resources.retainAll(vc.resources); 368 388 } 369 389 -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/VirtualCollectionValidator.java
r503 r556 1 1 package eu.clarin.cmdi.virtualcollectionregistry.model; 2 2 3 import java.util.HashMap; 3 import java.util.HashSet; 4 import java.util.Set; 4 5 5 6 import eu.clarin.cmdi.virtualcollectionregistry.VirtualCollectionRegistryException; … … 7 8 8 9 public class VirtualCollectionValidator { 9 private HashMap<Integer, Resource> uniqueResources = 10 new HashMap<Integer, Resource>(); 11 private HashMap<String, Resource> uniqueResourceRefs = 12 new HashMap<String, Resource>(); 10 private Set<String> uniqueResourceRefs = new HashSet<String>(512); 13 11 14 12 public void validate(VirtualCollection vc) … … 27 25 } 28 26 for (Resource resource : vc.getResources()) { 29 int signature = resource.getSignature();30 if (uniqueResources.containsKey(signature)) {31 throw new VirtualCollectionRegistryUsageException(32 "collection contains non-unique resources");33 }34 uniqueResources.put(signature, resource);35 27 String ref = resource.getRef(); 36 28 if ((ref == null) || ref.trim().isEmpty()) { … … 38 30 "collection contains resource with empty ResourceRef"); 39 31 } 40 if (uniqueResourceRefs.contains Key(ref)) {32 if (uniqueResourceRefs.contains(ref)) { 41 33 throw new VirtualCollectionRegistryUsageException( 42 34 "collection contains non-unique ResourceRefs"); 43 35 } 44 uniqueResourceRefs. put(ref, resource);36 uniqueResourceRefs.add(ref); 45 37 } 46 38 } 47 39 48 40 private void reset() { 49 uniqueResources.clear();50 41 uniqueResourceRefs.clear(); 51 42 } -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/ASTPredicate.java
r522 r556 55 55 sb.append("vc_state"); 56 56 break; 57 case QueryParserConstants.VC_PURPOSE: 58 sb.append("vc_purpose"); 59 break; 60 case QueryParserConstants.VC_REPRODUCIBILITY: 61 sb.append("vc_reproducibility"); 62 break; 57 63 case QueryParserConstants.VC_MODIFIED: 58 64 sb.append("vc_modified"); -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/query/WhereClauseBuilder.java
r522 r556 132 132 case QueryParserConstants.VC_STATE: 133 133 predicate = makeStatePredicate(data, 134 node.getOperator(), node.getValue()); 135 break; 136 case QueryParserConstants.VC_PURPOSE: 137 predicate = makePurposePredicate(data, 138 node.getOperator(), node.getValue()); 139 break; 140 case QueryParserConstants.VC_REPRODUCIBILITY: 141 predicate = makeReproducibilityPredicate(data, 134 142 node.getOperator(), node.getValue()); 135 143 break; … … 208 216 return data.getBuilder().notEqual(attribute, state); 209 217 } 218 default: 219 throw new InternalError("bad operator"); 220 } // switch (operator) 221 } 222 223 private static Predicate makePurposePredicate(Data data, int operator, 224 String value) { 225 VirtualCollection.Purpose purpose = null; 226 if ("research".equalsIgnoreCase(value)) { 227 purpose = VirtualCollection.Purpose.RESEARCH; 228 } else if ("reference".equalsIgnoreCase(value)) { 229 purpose = VirtualCollection.Purpose.REFERENCE; 230 } else if ("sample".equalsIgnoreCase(value)) { 231 purpose = VirtualCollection.Purpose.SAMPLE; 232 } else if ("future-use".equalsIgnoreCase(value)) { 233 purpose = VirtualCollection.Purpose.FUTURE_USE; 234 } else { 235 throw new InternalError("bad value"); 236 } 237 Expression<VirtualCollection.Purpose> attribute = 238 data.getRoot().get(VirtualCollection_.purpose); 239 switch (operator) { 240 case QueryParserConstants.EQ: 241 return data.getBuilder().equal(attribute, purpose); 242 case QueryParserConstants.NE: 243 return data.getBuilder().notEqual(attribute, purpose); 244 default: 245 throw new InternalError("bad operator"); 246 } // switch (operator) 247 } 248 249 private static Predicate makeReproducibilityPredicate(Data data, 250 int operator, String value) { 251 VirtualCollection.Reproducibility reproducability = null; 252 if ("intended".equalsIgnoreCase(value)) { 253 reproducability = VirtualCollection.Reproducibility.INTENDED; 254 } else if ("fluctuating".equalsIgnoreCase(value)) { 255 reproducability = VirtualCollection.Reproducibility.FLUCTUATING; 256 } else if ("untended".equalsIgnoreCase(value)) { 257 reproducability = VirtualCollection.Reproducibility.UNTENDED; 258 } else { 259 throw new InternalError("bad value"); 260 } 261 Expression<VirtualCollection.Reproducibility> attribute = 262 data.getRoot().get(VirtualCollection_.reproducibility); 263 switch (operator) { 264 case QueryParserConstants.EQ: 265 return data.getBuilder().equal(attribute, reproducability); 266 case QueryParserConstants.NE: 267 return data.getBuilder().notEqual(attribute, reproducability); 210 268 default: 211 269 throw new InternalError("bad operator"); -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/jjtree/eu/clarin/cmdi/virtualcollectionregistry/query/QueryParser.jjt
r522 r556 6 6 VISITOR = true; 7 7 } 8 9 8 PARSER_BEGIN(QueryParser) 10 9 package eu.clarin.cmdi.virtualcollectionregistry.query; 11 12 10 public class QueryParser { 13 11 public QueryParser(String s) { … … 16 14 } // class QueryParser 17 15 PARSER_END(QueryParser) 18 19 16 /* 20 (vc.)name: STRING, EQ, NE 21 (vc.)desciption: STRING, EQ, NE 22 (vc.)created: DATE, EQ, NE, GT, GE, LT, LE 23 {vc.}modified: DATE, EQ, NE, GT, GE, LT, LE 24 (vc.)state: { "public", "private", "deleted"}, EQ, NE 17 (vc.)name: STRING, EQ, NE 18 (vc.)desciption: STRING, EQ, NE 19 (vc.)created: ISO-DATE, EQ, NE, GT, GE, LT, LE 20 {vc.}modified: ISO-DATE, EQ, NE, GT, GE, LT, LE 21 (vc.)state: { "public", "private", "deleted" }, EQ, NE 22 {vc.}purpose: { "research", "reference", 23 "sample", "future-use" } EQ, NE 24 {vc.}reproducability { "intended", "fluctuating", "untended"} EQ, NE 25 25 (cr.)creator: STRING, EQ, NE 26 26 {cr.}email: STRING, EQ, NE 27 27 {cr.}organization: STRING, EQ, NE 28 28 */ 29 30 29 SKIP: { 31 30 " " … … 34 33 | "\r" 35 34 } 36 37 35 TOKEN: { 38 36 <VC_NAME: "name"> … … 41 39 | <VC_MODIFIED: "modified"> 42 40 | <VC_STATE: "state"> 41 | <VC_PURPOSE: "purpose"> 42 | <VC_REPRODUCIBILITY: "reproducibility"> 43 43 | <CR_NAME: "creator"> 44 44 | <CR_ORGANIZATION: "organization"> … … 51 51 | <GE: ">="> 52 52 | <LT: "<"> 53 | <LE: "<="> 53 | <LE: "<="> 54 54 | <LPAREN: "("> 55 55 | <RPAREN: ")"> … … 57 57 | <STATE_PRIVATE: "private"> 58 58 | <STATE_DELETED: "deleted"> 59 | <PURPOSE_RESEARCH: "research"> 60 | <PURPOSE_REFERENCE: "reference"> 61 | <PURPOSE_SAMPLE: "sample"> 62 | <PURPOSE_FUTURE_USE: "future-use"> 63 | <REPRODUCIBILITY_INTENDED: "intended"> 64 | <REPRODUCIBILITY_FLUCTUATING: "fluctuating"> 65 | <REPRODUCIBILITY_UNTENDED: "untended"> 59 66 | <#DIGIT: ["0"-"9"]> 60 67 | <ISO_DATE: <DIGIT> <DIGIT> <DIGIT> <DIGIT> "-" … … 63 70 <DIGIT> <DIGIT> ":" 64 71 <DIGIT> <DIGIT> ":" 65 <DIGIT> <DIGIT> "Z"> 72 <DIGIT> <DIGIT> "Z"> 66 73 | <QUOTED_STRING: "\"" (~["\""])+ "\"" > 67 74 } 68 69 75 ASTStart start() #Start : { 70 76 } … … 73 79 { return jjtThis; } 74 80 } 75 76 81 private void expressionOr() : { 77 82 } … … 79 84 (expressionAnd() (<OR> expressionAnd())*) #Or(>1) 80 85 } 81 82 86 private void expressionAnd() : { 83 87 } … … 85 89 (term() (<AND> term())*) #And(>1) 86 90 } 87 88 91 private void term() : { 89 92 } … … 92 95 | (<LPAREN> expressionOr() <RPAREN>) 93 96 } 94 95 97 private void predicate() #Predicate : { 96 98 Token attribute = null; … … 123 125 | operator = <LE> ) 124 126 value = <ISO_DATE> ) 127 | ( attribute = <VC_PURPOSE> 128 ( operator = <EQ> 129 | operator = <NE> ) 130 ( value = <PURPOSE_RESEARCH> 131 | value = <PURPOSE_REFERENCE> 132 | value = <PURPOSE_SAMPLE> 133 | value = <PURPOSE_FUTURE_USE> ) ) 134 | ( attribute = <VC_REPRODUCIBILITY> 135 ( operator = <EQ> 136 | operator = <NE> ) 137 ( value = <REPRODUCIBILITY_INTENDED> 138 | value = <REPRODUCIBILITY_FLUCTUATING> 139 | value = <REPRODUCIBILITY_UNTENDED> ) ) 125 140 ) 126 141 { … … 128 143 throw new ParseException("internal error while parsing query"); 129 144 } 130 131 145 // strip quotes from QUOTED_STRING 132 146 String v = value.image; … … 134 148 v = v.substring(1, v.length() - 1); 135 149 } 136 137 150 jjtThis.setAttribute(attribute.kind); 138 151 jjtThis.setOperator(operator.kind); -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/resources/META-INF/VirtualCollection.xsd
r507 r556 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> 2 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 3 elementFormDefault="qualified"> 3 4 4 <xs:element name="VirtualCollection" type="VirtualCollectionType" /> 5 <xs:element name="VirtualCollections"> 6 <xs:complexType> 7 <xs:sequence maxOccurs="unbounded"> 8 <xs:element ref="VirtualCollection" /> 9 </xs:sequence> 10 <xs:attribute name="totalCount" type="xs:integer" /> 11 <xs:attribute name="offset" type="xs:integer" /> 12 <xs:attribute name="result"> 13 <xs:simpleType> 14 <xs:restriction base="xs:string"> 15 <xs:enumeration value="full" /> 16 <xs:enumeration value="partial" /> 17 </xs:restriction> 18 </xs:simpleType> 19 </xs:attribute> 20 </xs:complexType> 21 </xs:element> 5 22 6 <xs:element name="VirtualCollections" type="VirtualCollectionsType" /> 7 8 <xs:complexType name="VirtualCollectionsType"> 9 <xs:sequence maxOccurs="unbounded"> 10 <xs:element ref="VirtualCollection" /> 11 </xs:sequence> 12 <xs:attribute name="totalCount" type="xs:integer" /> 13 <xs:attribute name="offset" type="xs:integer" /> 14 <xs:attribute name="result"> 15 <xs:simpleType> 16 <xs:restriction base="xs:string"> 17 <xs:enumeration value="full" /> 18 <xs:enumeration value="partial" /> 19 </xs:restriction> 20 </xs:simpleType> 21 </xs:attribute> 22 </xs:complexType> 23 24 <xs:complexType name="VirtualCollectionType"> 25 <xs:sequence> 26 <xs:element name="Name" type="xs:string" /> 27 <xs:element minOccurs="0" name="Description" type="xs:string" /> 28 <xs:element minOccurs="0" name="CreationDate" type="xs:date" /> 29 <xs:element minOccurs="0" name="Visibility" type="VisibilityType" /> 30 <xs:element name="Type" type="TypeType" /> 31 <xs:element minOccurs="0" name="Origin" type="xs:string" /> 32 <xs:element minOccurs="0" name="Creator" type="CreatorType" /> 33 <xs:element name="Resources" type="ResourcesType" /> 34 </xs:sequence> 35 <xs:attribute name="id" type="xs:long" use="optional" /> 36 <xs:attribute name="persistentId" type="xs:string" use="optional" /> 37 <xs:attribute name="state" type="xs:string" use="optional" /> 38 </xs:complexType> 39 40 41 <xs:complexType name="ResourcesType"> 42 <xs:sequence maxOccurs="unbounded"> 43 <xs:element name="ResourceProxy" type="ResourceType" /> 44 </xs:sequence> 45 </xs:complexType> 46 47 <xs:complexType name="ResourceType"> 48 <xs:sequence> 49 <xs:element name="ResourceType" type="ResourceTypeType" /> 50 <xs:element name="ResourceRef" type="ResourceRefType" /> 51 </xs:sequence> 52 <xs:attribute name="id" type="xs:ID" use="required" /> 53 </xs:complexType> 54 55 <xs:complexType name="CreatorType"> 56 <xs:sequence> 57 <xs:element name="Name" type="xs:string" /> 58 <xs:element minOccurs="0" name="Email" type="xs:string" /> 59 <xs:element minOccurs="0" name="Organisation" type="xs:string" /> 60 </xs:sequence> 61 <xs:attribute name="ref" type="xs:IDREF" /> 62 </xs:complexType> 63 64 <xs:simpleType name="ResourceTypeType"> 65 <xs:restriction base="xs:string"> 66 <xs:enumeration value="Metadata" /> 67 <xs:enumeration value="Resource" /> 68 </xs:restriction> 69 </xs:simpleType> 70 71 <xs:simpleType name="ResourceRefType"> 72 <xs:restriction base="xs:anyURI" /> 73 </xs:simpleType> 74 75 <xs:simpleType name="VisibilityType"> 76 <xs:restriction base="xs:string"> 77 <xs:enumeration value="advertised" /> 78 <xs:enumeration value="non-advertised" /> 79 </xs:restriction> 80 </xs:simpleType> 81 82 <xs:simpleType name="TypeType"> 83 <xs:restriction base="xs:string"> 84 <xs:enumeration value="extensional" /> 85 <xs:enumeration value="intensional" /> 86 </xs:restriction> 87 </xs:simpleType> 88 23 <xs:element name="VirtualCollection"> 24 <xs:complexType> 25 <xs:sequence> 26 <xs:element name="Name" type="xs:string" /> 27 <xs:element minOccurs="0" name="Description" type="xs:string" /> 28 <xs:element minOccurs="0" name="CreationDate" type="xs:date" /> 29 <xs:element name="Type"> 30 <xs:simpleType> 31 <xs:restriction base="xs:string"> 32 <xs:enumeration value="extensional" /> 33 <xs:enumeration value="intensional" /> 34 </xs:restriction> 35 </xs:simpleType> 36 </xs:element> 37 <xs:element minOccurs="0" name="Creator"> 38 <xs:complexType> 39 <xs:sequence> 40 <xs:element name="Name" type="xs:string" /> 41 <xs:element minOccurs="0" name="Email" type="xs:string" /> 42 <xs:element minOccurs="0" name="Organisation" 43 type="xs:string" /> 44 </xs:sequence> 45 <xs:attribute name="ref" type="xs:IDREF" /> 46 </xs:complexType> 47 </xs:element> 48 <xs:element minOccurs="0" name="Purpose"> 49 <xs:simpleType> 50 <xs:restriction base="xs:string"> 51 <xs:enumeration value="research" /> 52 <xs:enumeration value="reference" /> 53 <xs:enumeration value="sample" /> 54 <xs:enumeration value="future-use" /> 55 <!-- to be extended --> 56 </xs:restriction> 57 </xs:simpleType> 58 </xs:element> 59 <xs:element minOccurs="0" name="Reproducibility"> 60 <xs:simpleType> 61 <xs:restriction base="xs:string"> 62 <xs:enumeration value="intended" /> 63 <xs:enumeration value="fluctuating" /> 64 <xs:enumeration value="untended" /> 65 </xs:restriction> 66 </xs:simpleType> 67 </xs:element> 68 <xs:element minOccurs="0" name="ReproducibilityNotice" 69 type="xs:string" /> 70 <xs:element name="Resources"> 71 <xs:complexType> 72 <xs:sequence maxOccurs="unbounded"> 73 <xs:element name="Resource"> 74 <xs:complexType> 75 <xs:sequence> 76 <xs:element name="ResourceType"> 77 <xs:simpleType> 78 <xs:restriction base="xs:string"> 79 <xs:enumeration value="Metadata" /> 80 <xs:enumeration value="Resource" /> 81 </xs:restriction> 82 </xs:simpleType> 83 </xs:element> 84 <xs:element name="ResourceRef"> 85 <xs:simpleType> 86 <xs:restriction base="xs:anyURI" /> 87 </xs:simpleType> 88 </xs:element> 89 </xs:sequence> 90 </xs:complexType> 91 </xs:element> 92 </xs:sequence> 93 </xs:complexType> 94 </xs:element> 95 <xs:element name="GeneratedBy" minOccurs="0"> 96 <xs:complexType> 97 <xs:sequence> 98 <xs:element name="Description" type="xs:string" /> 99 <xs:element name="Query" maxOccurs="1" 100 minOccurs="0"> 101 <xs:complexType> 102 <xs:sequence> 103 <xs:any namespace="##any" processContents="lax" /> 104 </xs:sequence> 105 <xs:attribute name="profile" type="xs:string" 106 use="optional" /> 107 </xs:complexType> 108 </xs:element> 109 </xs:sequence> 110 </xs:complexType> 111 </xs:element> 112 </xs:sequence> 113 <xs:attribute name="id" type="xs:long" use="optional" /> 114 <xs:attribute name="persistentId" type="xs:string" 115 use="optional" /> 116 <xs:attribute name="state" use="optional"> 117 <xs:simpleType> 118 <xs:restriction base="xs:string"> 119 <xs:enumeration value="private" /> 120 <xs:enumeration value="public-pending" /> 121 <xs:enumeration value="public" /> 122 <xs:enumeration value="deleted" /> 123 <xs:enumeration value="dead" /> 124 </xs:restriction> 125 </xs:simpleType> 126 </xs:attribute> 127 </xs:complexType> 128 </xs:element> 89 129 </xs:schema>
Note: See TracChangeset
for help on using the changeset viewer.