Advertisement
DrupalCustom

class

Jul 31st, 2012
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.14 KB | None | 0 0
  1. package com.atlassian.lionbridge;
  2.  
  3.  
  4.  
  5. import java.util.Calendar;
  6. import java.util.Date;
  7.  
  8. import org.apache.axis.utils.ClassUtils;
  9. import org.tempuri.FreewayAuthLocator;
  10. import org.tempuri.FreewayAuthSoap;
  11. import org.tempuri.Vojo;
  12. import org.tempuri.VojoLocator;
  13. import org.tempuri.VojoSoap;
  14.  
  15. import com.atlassian.confluence.core.ConfluenceActionSupport;
  16. import com.atlassian.confluence.pages.AbstractPage;
  17. import com.atlassian.confluence.pages.actions.PageAware;
  18.  
  19.  
  20.  
  21. import com.opensymphony.xwork.Action;
  22.  
  23. /**
  24.  * The simplest action possible
  25.  */
  26.  
  27.  
  28. public class FreewayProjectActionSend extends ConfluenceActionSupport
  29. {
  30.     private String name;
  31.     private String customerReference;
  32.     private String poReference;
  33.     private String specialInstructions;
  34.     private Date enddate = null;
  35.     private Date strtdate = null;
  36.    
  37.     private String  nameval;
  38.     private String crefval;
  39.     private String porefval;
  40.     private String splinstval;
  41.      Calendar caldue;
  42.      Calendar calStart;
  43.      
  44.     public String doEdit() throws Exception
  45.     {
  46.          String logonResult = "";
  47.           String projectID = "";
  48.           VojoSoap vojoSoap = null;
  49.         try {
  50.             ClassUtils.setClassLoader("org.apache.axis.attachments.AttachmentsImpl",getClass().getClassLoader());
  51.             ClassUtils.setClassLoader("org.apache.axis.transport.http.HTTPSender",getClass().getClassLoader());
  52.              
  53.  
  54.         System.out.println("This is in execute>>");
  55.         FreewayAuthLocator freewayAuth = new FreewayAuthLocator();                     
  56.         FreewayAuthSoap freewayAuthSoap = freewayAuth.getFreewayAuthSoap();
  57.         logonResult = freewayAuthSoap.logon("username", "password");
  58.         System.out.println("LogonResult >> " + logonResult);
  59.         System.out.println("This is the name >> " + name);
  60.         System.out.println("This is the Customer Ref >> " + customerReference);
  61.         System.out.println("This is the Po Ref >> " + poReference);
  62.        
  63.         System.out.println("This is the Special Instruction >> " + specialInstructions);
  64.         caldue = Calendar.getInstance();
  65.         //caldue.setTime(enddate);
  66.     //  caldue.getTime();
  67.         calStart = Calendar.getInstance();
  68.     //  calStart.getTime();
  69.         //calStart.setTime(strtdate);
  70.        
  71.        
  72.        VojoLocator vojo = new VojoLocator();
  73.        vojo.setVojoSoapEndpointAddress("https://freeway.demo.lionbridge.com/vojo/service.asmx");
  74.        vojo.setVojoSoap12EndpointAddress("https://freeway.demo.lionbridge.com/vojo/service.asmx");
  75.        vojoSoap = vojo.getVojoSoap();
  76.         projectID =  vojoSoap.createProject(logonResult, name, specialInstructions, customerReference, poReference, caldue, calStart, null);
  77.         System.out.println("Project ID >>>  " + projectID);
  78.         }
  79.         catch (javax.xml.rpc.ServiceException ex) {
  80.             // TODO handle ServiceException
  81.             ex.printStackTrace();
  82.         } catch (java.rmi.RemoteException ex) {
  83.             // TODO handle remote exception
  84.             ex.printStackTrace();
  85.         } catch (Exception ex) {
  86.             // TODO handle custom exceptions here
  87.             ex.printStackTrace();
  88.         }
  89.           return Action.SUCCESS;
  90.     }
  91.     public String getName() {
  92.         return name;
  93.     }
  94.     public void setName(String name) {
  95.         this.name = name;
  96.     }
  97.     public String getCustomerReference() {
  98.         return customerReference;
  99.     }
  100.     public void setCustomerReference(String customerReference) {
  101.         this.customerReference = customerReference;
  102.     }
  103.     public String getPoReference() {
  104.         return poReference;
  105.     }
  106.     public void setPoReference(String poReference) {
  107.         this.poReference = poReference;
  108.     }
  109.     public String getSpecialInstructions() {
  110.         return specialInstructions;
  111.     }
  112.     public void setSpecialInstructions(String specialInstructions) {
  113.         this.specialInstructions = specialInstructions;
  114.     }
  115.     public String getNameval() {
  116.         return nameval;
  117.     }
  118.     public void setNameval(String nameval) {
  119.         this.nameval = nameval;
  120.     }
  121.     public String getCrefval() {
  122.         return crefval;
  123.     }
  124.     public void setCrefval(String crefval) {
  125.         this.crefval = crefval;
  126.     }
  127.     public String getPorefval() {
  128.         return porefval;
  129.     }
  130.     public void setPorefval(String porefval) {
  131.         this.porefval = porefval;
  132.     }
  133.     public String getSplinstval() {
  134.         return splinstval;
  135.     }
  136.     public void setSplinstval(String splinstval) {
  137.         this.splinstval = splinstval;
  138.     }
  139.    
  140.  
  141.    
  142.    
  143.  
  144. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement