192 |
brianR |
1 |
/*
|
|
|
2 |
* Copyright 2017 Brian Rosenberger (Brutex Network)
|
|
|
3 |
*
|
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
|
6 |
* You may obtain a copy of the License at
|
|
|
7 |
*
|
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
9 |
*
|
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13 |
* See the License for the specific language governing permissions and
|
|
|
14 |
* limitations under the License.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
package net.brutex.xservices.ws;
|
|
|
18 |
|
|
|
19 |
import java.util.GregorianCalendar;
|
|
|
20 |
import java.util.List;
|
|
|
21 |
|
|
|
22 |
import javax.jws.WebMethod;
|
|
|
23 |
import javax.jws.WebParam;
|
|
|
24 |
import javax.jws.WebService;
|
|
|
25 |
import javax.jws.soap.SOAPBinding;
|
|
|
26 |
import javax.xml.bind.annotation.XmlElement;
|
|
|
27 |
|
|
|
28 |
import net.brutex.mgmt.api.xml.AnyEntity;
|
|
|
29 |
import net.brutex.mgmt.api.xml.Customer;
|
|
|
30 |
import net.brutex.mgmt.api.xml.Project;
|
|
|
31 |
import net.brutex.mgmt.api.xml.TimesheetEntry;
|
|
|
32 |
import net.brutex.mgmt.api.xml.TimesheetFilter;
|
|
|
33 |
import net.brutex.mgmt.api.xml.User;
|
|
|
34 |
import net.brutex.xservices.types.ant.AttachmentType;
|
|
|
35 |
import net.brutex.xservices.util.BrutexNamespaces;
|
|
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
/**
|
|
|
40 |
* OpenAir proxy services
|
|
|
41 |
* @author Brian Rosenberger
|
|
|
42 |
* @since 20160531
|
|
|
43 |
*
|
|
|
44 |
*/
|
|
|
45 |
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
|
|
|
46 |
public interface OpenAirProxyService {
|
|
|
47 |
|
|
|
48 |
public static final String SERVICE_NAME = "OpenAirProxyService";
|
|
|
49 |
final String OPERATION_GETTIMEENTRIES = "getTimeentries";
|
|
|
50 |
final String OPERATION_GETEXCELTIMESHEET = "getExcelTimesheet";
|
|
|
51 |
final String OPERATION_GETEXCELTIMESHEET2 = "getExcelTimesheet2";
|
|
|
52 |
final String OPERATION_GETPROJECTBYEXTERNALID = "getProjectsByExternalId";
|
|
|
53 |
final String OPERATION_GETPROJECTBYOPPID = "getProjectsByOppId";
|
|
|
54 |
final String OPERATION_GETCUSTOMERBYID = "getCustomerById";
|
|
|
55 |
final String OPERATION_GETUSERBYID = "getUserById";
|
|
|
56 |
final String OPERATION_GETUSERBYUSERNAME = "getUserByUsername";
|
|
|
57 |
final String OPERATION_GETANYOBJECT = "getAnyObject";
|
|
|
58 |
final String OPERATION_GETUPDATEDCOMPANIES = "getUpdatedCustomer";
|
|
|
59 |
final String OPERATION_GETUPDATEDPROJECTS = "getUpdatedProject";
|
|
|
60 |
|
|
|
61 |
|
|
|
62 |
final String PARAM_PROJECTID = "oa_projectid";
|
|
|
63 |
final String PARAM_CUSTOMERID = "oa_customerid";
|
|
|
64 |
final String PARAM_USERID = "oa_userid";
|
|
|
65 |
final String PARAM_USERNAME = "oa_username";
|
|
|
66 |
final String PARAM_TEMPLATE ="template";
|
|
|
67 |
final String PARAM_STARTDATE = "startdate";
|
|
|
68 |
final String PARAM_ENDDATE = "enddate";
|
|
|
69 |
final String PARAM_ENTRYLIST = "timeentries";
|
|
|
70 |
final String PARAM_EXTERNALID = "externalid";
|
|
|
71 |
final String PARAM_OPPID = "oppid";
|
|
|
72 |
final String PARAM_INCLUDENONBILLABLE = "includeNonBillable";
|
|
|
73 |
final String PARAM_OBJECTTYPE = "objecttype";
|
|
|
74 |
final String PARAM_QUERIES = "queries";
|
|
|
75 |
final String PARAM_DATE = "datetime";
|
|
|
76 |
final String PARAM_OFFSET = "offset_minutes";
|
|
|
77 |
final String PARAM_TIMESHEETSTATUS = "timesheetstatus";
|
|
|
78 |
|
|
|
79 |
/**
|
|
|
80 |
* Get a list of time entries.
|
|
|
81 |
*
|
|
|
82 |
* @return List of time entries
|
|
|
83 |
* @throws XServicesFault
|
|
|
84 |
*/
|
|
|
85 |
@WebMethod(operationName=OPERATION_GETTIMEENTRIES)
|
|
|
86 |
@WSDLDocumentation(value="Get list of time entries")
|
|
|
87 |
public abstract List<TimesheetEntry> getTimeEntryList(
|
|
|
88 |
@WebParam(name=PARAM_PROJECTID) int oa_projectid,
|
|
|
89 |
@WebParam(name=PARAM_CUSTOMERID) int oa_customerid,
|
|
|
90 |
@WebParam(name=PARAM_USERID) int oa_userid,
|
|
|
91 |
@WebParam(name=PARAM_STARTDATE) GregorianCalendar startdate,
|
|
|
92 |
@WebParam(name=PARAM_ENDDATE) GregorianCalendar enddate,
|
|
|
93 |
@WebParam(name=PARAM_INCLUDENONBILLABLE) boolean includeNonBillable,
|
|
|
94 |
@WebParam(name=PARAM_TIMESHEETSTATUS) java.util.List<TimesheetFilter.TimesheetFilterType> filter)
|
|
|
95 |
throws XServicesFault;
|
|
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
|
99 |
/**
|
|
|
100 |
* Get an excel time sheet file.
|
|
|
101 |
*
|
|
|
102 |
* @return List of time entries
|
|
|
103 |
* @throws XServicesFault
|
|
|
104 |
*/
|
|
|
105 |
@WebMethod(operationName=OPERATION_GETEXCELTIMESHEET)
|
|
|
106 |
@WSDLDocumentation(value="Get an excel time sheet file.")
|
|
|
107 |
public abstract AttachmentType getExcelTimesheet(
|
|
|
108 |
@WebParam(name=PARAM_PROJECTID) int oa_projectid,
|
|
|
109 |
@WebParam(name=PARAM_CUSTOMERID) int oa_customerid,
|
|
|
110 |
@WebParam(name=PARAM_USERID) int oa_userid,
|
|
|
111 |
@WebParam(name=PARAM_STARTDATE) GregorianCalendar startdate,
|
|
|
112 |
@WebParam(name=PARAM_ENDDATE) GregorianCalendar enddate,
|
|
|
113 |
@WebParam(name=PARAM_INCLUDENONBILLABLE) boolean includeNonBillable,
|
|
|
114 |
@WebParam(name=PARAM_TIMESHEETSTATUS) java.util.List<TimesheetFilter.TimesheetFilterType> filter,
|
|
|
115 |
@WebParam(name=PARAM_TEMPLATE) AttachmentType templatefile) throws XServicesFault;
|
|
|
116 |
|
|
|
117 |
/**
|
|
|
118 |
* Get an excel time sheet file.
|
|
|
119 |
*
|
|
|
120 |
* @return List of time entries
|
|
|
121 |
* @throws XServicesFault
|
|
|
122 |
*/
|
|
|
123 |
@WebMethod(operationName=OPERATION_GETEXCELTIMESHEET2)
|
|
|
124 |
@WSDLDocumentation(value="Get an excel time sheet file.")
|
|
|
125 |
public abstract AttachmentType getExcelTimesheet2(
|
|
|
126 |
@WebParam(name=PARAM_ENTRYLIST) List<TimesheetEntry> entries,
|
|
|
127 |
@WebParam(name=PARAM_INCLUDENONBILLABLE) boolean includeNonBillable,
|
|
|
128 |
@WebParam(name=PARAM_TEMPLATE) AttachmentType templatefile) throws XServicesFault;
|
|
|
129 |
|
|
|
130 |
|
|
|
131 |
/**
|
|
|
132 |
* Get a project from External Id
|
|
|
133 |
*
|
|
|
134 |
* @return List of projects with this ExternalId
|
|
|
135 |
* @throws XServicesFault
|
|
|
136 |
*/
|
|
|
137 |
@WebMethod(operationName=OPERATION_GETPROJECTBYEXTERNALID)
|
|
|
138 |
@WSDLDocumentation(value="Get a project from External Id")
|
|
|
139 |
public abstract List<Project> getProjectsByExternalId(
|
|
|
140 |
@WebParam(name=PARAM_EXTERNALID) String externalid) throws XServicesFault;
|
|
|
141 |
|
|
|
142 |
/**
|
|
|
143 |
* Get a project from Opportunity
|
|
|
144 |
*
|
|
|
145 |
* @return List of projects with this Opportunity
|
|
|
146 |
* @throws XServicesFault
|
|
|
147 |
*/
|
|
|
148 |
@WebMethod(operationName=OPERATION_GETPROJECTBYOPPID)
|
|
|
149 |
@WSDLDocumentation(value="Get a project from Opportunity Id")
|
|
|
150 |
public abstract List<Project> getProjectsByOppId(
|
|
|
151 |
@WebParam(name=PARAM_OPPID) String oppid) throws XServicesFault;
|
|
|
152 |
|
|
|
153 |
/**
|
|
|
154 |
* Get a customer by its ID
|
|
|
155 |
*
|
|
|
156 |
* @return Customer object
|
|
|
157 |
* @throws XServicesFault
|
|
|
158 |
*/
|
|
|
159 |
@WebMethod(operationName=OPERATION_GETCUSTOMERBYID)
|
|
|
160 |
@WSDLDocumentation(value="Get a customer by its Id")
|
|
|
161 |
public abstract Customer getCustomerById(
|
|
|
162 |
@WebParam(name=PARAM_CUSTOMERID) int customerid) throws XServicesFault;
|
|
|
163 |
|
|
|
164 |
/**
|
|
|
165 |
* Get a user record by its ID
|
|
|
166 |
*
|
|
|
167 |
* @return user object
|
|
|
168 |
* @throws XServicesFault
|
|
|
169 |
*/
|
|
|
170 |
@WebMethod(operationName=OPERATION_GETUSERBYID)
|
|
|
171 |
@WSDLDocumentation(value="Get a user by its Id")
|
|
|
172 |
public abstract User getUserById(
|
|
|
173 |
@WebParam(name=PARAM_USERID) int userid) throws XServicesFault;
|
|
|
174 |
|
|
|
175 |
|
|
|
176 |
/**
|
|
|
177 |
* Get a user record by its username
|
|
|
178 |
*
|
|
|
179 |
* @return user object
|
|
|
180 |
* @throws XServicesFault
|
|
|
181 |
*/
|
|
|
182 |
@WebMethod(operationName=OPERATION_GETUSERBYUSERNAME)
|
|
|
183 |
@WSDLDocumentation(value="Get a user by its username")
|
|
|
184 |
public abstract User getUserByUsername(
|
|
|
185 |
@WebParam(name=PARAM_USERNAME) String username) throws XServicesFault;
|
|
|
186 |
|
|
|
187 |
@WebMethod(operationName=OPERATION_GETANYOBJECT)
|
|
|
188 |
@WSDLDocumentation(value="Get any Object by Query")
|
|
|
189 |
public abstract List<AnyEntity> getAnyObject(
|
|
|
190 |
@WebParam(name=PARAM_OBJECTTYPE) @XmlElement(required=true) String objecttype,
|
|
|
191 |
@WebParam(name=PARAM_QUERIES) List<QueryParameter> queries) throws XServicesFault;
|
|
|
192 |
|
|
|
193 |
|
|
|
194 |
@WebMethod(operationName=OPERATION_GETUPDATEDCOMPANIES)
|
|
|
195 |
@WSDLDocumentation(value="Get updated customers")
|
|
|
196 |
public abstract List<Customer> getUpdatedCustomer(
|
|
|
197 |
@WebParam(name=PARAM_DATE) @XmlElement(required=true) GregorianCalendar date,
|
|
|
198 |
@WebParam(name=PARAM_OFFSET) @XmlElement(required=true) int offset)
|
|
|
199 |
throws XServicesFault;
|
|
|
200 |
|
|
|
201 |
@WebMethod(operationName=OPERATION_GETUPDATEDPROJECTS)
|
|
|
202 |
@WSDLDocumentation(value="Get updated projects")
|
|
|
203 |
|
|
|
204 |
public abstract List<Project> getUpdatedProjects(
|
|
|
205 |
@WebParam(name=PARAM_DATE) @XmlElement(required=true) GregorianCalendar date,
|
|
|
206 |
@WebParam(name=PARAM_OFFSET) @XmlElement(required=true) int offset)
|
|
|
207 |
throws XServicesFault;
|
|
|
208 |
|
|
|
209 |
|
|
|
210 |
public class QueryParameter {
|
|
|
211 |
@XmlElement(required=true)
|
|
|
212 |
public String field;
|
|
|
213 |
@XmlElement(required=true)
|
|
|
214 |
public String value;
|
|
|
215 |
}
|
|
|
216 |
}
|