Forum Discussion

slambeth's avatar
slambeth
Occasional Contributor
13 years ago

Creating a Review with web services



We're working on a process to automatically create and assign reviews to developers using the web services interface.



I've gotten as far as creating a very basic review using the "createReview", and "updateReview" methods on the web services. 



I can't seem to find the functionality in the services to assign participants as the author, and reviewers.  I thought that maybe that the ReviewAccessSpec parameter would do it, but that seems to only define what roles have access to the review, not who would be in each role.



Does this functionality exist in the services?



Thanks,

Scott
  • slambeth's avatar
    slambeth
    Occasional Contributor
    Here is our code thus far:





        private void createReview(String Auther) {

            

            try {

                //connect to service

                m_proxy = new CodeCollaboratorProxy();

                m_proxy.setEndpoint("http://localhost:88/services/CodeCollaborator_7001?wsdl");

                String ticket = m_proxy.getLoginTicket("myuserid", "mypassword");

                System.out.println(ticket);

                

                javax.xml.rpc.Stub stub = (javax.xml.rpc.Stub)m_proxy.getCodeCollaborator();

                

                //setup basic auth

                stub._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, "myuserid");

                stub._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, ticket);

                

                //create review

                int reviewID = m_proxy.createReview(Author);

                

                //update review with details

                Calendar deadline = null;

                DisplayChangeListAsSpec displayChangeListAs = null;

                ReviewAccessSpec accessibleBy = null;

                String templateName = null;

                String title = null;

                m_proxy.updateReview(reviewID, title, null, deadline, displayChangeListAs, accessibleBy, templateName);

                

                

            } catch (ServerNotInitializedException e) {

                // TODO Auto-generated catch block

                e.printStackTrace();

            } catch (NotAuthorizedException e) {

                // TODO Auto-generated catch block

                e.printStackTrace();

            } catch (ServiceException e) {

                // TODO Auto-generated catch block

                e.printStackTrace();

            } catch (RemoteException e) {

                // TODO Auto-generated catch block

                e.printStackTrace();

            }

  • slambeth's avatar
    slambeth
    Occasional Contributor
    Okay... that'll work, I'll just drop exec commands from java
  • lkremer's avatar
    lkremer
    Occasional Contributor
    Same issue here.



    We'd like to add authors, reviewers and perforce changelists with the web service, but it is not implemented. Why? Just creating a new review is just one click, it is not worth doing programatically via the webservice.



    Adding author, reviewers, uploading changelist via the web service would be the real deal as this is the more complex part of the review creation. 



    Creating the just review via the  web service(which is easy to debug, etc.) and doing everything with calling ccollab... Simply not worth it. 



    And the ccollab.exe starts rather slow. Adds extra seconds to the whole operation.



    Suggestions?