Subversion Repositories XServices

Rev

Rev 192 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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