Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
synergy-api-util
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Raimbek Egemberdiev
synergy-api-util
Commits
ca814402
Commit
ca814402
authored
Nov 10, 2016
by
Raimbek Egemberdiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved to new module
parents
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
728 additions
and
0 deletions
+728
-0
build.gradle
build.gradle
+15
-0
src/main/java/kz/arta/synergy/asforms/AdvancedSearchParams.java
...in/java/kz/arta/synergy/asforms/AdvancedSearchParams.java
+76
-0
src/main/java/kz/arta/synergy/asforms/AdvancedSearchResult.java
...in/java/kz/arta/synergy/asforms/AdvancedSearchResult.java
+38
-0
src/main/java/kz/arta/synergy/asforms/AsFormProvider.java
src/main/java/kz/arta/synergy/asforms/AsFormProvider.java
+158
-0
src/main/java/kz/arta/synergy/asforms/SynergyApiProvider.java
...main/java/kz/arta/synergy/asforms/SynergyApiProvider.java
+14
-0
src/main/java/kz/arta/synergy/asforms/annotations/Entity.java
...main/java/kz/arta/synergy/asforms/annotations/Entity.java
+18
-0
src/main/java/kz/arta/synergy/asforms/annotations/KeyValue.java
...in/java/kz/arta/synergy/asforms/annotations/KeyValue.java
+16
-0
src/main/java/kz/arta/synergy/asforms/annotations/ListBox.java
...ain/java/kz/arta/synergy/asforms/annotations/ListBox.java
+18
-0
src/main/java/kz/arta/synergy/asforms/annotations/NumericInput.java
...ava/kz/arta/synergy/asforms/annotations/NumericInput.java
+18
-0
src/main/java/kz/arta/synergy/asforms/annotations/Table.java
src/main/java/kz/arta/synergy/asforms/annotations/Table.java
+18
-0
src/main/java/kz/arta/synergy/asforms/annotations/TextInput.java
...n/java/kz/arta/synergy/asforms/annotations/TextInput.java
+18
-0
src/main/java/kz/arta/synergy/asforms/exceptions/CreateAsFormException.java
...rta/synergy/asforms/exceptions/CreateAsFormException.java
+12
-0
src/main/java/kz/arta/synergy/asforms/exceptions/SynergyApiCallException.java
...a/synergy/asforms/exceptions/SynergyApiCallException.java
+14
-0
src/main/java/kz/arta/synergy/asforms/exceptions/UnsupportedFieldTypeException.java
...rgy/asforms/exceptions/UnsupportedFieldTypeException.java
+15
-0
src/main/java/kz/arta/synergy/asforms/pojo/AsForm.java
src/main/java/kz/arta/synergy/asforms/pojo/AsForm.java
+87
-0
src/main/java/kz/arta/synergy/asforms/pojo/AsFormData.java
src/main/java/kz/arta/synergy/asforms/pojo/AsFormData.java
+109
-0
src/main/java/kz/arta/synergy/asforms/pojo/ComponentTypes.java
...ain/java/kz/arta/synergy/asforms/pojo/ComponentTypes.java
+13
-0
src/test/java/kz/arta/synergy/asforms/AsFormProviderTest.java
...test/java/kz/arta/synergy/asforms/AsFormProviderTest.java
+18
-0
src/test/java/kz/arta/synergy/asforms/AsFormTest.java
src/test/java/kz/arta/synergy/asforms/AsFormTest.java
+18
-0
src/test/java/kz/arta/synergy/pojo/TestForm.java
src/test/java/kz/arta/synergy/pojo/TestForm.java
+35
-0
No files found.
build.gradle
0 → 100644
View file @
ca814402
group
'kz.arta.synergy.asforms'
version
'1.0'
apply
plugin:
'java'
sourceCompatibility
=
1.7
repositories
{
mavenCentral
()
}
dependencies
{
compile
group:
'cglib'
,
name:
'cglib'
,
version:
'3.2.4'
testCompile
group:
'org.testng'
,
name:
'testng'
,
version:
'6.9.13.6'
}
src/main/java/kz/arta/synergy/asforms/AdvancedSearchParams.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
/**
* @author raimbek
* @since 02.11.2016
*/
public
class
AdvancedSearchParams
{
private
String
query
;
private
List
<
String
>
parameters
=
new
ArrayList
<
String
>();
private
boolean
searchInRegistry
=
true
;
private
int
startRecord
=
0
;
private
int
recordsCount
=
100
;
private
List
<
List
<
String
>>
dynParams
=
new
ArrayList
<
List
<
String
>>();
public
AdvancedSearchParams
()
{
}
public
static
AdvancedSearchParams
build
(
String
query
,
String
...
parameters
)
{
AdvancedSearchParams
advancedSearchParams
=
new
AdvancedSearchParams
();
advancedSearchParams
.
setQuery
(
query
);
advancedSearchParams
.
setParameters
(
Arrays
.
asList
(
parameters
));
return
advancedSearchParams
;
}
public
String
getQuery
()
{
return
query
;
}
public
void
setQuery
(
String
query
)
{
this
.
query
=
query
;
}
public
List
<
String
>
getParameters
()
{
return
parameters
;
}
public
void
setParameters
(
List
<
String
>
parameters
)
{
this
.
parameters
=
parameters
;
}
public
boolean
isSearchInRegistry
()
{
return
searchInRegistry
;
}
public
void
setSearchInRegistry
(
boolean
searchInRegistry
)
{
this
.
searchInRegistry
=
searchInRegistry
;
}
public
int
getStartRecord
()
{
return
startRecord
;
}
public
void
setStartRecord
(
int
startRecord
)
{
this
.
startRecord
=
startRecord
;
}
public
int
getRecordsCount
()
{
return
recordsCount
;
}
public
void
setRecordsCount
(
int
recordsCount
)
{
this
.
recordsCount
=
recordsCount
;
}
public
List
<
List
<
String
>>
getDynParams
()
{
return
dynParams
;
}
public
void
setDynParams
(
List
<
List
<
String
>>
dynParams
)
{
this
.
dynParams
=
dynParams
;
}
}
src/main/java/kz/arta/synergy/asforms/AdvancedSearchResult.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms
;
/**
* @author raimbek
* @since 02.11.2016
*/
public
class
AdvancedSearchResult
<
T
>
{
private
String
dataUUID
;
private
String
documentID
;
private
String
registryRecordStatus
;
public
AdvancedSearchResult
()
{
}
public
String
getDataUUID
()
{
return
dataUUID
;
}
public
void
setDataUUID
(
String
dataUUID
)
{
this
.
dataUUID
=
dataUUID
;
}
public
String
getDocumentID
()
{
return
documentID
;
}
public
void
setDocumentID
(
String
documentID
)
{
this
.
documentID
=
documentID
;
}
public
String
getRegistryRecordStatus
()
{
return
registryRecordStatus
;
}
public
void
setRegistryRecordStatus
(
String
registryRecordStatus
)
{
this
.
registryRecordStatus
=
registryRecordStatus
;
}
}
src/main/java/kz/arta/synergy/asforms/AsFormProvider.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms
;
import
kz.arta.synergy.asforms.annotations.*
;
import
kz.arta.synergy.asforms.exceptions.CreateAsFormException
;
import
kz.arta.synergy.asforms.exceptions.SynergyApiCallException
;
import
kz.arta.synergy.asforms.exceptions.UnsupportedFieldTypeException
;
import
kz.arta.synergy.asforms.pojo.AsForm
;
import
kz.arta.synergy.asforms.pojo.AsFormData
;
import
kz.arta.synergy.asforms.pojo.ComponentTypes
;
import
java.lang.annotation.Annotation
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Type
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author raimbek
* @since 09.11.2016
*/
public
class
AsFormProvider
{
private
SynergyApiProvider
synergyApiProvider
;
public
AsFormProvider
()
{
}
public
AsFormProvider
(
SynergyApiProvider
synergyApiProvider
)
{
this
.
synergyApiProvider
=
synergyApiProvider
;
}
public
<
T
extends
AsForm
>
List
<
AdvancedSearchResult
<
T
>>
advancedSearch
(
Class
<
T
>
formClass
,
AdvancedSearchParams
advancedSearchParams
)
{
return
new
ArrayList
<
AdvancedSearchResult
<
T
>>();
}
public
<
T
extends
AsForm
>
T
fetchData
(
Class
<
T
>
formClass
,
String
dataUUID
)
throws
CreateAsFormException
,
SynergyApiCallException
,
UnsupportedFieldTypeException
{
AsForm
asfData
=
synergyApiProvider
.
getAsfData
(
dataUUID
);
return
createAsForm
(
formClass
,
asfData
);
}
public
<
T
extends
AsForm
>
T
createAsForm
(
Class
<
T
>
asFormClass
,
AsForm
asfData
)
throws
CreateAsFormException
,
UnsupportedFieldTypeException
{
try
{
T
asFormObject
=
asFormClass
.
newInstance
();
Field
[]
allFields
=
asFormClass
.
getDeclaredFields
();
for
(
Field
field
:
allFields
)
{
Annotation
[]
declaredAnnotations
=
field
.
getDeclaredAnnotations
();
for
(
Annotation
annotation
:
declaredAnnotations
)
{
if
(
annotation
instanceof
TextInput
)
{
String
cmpId
=
((
TextInput
)
annotation
).
value
();
setFieldValue
(
asfData
,
asFormObject
,
field
,
cmpId
,
ComponentTypes
.
TEXT_INPUT
);
break
;
}
if
(
annotation
instanceof
NumericInput
)
{
String
cmpId
=
((
NumericInput
)
annotation
).
value
();
setFieldValue
(
asfData
,
asFormObject
,
field
,
cmpId
,
ComponentTypes
.
NUMERIC_INPUT
);
break
;
}
if
(
annotation
instanceof
Entity
)
{
String
cmpId
=
((
Entity
)
annotation
).
value
();
setFieldValue
(
asfData
,
asFormObject
,
field
,
cmpId
,
ComponentTypes
.
ENTITY
);
break
;
}
if
(
annotation
instanceof
ListBox
)
{
String
cmpId
=
((
ListBox
)
annotation
).
value
();
setFieldValue
(
asfData
,
asFormObject
,
field
,
cmpId
,
ComponentTypes
.
LISTBOX
);
break
;
}
if
(
annotation
instanceof
Table
)
{
String
cmpId
=
((
Table
)
annotation
).
value
();
if
(
field
.
getType
().
isAssignableFrom
(
AsFormData
.
class
))
{
setFieldValue
(
asfData
,
asFormObject
,
field
,
cmpId
,
ComponentTypes
.
TABLE
);
}
else
if
(
field
.
getType
().
isAssignableFrom
(
List
.
class
))
{
getList
(
asfData
,
field
.
getGenericType
(),
cmpId
,
ComponentTypes
.
TABLE
);
}
else
{
throw
new
UnsupportedFieldTypeException
();
}
break
;
}
}
}
return
asFormObject
;
}
catch
(
InstantiationException
e
)
{
throw
new
CreateAsFormException
(
"Form class should has accessible without params constructor"
);
}
catch
(
IllegalAccessException
e
)
{
throw
new
CreateAsFormException
(
"Form class should be accessible"
);
}
}
private
void
getList
(
AsForm
asfData
,
Type
genericType
,
String
cmpId
,
String
table
)
{
}
private
<
T
extends
AsForm
>
void
setFieldValue
(
AsForm
asfData
,
T
asFormObject
,
Field
field
,
String
cmpId
,
String
cmpType
)
throws
IllegalAccessException
,
UnsupportedFieldTypeException
{
field
.
setAccessible
(
true
);
if
(
field
.
getType
().
isAssignableFrom
(
String
.
class
))
{
// string
String
value
=
getValueForClassField
(
field
,
asfData
,
cmpId
);
field
.
set
(
asFormObject
,
value
);
}
if
(
field
.
getType
().
isAssignableFrom
(
Integer
.
class
))
{
// int
String
value
=
getValueForClassField
(
field
,
asfData
,
cmpId
);
field
.
set
(
asFormObject
,
Integer
.
parseInt
(
value
));
}
if
(
field
.
getType
().
isAssignableFrom
(
Double
.
class
))
{
// double
String
value
=
getValueForClassField
(
field
,
asfData
,
cmpId
);
field
.
set
(
asFormObject
,
Double
.
parseDouble
(
value
));
}
else
if
(
field
.
getType
().
isAssignableFrom
(
AsFormData
.
class
))
{
// common type
AsFormData
data
=
asfData
.
getData
(
cmpId
);
if
(
data
!=
null
)
{
AsFormData
fieldAsFormData
=
new
AsFormData
();
fieldAsFormData
.
setId
(
cmpId
);
fieldAsFormData
.
setType
(
cmpType
);
fieldAsFormData
.
setValue
(
data
.
getValue
());
fieldAsFormData
.
setKey
(
data
.
getKey
());
fieldAsFormData
.
setKeys
(
data
.
getKeys
());
fieldAsFormData
.
setValues
(
data
.
getValues
());
fieldAsFormData
.
setUserID
(
data
.
getUserID
());
fieldAsFormData
.
setValueID
(
data
.
getValueID
());
fieldAsFormData
.
setLabel
(
data
.
getLabel
());
fieldAsFormData
.
setUsername
(
data
.
getUsername
());
fieldAsFormData
.
setData
(
data
.
getData
());
field
.
set
(
asFormObject
,
fieldAsFormData
);
}
}
else
{
throw
new
UnsupportedFieldTypeException
(
"This type unsupported"
);
}
}
private
String
getValueForClassField
(
Field
field
,
AsForm
asfData
,
String
cmpId
)
{
boolean
fetchKey
=
false
;
Annotation
[]
declaredAnnotations
=
field
.
getDeclaredAnnotations
();
for
(
Annotation
annotation
:
declaredAnnotations
)
{
if
(
annotation
instanceof
KeyValue
)
{
fetchKey
=
true
;
}
}
if
(
fetchKey
)
{
return
asfData
.
getKey
(
cmpId
);
}
return
asfData
.
getValue
(
cmpId
);
}
}
src/main/java/kz/arta/synergy/asforms/SynergyApiProvider.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms
;
import
kz.arta.synergy.asforms.exceptions.SynergyApiCallException
;
import
kz.arta.synergy.asforms.pojo.AsForm
;
/**
* @author raimbek
* @since 09.11.2016
*/
public
class
SynergyApiProvider
{
public
AsForm
getAsfData
(
String
dataUUID
)
throws
SynergyApiCallException
{
return
new
AsForm
();
}
}
src/main/java/kz/arta/synergy/asforms/annotations/Entity.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms.annotations
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* @author raimbek
* @since 09.11.2016
*/
@Target
({
ElementType
.
METHOD
,
ElementType
.
FIELD
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
Entity
{
String
value
();
}
src/main/java/kz/arta/synergy/asforms/annotations/KeyValue.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms.annotations
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* @author raimbek
* @since 09.11.2016
*/
@Target
({
ElementType
.
METHOD
,
ElementType
.
FIELD
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
KeyValue
{
}
src/main/java/kz/arta/synergy/asforms/annotations/ListBox.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms.annotations
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* @author raimbek
* @since 09.11.2016
*/
@Target
({
ElementType
.
METHOD
,
ElementType
.
FIELD
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
ListBox
{
String
value
();
}
src/main/java/kz/arta/synergy/asforms/annotations/NumericInput.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms.annotations
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* @author raimbek
* @since 09.11.2016
*/
@Target
({
ElementType
.
METHOD
,
ElementType
.
FIELD
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
NumericInput
{
String
value
();
}
src/main/java/kz/arta/synergy/asforms/annotations/Table.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms.annotations
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* @author raimbek
* @since 09.11.2016
*/
@Target
({
ElementType
.
METHOD
,
ElementType
.
FIELD
,
ElementType
.
TYPE
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
Table
{
String
value
();
}
src/main/java/kz/arta/synergy/asforms/annotations/TextInput.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms.annotations
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* @author raimbek
* @since 09.11.2016
*/
@Target
({
ElementType
.
METHOD
,
ElementType
.
FIELD
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
TextInput
{
String
value
();
}
src/main/java/kz/arta/synergy/asforms/exceptions/CreateAsFormException.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms.exceptions
;
/**
* @author raimbek
* @since 09.11.2016
*/
public
class
CreateAsFormException
extends
Exception
{
public
CreateAsFormException
(
String
message
)
{
super
(
message
);
}
}
src/main/java/kz/arta/synergy/asforms/exceptions/SynergyApiCallException.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms.exceptions
;
/**
* @author raimbek
* @since 09.11.2016
*/
public
class
SynergyApiCallException
extends
Exception
{
public
SynergyApiCallException
()
{
}
public
SynergyApiCallException
(
String
message
)
{
super
(
message
);
}
}
src/main/java/kz/arta/synergy/asforms/exceptions/UnsupportedFieldTypeException.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms.exceptions
;
/**
* @author raimbek
* @since 09.11.2016
*/
public
class
UnsupportedFieldTypeException
extends
Exception
{
public
UnsupportedFieldTypeException
()
{
}
public
UnsupportedFieldTypeException
(
String
message
)
{
super
(
message
);
}
}
src/main/java/kz/arta/synergy/asforms/pojo/AsForm.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms.pojo
;
import
java.util.List
;
/**
* @author raimbek
* @since 09.11.2016
*/
public
class
AsForm
{
private
String
nodeUUID
;
private
String
uuid
;
private
String
form
;
private
String
modified
;
private
List
<
AsFormData
>
data
;
public
AsForm
()
{
}
public
AsFormData
getData
(
String
cmpId
)
{
if
(
getData
()
==
null
||
getData
().
isEmpty
())
{
return
null
;
}
for
(
AsFormData
asFormData
:
getData
())
{
if
(
asFormData
.
getId
()
!=
null
&&
asFormData
.
getId
().
equalsIgnoreCase
(
cmpId
))
{
return
asFormData
;
}
}
return
null
;
}
public
String
getValue
(
String
cmpId
)
{
AsFormData
data
=
getData
(
cmpId
);
if
(
data
!=
null
)
{
return
data
.
getValue
();
}
return
null
;
}
public
String
getKey
(
String
cmpId
)
{
AsFormData
data
=
getData
(
cmpId
);
if
(
data
!=
null
)
{
return
data
.
getKey
();
}
return
null
;
}
public
String
getNodeUUID
()
{
return
nodeUUID
;
}
public
void
setNodeUUID
(
String
nodeUUID
)
{
this
.
nodeUUID
=
nodeUUID
;
}
public
String
getUuid
()
{
return
uuid
;
}
public
void
setUuid
(
String
uuid
)
{
this
.
uuid
=
uuid
;
}
public
String
getForm
()
{
return
form
;
}
public
void
setForm
(
String
form
)
{
this
.
form
=
form
;
}
public
String
getModified
()
{
return
modified
;
}
public
void
setModified
(
String
modified
)
{
this
.
modified
=
modified
;
}
public
List
<
AsFormData
>
getData
()
{
return
data
;
}
public
void
setData
(
List
<
AsFormData
>
data
)
{
this
.
data
=
data
;
}
}
src/main/java/kz/arta/synergy/asforms/pojo/AsFormData.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms.pojo
;
import
java.util.List
;
/**
* @author raimbek
* @since 09.11.2016
*/
public
class
AsFormData
{
private
String
id
;
private
String
type
;
private
String
label
;
private
String
value
;
private
String
key
;
private
String
valueID
;
private
String
username
;
private
String
userID
;
private
List
<
String
>
values
;
private
List
<
String
>
keys
;
private
List
<
AsFormData
>
data
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getLabel
()
{
return
label
;
}
public
void
setLabel
(
String
label
)
{
this
.
label
=
label
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
String
getValueID
()
{
return
valueID
;
}
public
void
setValueID
(
String
valueID
)
{
this
.
valueID
=
valueID
;
}
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
getUserID
()
{
return
userID
;
}
public
void
setUserID
(
String
userID
)
{
this
.
userID
=
userID
;
}
public
List
<
String
>
getValues
()
{
return
values
;
}
public
void
setValues
(
List
<
String
>
values
)
{
this
.
values
=
values
;
}
public
List
<
String
>
getKeys
()
{
return
keys
;
}
public
void
setKeys
(
List
<
String
>
keys
)
{
this
.
keys
=
keys
;
}
public
List
<
AsFormData
>
getData
()
{
return
data
;
}
public
void
setData
(
List
<
AsFormData
>
data
)
{
this
.
data
=
data
;
}
}
src/main/java/kz/arta/synergy/asforms/pojo/ComponentTypes.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms.pojo
;
/**
* @author raimbek
* @since 09.11.2016
*/
public
class
ComponentTypes
{
public
static
final
String
TEXT_INPUT
=
"textinput"
;
public
static
final
String
NUMERIC_INPUT
=
"numericinput"
;
public
static
final
String
LISTBOX
=
"listbox"
;
public
static
final
String
ENTITY
=
"entity"
;
public
static
final
String
TABLE
=
"appendable_table"
;
}
src/test/java/kz/arta/synergy/asforms/AsFormProviderTest.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms
;
import
kz.arta.synergy.asforms.exceptions.CreateAsFormException
;
import
kz.arta.synergy.asforms.exceptions.SynergyApiCallException
;
import
kz.arta.synergy.pojo.TestForm
;
/**
* @author raimbek
* @since 09.11.2016
*/
public
class
AsFormProviderTest
{
public
static
void
main
(
String
[]
args
)
throws
SynergyApiCallException
,
CreateAsFormException
{
SynergyApiProvider
synergyApiProvider
=
new
SynergyApiProvider
();
AsFormProvider
asFormProvider
=
new
AsFormProvider
(
synergyApiProvider
);
TestForm
testForm
=
asFormProvider
.
fetchData
(
TestForm
.
class
,
"123456"
);
}
}
src/test/java/kz/arta/synergy/asforms/AsFormTest.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.asforms
;
import
org.testng.annotations.Test
;
/**
* @author raimbek
* @since 09.11.2016
*/
public
class
AsFormTest
{
private
SynergyApiProvider
synergyApiProvider
;
@Test
public
void
createAsForm
()
{
}
}
src/test/java/kz/arta/synergy/pojo/TestForm.java
0 → 100644
View file @
ca814402
package
kz.arta.synergy.pojo
;
import
kz.arta.synergy.asforms.annotations.KeyValue
;
import
kz.arta.synergy.asforms.annotations.NumericInput
;
import
kz.arta.synergy.asforms.annotations.Table
;
import
kz.arta.synergy.asforms.annotations.TextInput
;
import
kz.arta.synergy.asforms.pojo.AsForm
;
import
kz.arta.synergy.asforms.pojo.AsFormData
;
import
java.util.List
;
/**
* @author raimbek
* @since 09.11.2016
*/
public
class
TestForm
extends
AsForm
{
@TextInput
(
"text_input"
)
private
String
textInput
;
@KeyValue
@NumericInput
(
"text_input_2"
)
private
String
textInputKeyValue
;
@Table
(
"table_cmp"
)
private
List
<
List
<
AsFormData
>>
tableData
;
public
String
getTextInput
()
{
return
textInput
;
}
public
void
setTextInput
(
String
textInput
)
{
this
.
textInput
=
textInput
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment