레이블이 workitem인 게시물을 표시합니다. 모든 게시물 표시
레이블이 workitem인 게시물을 표시합니다. 모든 게시물 표시

2011년 12월 5일 월요일

작업항목 속성사용자정의

https://jazz.net/library/article/537


This article describes the possibilities of customizing attributes with default values, dependent value sets, validation rules and dynamic required attributes. You should be familiar with work item customization already. If not, please read Work Item Customization and Work Item Editor Presentations first. The functionality shown here applies to both the Web UI and the Eclipse UI.

Overview

An early preview of attribute customization was made available in RTC 2.0.0.2. In 3.0 the functionality has been extended and is now configurable in the Process Configuration UI of the Eclipse client. Default values, value sets and validation rules are managed in the Attribute Customizationsection of the Project Area Editor. Once you have defined them there, you have the option to associate e.g. a value set with custom or built-in attributes. Required attributes can be configured in the Operation Behavior section of Team Configuration and, since 3.0.1, computed dynamically for values of other attributes using a Condition.

작업항목 사용자정의

https://jazz.net/library/article/129


The Work Item component can be customized in various ways. These customizations are configured on the Process Configuration page of the Project Area or Project Template editor. This article covers both RTC 1.0 and RTC 2.0. The screen captures are from RTC 2.0 but they still apply to RTC 1.0 since the UI hasn't changed much in RTC 2.0.
Work item customization in the Process Configuration in RTC 2.0

작업항목 스크립트기반 사용자정의

https://jazz.net/wiki/bin/view/Main/AttributeCustomization


dojo.provide("org.example.workitems.providers.SeverityTagValueSet");

dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.string");

(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;

dojo.declare("org.example.workitems.providers.SeverityTagValueSet", null, {

    getValueSet: function(attributeId, workItem, configuration) {
    
        var tags= workItem.getValue(WorkItemAttributes.TAGS);
        var severityOptions= [];
        
        if (tags.indexOf("important") === -1) {
            severityOptions.push("severity.literal.l1"); // Unclassified
            severityOptions.push("severity.literal.l2"); // Minor
            severityOptions.push("severity.literal.l3"); // Normal
        }
        
        severityOptions.push("severity.literal.l4"); // Major
        severityOptions.push("severity.literal.l5"); // Critical
        severityOptions.push("severity.literal.l6"); // Blocker

        return severityOptions;
    }
});
})();


Attribute customization is a way to add additional behavior for an attribute of a work item. For example you might want to validate the value of an attribute or even calculate its value based on other attributes. This article discusses in detail all available types of attribute customization. The examples on this page have been developed and tested with RTC version 3.0.1.


This Wiki page is not a tutorial and is meant to serve as a reference. Please see Customizing attributes in RTC 3.0 for a step-by-step introduction on attribute customization where the general concepts are explained and a few examples are provided. Here you can find more details about each possible customization together with further examples. This Wiki also contains information about using scripts to achieve more advanced behavior.

작업항목 속성사용자정의 - DataSourceValueSet

https://jazz.net/wiki/bin/view/Main/DataSourceValueSetProviders

Since version 3.0.1.1 and 3.5 it is possible to configure a Value Set customization that fetches the values for an attribute using an external data source such as an HTTP Rest request that fetches XML data.




작업항목 스크립트기반 사용자정의 중급예제 - HttpFilteredValueSet


RTC 3.0.1.1에서 car, area 속성간의 의존성을 구현하는 방법입니다.

1. 자바스크립트를 첨부하여 customization하도록 CCM 서버를 구성합니다.

  • 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("1");
        out.println("Acura");
        out.println("Acura1Acura2");
        out.println("
");
        out.println("");
        out.println("2");
        out.println("Aixam");
        out.println("Aixam1Aixam2");
        out.println("
");
        out.println("
");
        out.close();
}

3. 'car'용 value set provider를 만듭니다.
CarMakeProvider.png


4. 'car' 속성에 value set provider를 설정합니다.
car-valueset.png


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
MyCarAreaValueSet.png

7. 'area' 속성에 'MyCarAreaValueSet'을 설정합니다.

작업항목 속성사용자정의 중급예제 - HttpFilteredValueSet


기본 예제가 하나의 속성을 다루었다면, 여기서는 두 속성 간에 의존 관계를 다룹니다.

1. car 속성은 기본 예제와 같이 설정합니다.
(1) CarValueSetProvider
- XML DataSource URL : http://localhost:8080/MyCar/mycar
- Row XPath Expression : //xml/node
- Col XPath Expressions : ./make
- Col identifiers : Make
- Entry label format : ${0} 

2. area 속성은 기본 예제와 같지만 car 속성에 의존적으로 설정합니다.
- XML DataSource URL : http://localhost:8080/MyCar/mycar
- Row XPath Expression : //xml/node[make='${car.value}']/areas/area
- Col XPath Expressions : ./name
- Col identifiers : Area
- Entry label format : ${0} 

3. 서블릿에서 제공하는 XML은 아래와 같습니다.

1
Acura

Acura1
Acura2 
 


2
Aixam

Aixam1
Aixam2 
 
 
 

작업항목 속성사용자정의 기본예제 - HttpFilteredValueSet

1. 먼저 서블릿(MyCar.zip)을 하나 만듭니다. 여기서는 시간상 데이터베이스에서 읽어서 XML를 만들지 않고 하드코딩한 XML를 던지도록 작성했습니다.

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doMyCar(request,response);    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doMyCar(request,response);    }

    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(",1,2,");
        out.println("
");
        out.println("");
        out.println("2");
        out.println("Aixam");
        out.println(",2,");
        out.println("
");
        out.println("
");
        out.close();

    }

화면상에서는 아래와 같이 서블릿을 호출하면 호출자에게 XML를 던집니다.

mycar-servlet.png


2. RTC 프로젝트 영역에 todo 작업항목 유형을 만들고 car 속성을 추가하여 테스트 해 봤습니다
- todo 작업항목 유형 만들기
  * "car"라는 small string 유형의 속성을 추가해 봤습니다.  

- todo 워크플로우 만들기

- todo 프리젠테이션 만들기
  * "car" 속성에 해당하는 프리젠테이션을 추가해 줬습니다. Kind는 Value Set Combo 또는 Value Set Picker를 사용해야 합니다.
car-presentation.png

- 속성 사용자 정의에 "CarMakeProvider"라는 Value Set 구성을 추가해 줍니다.
Category는 HTTP Filtered Value Set를 사용하고.. 아래와 같이 configuration을 해줍니다.

참고로 서블릿이 던지는 XML 문서 포맷을 다시 싣습니다.
- <xml>
-   <node>
        <id>1id>
        <make>Acuramake>
        <regions>,1,2,regions>
  node>
-    <node>
        <id>2id>
        <make>Aixammake>
        <regions>,2,regions>
  node>
xml>

CarMakeProvider.png
- "car" 속성에 Value Set를 "CarMakeProvider"로 지정해 줍니다.
car-valueset.png

3. todo 작업항목을 하나 만들어 봅니다.
todo-car.png

2011년 12월 3일 토요일

RTC를 이용한 작업항목 유형 만들기 (3.0).ppt


RTC를 이용해서 필요한 작업항목 유형을 만들 수 있는 데, 간단한 예제를 통해 워밍업을 해 볼 수 있는 자료입니다.

전반적인 작업 항목 유형 편집은 프로젝트 영역 편집기를 통해서 이뤄집니다. 아래는 일부 화면입니다.

Todo.png