Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bp_custom
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mikhail Gashenko
bp_custom
Commits
cdeba25a
Commit
cdeba25a
authored
Jan 30, 2017
by
everdarkgreen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JsonNode: (draft12) production adaptation
parent
34167fae
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
55 deletions
+104
-55
nb-configuration.xml
nb-configuration.xml
+29
-0
nbactions.xml
nbactions.xml
+13
-0
pom.xml
pom.xml
+2
-1
Main.java
src/main/java/kz/arta/synergy/astdev/custom_bp/Main.java
+56
-54
jboss-web.xml
src/main/webapp/WEB-INF/jboss-web.xml
+4
-0
No files found.
nb-configuration.xml
0 → 100644
View file @
cdeba25a
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<libraries
xmlns=
"http://www.netbeans.org/ns/cdnjs-libraries/1"
/>
<properties
xmlns=
"http://www.netbeans.org/ns/maven-properties-data/1"
>
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
1.6-web
</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
JBoss4
</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
<netbeans.hint.jdkPlatform>
JDK_1.7
</netbeans.hint.jdkPlatform>
<org-netbeans-modules-css-prep.less_2e_mappings>
/less:/css
</org-netbeans-modules-css-prep.less_2e_mappings>
<org-netbeans-modules-css-prep.less_2e_enabled>
false
</org-netbeans-modules-css-prep.less_2e_enabled>
<org-netbeans-modules-css-prep.sass_2e_enabled>
false
</org-netbeans-modules-css-prep.sass_2e_enabled>
<org-netbeans-modules-css-prep.sass_2e_compiler_2e_options/>
<org-netbeans-modules-css-prep.less_2e_compiler_2e_options/>
<org-netbeans-modules-css-prep.sass_2e_mappings>
/scss:/css
</org-netbeans-modules-css-prep.sass_2e_mappings>
<org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder>
js/libs
</org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder>
<org-netbeans-modules-javascript2-requirejs.enabled>
true
</org-netbeans-modules-javascript2-requirejs.enabled>
</properties>
</project-shared-configuration>
nbactions.xml
0 → 100644
View file @
cdeba25a
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>
build
</actionName>
<packagings>
<packaging>
*
</packaging>
</packagings>
<goals>
<goal>
install
</goal>
<goal>
checkstyle:check
</goal>
</goals>
</action>
</actions>
pom.xml
View file @
cdeba25a
...
...
@@ -104,8 +104,9 @@
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-checkstyle-plugin
</artifactId>
<version>
${maven.checkstyle.plugin.version}
</version>
<configuration>
<configLocation>
config/
sun
_checks.xml
</configLocation>
<configLocation>
config/
google
_checks.xml
</configLocation>
</configuration>
</plugin>
</plugins>
...
...
src/main/java/kz/arta/synergy/astdev/custom_bp/Main.java
View file @
cdeba25a
...
...
@@ -58,7 +58,7 @@ public class Main implements MessageListener {
private
String
executionID
=
null
;
// идентификатор блокирующего процесса
private
String
documentID
=
null
;
// идентификатор документа реестра
private
static
final
String
LOGIN
=
"
111111"
;
private
static
final
String
LOGIN
=
"
Ипатьев"
;
private
static
final
String
PASSWORD
=
"1"
;
private
final
String
TARGET_FORM_UUID
=
"fb44d99d-1579-4ac3-884a-01a6d4f71f9c"
;
private
final
String
SYNERGY_ADDRESS
=
"http://127.0.0.1:8080/Synergy"
;
...
...
@@ -142,70 +142,67 @@ public class Main implements MessageListener {
}
targetFormData
=
OBJECT_MAPPER
.
readValue
(
TargetRootDataNode
,
new
TypeReference
<
List
<
AsNode
>>()
{});
// Получение значений текущих дат исходной формы
String
b5b1
;
String
t2b1
;
String
t8b1
;
// String t18b1, t20b1, t16b1;
// String t26b1, t24b1, t22b1;
// String t32b1, t30b1, t28b1;
// common vacation period
String
dateStart
=
getComponentValueByID
(
this
.
sourceFormData
,
"date_start"
,
FieldType
.
KEY
);
String
dateFinish
=
getComponentValueByID
(
this
.
sourceFormData
,
"date_finish"
,
FieldType
.
KEY
);
if
(
dateStart
==
null
||
dateFinish
==
null
)
{
throw
new
Exception
(
"Vacation period is not specified"
);
}
// first table
String
b2b1
=
getComponentValueByID
(
this
.
sourceFormData
,
"b2-b1
-b1"
,
FieldType
.
KEY
);
String
b4b1
=
getComponentValueByID
(
this
.
sourceFormData
,
"b4-b1
-b1"
,
FieldType
.
KEY
);
String
b2b1
=
getComponentValueByID
(
this
.
sourceFormData
,
"b2-b1
"
,
FieldType
.
KEY
);
String
b4b1
=
getComponentValueByID
(
this
.
sourceFormData
,
"b4-b1
"
,
FieldType
.
KEY
);
if
(
b2b1
==
null
||
b4b1
==
null
)
{
// отображается key
throw
new
Exception
(
"Source date fields is empty"
);
}
else
{
constructNewTableRow
(
b2b1
,
b4b1
);
if
(
notNull
(
b2b1
,
b4b1
))
{
// отображается key
constructNewTableRow
(
b2b1
,
b4b1
,
dateStart
,
dateFinish
);
updateTargetForm
();
return
;
}
String
t4b1
=
getComponentValueByID
(
this
.
sourceFormData
,
"t4-b1"
,
FieldType
.
KEY
);
String
t6b1
=
getComponentValueByID
(
this
.
sourceFormData
,
"t6-b1"
,
FieldType
.
KEY
);
String
t10b1
=
getComponentValueByID
(
this
.
sourceFormData
,
"t10-b1"
,
FieldType
.
KEY
);
String
t12b1
=
getComponentValueByID
(
this
.
sourceFormData
,
"t12-b1"
,
FieldType
.
KEY
);
if
(
notNull
(
t4b1
,
t6b1
,
t10b1
,
t12b1
))
{
constructNewTableRow
(
t4b1
,
t6b1
,
dateStart
,
dateFinish
);
constructNewTableRow
(
t10b1
,
t12b1
,
dateStart
,
dateFinish
);
updateTargetForm
();
return
;
}
// boolean key_b2b1 = false, key_b4b1 = false, val_b2b1 = false, val_b4b1 = false;
// if (!b2b1.isEmpty() && !b4b1.isEmpty()) { // do not update with empty values
// key_b2b1 = updateFieldValue(this.targetFormData, "start-b1", FieldType.KEY, b2b1);
// key_b4b1 = updateFieldValue(this.targetFormData, "finish-b1", FieldType.KEY, b4b1);
// val_b2b1 = updateFieldValue(this.targetFormData, "start-b1", FieldType.VALUE, dateValueFromKey(b2b1));
// val_b4b1 = updateFieldValue(this.targetFormData, "finish-b1", FieldType.VALUE, dateValueFromKey(b4b1));
// }
//
// if (key_b2b1 && key_b4b1 && val_b2b1 && val_b4b1) {
// updateTargetForm();
// }
// Second table
// String t4b1 = getComponentValueByID(sourceFormData, "t2-b1", ObjectType.DATE);
// String t6b1 = getComponentValueByID(sourceFormData, "b6-b1", ObjectType.DATE);
// String t10b1 = getComponentValueByID(sourceFormData, "t10-b1", ObjectType.DATE);
// String t12b1 = getComponentValueByID(sourceFormData, "t12-b1", ObjectType.DATE);
//
// if (!t4b1.isEmpty() && !t6b1.isEmpty() && !t10b1.isEmpty() && !t12b1.isEmpty()) {
// setComponentValueByID(targetFormData, "start-b1", "key", b2b1);
// setComponentValueByID(targetFormData, "start-b1", "key", b2b1);
// setComponentValueByID(targetFormData, "start-b1", "key", b2b1);
// setComponentValueByID(targetFormData, "start-b1", "key", b2b1);
//
// unlockRoute();
// return;
// }
// Разблокировка маршрута
String
t18b1
=
getComponentValueByID
(
this
.
sourceFormData
,
"t18-b1"
,
FieldType
.
KEY
);
String
t20b1
=
getComponentValueByID
(
this
.
sourceFormData
,
"t20-b1"
,
FieldType
.
KEY
);
String
t24b1
=
getComponentValueByID
(
this
.
sourceFormData
,
"t24-b1"
,
FieldType
.
KEY
);
String
t26b1
=
getComponentValueByID
(
this
.
sourceFormData
,
"t26-b1"
,
FieldType
.
KEY
);
String
t30b1
=
getComponentValueByID
(
this
.
sourceFormData
,
"t30-b1"
,
FieldType
.
KEY
);
String
t32b1
=
getComponentValueByID
(
this
.
sourceFormData
,
"t32-b1"
,
FieldType
.
KEY
);
if
(
notNull
(
t18b1
,
t20b1
,
t24b1
,
t26b1
,
t30b1
,
t32b1
))
{
constructNewTableRow
(
t18b1
,
t20b1
,
dateStart
,
dateFinish
);
constructNewTableRow
(
t24b1
,
t26b1
,
dateStart
,
dateFinish
);
constructNewTableRow
(
t30b1
,
t32b1
,
dateStart
,
dateFinish
);
updateTargetForm
();
return
;
}
}
catch
(
Exception
exc
)
{
LOGGER
.
error
(
exc
.
getMessage
(),
exc
);
}
finally
{
unlockRoute
();
unlockRoute
();
// Разблокировка маршрута
}
}
private
static
boolean
notNull
(
Object
...
args
)
{
for
(
Object
arg
:
args
)
{
if
(
arg
==
null
)
{
return
false
;
}
}
return
true
;
}
private
void
constructNewTableRow
(
String
b2b1
,
String
b4b1
)
throws
Exception
{
private
void
constructNewTableRow
(
String
vacStart
,
String
vacEnd
,
String
perStart
,
String
perEnd
)
throws
Exception
{
AsNode
tableNode
=
findNode
(
targetFormData
,
"table"
);
if
(
tableNode
!=
null
)
{
List
<
AsNode
>
tableDataNodesList
=
tableNode
.
getData
();
...
...
@@ -222,19 +219,20 @@ public class Main implements MessageListener {
n1
.
setId
(
"start-b"
+
tablesCounter
);
n1
.
setType
(
"date"
);
n1
.
setLabel
(
" "
);
n1
.
setValue
(
dateValueFromKey
(
b2b1
));
n1
.
setKey
(
b2b1
);
n1
.
setValue
(
dateValueFromKey
(
vacStart
));
n1
.
setKey
(
vacStart
);
n2
.
setId
(
"finish-b"
+
tablesCounter
);
n2
.
setType
(
"date"
);
n2
.
setLabel
(
" "
);
n2
.
setValue
(
dateValueFromKey
(
b4b1
));
n2
.
setKey
(
b4b1
);
n2
.
setValue
(
dateValueFromKey
(
vacEnd
));
n2
.
setKey
(
vacEnd
);
n3
.
setId
(
"days-b"
+
tablesCounter
);
n3
.
setType
(
"textbox"
);
n3
.
setLabel
(
" "
);
n3
.
setValue
(
Integer
.
toString
(
dateDiffToDays
(
b2b1
,
b4b1
)));
// n3.setValue(Integer.toString(dateDiffToDays(b2b1, b4b1)));
n3
.
setValue
(
""
);
n4
.
setId
(
"matpom-b"
+
tablesCounter
);
n4
.
setType
(
"listbox"
);
...
...
@@ -243,9 +241,13 @@ public class Main implements MessageListener {
n5
.
setId
(
"period_start-b"
+
tablesCounter
);
n5
.
setType
(
"date"
);
n5
.
setValue
(
dateValueFromKey
(
perStart
));
n5
.
setKey
(
perStart
);
n6
.
setId
(
"period_finish-b"
+
tablesCounter
);
n6
.
setType
(
"date"
);
n6
.
setValue
(
dateValueFromKey
(
perEnd
));
n6
.
setKey
(
perEnd
);
n7
.
setId
(
"otozvano-b"
+
tablesCounter
);
n7
.
setType
(
"texbox"
);
...
...
src/main/webapp/WEB-INF/jboss-web.xml
0 → 100644
View file @
cdeba25a
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>
/cwm
</context-root>
</jboss-web>
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