Changeset 261:d4599d39e689
- Timestamp:
- 09/02/09 15:45:43 (4 years ago)
- Author:
- tgambet
- Branch:
- default
- convert_revision:
- svn:cdcfb263-7567-472c-a848-e2c2df3466e7/trunk@262
- Message:
-
added group elements to output with special behavior (type=firstPassed will output only the first passed observation child)
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r258
|
r261
|
|
| 34 | 34 | <xs:complexType name="outputType"> |
| 35 | 35 | <xs:sequence> |
| 36 | | <xs:element type="xs:string" name="observation" maxOccurs="unbounded" minOccurs="0" xmlns:tas="http://www.w3.org/unicorn/tasklist" /> |
| | 36 | |
| | 37 | <xs:element name="group" type="tas:groupType" minOccurs="0" maxOccurs="unbounded"></xs:element> |
| 37 | 38 | </xs:sequence> |
| 38 | 39 | </xs:complexType> |
| … |
… |
|
| 94 | 95 | </xs:complexType> |
| 95 | 96 | <xs:complexType name="execType" mixed="true"> |
| 96 | | <xs:sequence> |
| 97 | | <xs:element type="tas:paramType" name="param" minOccurs="0" xmlns:tas="http://www.w3.org/unicorn/tasklist"/> |
| 98 | | </xs:sequence> |
| 99 | | <xs:attribute type="xs:string" name="value" use="optional"/> |
| 100 | | <xs:attribute type="xs:string" name="type" use="optional"/> |
| | 97 | <xs:sequence> |
| | 98 | <xs:element type="tas:paramType" name="param" minOccurs="0" |
| | 99 | xmlns:tas="http://www.w3.org/unicorn/tasklist" /> |
| | 100 | </xs:sequence> |
| | 101 | |
| | 102 | <xs:attribute type="xs:string" name="value" use="optional" /> |
| | 103 | <xs:attribute type="xs:string" name="type" use="optional" /> |
| | 104 | |
| | 105 | <xs:attribute name="id" type="xs:string" use="required"></xs:attribute> |
| 101 | 106 | </xs:complexType> |
| 102 | | <xs:simpleType name="tInputMethod" xmlns:tas="http://www.w3.org/unicorn/tasklist"> |
| | 107 | <xs:simpleType name="tInputMethod" xmlns:tas="http://www.w3.org/unicorn/tasklist"> |
| 103 | 108 | <xs:restriction base="xs:string"> |
| 104 | 109 | <xs:enumeration value="file"/> |
| … |
… |
|
| 125 | 130 | </xs:restriction> |
| 126 | 131 | </xs:simpleType> |
| | 132 | |
| | 133 | <xs:complexType name="groupType"> |
| | 134 | <xs:sequence> |
| | 135 | <xs:element name="observation" type="xs:string" maxOccurs="unbounded" minOccurs="1"></xs:element> |
| | 136 | </xs:sequence> |
| | 137 | <xs:attribute name="type" use="optional"> |
| | 138 | <xs:simpleType> |
| | 139 | <xs:restriction base="xs:string"> |
| | 140 | <xs:enumeration value="firstPassed"></xs:enumeration> |
| | 141 | </xs:restriction> |
| | 142 | </xs:simpleType> |
| | 143 | </xs:attribute> |
| | 144 | </xs:complexType> |
| 127 | 145 | </xs:schema> |
-
|
r258
|
r261
|
|
| 38 | 38 | <if test="is-css"> |
| 39 | 39 | <then> |
| 40 | | <exec value="css-validator" type="observation" /> |
| | 40 | <exec id="css-validator" value="css-validator" type="observation" /> |
| 41 | 41 | </then> |
| 42 | 42 | <else> |
| 43 | | <exec value="markup-validator" type="observation" /> |
| | 43 | <exec id="markup-validator" value="markup-validator" type="observation" /> |
| 44 | 44 | <if test="is-html"> |
| 45 | 45 | <then> |
| 46 | | <exec value="appc-checker" type="observation" /> |
| | 46 | <exec id="css-validator" value="appc-checker" type="observation" /> |
| 47 | 47 | </then> |
| 48 | 48 | </if> |
| 49 | | <exec value="css-validator" type="observation" /> |
| | 49 | <!-- <exec value="css-validator" type="observation" /> --> |
| | 50 | <exec id="css2" value="css2-validator" type="observation" /> |
| | 51 | <exec id="css21" value="css21-validator" type="observation" /> |
| | 52 | <exec id="css3" value="css3-validator" type="observation" /> |
| 50 | 53 | </else> |
| 51 | 54 | </if> |
| … |
… |
|
| 58 | 61 | |
| 59 | 62 | <output> |
| 60 | | <observation>markup-validator</observation> |
| 61 | | <observation>appc-checker</observation> |
| 62 | | <observation>css-validator</observation> |
| | 63 | <group> |
| | 64 | <observation>markup-validator</observation> |
| | 65 | <observation>appc-checker</observation> |
| | 66 | </group> |
| | 67 | <group type="firstPassed"> |
| | 68 | <observation>css21-validator</observation> |
| | 69 | <observation>css2-validator</observation> |
| | 70 | <observation>css3-validator</observation> |
| | 71 | </group> |
| 63 | 72 | </output> |
| 64 | 73 | |
| … |
… |
|
| 68 | 77 | <task id="full-css"> |
| 69 | 78 | <routine> |
| 70 | | <exec value="css1-validator" type="observation" /> |
| 71 | | <exec value="css2-validator" type="observation" /> |
| 72 | | <exec value="css21-validator" type="observation" /> |
| 73 | | <exec value="css3-validator" type="observation" /> |
| | 79 | <exec id="css1" value="css1-validator" type="observation" /> |
| | 80 | <exec id="css2" value="css2-validator" type="observation" /> |
| | 81 | <exec id="css21" value="css21-validator" type="observation" /> |
| | 82 | <exec id="css3" value="css3-validator" type="observation" /> |
| 74 | 83 | </routine> |
| 75 | 84 | |
| … |
… |
|
| 234 | 243 | |
| 235 | 244 | <output> |
| 236 | | <observation>css3-validator</observation> |
| 237 | | <observation>css21-validator</observation> |
| 238 | | <observation>css2-validator</observation> |
| 239 | | <observation>css1-validator</observation> |
| | 245 | <group> |
| | 246 | <observation>css21-validator</observation> |
| | 247 | <observation>css2-validator</observation> |
| | 248 | <observation>css3-validator</observation> |
| | 249 | <observation>css1-validator</observation> |
| | 250 | </group> |
| 240 | 251 | </output> |
| 241 | 252 | </task> |
-
|
r258
|
r261
|
|
| 1 | | // $Id: UnicornCall.java,v 1.4 2009-09-02 13:50:54 tgambet Exp $ |
| | 1 | // $Id: UnicornCall.java,v 1.5 2009-09-02 15:45:42 tgambet Exp $ |
| 2 | 2 | // Author: Jean-Guilhem Rouel |
| 3 | 3 | // (c) COPYRIGHT MIT, ERCIM and Keio, 2006. |
| … |
… |
|
| 33 | 33 | import org.apache.velocity.app.event.EventCartridge; |
| 34 | 34 | import org.apache.velocity.app.event.implement.EscapeXmlReference; |
| | 35 | import org.w3.unicorn.tasklist.GroupType; |
| 35 | 36 | import org.w3c.dom.Document; |
| 36 | 37 | import org.w3c.unicorn.contract.CallParameter; |
| … |
… |
|
| 600 | 601 | */ |
| 601 | 602 | public LinkedHashMap<String, Response> getObservationList() { |
| | 603 | |
| 602 | 604 | LinkedHashMap<String, Response> tempMap = new LinkedHashMap<String, Response>(); |
| 603 | | for (String observerId : aTask.getListOfOutput()) { |
| 604 | | tempMap.put(observerId, mapOfResponse.get(observerId)); |
| 605 | | } |
| | 605 | |
| | 606 | for (GroupType group : aTask.getOutput().getGroupList()) { |
| | 607 | if (!group.isSetType()) { |
| | 608 | for (String observerId : group.getObservationList()) { |
| | 609 | tempMap.put(observerId, mapOfResponse.get(observerId)); |
| | 610 | } |
| | 611 | } else { |
| | 612 | String type = group.getType().toString(); |
| | 613 | if (type.equals("firstPassed")) { |
| | 614 | |
| | 615 | String passedId = null; |
| | 616 | |
| | 617 | for (String observerId : group.getObservationList()) { |
| | 618 | if (mapOfResponse.get(observerId).isPassed()) { |
| | 619 | passedId = observerId; |
| | 620 | break; |
| | 621 | } |
| | 622 | } |
| | 623 | if (passedId == null) |
| | 624 | tempMap.put(group.getObservationList().get(0), mapOfResponse.get(group.getObservationList().get(0))); |
| | 625 | else |
| | 626 | tempMap.put(passedId, mapOfResponse.get(passedId)); |
| | 627 | } |
| | 628 | } |
| | 629 | } |
| | 630 | |
| 606 | 631 | return tempMap; |
| 607 | 632 | } |
-
|
r258
|
r261
|
|
| 1 | | // $Id: Task.java,v 1.3 2009-09-02 13:50:54 tgambet Exp $ |
| | 1 | // $Id: Task.java,v 1.4 2009-09-02 15:45:42 tgambet Exp $ |
| 2 | 2 | // Author: Jean-Guilhem Rouel |
| 3 | 3 | // (c) COPYRIGHT MIT, ERCIM and Keio, 2006. |
| … |
… |
|
| 13 | 13 | import javax.activation.MimeType; |
| 14 | 14 | |
| | 15 | import org.w3.unicorn.tasklist.OutputType; |
| 15 | 16 | import org.w3c.unicorn.contract.Observer; |
| 16 | 17 | import org.w3c.unicorn.tasklist.parameters.Parameter; |
| … |
… |
|
| 57 | 58 | private TLTNode root; |
| 58 | 59 | |
| 59 | | private List<String> listOfOutput; |
| | 60 | //private List<String> listOfOutput; |
| | 61 | |
| | 62 | private OutputType output; |
| 60 | 63 | |
| 61 | 64 | /** |
| … |
… |
|
| 418 | 421 | } |
| 419 | 422 | |
| 420 | | public void setOutputList(List<String> observationList) { |
| | 423 | /*public void setOutputList(List<String> observationList) { |
| 421 | 424 | this.listOfOutput = observationList; |
| 422 | 425 | } |
| … |
… |
|
| 424 | 427 | public List<String> getListOfOutput() { |
| 425 | 428 | return listOfOutput; |
| 426 | | } |
| 427 | | |
| 428 | | |
| | 429 | }*/ |
| | 430 | |
| | 431 | public void setOutput(OutputType output) { |
| | 432 | this.output = output; |
| | 433 | } |
| | 434 | |
| | 435 | public OutputType getOutput() { |
| | 436 | return output; |
| | 437 | } |
| 429 | 438 | |
| 430 | 439 | } |
-
|
r258
|
r261
|
|
| 94 | 94 | |
| 95 | 95 | // Add the OutputList |
| 96 | | aTaskCurrent.setOutputList(aTask.getOutput().getObservationList()); |
| | 96 | aTaskCurrent.setOutput(aTask.getOutput()); |
| 97 | 97 | |
| 98 | 98 | // parameters |