Compare commits

...

14 Commits

Author SHA1 Message Date
Abdulhamid Rashankar
2faedea14c APPINT-35490:App & API Integration - Studio Metrics gathering: build types & APIs usage (#8725) (#8729)
* APPINT-35490:App & API Integration - Studio Metrics gathering: build types & APIs usage

* APPINT-35490:App & API Integration - Studio Metrics gathering: build types & APIs usage
2023-05-02 16:03:12 +02:00
jiezhang-tlnd
7582eb54e1 Revert "fix(TUP-38314)Guess schema fails with the warning (#8583)" (#8721) (#8722)
This reverts commit 6e720df1cc.
2023-04-27 17:37:17 +08:00
jiezhang-tlnd
6e720df1cc fix(TUP-38314)Guess schema fails with the warning (#8583)
* fix(TUP-38314)Guess schema fails with the warning
https://jira.talendforge.org/browse/TUP-38314

* fix(TUP-38314)Guess schema fails with the warning

* fix(TUP-38314)Guess schema fails with the warning

* fix(TUP-38314)Guess schema fails with the warning

* code format

* code format

* code format
2023-04-27 15:06:07 +08:00
Abdulhamid Rashankar
5313413799 APPINT-35490:App & API Integration - Studio Metrics gathering: build … (#8714)
* APPINT-35490:App & API Integration - Studio Metrics gathering: build types & APIs usage

* APPINT-35490:App & API Integration - Studio Metrics gathering: build types & APIs usage

* APPINT-35490:App & API Integration - Studio Metrics gathering: build types & APIs usage
2023-04-27 09:50:49 +08:00
AlixMetivier
9180096b87 fix(TBD-14987): fix hadoop jar not found (#8643) (#8682) 2023-04-24 10:54:27 +02:00
wang wei
a1a28c0a61 fix(TDI-49452): CVE-2022-45143,org.apache.tomcat:tomcat-catalina:9.0.68 (#8666) 2023-04-24 15:35:14 +08:00
wang wei
ecd3952727 fix(TDI-49546): CVE-2022-45688, org.json:json:(<=20220924) (#8590) 2023-04-24 14:08:02 +08:00
Jill Yan
df7974265f Jill/m80/appint-35472 (#8688) (#8700)
* APPINT-35470 gather pure DI jobs

* APPINT-35470 gather pure DI jobs

* APPINT-35470 count data services

* APPINT-35470 count soap services

* APPINT-35470 App & API Integration - Studio Metrics gathering

* APPINT-35470 App & API Integration - Studio Metrics gathering

* APPINT-3547 add runtime feature count in studio metrix

* APPINT-35472 add runtime feature count in studio metrix
2023-04-23 10:12:30 +08:00
Jill Yan
4bcc864761 Jill/m80/appint 35470 (#8635) (#8698)
* APPINT-35470 gather pure DI jobs

* APPINT-35470 gather pure DI jobs

* APPINT-35470 count data services

* APPINT-35470 count soap services

* APPINT-35470 App & API Integration - Studio Metrics gathering

* APPINT-35470 App & API Integration - Studio Metrics gathering
2023-04-23 09:50:51 +08:00
hzhao
a0e04938fa fix(TUP-38334): job showing error when running from studio on remote (#8637)
jobserver
2023-04-22 16:55:32 +08:00
Zhiwei Xue
9706a0f82b fix(TUP-38316):[801 CI/CD] Duplicate Parameter error in the artifact and (#8613)
creating the task
2023-04-20 18:33:33 +08:00
wang wei
f99b6129ad fix(TDI-49483): Denial Of Service (DoS) in Talend/connectors-se (master)-FileUpload (#8609) 2023-04-14 11:08:01 +08:00
Jane Ding
8f25b6380d fix(TUP-37227):Issue building when items names too long (#8594)
* fix(TUP-37227):Issue building when items names too long (#8412)

* fix(TUP-37227):Issue building when items names too long
https://jira.talendforge.org/browse/TUP-37227

* fix(TUP-37227):Issue building when items names too long
https://jira.talendforge.org/browse/TUP-37227

* fix(TUP-37227):Issue building when items names too long
https://jira.talendforge.org/browse/TUP-37227

* fix(TUP-37227):Issue building when items names too long
https://jira.talendforge.org/browse/TUP-37227

* fix(TUP-38185):job run fail if joblet use db connection from other
joblet
https://jira.talendforge.org/browse/TUP-38185

* fix(TUP-38185):job run fail if joblet use db connection from other
joblet
https://jira.talendforge.org/browse/TUP-38185

* fix(TUP-38185):job run fail if joblet use db connection from other
joblet
https://jira.talendforge.org/browse/TUP-38185

* fix(TUP-38185):job run fail if joblet use db connection from other
joblet
https://jira.talendforge.org/browse/TUP-38185

* fix(TUP-38185):job run fail if joblet use db connection from other
joblet
https://jira.talendforge.org/browse/TUP-38185

* fix(TUP-38185):job run fail if joblet use db connection from other
joblet
https://jira.talendforge.org/browse/TUP-38185

* fix(TUP-38185):job run fail if joblet use db connection from other
joblet
https://jira.talendforge.org/browse/TUP-38185

* fix(TUP-38185):job run fail if joblet use db connection from other
joblet
https://jira.talendforge.org/browse/TUP-38185

* fix(TUP-38185):job run fail if joblet use db connection from other
joblet
https://jira.talendforge.org/browse/TUP-38185
2023-03-30 18:15:51 +08:00
vyu-talend
c61694066d fix(TDI-49458):bump talend_file_enhanced.jar (#8608) 2023-03-30 16:21:57 +08:00
45 changed files with 794 additions and 64 deletions

View File

@@ -15,9 +15,9 @@
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<version>1.1.1</version>
</dependency>
</dependency>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>oauth2-oidc-sdk</artifactId>
@@ -26,7 +26,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
<version>20230227</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>

View File

@@ -25,7 +25,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
<version>20230227</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>

View File

@@ -77,7 +77,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20150729</version>
<version>20230227</version>
<type>jar</type>
</dependency>
<dependency>

View File

@@ -149,7 +149,7 @@
<IMPORTS>
<IMPORT
NAME="Talen File Enhanced"
MODULE="talend_file_enhanced-1.2.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.2" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.2.jar"
MODULE="talend_file_enhanced-1.3.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.3" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.3.jar"
REQUIRED="true"
/>
</IMPORTS>

View File

@@ -149,7 +149,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Talen File Enhanced"
MODULE="talend_file_enhanced-1.2.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.2" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.2.jar" REQUIRED="true" />
MODULE="talend_file_enhanced-1.3.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.3" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.3.jar" REQUIRED="true" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -213,7 +213,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Talen File Enhanced"
MODULE="talend_file_enhanced-1.2.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.2" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.2.jar" REQUIRED="true" />
MODULE="talend_file_enhanced-1.3.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.3" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.3.jar" REQUIRED="true" />
<IMPORT NAME="Talend_CSV" MODULE="talendcsv.jar" MVN="mvn:org.talend.libraries/talendcsv/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.csv/lib/talendcsv.jar"
REQUIRED="true" />
</IMPORTS>

View File

@@ -131,7 +131,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Talend File Enhanced" MODULE="talend_file_enhanced-1.2.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.2" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.2.jar" REQUIRED="true" />
<IMPORT NAME="Talend File Enhanced" MODULE="talend_file_enhanced-1.3.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.3" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.3.jar" REQUIRED="true" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -118,7 +118,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Talen File Enhanced"
MODULE="talend_file_enhanced-1.2.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.2" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.2.jar" REQUIRED="true" />
MODULE="talend_file_enhanced-1.3.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.3" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.3.jar" REQUIRED="true" />
<IMPORT NAME="Talend_CSV" MODULE="talendcsv.jar" MVN="mvn:org.talend.libraries/talendcsv/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.csv/lib/talendcsv.jar" REQUIRED="true" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -81,7 +81,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Talen File Enhanced" MODULE="talend_file_enhanced-1.2.jar" REQUIRED="true" />
<IMPORT NAME="Talen File Enhanced" MODULE="talend_file_enhanced-1.3.jar" REQUIRED="true" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -39,7 +39,7 @@
String skipEmptyRows = "true"; //("true").equals(ElementParameterParser.getValue(node, "__SKIP_EMPTY_ROWS__"));
boolean trimAll = ("true").equals(ElementParameterParser.getValue(node,"__TRIMALL__"));
String encoding = ElementParameterParser.getValue(node,"__ENCODING__");
//need to process rows longger than 100,000 characters, the property SafetySwitch(in talend_file_enhanced-1.2.jar) should be sent to false.(the default is true)
//need to process rows longger than 100,000 characters, the property SafetySwitch(in talend_file_enhanced-1.3.jar) should be sent to false.(the default is true)
//that means if check the option(true), the logic value of bSafetySwitch should be changed to false (negate the property)
boolean bSafetySwitch = !(("true").equals(ElementParameterParser.getValue(node, "__PROCESS_LONG_ROW__")));
String advancedSeparatorStr = ElementParameterParser.getValue(node, "__ADVANCED_SEPARATOR__");

View File

@@ -128,7 +128,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Talen File Enhanced" MODULE="talend_file_enhanced-1.2.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.2" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.2.jar" REQUIRED="true" />
<IMPORT NAME="Talen File Enhanced" MODULE="talend_file_enhanced-1.3.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.3" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.3.jar" REQUIRED="true" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -69,7 +69,7 @@
String dieOnErrorStr = ElementParameterParser.getValue(node, "__DIE_ON_ERROR__");
boolean dieOnError = (dieOnErrorStr!=null&&!("").equals(dieOnErrorStr))?("true").equals(dieOnErrorStr):false;
//need to process rows longger than 100 000 characters, the property SafetySwitch(in talend_file_enhanced-1.2.jar) should be sent to false.(the default is true)
//need to process rows longger than 100 000 characters, the property SafetySwitch(in talend_file_enhanced-1.3.jar) should be sent to false.(the default is true)
//that means if check the option(true), the logic value of bSafetySwitch should be changed to false (XOR with 'true')
boolean bSafetySwitch = (("true").equals(ElementParameterParser.getValue(node, "__PROCESS_LONG_ROW__")) ^ true);
String advancedSeparatorStr = ElementParameterParser.getValue(node, "__ADVANCED_SEPARATOR__");

View File

@@ -258,7 +258,7 @@
<IMPORTS>
<IMPORT
NAME="Talen File Enhanced"
MODULE="talend_file_enhanced-1.2.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.2" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.2.jar"
MODULE="talend_file_enhanced-1.3.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.3" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.3.jar"
REQUIRED="true"
/>
</IMPORTS>

View File

@@ -175,7 +175,7 @@
<IMPORTS>
<IMPORT
NAME="Talen File Enhanced"
MODULE="talend_file_enhanced-1.2.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.2" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.2.jar"
MODULE="talend_file_enhanced-1.3.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.3" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.3.jar"
REQUIRED="true"
/>
</IMPORTS>

View File

@@ -79,7 +79,7 @@
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="Talen File Enhanced" MODULE="talend_file_enhanced-1.2.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.2" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.2.jar" REQUIRED="true" />
<IMPORT NAME="Talen File Enhanced" MODULE="talend_file_enhanced-1.3.jar" MVN="mvn:org.talend.components.lib/talend_file_enhanced/1.3" UrlPath="platform:/plugin/org.talend.libraries.custom/lib/talend_file_enhanced-1.3.jar" REQUIRED="true" />
</IMPORTS>
</CODEGENERATION>

View File

@@ -406,7 +406,7 @@
<IMPORT NAME="gson"
MODULE="gson-2.8.9.jar" MVN="mvn:com.google.code.gson/gson/2.8.9" REQUIRED="true"/>
<IMPORT NAME="json"
MODULE="json-20170516.jar" MVN="mvn:org.json/json/20170516" REQUIRED="true"/>
MODULE="json-20230227.jar" MVN="mvn:org.json/json/20230227" REQUIRED="true"/>
<IMPORT NAME="guava"
MODULE="guava-27.0.1-jre.jar" MVN="mvn:com.google.guava/guava/27.0.1-jre" REQUIRED="true"/>
<IMPORT NAME="jackson-core"

View File

@@ -80,15 +80,22 @@ class DealJobLibrary_<%=cid%> {
}
private String adaptLibPaths(String line, java.util.Map.Entry<String, String> entry) {
line = line.replace("\\", "/");
String jarName = entry.getValue();
String crc = entry.getKey();
String libStringFinder = "../lib/" + jarName;
String libStringFinder2 = "./" + jarName; // for the job jar itself.
String replacement = "../../../cache/lib/" + crc + "/" + jarName;
if (line.contains(libStringFinder)) {
line = line.replace(libStringFinder, "../../../cache/lib/" + crc + "/" + jarName);
line = line.replace(libStringFinder, replacement);
} else if (line.toLowerCase().contains(libStringFinder2)) {
line = line.toLowerCase().replace(libStringFinder2, replacement);
} else if (line.equalsIgnoreCase(jarName)) {
line = replacement;
} else if (line.contains(":$ROOT_PATH/" + jarName + ":")) {
line = line.replace(":$ROOT_PATH/" + jarName + ":", ":$ROOT_PATH/../../../cache/lib/" + crc + "/" + jarName + ":");
line = line.replace(":$ROOT_PATH/" + jarName + ":", ":$ROOT_PATH/" + replacement + ":");
} else if (line.contains(";" + jarName + ";")) {
line = line.replace(";" + jarName + ";", ";../../../cache/lib/" + crc + "/" + jarName + ";");
line = line.replace(";" + jarName + ";", ";" + replacement + ";");
}
return line;
}

View File

@@ -27597,7 +27597,7 @@
<IMPORT NAME="wstx-asl-3.2.9" MODULE="wstx-asl-3.2.9.jar" MVN="mvn:org.talend.libraries/wstx-asl-3.2.9/6.0.0" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')" />
<IMPORT NAME="xmlbeans-3.0.1" MODULE="xmlbeans-3.0.1.jar" MVN="mvn:org.apache.xmlbeans/xmlbeans/3.0.1" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')" />
<IMPORT NAME="xmlschema-core-2.3.0" MODULE="xmlschema-core-2.3.0.jar" MVN="mvn:org.apache.ws.xmlschema/xmlschema-core/2.3.0" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')"/>
<IMPORT NAME="commons-fileupload-1.4" MODULE="commons-fileupload-1.4.jar" MVN="mvn:commons-fileupload/commons-fileupload/1.4" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')" />
<IMPORT NAME="commons-fileupload-1.5" MODULE="commons-fileupload-1.5.jar" MVN="mvn:commons-fileupload/commons-fileupload/1.5" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')" />
<IMPORT NAME="addressing-1.6.2" MODULE="addressing-1.6.2.jar" MVN="mvn:org.talend.libraries/addressing-1.6.2/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.axis2/lib/addressing-1.6.2.jar" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')" />
<IMPORT NAME="addressing" MODULE="addressing-1.6.2.mar" MVN="mvn:org.talend.libraries/addressing-1.6.2/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.axis2/lib/addressing-1.6.2.mar" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')" />
<IMPORT NAME="woden-core-1.0M10" MODULE="woden-core-1.0M10.jar" MVN="mvn:org.apache.woden/woden-core/1.0M10" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')" />

View File

@@ -38354,7 +38354,7 @@
<IMPORT NAME="wstx-asl-3.2.9" MODULE="wstx-asl-3.2.9.jar" MVN="mvn:org.talend.libraries/wstx-asl-3.2.9/6.0.0" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')" />
<IMPORT NAME="xmlbeans-3.0.1" MODULE="xmlbeans-3.0.1.jar" MVN="mvn:org.apache.xmlbeans/xmlbeans/3.0.1" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')" />
<IMPORT NAME="xmlschema-core-2.3.0" MODULE="xmlschema-core-2.3.0.jar" MVN="mvn:org.apache.ws.xmlschema/xmlschema-core/2.3.0" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')"/>
<IMPORT NAME="commons-fileupload-1.4" MODULE="commons-fileupload-1.4.jar" MVN="mvn:commons-fileupload/commons-fileupload/1.4" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')" />
<IMPORT NAME="commons-fileupload-1.5" MODULE="commons-fileupload-1.5.jar" MVN="mvn:commons-fileupload/commons-fileupload/1.5" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')" />
<IMPORT NAME="addressing-1.6.2" MODULE="addressing-1.6.2.jar" MVN="mvn:org.talend.libraries/addressing-1.6.2/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.axis2/lib/addressing-1.6.2.jar" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')" />
<IMPORT NAME="addressing" MODULE="addressing-1.6.2.mar" MVN="mvn:org.talend.libraries/addressing-1.6.2/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.axis2/lib/addressing-1.6.2.mar" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')" />
<IMPORT NAME="woden-api-1.0M9" MODULE="woden-api-1.0M9.jar" MVN="mvn:org.talend.libraries/woden-api-1.0M9/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.axis2/lib/woden-api-1.0M9.jar" REQUIRED_IF="(AUTH_TYPE=='ONLINE') AND (API_VERSION=='API_2011')" />

View File

@@ -190,7 +190,7 @@
<IMPORT NAME="slf4j-log4j12-1.7.16.jar" MODULE="slf4j-log4j12-1.7.16.jar" MVN="mvn:org.slf4j/slf4j-log4j12/1.7.16" REQUIRED_IF="SERVER == 'ACTIVEMQ'" />
<IMPORT NAME="WEBSPHERE MQ LIB" MODULE="com.ibm.mq.allclient-9.2.4.0.jar" MVN="mvn:com.ibm.mq/com.ibm.mq.allclient/9.2.4.0" REQUIRED_IF="(SERVER == 'WEBSPHERE')" />
<IMPORT NAME="JSON In Java " MODULE="json-20210307.jar" MVN="mvn:org.json/json/20210307" REQUIRED_IF="(SERVER == 'WEBSPHERE')" />
<IMPORT NAME="JSON In Java " MODULE="json-20230227.jar" MVN="mvn:org.json/json/20230227" REQUIRED_IF="(SERVER == 'WEBSPHERE')" />
<IMPORT NAME="bcprov-jdk15on-1.69" MODULE="bcprov-jdk15on-1.69.jar" MVN="mvn:org.bouncycastle/bcprov-jdk15on/1.69" REQUIRED_IF="(SERVER == 'WEBSPHERE')" />
<IMPORT NAME="bcpkix-jdk15on-1.69" MODULE="bcpkix-jdk15on-1.69.jar" MVN="mvn:org.bouncycastle/bcpkix-jdk15on/1.69" REQUIRED_IF="(SERVER == 'WEBSPHERE')" />
<IMPORT NAME="bcutil-jdk15on-1.69" MODULE="bcutil-jdk15on-1.69.jar" MVN="mvn:org.bouncycastle/bcutil-jdk15on/1.69" REQUIRED_IF="(SERVER == 'WEBSPHERE')" />

View File

@@ -329,7 +329,7 @@
<!-- Websphere MQ -->
<IMPORT NAME="WEBSPHERE MQ LIB" MODULE="com.ibm.mq.allclient-9.2.4.0.jar" MVN="mvn:com.ibm.mq/com.ibm.mq.allclient/9.2.4.0" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="JSON In Java " MODULE="json-20210307.jar" MVN="mvn:org.json/json/20210307" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="JSON In Java " MODULE="json-20230227.jar" MVN="mvn:org.json/json/20230227" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="bcprov-jdk15on-1.69" MODULE="bcprov-jdk15on-1.69.jar" MVN="mvn:org.bouncycastle/bcprov-jdk15on/1.69" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="bcpkix-jdk15on-1.69" MODULE="bcpkix-jdk15on-1.69.jar" MVN="mvn:org.bouncycastle/bcpkix-jdk15on/1.69" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="bcutil-jdk15on-1.69" MODULE="bcutil-jdk15on-1.69.jar" MVN="mvn:org.bouncycastle/bcutil-jdk15on/1.69" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />

View File

@@ -83,7 +83,7 @@ This component only support Websphere MQ currently!
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="WEBSPHERE MQ LIB" MODULE="com.ibm.mq.allclient-9.2.4.0.jar" MVN="mvn:com.ibm.mq/com.ibm.mq.allclient/9.2.4.0" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="JSON In Java " MODULE="json-20210307.jar" MVN="mvn:org.json/json/20210307" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="JSON In Java " MODULE="json-20230227.jar" MVN="mvn:org.json/json/20230227" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="bcprov-jdk15on-1.69" MODULE="bcprov-jdk15on-1.69.jar" MVN="mvn:org.bouncycastle/bcprov-jdk15on/1.69" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="bcpkix-jdk15on-1.69" MODULE="bcpkix-jdk15on-1.69.jar" MVN="mvn:org.bouncycastle/bcpkix-jdk15on/1.69" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="bcutil-jdk15on-1.69" MODULE="bcutil-jdk15on-1.69.jar" MVN="mvn:org.bouncycastle/bcutil-jdk15on/1.69" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />

View File

@@ -454,7 +454,7 @@
<!-- Websphere MQ -->
<IMPORT NAME="WEBSPHERE MQ LIB" MODULE="com.ibm.mq.allclient-9.2.4.0.jar" MVN="mvn:com.ibm.mq/com.ibm.mq.allclient/9.2.4.0" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="JSON In Java " MODULE="json-20210307.jar" MVN="mvn:org.json/json/20210307" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="JSON In Java " MODULE="json-20230227.jar" MVN="mvn:org.json/json/20230227" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="bcprov-jdk15on-1.69" MODULE="bcprov-jdk15on-1.69.jar" MVN="mvn:org.bouncycastle/bcprov-jdk15on/1.69" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="bcpkix-jdk15on-1.69" MODULE="bcpkix-jdk15on-1.69.jar" MVN="mvn:org.bouncycastle/bcpkix-jdk15on/1.69" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />
<IMPORT NAME="bcutil-jdk15on-1.69" MODULE="bcutil-jdk15on-1.69.jar" MVN="mvn:org.bouncycastle/bcutil-jdk15on/1.69" REQUIRED_IF="(USE_CONNECTION=='false' AND SERVER == 'WEBSPHERE')" />

View File

@@ -328,7 +328,7 @@
<IMPORT NAME="commons-log" MODULE="commons-logging-1.1.jar" MVN="mvn:org.talend.libraries/commons-logging-1.1/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-logging-1.1.jar" REQUIRED="true" />
<IMPORT NAME="commons-beanutils" MODULE="commons-beanutils-1.9.4.jar" MVN="mvn:commons-beanutils/commons-beanutils/1.9.4" REQUIRED="true" />
<IMPORT NAME="commons-colections" MODULE="commons-collections-3.2.2.jar" MVN="mvn:commons-collections/commons-collections/3.2.2" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-collections-3.2.2.jar" REQUIRED="true" BundleID="" />
<IMPORT NAME="commons-fileupload" MODULE="commons-fileupload-1.3.1.jar" MVN="mvn:org.talend.libraries/commons-fileupload-1.3.1/6.0.0" REQUIRED="true" />
<IMPORT NAME="commons-fileupload-1.5" MODULE="commons-fileupload-1.5.jar" MVN="mvn:commons-fileupload/commons-fileupload/1.5" REQUIRED="true" />
<IMPORT NAME="commons-pool" MODULE="commons-pool-1.2.jar" MVN="mvn:org.talend.libraries/commons-pool-1.2/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-pool-1.2.jar" REQUIRED="true" />
<IMPORT NAME="commons-digester" MODULE="commons-digester-1.7.jar" MVN="mvn:org.talend.libraries/commons-digester-1.7/6.0.0" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-digester-1.7.jar" REQUIRED="true" />
<IMPORT NAME="commons-httpclient" MODULE="commons-httpclient-3.0.1.jar" MVN="mvn:commons-httpclient/commons-httpclient/3.0.1" REQUIRED="true" />

View File

@@ -455,7 +455,7 @@
<IMPORT MODULE="httpclient-cache-4.3.1.jar" NAME="httpclient-cache" MVN="mvn:org.apache.httpcomponents/httpclient-cache/4.3.1" REQUIRED="true"/>
<IMPORT NAME="httpcore-4.4.13" MODULE="httpcore-4.4.13.jar" MVN="mvn:org.apache.httpcomponents/httpcore/4.4.13" REQUIRED="true"/>
<IMPORT MODULE="httpmime-4.3.1.jar" NAME="httpmime" MVN="mvn:org.apache.httpcomponents/httpmime/4.3.1" REQUIRED="true"/>
<IMPORT MODULE="org.json.jar" NAME="json" MVN="mvn:org.talend.libraries/org.json/6.0.0" REQUIRED="true"/>
<IMPORT NAME="json" MODULE="json-20230227.jar" MVN="mvn:org.json/json/20230227" REQUIRED="true"/>
<IMPORT NAME="components-servicenow" MODULE="components-servicenow-1.0.1-20210428.jar" MVN="mvn:org.talend.components/components-servicenow/1.0.1-20210428" REQUIRED="true"/>
</IMPORTS>
</CODEGENERATION>

View File

@@ -426,7 +426,7 @@
<IMPORT MODULE="httpclient-cache-4.3.1.jar" NAME="httpclient-cache" MVN="mvn:org.apache.httpcomponents/httpclient-cache/4.3.1" REQUIRED="true"/>
<IMPORT NAME="httpcore-4.4.13" MODULE="httpcore-4.4.13.jar" MVN="mvn:org.apache.httpcomponents/httpcore/4.4.13" REQUIRED="true"/>
<IMPORT MODULE="httpmime-4.3.1.jar" NAME="httpmime" MVN="mvn:org.apache.httpcomponents/httpmime/4.3.1" REQUIRED="true"/>
<IMPORT MODULE="org.json.jar" NAME="json" MVN="mvn:org.talend.libraries/org.json/6.0.0" REQUIRED="true"/>
<IMPORT NAME="json" MODULE="json-20230227.jar" MVN="mvn:org.json/json/20230227" REQUIRED="true"/>
<IMPORT MODULE="commons-io-2.8.0.jar" NAME="commons-io" MVN="mvn:commons-io/commons-io/2.8.0" REQUIRED="true"/>
</IMPORTS>
</CODEGENERATION>

View File

@@ -381,6 +381,9 @@ public enum EParameterName {
REPAINT("REPAINT"), //$NON-NLS-1$
// for joblet short unique name
SHORT_UNIQUE_NAME("SHORT_UNIQUE_NAME"), //$NON-NLS-1$
// for automap algorithms
LEVENSHTEIN("LEVENSHTEIN"), //$NON-NLS-1$
JACCARD("JACCARD"), //$NON-NLS-1$

View File

@@ -727,7 +727,7 @@ public class ConnectionCreateAction extends SelectionAction {
listArgs.add(meta.getTableName());
}
} else {
listArgs.add(node.getUniqueName());
listArgs.add(node.getUniqueName(false));
}
String baseName = node.getConnectionName();

View File

@@ -99,6 +99,7 @@ import org.talend.core.model.repository.ExternalNodesFactory;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.model.utils.ContextParameterUtils;
import org.talend.core.model.utils.NodeUtil;
import org.talend.core.model.utils.TalendPropertiesUtil;
import org.talend.core.model.utils.TalendTextUtils;
import org.talend.core.prefs.ITalendCorePrefConstants;
import org.talend.core.repository.model.ProxyRepositoryFactory;
@@ -608,6 +609,23 @@ public class Node extends Element implements IGraphicalNode {
}
setPropertyValue(EParameterName.UNIQUE_NAME.getName(), uniqueName2);
IElementParameter shortUniqueNameParam = getElementParameter(EParameterName.SHORT_UNIQUE_NAME.getName());
if (shortUniqueNameParam != null) {
// Only for SHORT_UNIQUE_NAME element parameter exist.
// Joblet SHORT_UNIQUE_NAME init in AbstractJobletComponent.createElementParameters(INode)
String shortUniqueName = "";
if (shortUniqueNameParam.getValue() != null && !"".equals(shortUniqueNameParam.getValue())) {
shortUniqueName = (String) shortUniqueNameParam.getValue();
}
if (!reloadingComponent && shortUniqueName != null
&& (shortUniqueNameParam.getValue() == null || "".equals(shortUniqueNameParam.getValue()))) {
shortUniqueName = ((Process) getProcess()).generateUniqueNodeName(this, true);
((Process) getProcess()).addUniqueNodeName(shortUniqueName);
}
setPropertyValue(EParameterName.SHORT_UNIQUE_NAME.getName(), shortUniqueName);
}
/*
* for implements [TESB-10335], need to replace "__NODE_UNIQUE_NAME__" to node unique name in expression.
*/
@@ -876,17 +894,28 @@ public class Node extends Element implements IGraphicalNode {
*/
@Override
public String getUniqueName() {
return getUniqueName(TalendPropertiesUtil.isEnabledUseShortJobletName());
}
public String getUniqueName(boolean enableShortName) {
String uniqueName = null;
IElementParameter param = getElementParameter(EParameterName.UNIQUE_NAME.getName());
if (param != null) {
uniqueName = (String) param.getValue();
}
if (enableShortName) {
IElementParameter parameter = getElementParameter(EParameterName.SHORT_UNIQUE_NAME.getName());
if (parameter != null) {
uniqueName = (String) parameter.getValue();
}
}
return uniqueName;
}
// can only be set with the properties
private void setUniqueName(String uniqueName) {
((Process) getProcess()).removeUniqueNodeName(getUniqueName());
((Process) getProcess()).removeUniqueNodeName(getUniqueName(false));
((Process) getProcess()).addUniqueNodeName(uniqueName);
}
@@ -2074,7 +2103,7 @@ public class Node extends Element implements IGraphicalNode {
externalNode.setIncomingConnections(inputs);
externalNode.setOutgoingConnections(outputs);
externalNode.setElementParameters(getElementParameters());
externalNode.setUniqueName(getUniqueName());
externalNode.setUniqueName(getUniqueName(false));
externalNode.setSubProcessStart(isSubProcessStart());
externalNode.setProcess(getProcess());
externalNode.setComponent(getComponent());

View File

@@ -124,6 +124,7 @@ import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.model.routines.RoutinesUtil;
import org.talend.core.model.update.IUpdateManager;
import org.talend.core.model.utils.NodeUtil;
import org.talend.core.model.utils.TalendPropertiesUtil;
import org.talend.core.model.utils.TalendTextUtils;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.repository.utils.ConvertJobsUtil;
@@ -745,6 +746,10 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
String uniqueName = nodeContainer.getNode().getUniqueName();
removeUniqueNodeName(uniqueName);
if (nodeContainer instanceof AbstractJobletContainer) {
// remove SHORT_UNIQUE_NAME and UNIQUE_NAME for joblet
String name = nodeContainer.getNode().getUniqueName(false);
removeUniqueNodeName(name);
// use readedContainers to record the containers alreay be read, in case of falling into dead loop
Set<NodeContainer> readedContainers = new HashSet<NodeContainer>();
removeUniqueNodeNamesInJoblet((AbstractJobletContainer) nodeContainer, readedContainers);
@@ -1153,7 +1158,8 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|| param.getFieldType().equals(EParameterFieldType.PROPERTY_TYPE)
|| param.getFieldType().equals(EParameterFieldType.VALIDATION_RULE_TYPE)
|| param.getFieldType().equals(EParameterFieldType.UNIFIED_COMPONENTS)
|| param.getName().equals(EParameterName.UPDATE_COMPONENTS.getName())) {
|| param.getName().equals(EParameterName.UPDATE_COMPONENTS.getName())
|| param.getName().equals(EParameterName.SHORT_UNIQUE_NAME.getName())) {
return;
}
if (param.getParentParameter() != null) {
@@ -1284,6 +1290,19 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
}
} else if (param.getFieldType().equals(EParameterFieldType.PASSWORD) && value instanceof String) {
pType.setRawValue((String) value);
} else if (param.getFieldType().equals(EParameterFieldType.COMPONENT_LIST) && value != null) {
String componentValue = value.toString();
if (TalendPropertiesUtil.isEnabledUseShortJobletName() && (param.getElement() instanceof INode)) {
INode node = (INode) param.getElement();
String completeValue = DesignerUtilities.getNodeInJobletCompleteUniqueName(node, componentValue);
// possible blank when joblet node removed from process
componentValue = completeValue;
if (StringUtils.isBlank(completeValue) && param.isContextMode()
&& !DesignerUtilities.validateJobletShortName(value.toString())) {
componentValue = value.toString();
}
}
pType.setValue(componentValue);
} else {
if (value == null) {
pType.setValue(""); //$NON-NLS-1$
@@ -1820,10 +1839,11 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
for (Connection element : connList) {
connec = element;
cType = fileFact.createConnectionType();
cType.setSource(node.getUniqueName());
cType.setSource(node.getUniqueName(false));
INode jTarget = connec.getTarget();
String targetUniqueName = jTarget.getUniqueName();
if (jTarget instanceof Node) {
targetUniqueName = ((Node) jTarget).getUniqueName(false);
Node jn = (Node) jTarget.getJobletNode();
if (jn != null) {
targetUniqueName = jn.getUniqueName();
@@ -2195,6 +2215,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
loadNotes(processType);
loadSubjobs(processType);
checkNodeComponentListElementParameters();
initExternalComponents();
initJobletComponents();
setActivate(true);
@@ -2230,6 +2251,32 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
}
}
public void checkNodeComponentListElementParameters() {
if (!TalendPropertiesUtil.isEnabledUseShortJobletName()) {
return;
}
// load short unique name value for component list value
for (INode node : getGraphicalNodes()) {
for (IElementParameter param : node.getElementParameters()) {
loadComponentListShortNameValue(node, param);
Collection<IElementParameter> childrenParameter = param.getChildParameters().values();
for (IElementParameter childParameter : childrenParameter) {
loadComponentListShortNameValue(node, childParameter);
}
}
}
}
private void loadComponentListShortNameValue(INode node, IElementParameter param) {
if (param != null && EParameterFieldType.COMPONENT_LIST == param.getFieldType()) {
String originalValue = param.getValue().toString();
String shortUniqueName = DesignerUtilities.getNodeInJobletShortUniqueName(node, originalValue);
if (StringUtils.isNotBlank(shortUniqueName)) {
param.setValue(shortUniqueName);
}
}
}
@SuppressWarnings("unchecked")
private void checkNodeTableParameters() {
for (INode node : getGraphicalNodes()) {
@@ -2543,7 +2590,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
}
loadElementParameters(nc, listParamType);
if (nodesHashtable.containsKey(nc.getUniqueName())) {
if (nodesHashtable.containsKey(nc.getUniqueName(false))) {
// if the uniquename is already in the list, there must be a problem with the job.
// simply don't load the component
return null;
@@ -2586,7 +2633,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
NodeContainer nodeContainer = loadNodeContainer(nc, isJunitContainer);
addNodeContainer(nodeContainer);
nodesHashtable.put(nc.getUniqueName(), nc);
nodesHashtable.put(nc.getUniqueName(false), nc);
updateAllMappingTypes();
nc.setNeedLoadLib(false);
if (nc.isJoblet()) {
@@ -3455,12 +3502,18 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
}
public String generateUniqueNodeName(INode node) {
return generateUniqueNodeName(node, false);
}
public String generateUniqueNodeName(INode node, boolean useShortName) {
IComponent component = node.getComponent();
if (node instanceof Node) {
component = ((Node) node).getDelegateComponent();
}
String baseName = component.getOriginalName();
if (EComponentType.GENERIC.equals(component.getComponentType())) {
if (useShortName) {
baseName = component.getShortName();
} else if (EComponentType.GENERIC.equals(component.getComponentType())) {
baseName = component.getDisplayName();
}
return UniqueNodeNameGenerator.generateUniqueNodeName(baseName, uniqueNodeNameList);

View File

@@ -470,6 +470,9 @@ public class ProcessUpdateManager extends AbstractUpdateManager {
}
}
}
// re-check deleteParams from repositoryRenamedMap
repositoryRenamedMap.forEach((item, renameMap) -> renameMap.forEach((_new, _old) -> deleteParams.remove(item, _old)));
// built-in
if (contextManager instanceof JobContextManager) { // add the lost source for init process
Set<String> lostParameters = ((JobContextManager) contextManager).getLostParameters();
@@ -504,7 +507,8 @@ public class ProcessUpdateManager extends AbstractUpdateManager {
}
}
}
checkNewAddParameterForRef(existedParams, contextManager, ContextUtils.isPropagateContextVariable());
checkNewAddParameterForRef(existedParams, repositoryRenamedMap, contextManager,
ContextUtils.isPropagateContextVariable());
// see 0004661: Add an option to propagate when add or remove a variable in a repository context to
// jobs/joblets.
checkPropagateContextVariable(contextResults, contextManager, deleteParams, allContextItem, refContextIds);
@@ -556,7 +560,8 @@ public class ProcessUpdateManager extends AbstractUpdateManager {
return contextResults;
}
private void checkNewAddParameterForRef(Map<Item, Set<String>> existedParams, final IContextManager contextManager,
private void checkNewAddParameterForRef(Map<Item, Set<String>> existedParams,
Map<Item, Map<String, String>> repositoryRenamedMap, final IContextManager contextManager,
boolean isPropagateContextVariable) {
if (!isPropagateContextVariable) {
return;
@@ -567,14 +572,15 @@ public class ProcessUpdateManager extends AbstractUpdateManager {
ContextType contextType = ContextUtils.getContextTypeByName(contextItem, null);
List<ContextParameterType> contextParameter = contextType.getContextParameter();
Set<String> existedParName = existedParams.get(contextItem);
Map<String, String> renameMap = repositoryRenamedMap.get(contextItem);
for (ContextParameterType parameterType : contextParameter) {
if (!existedParName.contains(parameterType.getName())) {
if (!existedParName.contains(parameterType.getName())
&& (renameMap == null || !renameMap.containsKey(parameterType.getName()))) {
if (newParametersMap.get(contextItem) == null) {
newParametersMap.put(contextItem, new HashSet<String>());
}
// To avoid the case: serval contexts contain more than one same name parameters, but we only can
// add
// one of them
// To avoid the case: several contexts contain more than one same name parameters
// but we only can add one of them
IContext processContext = ((JobContextManager) contextManager).getDefaultContext();
if (processContext.getContextParameter(parameterType.getName()) == null) {
newParametersMap.get(contextItem).add(parameterType.getName());

View File

@@ -31,6 +31,7 @@ import org.talend.core.ui.metadata.dialog.CustomTableManager;
import org.talend.core.ui.metadata.dialog.MetadataDialog;
import org.talend.core.ui.metadata.editor.MetadataTableEditor;
import org.talend.core.ui.metadata.editor.MetadataTableEditorView;
import org.talend.designer.core.model.components.EParameterName;
import org.talend.designer.core.ui.editor.connections.Connection;
import org.talend.designer.core.ui.editor.properties.controllers.AbstractElementPropertySectionController;
import org.talend.designer.core.ui.views.properties.MultipleThreadDynamicComposite;
@@ -78,8 +79,10 @@ public class MainConnectionComposite extends MultipleThreadDynamicComposite {
// Composite compositeEditorView = new Composite(composite, SWT.BORDER);
// compositeEditorView.setLayoutData(data);
String elementName = (String) ((Connection) elem).getSource()
.getElementParameter(EParameterName.UNIQUE_NAME.getName()).getValue();
metadataTableEditor = new MetadataTableEditor(outputMetaTable, "Schema from " //$NON-NLS-1$
+ ((Connection) elem).getSource().getElementName() + " output "); //$NON-NLS-1$
+ elementName + " output "); //$NON-NLS-1$
metadataTableEditorView = new MetadataTableEditorView(composite, SWT.NONE, metadataTableEditor, true, false,
true, false);
MetadataDialog.initializeMetadataTableView(metadataTableEditorView, ((Connection) elem).getSource(),

View File

@@ -18,6 +18,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CommandStack;
import org.eclipse.jface.fieldassist.DecoratedField;
@@ -48,6 +49,7 @@ import org.talend.core.model.process.IElement;
import org.talend.core.model.process.IElementParameter;
import org.talend.core.model.process.INode;
import org.talend.core.model.process.IProcess2;
import org.talend.core.model.utils.TalendPropertiesUtil;
import org.talend.core.runtime.services.IGenericService;
import org.talend.core.ui.IJobletProviderService;
import org.talend.core.ui.process.IGraphicalNode;
@@ -57,6 +59,7 @@ import org.talend.designer.core.ui.AbstractMultiPageTalendEditor;
import org.talend.designer.core.ui.editor.AbstractTalendEditor;
import org.talend.designer.core.ui.editor.cmd.PropertyChangeCommand;
import org.talend.designer.core.ui.editor.nodes.Node;
import org.talend.designer.core.utils.DesignerUtilities;
/**
* DOC nrousseau class global comment. Detailled comment <br/>
@@ -305,19 +308,23 @@ public class ComponentListController extends AbstractElementPropertySectionContr
if (node.getJobletNode() != null) {
node = node.getJobletNode();
}
final String uniqueName = node.getUniqueName();
String uniqueName = node.getUniqueName();
if (uniqueName.equals(currentNode.getUniqueName())) {
continue;
}
String displayName = (String) node.getElementParameter("LABEL").getValue(); //$NON-NLS-1$
String displayUniqueName = getDisplayUniqueName(node, uniqueName);
if (displayName == null) {
displayName = uniqueName;
displayName = displayUniqueName;
}
if (displayName.indexOf("__UNIQUE_NAME__") != -1) { //$NON-NLS-1$
displayName = displayName.replaceAll("__UNIQUE_NAME__", uniqueName); //$NON-NLS-1$
displayName = displayName.replaceAll("__UNIQUE_NAME__", displayUniqueName); //$NON-NLS-1$
}
if (!displayName.equals(uniqueName)) {
displayName = uniqueName + " - " + displayName; //$NON-NLS-1$
if (!uniqueName.equals(displayUniqueName) && displayName.indexOf(uniqueName) != -1) {
displayName = displayName.replaceAll(uniqueName, displayUniqueName);
}
if (!displayName.equals(displayUniqueName)) {
displayName = displayUniqueName + " - " + displayName; //$NON-NLS-1$
}
componentUniqueNames.add(uniqueName);
componentDisplayNames.add(displayName);
@@ -361,6 +368,13 @@ public class ComponentListController extends AbstractElementPropertySectionContr
}
}
private static String getDisplayUniqueName(INode node, String uniqueName) {
if (TalendPropertiesUtil.isEnabledUseShortJobletName()) {
return DesignerUtilities.getNodeInJobletCompleteUniqueName(node, uniqueName);
}
return uniqueName;
}
SelectionListener listenerSelection = new SelectionAdapter() {
@Override
@@ -391,9 +405,18 @@ public class ComponentListController extends AbstractElementPropertySectionContr
}
if (param.isContextMode()) {
String paramValue = (String) value;
if (elem instanceof INode) {
INode currentNode = (INode) elem;
String completeValue = getDisplayUniqueName(currentNode, paramValue);
if (StringUtils.isNotBlank(completeValue)
|| StringUtils.isBlank(completeValue) && DesignerUtilities.validateJobletShortName(paramValue)) {
paramValue = completeValue;
}
}
combo.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_YELLOW));
combo.setEnabled(false);
combo.setText((String) value);
combo.setText(paramValue);
} else {
combo.setItems(curComponentNameList);
if (numValue == -1) {

View File

@@ -512,7 +512,7 @@ public class SubjobContainer extends Element implements ISubjobContainer {
String subjobStartUniqueName = (String) getPropertyValue(EParameterName.UNIQUE_NAME.getName());
if (process != null && (List<Node>) process.getGraphicalNodes() != null) {
for (Node node : (List<Node>) process.getGraphicalNodes()) {
if (node.getUniqueName() != null && node.getUniqueName().equals(subjobStartUniqueName)) {
if (node.getUniqueName(false) != null && node.getUniqueName(false).equals(subjobStartUniqueName)) {
return node;
}
}
@@ -521,7 +521,7 @@ public class SubjobContainer extends Element implements ISubjobContainer {
}
public void setSubjobStartNode(Node node) {
setPropertyValue(EParameterName.UNIQUE_NAME.getName(), node.getUniqueName());
setPropertyValue(EParameterName.UNIQUE_NAME.getName(), node.getUniqueName(false));
if (node.getComponent().getName().equals("tPrejob") || node.getComponent().getName().equals("tPostjob")) { //$NON-NLS-1$ //$NON-NLS-2$
setPropertyValue(EParameterName.SHOW_SUBJOB_TITLE.getName(), Boolean.TRUE);

View File

@@ -17,6 +17,7 @@ import java.util.List;
import java.util.Map;
import org.apache.commons.collections.BidiMap;
import org.apache.commons.lang.StringUtils;
import org.eclipse.emf.common.ui.celleditor.ExtendedComboBoxCellEditor;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CommandStack;
@@ -56,6 +57,7 @@ import org.talend.core.model.process.Element;
import org.talend.core.model.process.IElementParameter;
import org.talend.core.model.process.IProcess2;
import org.talend.core.model.properties.ConnectionItem;
import org.talend.core.model.utils.TalendPropertiesUtil;
import org.talend.core.ui.CoreUIPlugin;
import org.talend.core.ui.process.IGEFProcess;
import org.talend.core.ui.properties.tab.IDynamicProperty;
@@ -472,12 +474,28 @@ public class AdvancedContextComposite extends ScrolledComposite implements IDyna
@Override
public Object get(IElementParameter bean) {
final Object value = bean.getValue();
Object value = bean.getValue();
if (EParameterFieldType.COMPONENT_LIST == bean.getFieldType()
&& TalendPropertiesUtil.isEnabledUseShortJobletName()) {
String completeValue = DesignerUtilities.getNodeInJobletCompleteUniqueName(node, value.toString());
if (StringUtils.isNotBlank(completeValue)
|| StringUtils.isBlank(completeValue)
&& DesignerUtilities.validateJobletShortName(value.toString())) {
value = completeValue;
}
}
return value == null ? "" : String.valueOf(value); //$NON-NLS-1$
}
@Override
public void set(IElementParameter bean, Object value) {
if (EParameterFieldType.COMPONENT_LIST == bean.getFieldType()
&& TalendPropertiesUtil.isEnabledUseShortJobletName()) {
String shortValue = DesignerUtilities.getNodeInJobletShortUniqueName(node, value.toString());
if (StringUtils.isNotBlank(shortValue)) {
value = shortValue;
}
}
if (value != null && !value.equals(bean.getValue())) {
executeCommand(new PropertyChangeCommand(node, bean.getName(), value));
getTableViewerCreator().refresh();

View File

@@ -553,7 +553,7 @@ public class ComponentSettingsView extends ViewPart implements IComponentSetting
Node node = (Node) elem;
label = node.getLabel();
String uniqueName = node.getUniqueName();
String uniqueName = node.getUniqueName(false);
if (!label.equals(uniqueName)) {
label = label + "(" + uniqueName + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}

View File

@@ -14,7 +14,10 @@ package org.talend.designer.core.utils;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
@@ -23,6 +26,8 @@ import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.PlatformUI;
import org.talend.commons.CommonsPlugin;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.CorePlugin;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.PluginChecker;
@@ -264,4 +269,97 @@ public class DesignerUtilities {
}
return null;
}
/**
* Get the complete unique name for the node in joblet by short unique name.
*
* e.g. jc_1_tDBConnection_1 =>testjoblet_1_tDBConnection_1
*
* @param node
* @param shortUniqueName
* @return
*/
public static String getNodeInJobletCompleteUniqueName(INode node, String shortUniqueName) {
if (StringUtils.isBlank(shortUniqueName) || !validateJobletShortName(shortUniqueName)) {
return shortUniqueName;
}
String graphicalName = "";
StringBuffer graphNameBuffer = new StringBuffer();
boolean findOut = findGraphicNodeInJoblet(node.getProcess(), shortUniqueName, graphNameBuffer, true);
if (findOut) {
graphicalName = graphNameBuffer.toString();
} else {
if (CommonsPlugin.isDebugMode()) {
ExceptionHandler.process(new Exception("Can't find out " + shortUniqueName + " in " + node.getProcess()
+ " for node " + node.getElementParameter(EParameterName.UNIQUE_NAME.getName())));
}
}
return graphicalName;
}
public static boolean validateJobletShortName(String shortUniqueName) {
if (StringUtils.isBlank(shortUniqueName)) {
return false;
}
Matcher matcher = Pattern.compile("jc[0-9]+_[0-9]").matcher(shortUniqueName);
return matcher.find();
}
/**
* Get the complete unique name for the node in joblet by short unique name.
*
* e.g. testjoblet_1_tDBConnection_1 => jc_1_tDBConnection_1
*
* @param node
* @param shortUniqueName
* @return
*/
public static String getNodeInJobletShortUniqueName(INode node, String completeUniqueName) {
if (StringUtils.isBlank(completeUniqueName)) {
return completeUniqueName;
}
String graphicalName = "";
StringBuffer graphNameBuffer = new StringBuffer();
boolean findOut = findGraphicNodeInJoblet(node.getProcess(), completeUniqueName, graphNameBuffer, false);
if (findOut) {
graphicalName = graphNameBuffer.toString();
} else {
if (CommonsPlugin.isDebugMode()) {
ExceptionHandler.process(new Exception("Can't find out " + completeUniqueName + " in " + node.getProcess()
+ " for node " + node.getElementParameter(EParameterName.UNIQUE_NAME.getName())));
}
}
return graphicalName;
}
private static boolean findGraphicNodeInJoblet(IProcess process, String uniqueName, StringBuffer graphNameBuffer,
boolean matchShortName) {
List<? extends INode> nodes = process.getGraphicalNodes();
for (INode iNode : nodes) {
Node graphNode = (Node) iNode;
String graphNodeName = graphNode.getUniqueName(matchShortName);
if (isJobletComponent(graphNode) && uniqueName.startsWith(graphNodeName)) {
if (graphNodeName.equals(uniqueName)) {
graphNameBuffer.append(graphNode.getUniqueName(!matchShortName));
return true;
}
String nonJobletName = uniqueName.replaceFirst(graphNodeName + "_", "");
graphNameBuffer.append(graphNode.getUniqueName(!matchShortName)).append("_");
boolean findOut = findGraphicNodeInJoblet(graphNode.getComponent().getProcess(), nonJobletName, graphNameBuffer,
matchShortName);
if (findOut) {
return true;
}
}
if (graphNodeName.equals(uniqueName)) {
graphNameBuffer.append(uniqueName);
return true;
}
}
return false;
}
public static boolean isJobletComponent(INode node) {
return node.getComponent().getComponentType() == EComponentType.JOBLET;
}
}

View File

@@ -641,7 +641,7 @@ public class RunProcessContext {
// job doesn't verify if code is
// correct
// before launching
if (!JobErrorsChecker.hasErrors(shell)) {
if (isRemoteRun || !JobErrorsChecker.hasErrors(shell)) {
ps = processor
.run(getStatisticsPort(), getTracesPort(), watchParam,
log4jRuntimeLevel, progressMonitor,

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/talend_file_enhanced-1.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/talend_file_enhanced-1.3.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>

View File

@@ -4,7 +4,7 @@ Bundle-Name: Custom
Bundle-SymbolicName: org.talend.libraries.custom;singleton:=true
Bundle-Version: 7.3.1.qualifier
Bundle-ClassPath: .,
lib/talend_file_enhanced-1.2.jar
lib/talend_file_enhanced-1.3.jar
Export-Package: org.talend.fileprocess,
org.talend.fileprocess.delimited
Bundle-ActivationPolicy: lazy

View File

@@ -61,7 +61,7 @@
<artifactItem>
<groupId>org.talend.components.lib</groupId>
<artifactId>talend_file_enhanced</artifactId>
<version>1.2</version>
<version>1.3</version>
</artifactItem>
</artifactItems>
</configuration>

View File

@@ -3726,6 +3726,15 @@
name="Encrypt passwords for nexus proxy password in project setting preference"
version="7.3.1">
</projecttask>
<projecttask
beforeLogon="false"
breaks="7.3.0"
class="org.talend.repository.model.migration.RemoveDuplicateContextReferencesMigrationTask"
description="Remove duplicate context references from item"
id="org.talend.repository.model.migration.RemoveDuplicateContextReferencesMigrationTask"
name="RemoveDuplicateContextReferencesMigrationTask"
version="7.3.1">
</projecttask>
</extension>
<extension

View File

@@ -0,0 +1,77 @@
package org.talend.repository.model.migration;
import java.util.ArrayList;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.collections.map.MultiKeyMap;
import org.eclipse.emf.common.util.EList;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.model.migration.AbstractItemMigrationTask;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.JobletProcessItem;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
public class RemoveDuplicateContextReferencesMigrationTask extends AbstractItemMigrationTask {
@Override
public Date getOrder() {
GregorianCalendar gc = new GregorianCalendar(2023, 3, 20, 12, 0, 0);
return gc.getTime();
}
@SuppressWarnings("unchecked")
@Override
public ExecutionResult execute(Item item) {
EList<ContextType> contexts = null;
if (item instanceof ProcessItem) {
ProcessItem processItem = (ProcessItem) item;
contexts = processItem.getProcess().getContext();
} else if (item instanceof JobletProcessItem) {
JobletProcessItem jobletItem = (JobletProcessItem) item;
contexts = jobletItem.getJobletProcess().getContext();
}
try {
if (!contexts.isEmpty()) {
distinct(contexts);
ProxyRepositoryFactory.getInstance().save(item, true);
return ExecutionResult.SUCCESS_NO_ALERT;
}
} catch (Exception e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
return ExecutionResult.NOTHING_TO_DO;
}
@SuppressWarnings("unchecked")
private void distinct(EList<ContextType> contexts) {
contexts.forEach(context -> {
EList<ContextParameterType> params = context.getContextParameter();
List<ContextParameterType> toRemove = new ArrayList<>();
MultiKeyMap map = new MultiKeyMap();
params.forEach(param -> {
if (!map.containsKey(param.getName(), param.getRepositoryContextId())) {
map.put(param.getName(), param.getRepositoryContextId(), null);
} else {
toRemove.add(param);
}
});
params.removeAll(toRemove);
});
}
@Override
public List<ERepositoryObjectType> getTypes() {
return Stream.concat(ERepositoryObjectType.getAllTypesOfProcess().stream(),
ERepositoryObjectType.getAllTypesOfJoblet().stream()).collect(Collectors.toList());
}
}

View File

@@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
@@ -13,6 +13,7 @@
package org.talend.repository.preference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -29,6 +30,7 @@ import org.eclipse.ui.PlatformUI;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.runtime.model.repository.ERepositoryStatus;
import org.talend.core.model.components.ComponentUtilities;
import org.talend.core.model.general.Project;
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.process.IProcess2;
@@ -38,6 +40,7 @@ import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.RoutineItem;
import org.talend.core.model.properties.SQLPatternItem;
import org.talend.core.model.properties.impl.AdditionalInfoMapImpl;
import org.talend.core.model.relationship.Relation;
import org.talend.core.model.relationship.RelationshipItemBuilder;
import org.talend.core.model.repository.DynaEnum;
@@ -67,6 +70,46 @@ import us.monoid.json.JSONObject;
*/
public class TosTokenCollector extends AbstractTokenCollector {
private static final String NB_ROUTE_MS = "nb.route.ms";
private static final String NB_ROUTE_OSGI = "nb.route.osgi";
private static final String NB_ROUTERESTDS_APIFILE_MS = "nb.routerestds.apifile.ms";
private static final String NB_ROUTERESTDS_APIDESIGNER_MS = "nb.routerestds.apidesigner.ms";
private static final String NB_ROUTERESTDS_APIFILE_OSGI = "nb.routerestds.apifile.osgi";
private static final String NB_ROUTERESTDS_APIDESIGNER_OSGI = "nb.routerestds.apidesigner.osgi";
private static final String NB_ROUTERESTDS_BUILTIN_MS = "nb.routerestds.builtin.ms";
private static final String NB_ROUTERESTDS_BUILTIN_OSGI = "nb.routerestds.builtin.osgi";
private static final String NB_ROUTESOAPDS_MS = "nb.routesoapds.ms";
private static final String NB_ROUTESOAPDS_OSGI = "nb.routesoapds.osgi";
private static final String ROUTE_MICROSERVICE = "ROUTE_MICROSERVICE";
private static final String ROUTE = "ROUTE";
private static final String REST_MS = "REST_MS";
private static final String OSGI = "OSGI";
private static final String NB_DSREST_APIFILE_MS = "nb.dsrest.apifile.ms";
private static final String NB_DSREST_APIDESIGNER_MS = "nb.dsrest.apidesigner.ms";
private static final String NB_DSREST_APIFILE_OSGI = "nb.dsrest.apifile.osgi";
private static final String NB_DSREST_APIDESIGNER_OSGI = "nb.dsrest.apidesigner.osgi";
private static final String NB_DSREST_BUILTIN_MS = "nb.dsrest.builtin.ms";
private static final String NB_DSREST_BUILTIN_OSGI = "nb.dsrest.builtin.osgi";
private static final String PREF_TOS_JOBS_RECORDS = "TOS_Jobs_Records"; //$NON-NLS-1$
private static final TokenKey PROJECTS = new TokenKey("projects"); //$NON-NLS-1$
@@ -78,7 +121,18 @@ public class TosTokenCollector extends AbstractTokenCollector {
private static final String NODE_CAMEL_COMPONENTS = "camel.components";
private static final String NODE_CUSTOM_CAMEL_COMPONENTS = "custom.camel.components";
//data service components used in DI jobs
private static final List<String> dsComponentsInDIJobs = Arrays.asList("tESBProviderRequest","tRESTRequest");
private static final List<String> tDBComponentNameList = Arrays.asList("tDB2Input", "tDB2Output", "tDB2Connection",
"tMSSqlInput", "tMSSqlOutput", "tMSSqlConnection", "tMysqlInput", "tMysqlOutput", "tMysqlConnection",
"tOracleInput", "tOracleOutput", "tOracleConnection", "tPostgresqlInput", "tPostgresqOutput",
"tPostgresqConnection", "tAmazonAuroraInput", "tAmazonAuroraOutput", "tAmazonAuroraConnection",
"cSQLConnection");
private static final List<String> JDBCComponentNameList = Arrays.asList("tDeltaLakeInput","tDeltaLakeConnection","tDeltaLakeOutput",
"tJDBCInput","tJDBCOutput","tJDBCConnection","tSingleStoreInput","tSingleStoreOutput","tSingleStoreConnection");
/**
* ggu JobTokenCollector constructor comment.
*/
@@ -117,6 +171,7 @@ public class TosTokenCollector extends AbstractTokenCollector {
JSONObject repoStats = new JSONObject();
// metadata
Integer nbdssoap = 0;
for (DynaEnum type : ERepositoryObjectType.values()) {
if (type instanceof ERepositoryObjectType && ((ERepositoryObjectType) type).isResourceItem()) {
try {
@@ -164,9 +219,37 @@ public class TosTokenCollector extends AbstractTokenCollector {
if (ERepositoryObjectType.getAllTypesOfProcess().contains(type)) {
JSONObject jobDetails = new JSONObject();
collectJobDetails(all, jobDetails, type);
if (ERepositoryObjectType.PROCESS.equals(type)) {
typeStats.put("nbwithoutds", jobDetails.get("nbwithoutds")); //$NON-NLS-1$
jobDetails.remove("nbwithoutds"); //$NON-NLS-1$
typeStats.put("nbds", jobDetails.get("nbds")); //$NON-NLS-1$
jobDetails.remove("nbds"); //$NON-NLS-1$
nbdssoap = (Integer)jobDetails.get("nbdssoap"); //$NON-NLS-1$
jobDetails.remove("nbdssoap"); //$NON-NLS-1$
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_DSREST_BUILTIN_MS);
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_DSREST_BUILTIN_OSGI);
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_DSREST_APIDESIGNER_OSGI);
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_DSREST_APIFILE_OSGI);
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_DSREST_APIDESIGNER_MS);
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_DSREST_APIFILE_MS);
}else if (ERepositoryObjectType.PROCESS_ROUTE.equals(type)) {
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_ROUTESOAPDS_OSGI);
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_ROUTESOAPDS_MS);
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_ROUTERESTDS_BUILTIN_OSGI);
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_ROUTERESTDS_BUILTIN_MS);
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_ROUTERESTDS_APIDESIGNER_OSGI);
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_ROUTERESTDS_APIFILE_OSGI);
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_ROUTERESTDS_APIDESIGNER_MS);
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_ROUTERESTDS_APIFILE_MS);
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_ROUTE_OSGI);
removeUnwantedNodeFromjobDetails(typeStats, jobDetails, NB_ROUTE_MS);
}
typeStats.put("details", jobDetails); //$NON-NLS-1$
}
if (ERepositoryObjectType.ROUTINES.equals(type)
|| ((ERepositoryObjectType) type).getFolder().startsWith("metadata/") //$NON-NLS-1$
|| ERepositoryObjectType.CONTEXT.equals(type) || type.equals(ERepositoryObjectType.JOBLET)) {
@@ -203,6 +286,10 @@ public class TosTokenCollector extends AbstractTokenCollector {
}
}
}
if(repoStats.has("SERVICES")) {
JSONObject serviceJson = (JSONObject)repoStats.get("SERVICES");
serviceJson.put("nbdssoap", nbdssoap);
}
jObject.put(PROJECTS.getKey(), repoStats); //$NON-NLS-1$
jObject.put(TYPE.getKey(), ProjectManager.getInstance().getProjectType(currentProject));
int nbRef = ProjectManager.getInstance().getAllReferencedProjects().size();
@@ -213,6 +300,179 @@ public class TosTokenCollector extends AbstractTokenCollector {
return jObject;
}
private void addCountInComponent(String key, JSONObject component_names) throws JSONException {
if (component_names.has(key)) {
component_names.put(key,
((Integer) component_names.get(key)) + 1);
} else {
component_names.put(key, 1);
}
}
private void removeUnwantedNodeFromjobDetails(JSONObject typeStats, JSONObject jobDetails, String key) throws JSONException {
if(jobDetails.has(key)) {
typeStats.put(key, jobDetails.get(key)); //$NON-NLS-1$
jobDetails.remove(key); //$NON-NLS-1$
}
}
@SuppressWarnings("unchecked")
private void extractBuildTypeData(NodeType node, Item item, String itemID, String componentName,
Set<String> checkedItemSet, Map<String, Integer> buildTypeDetails) {
List<AdditionalInfoMapImpl> properties = item.getProperty().getAdditionalProperties();
boolean isItemChecked = false;
boolean buildTypeIsPresent = false;
String buildType = null;
for (AdditionalInfoMapImpl property : properties) {
String buildTypeKey = property.getKey().toString();
String buildTypeValue = property.getValue().toString();
if("BUILD_TYPE".equals(buildTypeKey) && null != buildTypeValue) {
buildType = buildTypeValue;
buildTypeIsPresent = true;
break;
}
}
String nodeType = ComponentUtilities.getNodePropertyValue(node, "PROPERTY:PROPERTY_TYPE"); //$NON-NLS-1$
String apiID = ComponentUtilities.getNodePropertyValue(node, "API_ID"); //$NON-NLS-1$
// decide build type for Job/Route
if(!buildTypeIsPresent || null==buildType) {
if ("tRESTRequest".equals(componentName)) {
// if Build type is not present then treat this job as OSGI
buildType = OSGI;
}else {
// if Build type is not present then treat this Route as OSGI
buildType = ROUTE;
}
}
if ("tRESTRequest".equals(componentName)) {
extractDataWhenItemHastRESTRequest(buildTypeDetails, buildType, nodeType, apiID);
isItemChecked =true;
} else if("cSOAP".equals(componentName)) {
extractDataWhenItemHascSOAP(buildTypeDetails, buildType);
isItemChecked =true;
}else if("cREST".equals(componentName)) {
extractDataWhenItemHascREST(buildTypeDetails, buildType, nodeType, apiID);
isItemChecked =true;
}else if(!"cSOAP".equals(componentName) && !"cREST".equals(componentName) && !checkedItemSet.contains(itemID)) {
extractDataForRouteWithoutcRESTorcSOAP(buildTypeDetails, buildType);
isItemChecked =true;
}
if(isItemChecked) {
checkedItemSet.add(itemID);
}
}
private void extractDataForRouteWithoutcRESTorcSOAP(Map<String, Integer> buildTypeDetails, String buildType) {
// nb of jobs which doesn't contains cSOAP or cREST components
if(buildType.equals(ROUTE)) {
// nb routes without cSOAP or cREST as producer where build type = OSGI
String key = NB_ROUTE_OSGI;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
}else if(buildType.equals(ROUTE_MICROSERVICE)) {
// nb routes without cSOAP or cREST as producer where build type = Microservice
String key = NB_ROUTE_MS;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
}
}
private void extractDataWhenItemHascREST(Map<String, Integer> buildTypeDetails, String buildType, String nodeType, String apiID) {
if(null == nodeType || !nodeType.equals("REPOSITORY")) {
if(buildType.equals(ROUTE)) {
// nb routes with cREST as producer where build type = OSGI and API definition = Built-in
String key = NB_ROUTERESTDS_BUILTIN_OSGI;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
}else if(buildType.equals(ROUTE_MICROSERVICE)) {
// nb routes with cREST as producer where build build type = Microservice and API definition = Built-in
String key = NB_ROUTERESTDS_BUILTIN_MS;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
}
}else if(null != nodeType && nodeType.equals("REPOSITORY")){
// when API Definition = Repository
if(buildType.equals(ROUTE)) {
if(null!=apiID && !apiID.isEmpty()) {
// nb routes with cREST as producer where build type is = OSGI and API definition is = imported from API Designer
String key = NB_ROUTERESTDS_APIDESIGNER_OSGI;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
}else {
// nb routes with cREST as producer where build type is = OSGI and API definition is = imported from local file
String key = NB_ROUTERESTDS_APIFILE_OSGI;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
}
}else if(buildType.equals(ROUTE_MICROSERVICE)) {
if(null!=apiID && !apiID.isEmpty()) {
// nb routes with cREST as producer where build type is = Microservice and API definition is = imported from API Designer
String key = NB_ROUTERESTDS_APIDESIGNER_MS;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
}else {
// nb routes with cREST as producer where build type is = Microservice and API definition is = imported from local file
String key = NB_ROUTERESTDS_APIFILE_MS;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
}
}
}
}
private void extractDataWhenItemHascSOAP(Map<String, Integer> buildTypeDetails, String buildType) {
if(buildType.equals(ROUTE)) {
// nb routes with cSOAP as producer where build type = OSGI
String key = NB_ROUTESOAPDS_OSGI;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
//break;
}else if(buildType.equals(ROUTE_MICROSERVICE)) {
// nb routes with cSOAP as producer where build type = Microservice
String key = NB_ROUTESOAPDS_MS;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
//break;
}
}
private void extractDataWhenItemHastRESTRequest(Map<String, Integer> buildTypeDetails, String buildType,
String nodeType, String apiID) {
if(null == nodeType || !nodeType.equals("REPOSITORY")) {
// when API Definition = built-in
if(buildType.equals(OSGI)) {
// nb jobs with tRESTRequest where build type is = OSGI and API definition is = Built-in
String key = NB_DSREST_BUILTIN_OSGI;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
}else if(buildType.equals(REST_MS)) {
//nb jobs with tRESTRequest where build type is = Microservice and API definition is = Built-in
String key = NB_DSREST_BUILTIN_MS;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
}
}else if(null != nodeType && nodeType.equals("REPOSITORY")){
// when API Definition = Repository
if(buildType.equals(OSGI)) {
if(null!=apiID && !apiID.isEmpty()) {
// nb jobs with tRESTRequest where build type is = OSGI and API definition is = imported from API Designer
String key = NB_DSREST_APIDESIGNER_OSGI;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
}else {
// nb jobs with tRESTRequest where build type is = OSGI and API definition is = imported from local file
String key = NB_DSREST_APIFILE_OSGI;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
}
}else if(buildType.equals(REST_MS)) {
if(null!=apiID && !apiID.isEmpty()) {
//nb jobs with tRESTRequest where build type is = Microservice and API definition is = imported from API Designer
String key = NB_DSREST_APIDESIGNER_MS;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
}else {
// nb jobs with tRESTRequest where build type is = Microservice and API definition is = imported from local file
String key = NB_DSREST_APIFILE_MS;
buildTypeDetails.put(key, null!=buildTypeDetails.get(key) ? buildTypeDetails.get(key)+1 : 1);
}
}
}
}
/**
* DOC nrousseau Comment method "collectJobDetails".
*
@@ -221,6 +481,7 @@ public class TosTokenCollector extends AbstractTokenCollector {
* @param type
* @throws JSONException
*/
@SuppressWarnings("unchecked")
private void collectJobDetails(List<IRepositoryViewObject> allRvo, JSONObject jobDetails, DynaEnum type)
throws JSONException {
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
@@ -240,13 +501,21 @@ public class TosTokenCollector extends AbstractTokenCollector {
int contextVarsNum = 0;
int nbComponentsUsed = 0;
int pureDIJobs = 0; // nb of PROCESS without (tESBProviderRequest, tRESTRequest)
List<String> soapWsdlWithImpl = new ArrayList<String>();
int restJobInDIJob = 0;
Map<String, JSONObject> camelComponentMap = new HashMap<>();
Map<String, JSONObject> customCamelComponentMap = new HashMap<>();
Map<String,Integer> buildTypeDetails = new HashMap<String,Integer>();
Set<String> checkedIteSetForBuildTypes = new HashSet<String>();
for (IRepositoryViewObject rvo : allRvo) {
Item item = rvo.getProperty().getItem();
String itemID = ((ProcessItem) item).getProperty().getId();
if (item instanceof ProcessItem) {
boolean has_tRestRequest = false;
boolean has_tESBProviderRequest = false;
boolean has_tESBProviderRequest_Or_tRESTRequest = false;
ProcessType processType = ((ProcessItem) item).getProcess();
for (NodeType node : (List<NodeType>) processType.getNode()) {
JSONObject component_names = null;
String componentName = node.getComponentName();
@@ -266,6 +535,41 @@ public class TosTokenCollector extends AbstractTokenCollector {
component_names.put("component_name", componentName);
component_names.put("count", nbComp + 1);
extractRuntimeFeature(node, component_names, componentName);
if(!checkedIteSetForBuildTypes.contains(itemID)) {
extractBuildTypeData(node, item, itemID, componentName, checkedIteSetForBuildTypes, buildTypeDetails);
}
if (dsComponentsInDIJobs.contains(componentName)) {
has_tESBProviderRequest_Or_tRESTRequest = true;
if ("tRESTRequest".equals(componentName) && !has_tRestRequest) {
// More than one tRESTRequest will cause compile error, but save operation is allowed. So give a double check here.
has_tRestRequest = true;
restJobInDIJob++;
}
if ("tESBProviderRequest".equals(componentName) && !has_tESBProviderRequest) {
// More than one tESBProviderRequest will cause compile error, but save operation is allowed. So give a double check here.
has_tESBProviderRequest = true;
EList elementParameter = node.getElementParameter();
for (Object obj : elementParameter) {
if (obj instanceof ElementParameterType) {
ElementParameterType ep = (ElementParameterType) obj;
if (ep.getName().equalsIgnoreCase("PROPERTY:REPOSITORY_PROPERTY_TYPE")) {
String value = ep.getValue();
// get serviceId from "serviceId - portId - operationId"
String serviceId = value.substring(0, value.indexOf(" - "));
if (!soapWsdlWithImpl.contains(serviceId)) {
soapWsdlWithImpl.add(serviceId);
}
break;
}
}
}
}
}
if (TARGET_COMPONENT.equals(componentName)
&& (type == ERepositoryObjectType.PROCESS_ROUTE || type == ERepositoryObjectType.PROCESS_ROUTELET)) {
@@ -320,8 +624,12 @@ public class TosTokenCollector extends AbstractTokenCollector {
ContextType contextType = (ContextType) contexts.get(0);
contextVarsNum += contextType.getContextParameter().size();
}
if (!has_tESBProviderRequest_Or_tRESTRequest) {
pureDIJobs++;
}
}
if (factory.getStatus(item) != ERepositoryStatus.LOCK_BY_USER && !idsOpened.contains(item.getProperty().getId())) {
// job is not locked and not opened by editor, so we can unload.
if (item.getParent() instanceof FolderItem) {
@@ -337,6 +645,102 @@ public class TosTokenCollector extends AbstractTokenCollector {
jobDetails.put("components", components);
jobDetails.put("nb.contextVars", contextVarsNum);
jobDetails.put("nb.components", nbComponentsUsed);
if (ERepositoryObjectType.PROCESS.equals(type)) {
// will be moved to upper hierarchy/projects.repository/PROCESS/nbwithoutds
jobDetails.put("nbwithoutds", pureDIJobs);
// nb of Data Services:
// (nb PROCESS with (tRESTRequest)) + (nb Services (SOAP WSDL) with at least one operation implemented as job with tESBProviderRequest)
jobDetails.put("nbds", restJobInDIJob + soapWsdlWithImpl.size());
// nb Services (SOAP WSDL) with at least one operation implemented as job with tESBProviderRequest
jobDetails.put("nbdssoap", soapWsdlWithImpl.size());
}
// put build type data
for(Map.Entry<String,Integer> entry : buildTypeDetails.entrySet()){
jobDetails.put(entry.getKey(), entry.getValue());
}
}
private void extractRuntimeFeature(NodeType node, JSONObject component_names, String componentName)
throws JSONException {
if (tDBComponentNameList.contains(componentName)) {
EList elementParameter = node.getElementParameter();
for (Object obj : elementParameter) {
if (obj instanceof ElementParameterType) {
ElementParameterType ep = (ElementParameterType) obj;
if ((ep.getName().equals("SPECIFY_DATASOURCE_ALIAS")
|| (componentName.equals("cSQLConnection")
&& ep.getName().equals("USE_DATA_SOURCE_ALIAS"))) && ep.getValue().equals("true")) {
addCountInComponent("count_use_datasource_alias", component_names);
}
}
}
}
if (JDBCComponentNameList.contains(componentName)) {
EList elementParameter = node.getElementParameter();
for (Object obj : elementParameter) {
if (obj instanceof ElementParameterType) {
ElementParameterType ep = (ElementParameterType) obj;
if ((ep.getName().equals("PROPERTIES"))) {
JSONObject properties = new JSONObject(ep.getValue());
JSONObject useDs = (JSONObject) properties.get("useDataSource");
JSONObject storedValue = (JSONObject) useDs.get("storedValue");
Object value = storedValue.get("value");
if(value.equals(true)) {
addCountInComponent("count_use_datasource_alias", component_names);
}
}
}
}
}
// cREST, tRESTRequest, tRESTClient
if (Arrays.asList("cREST", "tRESTRequest", "tRESTClient").contains(componentName)) {
EList elementParameter = node.getElementParameter();
boolean useAuthentication = false;
for (Object obj : elementParameter) {
if (obj instanceof ElementParameterType) {
ElementParameterType ep = (ElementParameterType) obj;
// check if service locator is used
if (ep.getName().equals("SERVICE_LOCATOR") && ep.getValue().equals("true")) {
addCountInComponent("count_use_service_locator", component_names);
}
// check if service activity monitoring is used
if (ep.getName().equals("SERVICE_ACTIVITY_MONITOR") && ep.getValue().equals("true")) {
addCountInComponent("count_use_service_activity_monitoring", component_names);
}
// check if authentication is used.
if (("cREST".equals(componentName) && ep.getName().equals("ENABLE_SECURITY") && ep.getValue().equals("true"))
|| ((Arrays.asList("tRESTRequest", "tRESTClient").contains(componentName) && ep.getName().equals("NEED_AUTH")
&& ep.getValue().equals("true")))) {
useAuthentication = true;
}
// get authentication type
if (useAuthentication
&& ((("cREST".equals(componentName) && ep.getName().equals("SECURITY_TYPE"))
|| ((Arrays.asList("tRESTRequest", "tRESTClient").contains(componentName) && ep.getName().equals("AUTH_TYPE")))))) {
if (ep.getValue().equals("SAML")) {
addCountInComponent("count_use_authent_SAML_token", component_names);
}
if (ep.getValue().equals("BASIC")) {
addCountInComponent("count_use_authent_http_basic", component_names);
}
// check if use authent Open ID connect is used
if (ep.getValue().equals("OIDC") || ep.getValue().equals("OIDC_PASSWORD_GRANT")) {
addCountInComponent("count_use_authent_Open_ID_connect", component_names);
}
if(ep.getValue().equals("OAUTH2_BEARER")) {
addCountInComponent("count_use_OAuther2_Bearer", component_names);
}
if(ep.getValue().equals("HTTP Digest")) {
addCountInComponent("count_use_authent_http_digest", component_names);
}
}
}
}
}
}
private void record(JSONArray componentsArray, Map<String, JSONObject> camelComponentMap, String component) {

View File

@@ -14,7 +14,7 @@
<description>Studio integration of the Talend Component Kit framework.</description>
<properties>
<component-runtime.version>1.38.8</component-runtime.version>
<component-runtime.version>1.38.9</component-runtime.version>
<commons-lang3.version>3.11</commons-lang3.version>
<mockito.version>2.23.0</mockito.version>
<oro.version>2.0.8</oro.version>