RTC 3.0.1.1에서 car, area 속성간의 의존성을 구현하는 방법입니다.
1. 자바스크립트를 첨부하여 customization하도록 CCM 서버를 구성합니다.
2. XML문서를 제공하는 서블릿을 구성합니다.
예: http://localhost:8080/MyCar/mycar (mycar.java)
protected void doMyCar(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// Build the HTML response
response.setContentType("text/xml;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println("");
out.println("");
out.println("1 ");
out.println("Acura ");
out.println("Acura1 Acura2 ");
out.println(" ");
out.println("");
out.println("2 ");
out.println("Aixam ");
out.println("Aixam1 Aixam2 ");
out.println(" ");
out.println(" ");
out.close();
}
3. 'car'용 value set provider를 만듭니다.
4. 'car' 속성에 value set provider를 설정합니다.
5. 'area'용 value set provider 자바스크립트를 작성합니다.
예: MyCarAreaValueSet.js (MyCarAreaValueSet.js)
dojo.provide("org.example.workitems.providers.MyCarAreaValueSet");
dojo.require("com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters");
(function() {
var HttpConnectorParameters= com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters;
dojo.declare("org.example.workitems.providers.MyCarAreaValueSet", null, {
getFilteredValueSet: function(attributeId, workItem, context, filter) {
var params= new HttpConnectorParameters();
var car = workItem.getValue("car");
var xpath = "//xml/node[make=\"" + car + "\"]/areas/area";
params.url= "http://localhost:8080/MyCar/mycar";
params.xpath= xpath;
params.columnXpaths= ["./name"];
params.columnIds= ["Area"];
var connector = context.getDataConnector("HttpConnector");
var values= connector.get(params);
var result= [];
while(values.hasNext()){
var entry= values.next();
var area= entry.getById("Area");
result.push(area);
}
return result;
}
});
})();
6. 'area'용 value set provider를 만듭니다.
예: MyCarAreaValueSet
7. 'area' 속성에 'MyCarAreaValueSet'을 설정합니다.
- Go to administrative page of your RTC server https://your.server.name:9443/ccm/admin.
- Open the Server tab.
- From the left side-bar open Configuration > Advanced Properties
- In the Work Item Component find the Enable Process Attachment Scripts property and set its value to true.
2. XML문서를 제공하는 서블릿을 구성합니다.
예: http://localhost:8080/MyCar/mycar (mycar.java)
protected void doMyCar(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// Build the HTML response
response.setContentType("text/xml;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println("
out.println("
out.println("
out.println("
out.println("
out.println("
out.println("
out.println("
out.println("
out.println("
out.println("
out.println("
out.close();
}
3. 'car'용 value set provider를 만듭니다.
4. 'car' 속성에 value set provider를 설정합니다.
5. 'area'용 value set provider 자바스크립트를 작성합니다.
예: MyCarAreaValueSet.js (MyCarAreaValueSet.js)
dojo.provide("org.example.workitems.providers.MyCarAreaValueSet");
dojo.require("com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters");
(function() {
var HttpConnectorParameters= com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters;
dojo.declare("org.example.workitems.providers.MyCarAreaValueSet", null, {
getFilteredValueSet: function(attributeId, workItem, context, filter) {
var params= new HttpConnectorParameters();
var car = workItem.getValue("car");
var xpath = "//xml/node[make=\"" + car + "\"]/areas/area";
params.url= "http://localhost:8080/MyCar/mycar";
params.xpath= xpath;
params.columnXpaths= ["./name"];
params.columnIds= ["Area"];
var connector = context.getDataConnector("HttpConnector");
var values= connector.get(params);
var result= [];
while(values.hasNext()){
var entry= values.next();
var area= entry.getById("Area");
result.push(area);
}
return result;
}
});
})();
6. 'area'용 value set provider를 만듭니다.
예: MyCarAreaValueSet
7. 'area' 속성에 'MyCarAreaValueSet'을 설정합니다.
댓글 없음:
댓글 쓰기