27 February, 2007 / Web Services API in TargetProcess 2.3

0 comments

We've almost finished web services API implementation for TP 2.3 release. It looks quite powerful and provides huge integration capabilities. With web services API you may do almost anything: add, edit and delete new entities, retrieve entities and even execute custom queries based on HQL (Hibernate Query Language). Of course you need to know HQL syntax (close to SQL in fact) and understand TargetProcess domain model to create complex queries. So we share entities description, class diagrams and NHibernate mapping files. You may check Web Services Developers Guide (PDF - 0.4M) for details.

Here are some examples that shows web services abilities.

Add new bug into TargetProcess.

BugServiceWse bugService = new BugServiceWse();
TpPolicy.ApplyAutheticationTicket(bugService, "admin", "admin");

BugDTO bug = new BugDTO();
bug.Name = "New bug";
bug.CreateDate = DateTime.Today;
bug.Description = "Bug Description";
bug.ProjectID = 1;
            
int bugId = bugService.Create(bug);

Console.WriteLine(bugId);

Add comment to existing user story.

UserStoryServiceWse service = new UserStoryServiceWse();
TpServicePolicy.ApplyAutheticationTicket(service, "admin", "admin");
int storyId = 98;

CommentDTO comment = new CommentDTO();
comment.Description = "New Comment";

int commId = service.AddCommentToUserStory(storyId , comment);

Exampe with complex HQL query. Select all user stories assigned to user

string userName = "admin";
string userPassword = "admin";
UserStoryServiceWse userStoryService = new UserStoryServiceWse();
TpServicePolicy.ApplyAutheticationTicket(
userStoryService, userName, userPassword);

string hqlAssignedUserStoryQuery =
@"from UserStory as us where us.UserStoryID in 
       (select team.Assignable.AssignableID from Team as team 
            where team.User.UserID = ? 
            and team.Actor = us.EntityState.Actor 
            and team.Assignable.AssignableID = us.UserStoryID)";
UserStoryDTO[] stories = userStoryService.Retrieve(
hqlAssignedUserStoryQuery, new object[] {users[0].UserID});

Labels: , ,

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home

 

We are developing TargetProcess agile project management software and blogging about our progress.

Subscribe to the RSS feed
Stay tuned by having the latest updates via RSS
Follow TargetProcess on Twitter
Get in touch with our team

Try TargetProcess
TargetProcess quick tour