Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.atlassian.lionbridge;
- import java.util.Calendar;
- import java.util.Date;
- import org.apache.axis.utils.ClassUtils;
- import org.tempuri.FreewayAuthLocator;
- import org.tempuri.FreewayAuthSoap;
- import org.tempuri.Vojo;
- import org.tempuri.VojoLocator;
- import org.tempuri.VojoSoap;
- import com.atlassian.confluence.core.ConfluenceActionSupport;
- import com.atlassian.confluence.pages.AbstractPage;
- import com.atlassian.confluence.pages.actions.PageAware;
- import com.opensymphony.xwork.Action;
- /**
- * The simplest action possible
- */
- public class FreewayProjectActionSend extends ConfluenceActionSupport
- {
- private String name;
- private String customerReference;
- private String poReference;
- private String specialInstructions;
- private Date enddate = null;
- private Date strtdate = null;
- private String nameval;
- private String crefval;
- private String porefval;
- private String splinstval;
- Calendar caldue;
- Calendar calStart;
- public String doEdit() throws Exception
- {
- String logonResult = "";
- String projectID = "";
- VojoSoap vojoSoap = null;
- try {
- ClassUtils.setClassLoader("org.apache.axis.attachments.AttachmentsImpl",getClass().getClassLoader());
- ClassUtils.setClassLoader("org.apache.axis.transport.http.HTTPSender",getClass().getClassLoader());
- System.out.println("This is in execute>>");
- FreewayAuthLocator freewayAuth = new FreewayAuthLocator();
- FreewayAuthSoap freewayAuthSoap = freewayAuth.getFreewayAuthSoap();
- logonResult = freewayAuthSoap.logon("username", "password");
- System.out.println("LogonResult >> " + logonResult);
- System.out.println("This is the name >> " + name);
- System.out.println("This is the Customer Ref >> " + customerReference);
- System.out.println("This is the Po Ref >> " + poReference);
- System.out.println("This is the Special Instruction >> " + specialInstructions);
- caldue = Calendar.getInstance();
- //caldue.setTime(enddate);
- // caldue.getTime();
- calStart = Calendar.getInstance();
- // calStart.getTime();
- //calStart.setTime(strtdate);
- VojoLocator vojo = new VojoLocator();
- vojo.setVojoSoapEndpointAddress("https://freeway.demo.lionbridge.com/vojo/service.asmx");
- vojo.setVojoSoap12EndpointAddress("https://freeway.demo.lionbridge.com/vojo/service.asmx");
- vojoSoap = vojo.getVojoSoap();
- projectID = vojoSoap.createProject(logonResult, name, specialInstructions, customerReference, poReference, caldue, calStart, null);
- System.out.println("Project ID >>> " + projectID);
- }
- catch (javax.xml.rpc.ServiceException ex) {
- // TODO handle ServiceException
- ex.printStackTrace();
- } catch (java.rmi.RemoteException ex) {
- // TODO handle remote exception
- ex.printStackTrace();
- } catch (Exception ex) {
- // TODO handle custom exceptions here
- ex.printStackTrace();
- }
- return Action.SUCCESS;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getCustomerReference() {
- return customerReference;
- }
- public void setCustomerReference(String customerReference) {
- this.customerReference = customerReference;
- }
- public String getPoReference() {
- return poReference;
- }
- public void setPoReference(String poReference) {
- this.poReference = poReference;
- }
- public String getSpecialInstructions() {
- return specialInstructions;
- }
- public void setSpecialInstructions(String specialInstructions) {
- this.specialInstructions = specialInstructions;
- }
- public String getNameval() {
- return nameval;
- }
- public void setNameval(String nameval) {
- this.nameval = nameval;
- }
- public String getCrefval() {
- return crefval;
- }
- public void setCrefval(String crefval) {
- this.crefval = crefval;
- }
- public String getPorefval() {
- return porefval;
- }
- public void setPorefval(String porefval) {
- this.porefval = porefval;
- }
- public String getSplinstval() {
- return splinstval;
- }
- public void setSplinstval(String splinstval) {
- this.splinstval = splinstval;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement