2011년 11월 20일 일요일
Client API - 특정 프로젝트 영역내 특정 작업항목 유형 쿼리
IProjectAreaHandle prjAreaHandle = (IProjectAreaHandle)prjArea.getItemHandle();
IQueryClient queryClient = (IQueryClient) repo.getClientLibrary(IQueryClient.class);
IAuditableClient auditableClient = (IAuditableClient) repo.getClientLibrary(IAuditableClient.class);
IQueryableAttributeFactory attFactory = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE);
IQueryableAttribute typeAttribute = attFactory.findAttribute(prjAreaHandle, IWorkItem.TYPE_PROPERTY, auditableClient, null);
Expression expression = new AttributeExpression(typeAttribute, AttributeOperation.EQUALS, workItemTypeName);
IQueryableAttribute projectAreaAttribute = attFactory.findAttribute(prjAreaHandle, IWorkItem.PROJECT_AREA_PROPERTY, auditableClient, null);
AttributeExpression projectAreaExpression = new AttributeExpression(projectAreaAttribute, AttributeOperation.EQUALS, prjAreaHandle);
Term term = new Term(Operator.AND);
term.add(projectAreaExpression);
term.add(expression);
IQueryResult<IResolvedResult<IWorkItem>> queryResult = queryClient.getResolvedExpressionResults(prjAreaHandle, term, IWorkItem.FULL_PROFILE);
System.out.println("# of Query Results: " + queryResult.getResultSize(monitor).getTotal());
TeamPlatform.shutdown();
쿼리에 관련된 보다 자세한 정보는 https://jazz.net/wiki/bin/view/Main/QueryDevGuide
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기