Compare commits
3 Commits
vdrokov_fi
...
vdrokov_fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9177e88156 | ||
|
|
cac484fb3d | ||
|
|
0654834ad2 |
@@ -42,6 +42,6 @@ Feel free to share your Talend components on [Talend Exchange](http://www.talend
|
||||
|
||||
## License
|
||||
|
||||
Copyright (c) 2006-2021 Talend
|
||||
Copyright (c) 2006-2019 Talend
|
||||
|
||||
Licensed under the Apache V2 License
|
||||
|
||||
7
i18n/plugins/org.talend.model.migration.nl/.classpath
Normal file
7
i18n/plugins/org.talend.model.migration.nl/.classpath
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="class"/>
|
||||
</classpath>
|
||||
28
i18n/plugins/org.talend.model.migration.nl/.project
Normal file
28
i18n/plugins/org.talend.model.migration.nl/.project
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.talend.model.migration.nl</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,6 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Nl
|
||||
Bundle-SymbolicName: org.talend.model.migration.nl
|
||||
Bundle-Version: 7.4.1.qualifier
|
||||
Fragment-Host: org.talend.model.migration
|
||||
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
13
i18n/plugins/org.talend.model.migration.nl/build.properties
Normal file
13
i18n/plugins/org.talend.model.migration.nl/build.properties
Normal file
@@ -0,0 +1,13 @@
|
||||
source.. = src/
|
||||
output.. = class/
|
||||
bin.includes = META-INF/,\
|
||||
.\
|
||||
,plugin_ru.properties\
|
||||
,plugin_en.properties\
|
||||
,plugin_hr.properties\
|
||||
,plugin_fr.properties\
|
||||
,plugin_el.properties\
|
||||
,plugin_ja.properties\
|
||||
,plugin_it.properties\
|
||||
,plugin_de.properties\
|
||||
,plugin_swtbot.properties
|
||||
@@ -0,0 +1 @@
|
||||
providerName=www.beispiel.de
|
||||
@@ -0,0 +1,2 @@
|
||||
pluginName=Migration Model
|
||||
providerName=www.example.org
|
||||
@@ -0,0 +1,2 @@
|
||||
pluginName=Mod\u00E8le de migration
|
||||
providerName=www.example.org
|
||||
@@ -0,0 +1 @@
|
||||
providerName=www.example.org
|
||||
@@ -0,0 +1,2 @@
|
||||
pluginName=\u79FB\u884C\u30E2\u30C7\u30EB
|
||||
providerName=www.example.org
|
||||
@@ -0,0 +1 @@
|
||||
providerName=www.example.org
|
||||
@@ -0,0 +1,2 @@
|
||||
pluginName = Migration Model
|
||||
providerName = www.example.org
|
||||
@@ -0,0 +1,2 @@
|
||||
pluginName=\u8FC1\u79FB\u6A21\u578B
|
||||
providerName=www.example.org
|
||||
12
i18n/plugins/org.talend.model.migration.nl/pom.xml
Normal file
12
i18n/plugins/org.talend.model.migration.nl/pom.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.4.1-SNAPSHOT</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.model.migration.nl</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
@@ -0,0 +1,2 @@
|
||||
TopMetadataMigrationFrom400to410usingGenericVM_top_error_log=error while loading the Transformation file : {0}
|
||||
TosMetadataMigrationFrom400to410_tos_error_log=error while loading the Transformation file : {0}
|
||||
@@ -0,0 +1,2 @@
|
||||
TopMetadataMigrationFrom400to410usingGenericVM_top_error_log=error mientras se cargaba el fichero de Transformaci\u00F3n: {0}
|
||||
TosMetadataMigrationFrom400to410_tos_error_log=error mientras se cargaba el fichero de Transformaci\u00F3n: {0}
|
||||
@@ -0,0 +1,2 @@
|
||||
TopMetadataMigrationFrom400to410usingGenericVM_top_error_log=erreur lors du chargement du fichier de transformation : {0}
|
||||
TosMetadataMigrationFrom400to410_tos_error_log=Erreur lors du chargement du fichier de transformation : {0}
|
||||
@@ -0,0 +1,2 @@
|
||||
TopMetadataMigrationFrom400to410usingGenericVM_top_error_log=\u5909\u63DB\u30D5\u30A1\u30A4\u30EB\u30ED\u30FC\u30C9\u4E2D\u306B\u30A8\u30E9\u30FC\uFF1A{0}
|
||||
TosMetadataMigrationFrom400to410_tos_error_log=\u5909\u63DB\u30D5\u30A1\u30A4\u30EB\u30ED\u30FC\u30C9\u4E2D\u306B\u30A8\u30E9\u30FC\uFF1A{0}
|
||||
@@ -0,0 +1,2 @@
|
||||
TopMetadataMigrationFrom400to410usingGenericVM_top_error_log=error while loading the Transformation file : {0}
|
||||
TosMetadataMigrationFrom400to410_tos_error_log=error while loading the Transformation file : {0}
|
||||
@@ -0,0 +1,2 @@
|
||||
TopMetadataMigrationFrom400to410usingGenericVM_top_error_log=\u52A0\u8F7D\u8F6C\u6362\u6587\u4EF6\u65F6\u51FA\u9519\uFF1A{0}
|
||||
TosMetadataMigrationFrom400to410_tos_error_log=\u52A0\u8F7D\u8F6C\u6362\u6587\u4EF6\u65F6\u51FA\u9519\uFF1A{0}
|
||||
@@ -4,5 +4,5 @@ Version: {1}
|
||||
Build id: {0}
|
||||
|
||||
|
||||
(c) Copyright 2006-2021 Talend Inc. All rights reserved.
|
||||
(c) Copyright 2006-2020 Talend Inc. All rights reserved.
|
||||
Visit {3}
|
||||
|
||||
@@ -4,5 +4,5 @@ Version: {1}
|
||||
Build id: {0}
|
||||
|
||||
|
||||
(c) Copyright 2006-2021 Talend Inc. All rights reserved.
|
||||
(c) Copyright 2006-2020 Talend Inc. All rights reserved.
|
||||
Visit {3}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<discovery label="Talend web site" url="http://www.talend.com"/>
|
||||
</url>
|
||||
<requires>
|
||||
<import feature="org.talend.model.migration.feature" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.bouncycastle.bcprov" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.fasterxml.jackson.core.jackson-databind" version="2.9.8" match="greaterOrEqual"/>
|
||||
<import plugin="jackson-core-asl" version="0.0.0" match="greaterOrEqual"/>
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
<import plugin="org.apache.httpcomponents.httpcore" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.compare" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.compare.core" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.m2m.atl.emftvm.trace" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.ops4j.pax.url.mvn" version="0.0.0" match="greaterOrEqual"/>
|
||||
</requires>
|
||||
<plugin id="org.talend.core" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
@@ -65,6 +66,8 @@
|
||||
<plugin id="org.talend.model" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.model.edit" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.model.edit.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
|
||||
<plugin id="org.talend.model.migration" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.model.migration.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
|
||||
<plugin id="org.talend.model.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
|
||||
<plugin id="org.talend.osgi.lib.loader" download-size="0" install-size="0" version="0.0.0" unpack="false" fragment="true"/>
|
||||
<plugin id="org.talend.resources" download-size="0" install-size="0" version="0.0.0"/>
|
||||
|
||||
@@ -1,55 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feature
|
||||
id="org.talend.jdt.feature"
|
||||
label="Feature"
|
||||
version="7.4.1.qualifier">
|
||||
|
||||
<description url="http://www.example.com/description">
|
||||
[Enter Feature Description here.]
|
||||
</description>
|
||||
|
||||
<copyright url="http://www.example.com/copyright">
|
||||
[Enter Copyright Description here.]
|
||||
</copyright>
|
||||
|
||||
<license url="http://www.example.com/license">
|
||||
[Enter License Description here.]
|
||||
</license>
|
||||
|
||||
<requires>
|
||||
<import plugin="org.eclipse.jdt" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.annotation" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.apt.core" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.apt.pluggable.core" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.apt.ui" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.compiler.apt" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.compiler.tool" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.core" version="3.16.0.xx-201903290056-e1812-RELEASE" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.core.manipulation" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.debug" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.debug.ui" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.launching" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.ui" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.hamcrest.core" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.junit" version="4.13.2" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.groovy.core" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.codehaus.groovy" version="2.4.16" match="equivalent"/>
|
||||
</requires>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jdt.launching.macosx"
|
||||
os="macosx"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jdt.launching.ui.macosx"
|
||||
os="macosx"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<feature id="org.talend.jdt.feature" label="Feature" version="7.4.1.qualifier">
|
||||
<description url="http://www.example.com/description">[Enter Feature Description here.]</description>
|
||||
<copyright url="http://www.example.com/copyright">[Enter Copyright Description here.]</copyright>
|
||||
<license url="http://www.example.com/license">[Enter License Description here.]</license>
|
||||
<requires>
|
||||
<!-- bonita requires org.codehaus.groovy version 2.4.16.xx-201903290056-e1812-RELEASE -->
|
||||
<import plugin="org.codehaus.groovy" version="2.4.16.xx-201903290056-e1812-RELEASE" match="perfect"/>
|
||||
<import plugin="org.eclipse.ant.launching" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.ant.ui" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.annotation" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.apt.core" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.apt.pluggable.core" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.apt.ui" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.compiler.apt" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.compiler.tool" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.core" version="3.16.0.xx-201903290056-e1812-RELEASE" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.core.manipulation" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.debug" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.debug.ui" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.doc.user" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.groovy.core" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.junit" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.junit.core" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.junit.runtime" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.junit4.runtime" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.launching" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.ui" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.hamcrest.core" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.junit" version="0.0.0" match="greaterOrEqual"/>
|
||||
</requires>
|
||||
<plugin id="org.eclipse.jdt.launching.macosx" os="macosx" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.eclipse.jdt.launching.ui.macosx" os="macosx" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
</feature>
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.talend.help.di.feature</name>
|
||||
<name>org.talend.model.migration.feature</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<name>org.eclipse.pde.FeatureBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.pde.FeatureNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1 @@
|
||||
bin.includes = feature.xml
|
||||
26
main/features/org.talend.model.migration.feature/feature.xml
Normal file
26
main/features/org.talend.model.migration.feature/feature.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feature
|
||||
id="org.talend.model.migration.feature"
|
||||
label="model Migration feature"
|
||||
version="7.4.1.qualifier">
|
||||
|
||||
<description url="http://www.example.com/description">
|
||||
[Enter Feature Description here.]
|
||||
</description>
|
||||
|
||||
<copyright url="http://www.example.com/copyright">
|
||||
[Enter Copyright Description here.]
|
||||
</copyright>
|
||||
|
||||
<license url="http://www.example.com/license">
|
||||
[Enter License Description here.]
|
||||
</license>
|
||||
|
||||
<requires>
|
||||
<import feature="org.eclipse.m2m.atl" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import feature="org.talend.utils.feature" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.bouncycastle.bcprov" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.objectweb.asm" version="0.0.0" match="greaterOrEqual"/>
|
||||
</requires>
|
||||
|
||||
</feature>
|
||||
12
main/features/org.talend.model.migration.feature/pom.xml
Normal file
12
main/features/org.talend.model.migration.feature/pom.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.4.1-SNAPSHOT</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.model.migration.feature</artifactId>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
@@ -18,7 +18,7 @@
|
||||
<import plugin="org.apache.commons.lang3" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.log4j" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.servicemix.bundles.avro" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.junit" version="4.13.2" match="greaterOrEqual"/>
|
||||
<import plugin="org.junit" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.slf4j.api" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.commons.configuration" version="2.0.0" match="greaterOrEqual"/>
|
||||
</requires>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-202121 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
|
||||
@@ -15,7 +15,6 @@ package org.talend.commons.utils;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.Optional;
|
||||
@@ -353,12 +352,6 @@ public class VersionUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static File getStudioConfigFile() throws Exception {
|
||||
URL configLocation = new URL("platform:/config/config.ini"); //$NON-NLS-1$
|
||||
URL fileUrl = FileLocator.toFileURL(configLocation);
|
||||
return URIUtil.toFile(new URI(fileUrl.getProtocol(), fileUrl.getPath(), fileUrl.getQuery()));
|
||||
}
|
||||
|
||||
public static String getSimplifiedPatchName(String projectPatchName) {
|
||||
|
||||
if (projectPatchName != null) {
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.utils.time;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
|
||||
public class PropertiesCollectorUtil {
|
||||
|
||||
private static final String ROOT_NODE = "additional_packages_records"; // additional packages
|
||||
|
||||
private static final String PREF_ADDITIONAL_PACKAGES = "AdditionalPackages"; // preference node
|
||||
|
||||
private static final String ADDITONAL_PACKAGE_FILE = "additionalPackages";
|
||||
|
||||
|
||||
public static String getAdditionalPackageRecording() {
|
||||
File file = getRecordFile(ADDITONAL_PACKAGE_FILE);
|
||||
|
||||
Properties props = PropertiesFileUtil.read(file, true);
|
||||
String records = props.getProperty(ROOT_NODE, "");
|
||||
|
||||
return records;
|
||||
}
|
||||
|
||||
public static void storeAdditionalPackageRecording(String records) {
|
||||
File file = getRecordFile(ADDITONAL_PACKAGE_FILE);
|
||||
Properties props = PropertiesFileUtil.read(file, false);
|
||||
props.setProperty(ROOT_NODE, records);
|
||||
PropertiesFileUtil.store(file, props);
|
||||
}
|
||||
|
||||
private static File getRecordFile(String fileName) {
|
||||
String configurationLocation = Platform.getConfigurationLocation().getURL().getPath();
|
||||
File file = new File(configurationLocation + "/data_collector/" + fileName);
|
||||
return file;
|
||||
}
|
||||
|
||||
public static String getAdditionalPackagePreferenceNode() {
|
||||
return PREF_ADDITIONAL_PACKAGES;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -280,7 +280,7 @@
|
||||
</appInfo>
|
||||
<documentation>
|
||||
Talend Community Edition<br>
|
||||
Copyright (C) 2006-2021 Talend - www.talend.com
|
||||
Copyright (C) 2006-2019 Talend - www.talend.com
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
@@ -123,7 +123,6 @@ import org.talend.core.model.repository.LockInfo;
|
||||
import org.talend.core.model.repository.RepositoryContentManager;
|
||||
import org.talend.core.model.repository.RepositoryObject;
|
||||
import org.talend.core.model.repository.RepositoryViewObject;
|
||||
import org.talend.core.model.routines.CodesJarInfo;
|
||||
import org.talend.core.repository.CoreRepositoryPlugin;
|
||||
import org.talend.core.repository.constants.Constant;
|
||||
import org.talend.core.repository.constants.FileConstants;
|
||||
@@ -1369,15 +1368,21 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IRepositoryViewObject> getAllInnerCodes(CodesJarInfo info) throws PersistenceException {
|
||||
Project project = ProjectManager.getInstance().getProjectFromProjectTechLabel(info.getProjectTechName());
|
||||
public List<IRepositoryViewObject> getAllInnerCodes(ERepositoryObjectType codesJarType, Property jarProperty)
|
||||
throws PersistenceException {
|
||||
return getAllInnerCodes(projectManager.getCurrentProject(), codesJarType, jarProperty);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IRepositoryViewObject> getAllInnerCodes(Project project, ERepositoryObjectType codesJarType, Property jarProperty)
|
||||
throws PersistenceException {
|
||||
// empty folder won't be commit in git, create if not exist
|
||||
IFolder folder = ResourceUtils.getProject(project).getFolder(ERepositoryObjectType.getFolderName(info.getType()))
|
||||
.getFolder(info.getLabel());
|
||||
IFolder folder = ResourceUtils.getProject(project).getFolder(ERepositoryObjectType.getFolderName(codesJarType))
|
||||
.getFolder(jarProperty.getLabel());
|
||||
if (!folder.exists()) {
|
||||
ResourceUtils.createFolder(folder);
|
||||
}
|
||||
return repositoryFactoryFromProvider.getAll(project, info.getType(), false, false, folder);
|
||||
return repositoryFactoryFromProvider.getAll(project, codesJarType, false, false, folder);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2240,8 +2245,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
CodesJarResourceCache.initCodesJarCache();
|
||||
|
||||
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
|
||||
currentMonitor.beginTask("Execute before logon migrations tasks", 1); //$NON-NLS-1$
|
||||
ProjectManager.getInstance().getMigrationRecords().clear();
|
||||
@@ -2308,6 +2311,8 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
|
||||
currentMonitor.beginTask(Messages.getString("ProxyRepositoryFactory.synch.repo.items"), 1); //$NON-NLS-1$
|
||||
|
||||
CodesJarResourceCache.initCodesJarCache();
|
||||
|
||||
if (!isCommandLineLocalRefProject) {
|
||||
try {
|
||||
coreService.syncAllRoutines();
|
||||
|
||||
@@ -523,10 +523,10 @@ public class CopyObjectAction {
|
||||
|
||||
if (isInnerCode) {
|
||||
CodesJarInfo info = CodesJarResourceCache.getCodesJarByInnerCode(item);
|
||||
if (info != null) {
|
||||
if (info.getProperty() != null) {
|
||||
IDesignerMavenService designerMavenService = IDesignerMavenService.get();
|
||||
if (designerMavenService != null) {
|
||||
designerMavenService.updateCodeJarMavenProject(info, false);
|
||||
designerMavenService.updateCodeJarMavenProject(info.getProperty(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.apache.oro.text.regex.Util;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.generation.JavaUtils;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.RoutineItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
@@ -47,34 +48,27 @@ public final class RoutineUtils {
|
||||
public static void changeRoutinesPackage(Item item) {
|
||||
List<ERepositoryObjectType> allowedTypes = new ArrayList<ERepositoryObjectType>();
|
||||
allowedTypes.add(ERepositoryObjectType.ROUTINES);
|
||||
doChangeRoutinesPackage(item, DEFAULT_PACKAGE_REGEX, DEFAULT_PACKAGE_STRING, allowedTypes, false, true);
|
||||
doChangeRoutinesPackage(item, DEFAULT_PACKAGE_REGEX, DEFAULT_PACKAGE_STRING, allowedTypes, false);
|
||||
}
|
||||
|
||||
public static void changeInnerCodePackage(Item item, boolean avoidSave) {
|
||||
changeInnerCodePackage(item, avoidSave, true);
|
||||
}
|
||||
|
||||
public static void changeInnerCodePackage(Item item, boolean avoidSave, boolean commitMode) {
|
||||
IDesignerMavenService service = IDesignerMavenService.get();
|
||||
if (service != null && item instanceof RoutineItem) {
|
||||
RoutineItem routineItem = (RoutineItem) item;
|
||||
String codesJarPackageByInnerCode = service.getCodesJarPackageByInnerCode(routineItem);
|
||||
if (StringUtils.isNotBlank(codesJarPackageByInnerCode)) {
|
||||
String newPackageString = "package " + StringUtils.replace(codesJarPackageByInnerCode, "/", ".") + ";";
|
||||
if (!routineItem.isBuiltIn()) {
|
||||
String routineContent = new String(routineItem.getContent().getInnerContent());
|
||||
if (routineContent != null && routineContent.contains(newPackageString)) {
|
||||
return;
|
||||
}
|
||||
if (item instanceof RoutineItem
|
||||
&& GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerMavenService.class)) {
|
||||
IDesignerMavenService service = GlobalServiceRegister.getDefault().getService(IDesignerMavenService.class);
|
||||
if (service != null) {
|
||||
RoutineItem routineItem = (RoutineItem) item;
|
||||
String codesJarPackageByInnerCode = service.getCodesJarPackageByInnerCode(routineItem);
|
||||
if (StringUtils.isNotBlank(codesJarPackageByInnerCode)) {
|
||||
String newPackageString = "package " + StringUtils.replace(codesJarPackageByInnerCode, "/", ".") + ";";
|
||||
doChangeRoutinesPackage(item, INNER_ROUTINES_PACKAGE_REGEX, newPackageString,
|
||||
ERepositoryObjectType.getAllTypesOfCodes(), avoidSave);
|
||||
}
|
||||
doChangeRoutinesPackage(item, INNER_ROUTINES_PACKAGE_REGEX, newPackageString,
|
||||
ERepositoryObjectType.getAllTypesOfCodes(), avoidSave, commitMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void doChangeRoutinesPackage(Item item, String packageRegex, String newPackage,
|
||||
List<ERepositoryObjectType> allowedTypes, boolean avoidSave, boolean commitMode) {
|
||||
List<ERepositoryObjectType> allowedTypes, boolean avoidSave) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
@@ -100,12 +94,7 @@ public final class RoutineUtils {
|
||||
ProxyRepositoryFactory repFactory = ProxyRepositoryFactory.getInstance();
|
||||
|
||||
if (!avoidSave) {
|
||||
if (commitMode) {
|
||||
repFactory.save(rItem);
|
||||
} else {
|
||||
// avoid deadlock in git pull event listener
|
||||
new XmiResourceManager().saveResource(rItem.eResource());
|
||||
}
|
||||
repFactory.save(rItem);
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -12,26 +12,17 @@
|
||||
<dbType type="BPCHAR" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BYTEA" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="CHAR" defaultLength="50" ignorePre="true"/>
|
||||
<dbType type="CHARACTER" defaultLength="50" ignorePre="true"/>
|
||||
<dbType type="CID" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="CIDR" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="CIRCLE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="DATE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="FLOAT4" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="REAL" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="FLOAT8" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="DOUBLE PRECISION" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INET" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INT2" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="SMALLINT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INT2VECTOR" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INT4" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INT8" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INTEGER" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="CHARACTER VARYING" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BOOLEAN" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BIGINT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BIT VARYING" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INTERVAL" ignorePre="true" />
|
||||
<dbType type="LINE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="LSEG" ignoreLen="true" ignorePre="true" />
|
||||
@@ -39,7 +30,6 @@
|
||||
<dbType type="MONEY" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="NAME" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="NUMERIC" defaultLength="20" defaultPrecision="10"/>
|
||||
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10"/>
|
||||
<dbType type="OID" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="OIDVECTOR" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="PATH" ignoreLen="true" ignorePre="true" />
|
||||
@@ -120,19 +110,16 @@
|
||||
<talendToDbTypes><!-- Adviced mappings -->
|
||||
<talendType type="id_List"/>
|
||||
<talendType type="id_Boolean">
|
||||
<dbType type="BOOL" default="true" />
|
||||
<dbType type="BOOLEAN" />
|
||||
<dbType type="BOOL" default="true" />
|
||||
</talendType>
|
||||
<talendType type="id_Byte">
|
||||
</talendType>
|
||||
<talendType type="id_byte[]">
|
||||
<dbType type="BIT" default="true" />
|
||||
<dbType type="VARBIT" />
|
||||
<dbType type="BIT VARYING" />
|
||||
<dbType type="VARBIT" />
|
||||
</talendType>
|
||||
<talendType type="id_Character">
|
||||
<dbType type="CHAR" default="true" />
|
||||
<dbType type="CHARACTER" />
|
||||
<dbType type="BPCHAR" />
|
||||
<dbType type="VARCHAR" />
|
||||
<dbType type="TEXT" />
|
||||
@@ -149,47 +136,33 @@
|
||||
<dbType type="RELTIME" />
|
||||
</talendType>
|
||||
<talendType type="id_BigDecimal">
|
||||
<dbType type="NUMERIC" default="true" />
|
||||
<dbType type="DECIMAL" />
|
||||
<dbType type="NUMERIC" default="true" />
|
||||
<dbType type="FLOAT4" />
|
||||
<dbType type="REAL" />
|
||||
<dbType type="FLOAT8"/>
|
||||
<dbType type="DOUBLE PRECISION"/>
|
||||
</talendType>
|
||||
<talendType type="id_Double">
|
||||
<dbType type="FLOAT4" />
|
||||
<dbType type="REAL" />
|
||||
<dbType type="FLOAT8" default="true" />
|
||||
<dbType type="NUMERIC" />
|
||||
<dbType type="DECIMAL" />
|
||||
<dbType type="DOUBLE PRECISION"/>
|
||||
<dbType type="NUMERIC" />
|
||||
</talendType>
|
||||
<talendType type="id_Float">
|
||||
<dbType type="FLOAT4" default="true" />
|
||||
<dbType type="FLOAT8" />
|
||||
<dbType type="REAL" />
|
||||
<dbType type="NUMERIC" />
|
||||
<dbType type="DECIMAL" />
|
||||
<dbType type="DOUBLE PRECISION"/>
|
||||
<dbType type="NUMERIC" />
|
||||
</talendType>
|
||||
<talendType type="id_Integer">
|
||||
<dbType type="INT2" />
|
||||
<dbType type="SMALLINT" />
|
||||
<dbType type="INT4" default="true" />
|
||||
<dbType type="SERIAL" />
|
||||
<dbType type="INT8" />
|
||||
<dbType type="BIGINT" />
|
||||
<dbType type="BIGSERIAL" />
|
||||
<dbType type="INTEGER" />
|
||||
<dbType type="BIGSERIAL" />
|
||||
</talendType>
|
||||
<talendType type="id_Long">
|
||||
<dbType type="INT2" />
|
||||
<dbType type="INT4" />
|
||||
<dbType type="SERIAL" />
|
||||
<dbType type="INT8" default="true" />
|
||||
<dbType type="BIGINT" />
|
||||
<dbType type="BIGSERIAL" />
|
||||
<dbType type="SMALLINT" />
|
||||
<dbType type="BIGSERIAL" />
|
||||
</talendType>
|
||||
<talendType type="id_Object">
|
||||
<dbType type="_POINT" />
|
||||
@@ -236,26 +209,18 @@
|
||||
<dbType type="_ABSTIME" />
|
||||
<dbType type="_ACLITEM" />
|
||||
<dbType type="_INT8" />
|
||||
<dbType type="BIGINT" />
|
||||
<dbType type="BIT VARYING" />
|
||||
<dbType type="_VARBIT" />
|
||||
<dbType type="_BIT" />
|
||||
<dbType type="_BOOL" />
|
||||
<dbType type="BOOLEAN" />
|
||||
<dbType type="BOX" />
|
||||
<dbType type="_BOX" />
|
||||
<dbType type="_BYTEA" />
|
||||
<dbType type="_VARCHAR" />
|
||||
<dbType type="CHARACTER VARYING" />
|
||||
<dbType type="CHARACTER" />
|
||||
<dbType type="INTEGER" />
|
||||
<dbType type="REAL" />
|
||||
<dbType type="_BPCHAR" />
|
||||
<dbType type="_CID" />
|
||||
<dbType type="_CIDR" />
|
||||
<dbType type="_CIRCLE" />
|
||||
<dbType type="_DATE" />
|
||||
<dbType type="DOUBLE PRECISION"/>
|
||||
<dbType type="_FLOAT8" />
|
||||
<dbType type="_INET" />
|
||||
<dbType type="INT2VECTOR" />
|
||||
@@ -271,7 +236,6 @@
|
||||
<dbType type="NAME" />
|
||||
<dbType type="_NAME" />
|
||||
<dbType type="_NUMERIC" />
|
||||
<dbType type="DECIMAL" />
|
||||
<dbType type="_OID" />
|
||||
<dbType type="OIDVECTOR" />
|
||||
<dbType type="_OIDVECTOR" />
|
||||
@@ -283,44 +247,26 @@
|
||||
<dbType type="INT4" />
|
||||
<dbType type="SERIAL" />
|
||||
<dbType type="INT8" />
|
||||
<dbType type="BIGINT" />
|
||||
<dbType type="BIGSERIAL" />
|
||||
<dbType type="SMALLINT" />
|
||||
<dbType type="BIGSERIAL" />
|
||||
</talendType>
|
||||
<talendType type="id_String">
|
||||
<dbType type="BPCHAR" />
|
||||
<dbType type="VARCHAR" default="true" />
|
||||
<dbType type="CHARACTER VARYING" />
|
||||
<dbType type="TEXT" />
|
||||
</talendType>
|
||||
</talendToDbTypes>
|
||||
<dbToTalendTypes>
|
||||
<dbType type="INT2" >
|
||||
<talendType type="id_Short" default="true" />
|
||||
</dbType>
|
||||
<dbType type="SMALLINT" >
|
||||
<talendType type="id_Short" default="true" />
|
||||
</dbType>
|
||||
<dbType type="INT4" >
|
||||
<talendType type="id_Integer" default="true" />
|
||||
</dbType>
|
||||
<dbType type="INTEGER" >
|
||||
<talendType type="id_Integer" default="true" />
|
||||
</dbType>
|
||||
<dbType type="CHARACTER VARYING" >
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BOOLEAN" >
|
||||
<talendType type="id_Boolean" default="true" />
|
||||
</dbType>
|
||||
</dbType>
|
||||
<dbType type="SERIAL" >
|
||||
<talendType type="id_Integer" default="true" />
|
||||
</dbType>
|
||||
<dbType type="INT8" >
|
||||
<talendType type="id_Long" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BIGINT" >
|
||||
<talendType type="id_Long" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BIGSERIAL" >
|
||||
<talendType type="id_Long" default="true" />
|
||||
@@ -328,26 +274,14 @@
|
||||
<dbType type="FLOAT4" >
|
||||
<talendType type="id_Float" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="REAL" >
|
||||
<talendType type="id_Float" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
</dbType>
|
||||
<dbType type="FLOAT8" >
|
||||
<talendType type="id_Double" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="DOUBLE PRECISION" >
|
||||
<talendType type="id_Double" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="NUMERIC">
|
||||
<talendType type="id_Double"/>
|
||||
<talendType type="id_BigDecimal" default="true" />
|
||||
</dbType>
|
||||
<dbType type="DECIMAL">
|
||||
<talendType type="id_Double"/>
|
||||
<talendType type="id_BigDecimal" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BOOL" >
|
||||
<talendType type="id_Boolean" default="true" />
|
||||
@@ -357,15 +291,9 @@
|
||||
</dbType>
|
||||
<dbType type="VARBIT" >
|
||||
<talendType type="id_byte[]" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BIT VARYING" >
|
||||
<talendType type="id_byte[]" default="true" />
|
||||
</dbType>
|
||||
</dbType>
|
||||
<dbType type="CHAR" >
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="CHARACTER" >
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BPCHAR" >
|
||||
<talendType type="id_String" default="true" />
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
</appInfo>
|
||||
<documentation>
|
||||
Talend Community Edition<br>
|
||||
Copyright (C) 2006-2021 Talend - www.talend.com
|
||||
Copyright (C) 2006-2019 Talend - www.talend.com
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core;
|
||||
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.migration.IMigrationTask.ExecutionResult;
|
||||
|
||||
/**
|
||||
* DOC bZhou class global comment. Detailled comment
|
||||
*/
|
||||
public interface IMigrateDIMetadataItemService extends IService {
|
||||
|
||||
/**
|
||||
* DOC bZhou Comment method "migrateDIItems".
|
||||
*
|
||||
* This method to invode the migration task in DI to do migration when import items from DQ perspective.
|
||||
*
|
||||
* It should be removed after merge the migrate mechanism.
|
||||
*
|
||||
* @param item
|
||||
* @return
|
||||
*/
|
||||
ExecutionResult migrateDIItems(Item item);
|
||||
}
|
||||
@@ -12,19 +12,13 @@
|
||||
// ============================================================================
|
||||
package org.talend.core;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.runtime.FileLocator;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.VersionUtils;
|
||||
|
||||
/**
|
||||
* This class can check whether some specific plugins are loaded or not. <br/>
|
||||
@@ -68,8 +62,6 @@ public class PluginChecker {
|
||||
|
||||
private static final String PREVIEW_PLUGIN_ID = "org.talend.designer.component.preview"; //$NON-NLS-1$
|
||||
|
||||
private static final String REMOTE_PROVIDER_PLUGIN_ID = "org.talend.repository.remoteprovider"; //$NON-NLS-1$
|
||||
|
||||
private static final String SVN_PROVIDER_PLUGIN_ID = "org.talend.repository.svnprovider"; //$NON-NLS-1$
|
||||
|
||||
private static final String GIT_PROVIDER_PLUGIN_ID = "org.talend.repository.gitprovider"; //$NON-NLS-1$
|
||||
@@ -148,10 +140,6 @@ public class PluginChecker {
|
||||
|
||||
public static final String APACHE_CXF_PLUGIN_ID = "org.talend.libraries.apache.cxf"; //$NON-NLS-1$
|
||||
|
||||
public static final String SWTBOT_PLUGIN_ID = "org.eclipse.swtbot.eclipse.core"; //$NON-NLS-1$
|
||||
|
||||
private static Boolean isStudioLite;
|
||||
|
||||
/**
|
||||
* Check if specific plug-in is loaded.
|
||||
*
|
||||
@@ -170,23 +158,6 @@ public class PluginChecker {
|
||||
return isJobLetPluginLoaded();
|
||||
}
|
||||
|
||||
public static boolean isStudioLite() {
|
||||
if (isStudioLite == null) {
|
||||
try {
|
||||
File studioConfigFile = VersionUtils.getStudioConfigFile();
|
||||
Properties props = new Properties();
|
||||
try (BufferedReader reader = Files.newBufferedReader(studioConfigFile.toPath())) {
|
||||
props.load(reader);
|
||||
}
|
||||
isStudioLite = Boolean.valueOf(props.getProperty("talend.studio.lite"));
|
||||
} catch (Exception e) {
|
||||
isStudioLite = false;
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
return isStudioLite;
|
||||
}
|
||||
|
||||
public static boolean isRefProjectLoaded() {
|
||||
return isPluginLoaded(REF_PROJECT_PLUGIN_ID);
|
||||
}
|
||||
@@ -288,10 +259,6 @@ public class PluginChecker {
|
||||
return isPluginLoaded(PREVIEW_PLUGIN_ID);
|
||||
}
|
||||
|
||||
public static boolean isRemoteProviderPluginLoaded() {
|
||||
return isPluginLoaded(REMOTE_PROVIDER_PLUGIN_ID);
|
||||
}
|
||||
|
||||
public static boolean isSVNProviderPluginLoaded() {
|
||||
return isPluginLoaded(SVN_PROVIDER_PLUGIN_ID);
|
||||
}
|
||||
@@ -405,10 +372,6 @@ public class PluginChecker {
|
||||
return isPluginLoaded(BD_ROUTINE_PLUGIN_ID);
|
||||
}
|
||||
|
||||
public static boolean isSWTBotLoaded() {
|
||||
return isPluginLoaded(SWTBOT_PLUGIN_ID);
|
||||
}
|
||||
|
||||
public static String getBundlePath(String bundleName) {
|
||||
String bundlePath = ""; //$NON-NLS-1$
|
||||
Bundle refBundle = Platform.getBundle(bundleName);
|
||||
|
||||
@@ -67,8 +67,8 @@ public enum EDatabase4DriverClassName {
|
||||
// if change the order, it might break the audit for PSQL.
|
||||
PSQL(EDatabaseTypeName.PSQL, "org.postgresql.Driver"), //$NON-NLS-1$
|
||||
PLUSPSQL(EDatabaseTypeName.PLUSPSQL, "org.postgresql.Driver"), //$NON-NLS-1$
|
||||
GREENPLUM(EDatabaseTypeName.GREENPLUM, "com.pivotal.jdbc.GreenplumDriver"), //$NON-NLS-1$
|
||||
GREENPLUM_PSQL(EDatabaseTypeName.GREENPLUM, "org.postgresql.Driver"), //$NON-NLS-1$
|
||||
GREENPLUM(EDatabaseTypeName.GREENPLUM, "org.postgresql.Driver"), //$NON-NLS-1$
|
||||
|
||||
SAS(EDatabaseTypeName.SAS, "com.sas.rio.MVADriver"), //$NON-NLS-1$
|
||||
SAPHana(EDatabaseTypeName.SAPHana, "com.sap.db.jdbc.Driver"), //$NON-NLS-1$
|
||||
SQLITE(EDatabaseTypeName.SQLITE, "org.sqlite.JDBC"), //$NON-NLS-1$
|
||||
|
||||
@@ -336,19 +336,10 @@ public enum EDatabaseTypeName {
|
||||
.getProjectPreferenceManager()
|
||||
.getBoolean(IProjectSettingPreferenceConstants.METADATA_DBCONNECTION_ODBC_ENABLE);
|
||||
isSupport = isSupportODBC;
|
||||
} else if (EDatabaseTypeName.SAS == this) {
|
||||
isSupport = false;
|
||||
}
|
||||
|
||||
return isSupport;
|
||||
}
|
||||
|
||||
public static boolean isDeprecateDbType(String dbType) {
|
||||
if (EDatabaseTypeName.SAS.getXmlName().equals(dbType)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for dbType.
|
||||
|
||||
@@ -114,13 +114,6 @@ public class DatabaseConnStrUtil {
|
||||
&& EDatabaseVersion4Drivers.SYBASEIQ_16_SA.getVersionValue().equals(dbVersion)) {
|
||||
connStr = EDatabaseConnTemplate.SYBASEASE_16_SA;
|
||||
}
|
||||
if (EDatabaseTypeName.GREENPLUM.getDisplayName().equals(dbType)) {
|
||||
if (EDatabaseVersion4Drivers.GREENPLUM.getVersionValue().equals(dbVersion)) {
|
||||
connStr = EDatabaseConnTemplate.GREENPLUM;
|
||||
}else if(EDatabaseVersion4Drivers.GREENPLUM_PSQL.getVersionValue().equals(dbVersion)) {
|
||||
connStr = EDatabaseConnTemplate.GREENPLUM_PSQL;
|
||||
}
|
||||
}
|
||||
EDatabaseVersion4Drivers version = EDatabaseVersion4Drivers.indexOfByVersion(dbVersion);
|
||||
if (connStr != null) {
|
||||
String s = connStr.getUrlTemplate(version);
|
||||
|
||||
@@ -54,11 +54,6 @@ public enum EDatabaseConnTemplate {
|
||||
"5432")), //$NON-NLS-1$
|
||||
|
||||
GREENPLUM(new DbConnStr(EDatabaseTypeName.GREENPLUM, //
|
||||
"jdbc:pivotal:greenplum://<host>:<port>;;DatabaseName=<sid>;<property>", //$NON-NLS-1$
|
||||
"5432")), //$NON-NLS-1$
|
||||
|
||||
|
||||
GREENPLUM_PSQL(new DbConnStr(EDatabaseTypeName.GREENPLUM, //
|
||||
"jdbc:postgresql://<host>:<port>/<sid>?<property>", //$NON-NLS-1$
|
||||
"5432")), //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -99,8 +99,8 @@ public enum EDatabaseVersion4Drivers {
|
||||
VERTICA_3(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 3 (Deprecated)", "VERTICA_3", "vertica_3.0_jdk_5.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
// for bug 0017930
|
||||
GREENPLUM_PSQL(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM,"PostgreSQL", "POSTGRESQL", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$
|
||||
GREENPLUM(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM,"Greenplum", "GREENPLUM", "greenplum-5.1.4.000275.jar")), //$NON-NLS-1$
|
||||
|
||||
GREENPLUM(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM, "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$
|
||||
// PSQL_V10(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v10", "V10", "postgresql-42.2.5.jar")),
|
||||
PSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v9 and later", "V9_X", "postgresql-42.2.14.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
PSQL_PRIOR_TO_V9(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "Prior to v9", "PRIOR_TO_V9", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
@@ -53,7 +53,7 @@ public class BigDataBasicUtil {
|
||||
|
||||
private static IDynamicDistributionManager getDynamicDistributionManager(IProgressMonitor monitor) throws Exception {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopDistributionService.class)) {
|
||||
IHadoopDistributionService hdService = GlobalServiceRegister.getDefault()
|
||||
IHadoopDistributionService hdService = (IHadoopDistributionService) GlobalServiceRegister.getDefault()
|
||||
.getService(IHadoopDistributionService.class);
|
||||
if (hdService != null) {
|
||||
return hdService.getDynamicDistributionManager();
|
||||
|
||||
@@ -27,8 +27,8 @@ import org.talend.core.model.process.IElement;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.process.IProcess;
|
||||
import org.talend.core.model.process.Problem;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.routines.CodesJarInfo;
|
||||
import org.talend.designer.codegen.PigTemplate;
|
||||
|
||||
/**
|
||||
@@ -120,7 +120,7 @@ public interface ILibrariesService extends IService {
|
||||
|
||||
Set<ModuleNeeded> getAllCodesJarModuleNeededs();
|
||||
|
||||
Set<ModuleNeeded> getCodesJarModuleNeededs(CodesJarInfo info);
|
||||
Set<ModuleNeeded> getCodesJarModuleNeededs(Property property);
|
||||
|
||||
List<ModuleNeeded> getModuleNeeded(String id, boolean isGroup);
|
||||
|
||||
|
||||
@@ -191,23 +191,6 @@ public class ModuleToInstall {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModuleToInstall clone() {
|
||||
ModuleToInstall module = new ModuleToInstall();
|
||||
module.setName(this.name);
|
||||
module.setRequired(this.required);
|
||||
module.setContext(this.context);
|
||||
module.setDescription(this.description);
|
||||
module.setDistribution(this.distribution);
|
||||
module.setFromCustomNexus(this.fromCustomNexus);
|
||||
module.setLicenseType(this.licenseType);
|
||||
module.setLicenseUrl(this.licenseUrl);
|
||||
module.setMavenUri(this.mavenUri);
|
||||
module.setUrl_description(this.url_description);
|
||||
module.setUrl_download(this.url_download);
|
||||
return module;
|
||||
}
|
||||
|
||||
public static String removeAuthenrizationInfo(String mavenUri) throws Exception {
|
||||
MavenArtifact ma = MavenUrlHelper.parseMvnUrl(mavenUri);
|
||||
ma.setUsername(""); //$NON-NLS-1$
|
||||
|
||||
@@ -125,10 +125,6 @@ public interface IMetadataColumn {
|
||||
|
||||
public void setCustom(boolean custom);
|
||||
|
||||
public boolean isIgnoreCustomSort();
|
||||
|
||||
public void setIgnoreCustomSort(boolean ignoreCustomSort);
|
||||
|
||||
public void setCustomId(int customId); // only for custom columns to sort them
|
||||
|
||||
public int getCustomId(); // only for custom columns to sort them
|
||||
|
||||
@@ -53,8 +53,6 @@ public class MetadataColumn implements IMetadataColumn, Cloneable {
|
||||
|
||||
private boolean custom = false;
|
||||
|
||||
private boolean ignoreCustomSort = false;
|
||||
|
||||
private boolean readOnly = false;
|
||||
|
||||
private int customId = 0;
|
||||
@@ -576,24 +574,6 @@ public class MetadataColumn implements IMetadataColumn, Cloneable {
|
||||
this.custom = custom;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for ignoreCustomSort.
|
||||
*
|
||||
* @return the ignoreCustomSort
|
||||
*/
|
||||
public boolean isIgnoreCustomSort() {
|
||||
return ignoreCustomSort;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ignoreCustomSort.
|
||||
*
|
||||
* @param ignoreCustomSort the ignoreCustomSort to set
|
||||
*/
|
||||
public void setIgnoreCustomSort(boolean ignoreCustomSort) {
|
||||
this.ignoreCustomSort = ignoreCustomSort;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for readOnly.
|
||||
*
|
||||
|
||||
@@ -365,7 +365,7 @@ public class MetadataTable implements IMetadataTable, Cloneable {
|
||||
|
||||
for (int i = 0; i < listColumns.size(); i++) {
|
||||
IMetadataColumn column = listColumns.get(i);
|
||||
if (column.isCustom() && !column.isIgnoreCustomSort()) {
|
||||
if (column.isCustom()) {
|
||||
customColumns.add(column);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,6 @@ import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
@@ -494,55 +492,18 @@ public final class MetadataTalendType {
|
||||
}
|
||||
}
|
||||
|
||||
private static String getSha1OfFile(File file) {
|
||||
String sha1 = null;
|
||||
FileInputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = new FileInputStream(file);
|
||||
sha1 = DigestUtils.shaHex(fileInputStream);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
} finally {
|
||||
if (fileInputStream != null) {
|
||||
try {
|
||||
fileInputStream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace(); // Just print the exception for debug.
|
||||
}
|
||||
}
|
||||
}
|
||||
return sha1;
|
||||
}
|
||||
|
||||
public static void copyFile(File in, IFile out) throws CoreException, IOException {
|
||||
FileInputStream fis = new FileInputStream(in);
|
||||
if (out.exists()) {
|
||||
out.setContents(fis, true, false, null);
|
||||
} else {
|
||||
out.create(fis, true, null);
|
||||
}
|
||||
fis.close();
|
||||
}
|
||||
|
||||
public static void syncNewMappingFileToProject() throws SystemException {
|
||||
try {
|
||||
File sysMappingFiles = new File(MetadataTalendType.getSystemForderURLOfMappingsFile().getPath());
|
||||
IFolder projectMappingFolder = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject())
|
||||
.getFolder(MetadataTalendType.PROJECT_MAPPING_FOLDER);
|
||||
File projectMappingFiles = new File(projectMappingFolder.getLocationURI());
|
||||
if (!sysMappingFiles.exists() || !projectMappingFiles.exists()) {
|
||||
File projectMappingFiles = projectMappingFolder.getFullPath().toFile();
|
||||
if (sysMappingFiles.list().length == new File(projectMappingFolder.getLocationURI()).list().length) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (File sysMapping : sysMappingFiles.listFiles()) {
|
||||
IFile projectMapping = projectMappingFolder.getFile(sysMapping.getName());
|
||||
if (projectMapping.exists() && StringUtils.equals(sysMapping.getName(), "mapping_Greenplum.xml")) {
|
||||
|
||||
String sha1OfFile = DigestUtils.shaHex(projectMapping.getContents());
|
||||
String shalOfOldSystem = "8431f19215dacb3caa126778ae695954552cce2a";
|
||||
if (StringUtils.equals(sha1OfFile, shalOfOldSystem)) {
|
||||
copyFile(sysMapping, projectMapping);
|
||||
}
|
||||
}
|
||||
if (!projectMapping.exists()) {
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
|
||||
@@ -25,10 +25,8 @@ import org.apache.avro.SchemaBuilder.FieldAssembler;
|
||||
import org.apache.avro.SchemaBuilder.FieldBuilder;
|
||||
import org.apache.avro.SchemaBuilder.PropBuilder;
|
||||
import org.apache.avro.SchemaBuilder.RecordBuilder;
|
||||
import org.apache.avro.SchemaParseException;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
@@ -51,10 +49,6 @@ import orgomg.cwm.objectmodel.core.TaggedValue;
|
||||
*/
|
||||
public final class MetadataToolAvroHelper {
|
||||
|
||||
private static Logger LOGGER = Logger.getLogger(MetadataToolAvroHelper.class);
|
||||
|
||||
private static final String COLUMN = "Column";
|
||||
|
||||
private static final String TALEND_DB_COLUMN_NAME = "talend.field.dbColumnName";
|
||||
/**
|
||||
* @return An Avro schema with enriched properties from the incoming metadata table.
|
||||
@@ -72,7 +66,7 @@ public final class MetadataToolAvroHelper {
|
||||
dynamicPosition = i;
|
||||
dynColumn = column;
|
||||
} else {
|
||||
fa = convertToAvro(fa, column, i);
|
||||
fa = convertToAvro(fa, column);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
@@ -143,7 +137,7 @@ public final class MetadataToolAvroHelper {
|
||||
* Build a field into a schema using enriched properties from the incoming column.
|
||||
*/
|
||||
private static FieldAssembler<Schema> convertToAvro(FieldAssembler<Schema> fa,
|
||||
org.talend.core.model.metadata.builder.connection.MetadataColumn in, int i) {
|
||||
org.talend.core.model.metadata.builder.connection.MetadataColumn in) {
|
||||
ICoreService coreService = (ICoreService) GlobalServiceRegister.getDefault().getService(ICoreService.class);
|
||||
String label = in.getLabel();
|
||||
if (label != null && coreService != null) {
|
||||
@@ -243,27 +237,7 @@ public final class MetadataToolAvroHelper {
|
||||
}
|
||||
|
||||
type = in.isNullable() ? AvroUtils.wrapAsNullable(type) : type;
|
||||
FieldAssembler<Schema> returnResult = null;
|
||||
try {
|
||||
if (defaultValue == null) {
|
||||
returnResult = fb.type(type).noDefault();
|
||||
} else {
|
||||
returnResult = fb.type(type).withDefault(defaultValue);
|
||||
}
|
||||
} catch (SchemaParseException e) {
|
||||
// if validation not pass from avro ,then generate a new name like Column0 to pass the validation, but
|
||||
// actually the display name of schema and the column name is using TALEND_DB_COLUMN_NAME
|
||||
String genColumn = COLUMN + i;
|
||||
FieldBuilder<Schema> fbNew = fa.name(genColumn);
|
||||
copyColumnProperties(fbNew, in);
|
||||
if (defaultValue == null) {
|
||||
returnResult = fbNew.type(type).noDefault();
|
||||
} else {
|
||||
returnResult = fbNew.type(type).withDefault(defaultValue);
|
||||
}
|
||||
LOGGER.info(e.getMessage() + ", use " + genColumn + " instead");
|
||||
}
|
||||
return returnResult;
|
||||
return defaultValue == null ? fb.type(type).noDefault() : fb.type(type).withDefault(defaultValue);
|
||||
}
|
||||
|
||||
private static Schema getLogicalTypeSchema(org.talend.core.model.metadata.builder.connection.MetadataColumn column) {
|
||||
|
||||
@@ -647,7 +647,6 @@ public final class MetadataToolHelper {
|
||||
target.getListColumns().remove(targetColumn);
|
||||
newTargetColumn.setCustom(targetColumn.isCustom());
|
||||
newTargetColumn.setCustomId(targetColumn.getCustomId());
|
||||
newTargetColumn.setIgnoreCustomSort(targetColumn.isIgnoreCustomSort());
|
||||
columnsTAdd.add(newTargetColumn);
|
||||
}
|
||||
}
|
||||
@@ -807,7 +806,6 @@ public final class MetadataToolHelper {
|
||||
target.getListColumns().remove(targetColumn);
|
||||
newTargetColumn.setCustom(targetColumn.isCustom());
|
||||
newTargetColumn.setCustomId(targetColumn.getCustomId());
|
||||
newTargetColumn.setIgnoreCustomSort(targetColumn.isIgnoreCustomSort());
|
||||
columnsTAdd.add(newTargetColumn);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -607,12 +607,6 @@ public class ComponentToRepositoryProperty {
|
||||
}
|
||||
// SAX
|
||||
// can not find corresponding component. also not exist in EDatabaseType.java.
|
||||
|
||||
// impala
|
||||
else if (EDatabaseTypeName.IMPALA.getProduct().equalsIgnoreCase((String) parameter.getValue())) {
|
||||
connection.setDatabaseType(EDatabaseTypeName.IMPALA.getDisplayName());
|
||||
connection.setProductId(EDatabaseTypeName.IMPALA.getProduct());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -714,18 +708,6 @@ public class ComponentToRepositoryProperty {
|
||||
connection.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_ADDITIONAL_JDBC_SETTINGS, value);
|
||||
}
|
||||
}
|
||||
if ("DISTRIBUTION".equals(param.getRepositoryValue())) {
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_IMPALA_DISTRIBUTION, value);
|
||||
}
|
||||
}
|
||||
if ("IMPALA_VERSION".equals(param.getRepositoryValue())) {
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_IMPALA_VERSION, value);
|
||||
}
|
||||
}
|
||||
|
||||
if (connection.getDatabaseType().equals(EDatabaseTypeName.ORACLEFORSID.getDisplayName())) {
|
||||
setDatabaseValueForOracleSid(connection, node, param);
|
||||
|
||||
@@ -1067,10 +1067,7 @@ public class RepositoryToComponentProperty {
|
||||
return dbVersionString;
|
||||
} else if (EDatabaseTypeName.SYBASEASE.getDisplayName().equals(databaseType)) {
|
||||
return dbVersionString;
|
||||
} else if (EDatabaseTypeName.GREENPLUM.getDisplayName().equals(databaseType)) {
|
||||
return dbVersionString;
|
||||
|
||||
}else {
|
||||
} else {
|
||||
String driverValue = EDatabaseVersion4Drivers.getDriversStr(databaseType, dbVersionString);
|
||||
if (EDatabaseConnTemplate.ORACLE_OCI.getDBDisplayName().equals(databaseType)
|
||||
|| EDatabaseConnTemplate.ORACLE_CUSTOM.getDBDisplayName().equals(databaseType)
|
||||
|
||||
@@ -146,7 +146,7 @@ public abstract class AbstractItemMigrationTask extends AbstractMigrationTask im
|
||||
* this returns all type handled by this migration task even the extended type that could benefit from this
|
||||
* migrations
|
||||
* */
|
||||
protected List<ERepositoryObjectType> getAllTypes() {
|
||||
List<ERepositoryObjectType> getAllTypes() {
|
||||
List<ERepositoryObjectType> declaredTypes = getTypes();
|
||||
ArrayList<ERepositoryObjectType> allTypes = new ArrayList<ERepositoryObjectType>(declaredTypes.size());
|
||||
allTypes.addAll(declaredTypes);
|
||||
|
||||
@@ -124,7 +124,6 @@ public enum EParameterFieldType {
|
||||
TACOKIT_BUTTON,
|
||||
TACOKIT_SUGGESTABLE_TABLE,
|
||||
TACOKIT_VALUE_SELECTION,
|
||||
TACOKIT_TABLE,
|
||||
TACOKIT_TEXT_AREA_SELECTION;
|
||||
|
||||
public String getName() {
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.model.process;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -134,8 +133,4 @@ public interface IProcess extends IElement {
|
||||
public String getComponentsType();
|
||||
|
||||
public INode getNodeByUniqueName(String uniqueName);
|
||||
|
||||
default List<? extends INode> getProcessNodes() {
|
||||
return new ArrayList<INode>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +67,6 @@ public class JobInfo {
|
||||
|
||||
private boolean needUnloadProcessor;
|
||||
|
||||
private int includeESBFlag = 0;
|
||||
|
||||
public JobInfo(String jobId, String contextName, String version) {
|
||||
this.jobId = jobId;
|
||||
this.contextName = contextName;
|
||||
@@ -574,13 +572,4 @@ public class JobInfo {
|
||||
public boolean isNeedUnloadProcessor() {
|
||||
return this.needUnloadProcessor;
|
||||
}
|
||||
|
||||
public int getIncludeESBFlag() {
|
||||
return includeESBFlag;
|
||||
}
|
||||
|
||||
public void setIncludeESBFlag(int includeESBFlag) {
|
||||
this.includeESBFlag = includeESBFlag;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ public final class RepositoryManager {
|
||||
}
|
||||
|
||||
public static void syncUserComponents() {
|
||||
if (PluginChecker.isRemoteProviderPluginLoaded()) {
|
||||
if (PluginChecker.isSVNProviderPluginLoaded()) {
|
||||
IComponentsService codeGenService = (IComponentsService) GlobalServiceRegister.getDefault().getService(
|
||||
IComponentsService.class);
|
||||
if (codeGenService != null) {
|
||||
|
||||
@@ -12,23 +12,9 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.model.routines;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.properties.RoutinesJarItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.runtime.repository.item.ItemProductKeys;
|
||||
import org.talend.cwm.helper.ResourceHelper;
|
||||
import org.talend.designer.core.model.utils.emf.component.IMPORTType;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.model.IProxyRepositoryService;
|
||||
|
||||
/**
|
||||
* Could get most of codesjar's attribute in EMF model but some are lost when model is unloaded. Store those attributes
|
||||
@@ -37,7 +23,7 @@ import org.talend.repository.model.IProxyRepositoryService;
|
||||
|
||||
public class CodesJarInfo {
|
||||
|
||||
private static final String EMPTY_DATE;
|
||||
private Property property;
|
||||
|
||||
private String projectTechName;
|
||||
|
||||
@@ -49,47 +35,24 @@ public class CodesJarInfo {
|
||||
|
||||
private ERepositoryObjectType type;
|
||||
|
||||
private List<IMPORTType> imports;
|
||||
|
||||
private String modifiedDate;
|
||||
|
||||
static {
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.setTimeInMillis(0);
|
||||
EMPTY_DATE = ResourceHelper.dateFormat().format(c.getTime());
|
||||
}
|
||||
|
||||
private CodesJarInfo() {
|
||||
imports = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
||||
public static CodesJarInfo create(Property property) {
|
||||
Assert.isTrue(property.getItem() instanceof RoutinesJarItem);
|
||||
CodesJarInfo info = new CodesJarInfo();
|
||||
info.property = property;
|
||||
info.projectTechName = ProjectManager.getInstance().getProject(property).getTechnicalLabel();
|
||||
info.id = property.getId();
|
||||
info.label = property.getLabel();
|
||||
info.version = property.getVersion();
|
||||
info.type = ERepositoryObjectType.getItemType(property.getItem());
|
||||
if (((RoutinesJarItem) property.getItem()).getRoutinesJarType() != null) {
|
||||
info.imports.addAll(((RoutinesJarItem) property.getItem()).getRoutinesJarType().getImports());
|
||||
}
|
||||
String modifiedDate = (String) property.getAdditionalProperties().get(ItemProductKeys.DATE.getModifiedKey());
|
||||
info.modifiedDate = StringUtils.isNotBlank(modifiedDate) ? modifiedDate : EMPTY_DATE;
|
||||
return info;
|
||||
}
|
||||
|
||||
public Property getProperty() {
|
||||
try {
|
||||
IRepositoryViewObject obj = IProxyRepositoryService.get().getProxyRepositoryFactory().getLastVersion(id);
|
||||
if (obj != null) {
|
||||
return obj.getProperty();
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return property;
|
||||
}
|
||||
|
||||
public String getProjectTechName() {
|
||||
return projectTechName;
|
||||
@@ -111,14 +74,6 @@ public class CodesJarInfo {
|
||||
return type;
|
||||
}
|
||||
|
||||
public List<IMPORTType> getImports() {
|
||||
return imports;
|
||||
}
|
||||
|
||||
public String getModifiedDate() {
|
||||
return modifiedDate;
|
||||
}
|
||||
|
||||
public boolean isInCurrentMainProject() {
|
||||
return projectTechName.equals(ProjectManager.getInstance().getCurrentProject().getTechnicalLabel());
|
||||
}
|
||||
@@ -127,42 +82,36 @@ public class CodesJarInfo {
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
result = prime * result + ((label == null) ? 0 : label.hashCode());
|
||||
result = prime * result + ((type == null) ? 0 : type.hashCode());
|
||||
result = prime * result + ((version == null) ? 0 : version.hashCode());
|
||||
result = prime * result + ((projectTechName == null) ? 0 : projectTechName.hashCode());
|
||||
result = prime * result + ((property == null) ? 0 : property.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
if (this == obj) {
|
||||
return true;
|
||||
if (obj == null)
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
CodesJarInfo other = (CodesJarInfo) obj;
|
||||
if (id == null) {
|
||||
if (other.id != null)
|
||||
return false;
|
||||
} else if (!id.equals(other.id))
|
||||
if (projectTechName == null && other.projectTechName != null) {
|
||||
return false;
|
||||
if (label == null) {
|
||||
if (other.label != null)
|
||||
return false;
|
||||
} else if (!label.equals(other.label))
|
||||
} else if (!projectTechName.equals(other.projectTechName)) {
|
||||
return false;
|
||||
if (type == null) {
|
||||
if (other.type != null)
|
||||
return false;
|
||||
} else if (!type.equals(other.type))
|
||||
}
|
||||
if (property == null && other.property != null) {
|
||||
return false;
|
||||
if (version == null) {
|
||||
if (other.version != null)
|
||||
} else if (property != null && other.property != null) {
|
||||
if (!property.getId().equals(other.property.getId()) || !property.getLabel().equals(other.property.getLabel())
|
||||
|| !property.getVersion().equals(other.property.getVersion())) {
|
||||
return false;
|
||||
} else if (!version.equals(other.version))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -418,52 +418,6 @@ public class NodeUtil {
|
||||
return conns;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC
|
||||
* <p>
|
||||
* The method searches for the incoming node connections of type
|
||||
* on a processing path and returns the first ones only
|
||||
* </p>
|
||||
*
|
||||
* @param node
|
||||
* @param type - node type to look for
|
||||
* @return
|
||||
*/
|
||||
public static List<? extends IConnection> getFirstIncomingLineConnectionsOfType(INode node, String type) {
|
||||
if (type == null)
|
||||
return new ArrayList<IConnection>();
|
||||
|
||||
Set<String> uniqueNamesDone = new HashSet<String>();
|
||||
List<? extends IConnection> allIncomingConnections = getFirstIncomingLineConnectionsOfType(node, uniqueNamesDone, type);
|
||||
|
||||
return allIncomingConnections;
|
||||
}
|
||||
|
||||
private static List<? extends IConnection> getFirstIncomingLineConnectionsOfType(INode node, Set<String> uniqueNamesDone, String type) {
|
||||
List<IConnection> conns = new ArrayList<IConnection>();
|
||||
|
||||
List<? extends IConnection> incomingConnections = node.getIncomingConnections();
|
||||
if (incomingConnections != null) {
|
||||
|
||||
for (int i = 0; i < incomingConnections.size(); i++) {
|
||||
|
||||
IConnection connection = incomingConnections.get(i);
|
||||
INode nextNode = connection.getSource();
|
||||
|
||||
if (!uniqueNamesDone.contains(nextNode.getUniqueName())) {
|
||||
uniqueNamesDone.add(nextNode.getUniqueName());
|
||||
|
||||
if (type.equals((String)nextNode.getElementParameter("COMPONENT_NAME").getValue())) {
|
||||
conns.add(connection);
|
||||
} else {
|
||||
conns.addAll(getFirstIncomingLineConnectionsOfType(nextNode, uniqueNamesDone, type)); // follow this way
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return conns;
|
||||
}
|
||||
|
||||
public static INode getFirstMergeNode(INode node) {
|
||||
INode mergeNode = null;
|
||||
for (IConnection connection : node.getOutgoingConnections()) {
|
||||
|
||||
@@ -16,10 +16,8 @@ import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -99,8 +97,6 @@ public class NexusServerUtils {
|
||||
}
|
||||
final boolean status[] = { false };
|
||||
try {
|
||||
URI uri = new URI(nexusURL);
|
||||
uri.toURL();
|
||||
NullProgressMonitor monitor = new NullProgressMonitor();
|
||||
new HttpClientTransport(nexusURL, username, password) {
|
||||
|
||||
@@ -146,8 +142,6 @@ public class NexusServerUtils {
|
||||
}
|
||||
final List<HttpResponse> httpResponse = new ArrayList<>();
|
||||
try {
|
||||
URI uri = new URI(nexusURL);
|
||||
uri.toURL();
|
||||
NullProgressMonitor monitor = new NullProgressMonitor();
|
||||
new HttpClientTransport(nexusURL, username, password) {
|
||||
|
||||
@@ -166,7 +160,6 @@ public class NexusServerUtils {
|
||||
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
return null;
|
||||
}
|
||||
return httpResponse.get(0);
|
||||
}
|
||||
|
||||
@@ -36,8 +36,6 @@ public interface MavenConstants {
|
||||
|
||||
static final String DEFAULT_GROUP_ID = "org.talend";
|
||||
|
||||
static final String APACHE_GROUP_ID = "org.apache";
|
||||
|
||||
static final String DEFAULT_VERSION = "6.0.0";
|
||||
|
||||
static final String SNAPSHOT = "-SNAPSHOT";
|
||||
|
||||
@@ -80,13 +80,4 @@ public interface TalendProcessOptionConstants {
|
||||
*/
|
||||
public static final int MODULES_WITH_CODESJAR = 1 << 6;
|
||||
|
||||
/**
|
||||
* flag for check if is ESB job
|
||||
*/
|
||||
public static final int ISESB_CHECKED = 1;
|
||||
|
||||
public static final int ISESB_CHILDREN_INCLUDE = 1 << 1;
|
||||
|
||||
public static final int ISESB_CURRENT_INCLUDE = 1 << 2;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,16 +14,17 @@ package org.talend.core.runtime.services;
|
||||
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IService;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.properties.RoutineItem;
|
||||
import org.talend.core.model.routines.CodesJarInfo;
|
||||
|
||||
public interface IDesignerMavenService extends IService {
|
||||
|
||||
String getCodesJarPackageByInnerCode(RoutineItem innerCodeItem);
|
||||
|
||||
String getImportGAVPackageForCodesJar(CodesJarInfo info);
|
||||
String getImportGAVPackageForCodesJar(String projectTechName, Item codesJarItem);
|
||||
|
||||
void updateCodeJarMavenProject(CodesJarInfo info, boolean needReSync) throws Exception;
|
||||
void updateCodeJarMavenProject(Property codeJarProperty, boolean needReSync) throws Exception;
|
||||
|
||||
public static IDesignerMavenService get() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerMavenService.class)) {
|
||||
|
||||
@@ -47,6 +47,4 @@ public interface ICoreUIService extends IService {
|
||||
String getPreferenceValue(String key);
|
||||
|
||||
void loadComponentsFromProviders(ERepositoryObjectType type);
|
||||
|
||||
void resetDataCollectorData();
|
||||
}
|
||||
|
||||
@@ -147,6 +147,4 @@ public interface IJobletProviderService extends IService {
|
||||
|
||||
public void updateJobleModifiedRelated(Item item, String oldName, String newName);
|
||||
|
||||
public IProcess getJobletGEFProcessFromNode(INode node);
|
||||
|
||||
}
|
||||
|
||||
@@ -39,11 +39,10 @@ public class CodesJarResourceCache {
|
||||
List<Project> allProjects = new ArrayList<>();
|
||||
allProjects.addAll(ProjectManager.getInstance().getAllReferencedProjects(true));
|
||||
allProjects.add(ProjectManager.getInstance().getCurrentProject());
|
||||
IProxyRepositoryFactory factory = IProxyRepositoryService.get().getProxyRepositoryFactory();
|
||||
try {
|
||||
for (Project project : allProjects) {
|
||||
for (ERepositoryObjectType codesJarType : ERepositoryObjectType.getAllTypesOfCodesJar()) {
|
||||
List<IRepositoryViewObject> objects = factory.getAllCodesJars(project, codesJarType);
|
||||
List<IRepositoryViewObject> objects = getProxyRepositoryFactory().getAllCodesJars(project, codesJarType);
|
||||
for (IRepositoryViewObject obj : objects) {
|
||||
CACHE.add(CodesJarInfo.create(obj.getProperty()));
|
||||
}
|
||||
@@ -64,7 +63,8 @@ public class CodesJarResourceCache {
|
||||
|
||||
public static CodesJarInfo getCodesJarById(String id) {
|
||||
synchronized (LOCK) {
|
||||
Optional<CodesJarInfo> optional = CACHE.stream().filter(info -> info.getId().equals(id)).findFirst();
|
||||
Optional<CodesJarInfo> optional = CACHE.stream().filter(info -> info.getProperty().getId().equals(id))
|
||||
.findFirst();
|
||||
if (optional.isPresent()) {
|
||||
return optional.get();
|
||||
}
|
||||
@@ -75,12 +75,13 @@ public class CodesJarResourceCache {
|
||||
|
||||
public static CodesJarInfo getCodesJarByLabel(ERepositoryObjectType type, String projectTechName, String label) {
|
||||
synchronized (LOCK) {
|
||||
Optional<CodesJarInfo> optional = CACHE.stream().filter(info -> info.getType() == type
|
||||
&& info.getLabel().equals(label) && info.getProjectTechName().equals(projectTechName)).findFirst();
|
||||
Optional<CodesJarInfo> optional = CACHE.stream().filter(
|
||||
info -> ERepositoryObjectType.getItemType(info.getProperty().getItem()) == type
|
||||
&& info.getProperty().getLabel().equals(label) && info.getProjectTechName().equals(projectTechName))
|
||||
.findFirst();
|
||||
if (optional.isPresent()) {
|
||||
return optional.get();
|
||||
}
|
||||
ExceptionHandler.process(new Exception("Codes jar [" + label + "] is not found!")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -88,23 +89,19 @@ public class CodesJarResourceCache {
|
||||
public static CodesJarInfo getCodesJarByInnerCode(RoutineItem routineItem) throws PersistenceException {
|
||||
String codesJarName = RoutinesUtil.getCodesJarLabelByInnerCode(routineItem);
|
||||
String projectTechName = ProjectManager.getInstance().getProject(routineItem).getTechnicalLabel();
|
||||
Optional<CodesJarInfo> optional = getAllCodesJars().stream()
|
||||
.filter(info -> info.getLabel().equals(codesJarName) && info.getProjectTechName().equals(projectTechName))
|
||||
.findFirst();
|
||||
if (optional.isPresent()) {
|
||||
return optional.get();
|
||||
}
|
||||
ExceptionHandler.process(new Exception("Codes jar [" + routineItem.getProperty().getLabel() + "] is not found!")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return null;
|
||||
return getAllCodesJars().stream()
|
||||
.filter(info -> info.getProperty().getLabel().equals(codesJarName)
|
||||
&& info.getProjectTechName().equals(projectTechName))
|
||||
.findFirst().get();
|
||||
}
|
||||
|
||||
public static void addToCache(Property newProperty) {
|
||||
synchronized (LOCK) {
|
||||
Iterator<CodesJarInfo> iterator = CACHE.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
CodesJarInfo oldInfo = iterator.next();
|
||||
if (newProperty.getId().equals(oldInfo.getId()) && newProperty.getLabel().equals(oldInfo.getLabel())
|
||||
&& newProperty.getVersion().equals(oldInfo.getVersion())) {
|
||||
Property oldProperty = iterator.next().getProperty();
|
||||
if (newProperty.getId().equals(oldProperty.getId()) && newProperty.getLabel().equals(oldProperty.getLabel())
|
||||
&& newProperty.getVersion().equals(oldProperty.getVersion())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
@@ -116,9 +113,10 @@ public class CodesJarResourceCache {
|
||||
synchronized (LOCK) {
|
||||
Iterator<CodesJarInfo> iterator = CACHE.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
CodesJarInfo oldInfo = iterator.next();
|
||||
if ((oldId == null || (oldId != null && oldId.equals(oldInfo.getId()))) && oldLabel.equals(oldInfo.getLabel())
|
||||
&& oldVersion.equals(oldInfo.getVersion())) {
|
||||
Property oldProperty = iterator.next().getProperty();
|
||||
if ((oldId == null || (oldId != null && oldId.equals(oldProperty.getId())))
|
||||
&& oldLabel.equals(oldProperty.getLabel())
|
||||
&& oldVersion.equals(oldProperty.getVersion())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
@@ -130,15 +128,22 @@ public class CodesJarResourceCache {
|
||||
synchronized (LOCK) {
|
||||
Iterator<CodesJarInfo> iterator = CACHE.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
CodesJarInfo oldInfo = iterator.next();
|
||||
if (oldInfo.getId().equals(property.getId()) && oldInfo.getLabel().equals(property.getLabel())
|
||||
&& oldInfo.getVersion().equals(property.getVersion())) {
|
||||
Property oldProperty = iterator.next().getProperty();
|
||||
if (oldProperty.getId().equals(property.getId()) && oldProperty.getLabel().equals(property.getLabel())
|
||||
&& oldProperty.getVersion().equals(property.getVersion())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static IProxyRepositoryFactory getProxyRepositoryFactory() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
|
||||
return GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class).getProxyRepositoryFactory();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void addCodesJarChangeListener() {
|
||||
if (!isListenerAdded) {
|
||||
synchronized (LOCK) {
|
||||
|
||||
@@ -271,10 +271,14 @@ public abstract class AbstractRoutineSynchronizer implements ITalendSynchronizer
|
||||
protected void syncInnerCodeItems(boolean forceUpdate) throws SystemException {
|
||||
IProxyRepositoryFactory factory = getRepositoryService().getProxyRepositoryFactory();
|
||||
for (CodesJarInfo info : CodesJarResourceCache.getAllCodesJars()) {
|
||||
List<IRepositoryViewObject> innerCodesObjects = factory.getAllInnerCodes(info);
|
||||
Property property = info.getProperty();
|
||||
String projectTechName = info.getProjectTechName();
|
||||
Project project = ProjectManager.getInstance().getProjectFromProjectTechLabel(projectTechName);
|
||||
ERepositoryObjectType codesJarType = ERepositoryObjectType.getItemType(property.getItem());
|
||||
List<IRepositoryViewObject> innerCodesObjects = factory.getAllInnerCodes(project, codesJarType, property);
|
||||
for (IRepositoryViewObject codesObj : innerCodesObjects) {
|
||||
RoutineItem codeItem = (RoutineItem) codesObj.getProperty().getItem();
|
||||
syncRoutine(codeItem, info.getProjectTechName(), true, forceUpdate);
|
||||
syncRoutine(codeItem, projectTechName, true, forceUpdate);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -291,8 +295,11 @@ public abstract class AbstractRoutineSynchronizer implements ITalendSynchronizer
|
||||
return;
|
||||
}
|
||||
CodesJarInfo info = CodesJarResourceCache.getCodesJarByInnerCode(routineItem);
|
||||
Property codesJarProperty = info.getProperty();
|
||||
IFolder innerCodeFolder = ResourceUtils.getFolder(ResourceUtils.getProject(info.getProjectTechName()),
|
||||
ERepositoryObjectType.getFolderName(info.getType()) + "/" + info.getLabel(), true);
|
||||
ERepositoryObjectType.getFolderName(ERepositoryObjectType.getItemType(codesJarProperty.getItem())) + "/"
|
||||
+ codesJarProperty.getLabel(),
|
||||
true);
|
||||
IFile innerCodeFile = innerCodeFolder
|
||||
.getFile(routineItem.getProperty().getLabel() + "_" + routineItem.getProperty().getVersion() + ".item");
|
||||
if (innerCodeFile.exists()) {
|
||||
|
||||
@@ -192,7 +192,7 @@ public interface IRunProcessService extends IService {
|
||||
@Deprecated
|
||||
public void buildJavaProject();
|
||||
|
||||
public void buildCodesJavaProject(IProgressMonitor monitor, Set<CodesJarInfo> toUpdate);
|
||||
public void buildCodesJavaProject(IProgressMonitor monitor);
|
||||
|
||||
/**
|
||||
* @deprecated use {@link IRunProcessService#getTalendJobJavaProject(Property)} instead
|
||||
|
||||
@@ -186,7 +186,7 @@ public final class ProjectManager {
|
||||
Set<String> resolvedProjectLabels, boolean force) {
|
||||
if (p != null) {
|
||||
String parentBranch = ProjectManager.getInstance().getMainProjectBranch(p);
|
||||
if ((!p.isLocal() || parentBranch != null) || force) {
|
||||
if (parentBranch != null || force) {
|
||||
resolvedProjectLabels.add(p.getTechnicalLabel());
|
||||
for (ProjectReference pr : new Project(p).getProjectReferenceList()) {
|
||||
if (ProjectManager.validReferenceProject(p, pr)
|
||||
|
||||
@@ -43,7 +43,6 @@ import org.talend.core.model.repository.Folder;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.repository.IRepositoryWorkUnitListener;
|
||||
import org.talend.core.model.repository.LockInfo;
|
||||
import org.talend.core.model.routines.CodesJarInfo;
|
||||
import org.talend.repository.RepositoryWorkUnit;
|
||||
|
||||
/**
|
||||
@@ -318,7 +317,11 @@ public interface IProxyRepositoryFactory {
|
||||
public abstract List<IRepositoryViewObject> getAllCodesJars(Project project, ERepositoryObjectType type)
|
||||
throws PersistenceException;
|
||||
|
||||
public abstract List<IRepositoryViewObject> getAllInnerCodes(CodesJarInfo info) throws PersistenceException;
|
||||
public abstract List<IRepositoryViewObject> getAllInnerCodes(ERepositoryObjectType codesJarType, Property jarProperty)
|
||||
throws PersistenceException;
|
||||
|
||||
public abstract List<IRepositoryViewObject> getAllInnerCodes(Project project, ERepositoryObjectType codesJarType,
|
||||
Property jarProperty) throws PersistenceException;
|
||||
|
||||
public abstract List<String> getFolders(ERepositoryObjectType type) throws PersistenceException;
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
// ============================================================================
|
||||
package org.talend.repository.model;
|
||||
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IService;
|
||||
|
||||
/**
|
||||
@@ -21,11 +20,4 @@ import org.talend.core.IService;
|
||||
public interface IProxyRepositoryService extends IService {
|
||||
|
||||
public IProxyRepositoryFactory getProxyRepositoryFactory();
|
||||
|
||||
public static IProxyRepositoryService get() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
|
||||
return GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,12 +36,6 @@
|
||||
id="org.talend.core.ui.token.RepositroyActionsTokenCollector"
|
||||
name="actions">
|
||||
</provider>
|
||||
<provider
|
||||
collector="org.talend.core.ui.token.AdditionalPackagesTokenCollector"
|
||||
description="installed addtional package, old iems, amc"
|
||||
id="org.talend.core.ui.token.AdditionalPackageTokenCollector"
|
||||
name="addtional package">
|
||||
</provider>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
|
||||
@@ -27,7 +27,6 @@ import org.talend.core.ui.component.ComponentPaletteUtilities;
|
||||
import org.talend.core.ui.component.ComponentsFactoryProvider;
|
||||
import org.talend.core.ui.services.IDesignerCoreUIService;
|
||||
import org.talend.core.ui.services.IRulesProviderService;
|
||||
import org.talend.core.ui.token.TokenCollectorFactory;
|
||||
|
||||
/**
|
||||
* DOC ggu class global comment. Detailled comment
|
||||
@@ -108,9 +107,4 @@ public class CoreUIService implements ICoreUIService {
|
||||
designerCoreUIService.loadComponentsFromProviders(type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetDataCollectorData() {
|
||||
TokenCollectorFactory.getFactory().reset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-202121 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.token;
|
||||
|
||||
import org.talend.commons.utils.time.PropertiesCollectorUtil;
|
||||
|
||||
import us.monoid.json.JSONObject;
|
||||
|
||||
public class AdditionalPackagesTokenCollector extends AbstractTokenCollector {
|
||||
|
||||
public AdditionalPackagesTokenCollector() {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject collect() throws Exception {
|
||||
String records = PropertiesCollectorUtil.getAdditionalPackageRecording();
|
||||
|
||||
JSONObject allRecords;
|
||||
try {
|
||||
allRecords = new JSONObject(records);
|
||||
} catch (Exception e) {
|
||||
// the value is not set, or is empty
|
||||
allRecords = new JSONObject();
|
||||
allRecords.put(PropertiesCollectorUtil.getAdditionalPackagePreferenceNode(), new JSONObject());
|
||||
}
|
||||
|
||||
return allRecords;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2020 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
</appInfo>
|
||||
<documentation>
|
||||
Talend Community Edition<br>
|
||||
Copyright (C) 2006-2021 Talend - www.talend.com
|
||||
Copyright (C) 2006-2019 Talend - www.talend.com
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
</appInfo>
|
||||
<documentation>
|
||||
Talend Community Edition<br>
|
||||
Copyright (C) 2006-2021 Talend - www.talend.com
|
||||
Copyright (C) 2006-2019 Talend - www.talend.com
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
</appInfo>
|
||||
<documentation>
|
||||
Talend Community Edition<br>
|
||||
Copyright (C) 2006-2021 Talend - www.talend.com
|
||||
Copyright (C) 2006-2019 Talend - www.talend.com
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
</appinfo>
|
||||
<documentation>
|
||||
Talend Community Edition<br>
|
||||
Copyright (C) 2006-2021 Talend - www.talend.com
|
||||
Copyright (C) 2006-2019 Talend - www.talend.com
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ package org.talend.core.model.repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.IllegalPluginConfigurationException;
|
||||
import org.talend.commons.utils.workbench.extensions.ExtensionImplementationProvider;
|
||||
import org.talend.core.model.process.IExternalNode;
|
||||
@@ -36,8 +35,7 @@ public class ExternalNodesFactory {
|
||||
try {
|
||||
listComponents = ExtensionImplementationProvider.getInstance(ExtensionPointFactory.EXTERNAL_COMPONENT, extensionId);
|
||||
} catch (IllegalPluginConfigurationException e) {
|
||||
ExceptionHandler.process(new Exception("plugin:" + extensionId + " not found", e)); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return null; //temporary
|
||||
throw new RuntimeException("plugin:" + extensionId + " not found", e); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
return listComponents.get(0);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.core.i18n.Messages;
|
||||
import org.talend.core.model.context.ContextUtils;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.properties.Item;
|
||||
@@ -78,9 +79,6 @@ public class ContextOrderProperties extends Properties {
|
||||
@Override
|
||||
public Object put(Object key, Object value) {
|
||||
keys.add(key);
|
||||
if (value == null) {
|
||||
return super.remove(key);
|
||||
}
|
||||
return super.put(key, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,11 +19,9 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.utils.workbench.resources.ResourceUtils;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
@@ -38,7 +36,6 @@ import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.RoutineItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.routines.CodesJarInfo;
|
||||
import org.talend.core.runtime.services.IDesignerMavenService;
|
||||
import org.talend.core.ui.ITestContainerProviderService;
|
||||
import org.talend.core.utils.CodesJarResourceCache;
|
||||
@@ -154,9 +151,9 @@ public final class CodeGeneratorRoutine {
|
||||
}
|
||||
if (routinesParameterTypes != null) {
|
||||
routinesParameterTypes.stream().filter(r -> r.getType() != null)
|
||||
.map(r -> CodesJarResourceCache.getCodesJarById(r.getId()))
|
||||
.filter(info -> info != null && hasInnerCodes(info))
|
||||
.forEach(info -> neededCodesJars.add(designerMavenService.getImportGAVPackageForCodesJar(info)));
|
||||
.map(r -> CodesJarResourceCache.getCodesJarById(r.getId())).filter(info -> info != null)
|
||||
.forEach(info -> neededCodesJars.add(designerMavenService.getImportGAVPackageForCodesJar(
|
||||
info.getProjectTechName(), info.getProperty().getItem())));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -164,18 +161,6 @@ public final class CodeGeneratorRoutine {
|
||||
return neededCodesJars;
|
||||
}
|
||||
|
||||
private static boolean hasInnerCodes(CodesJarInfo info) {
|
||||
try {
|
||||
IFolder folder = ResourceUtils
|
||||
.getProject(ProjectManager.getInstance().getProjectFromProjectTechLabel(info.getProjectTechName()))
|
||||
.getFolder(ERepositoryObjectType.getFolderName(info.getType())).getFolder(info.getLabel());
|
||||
return folder.exists() && folder.members().length > 0;
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Deprecate for won't use pigudf any more
|
||||
|
||||
@@ -22,12 +22,9 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -67,6 +64,8 @@ import org.talend.core.language.LanguageManager;
|
||||
import org.talend.core.model.components.ComponentCategory;
|
||||
import org.talend.core.model.components.EComponentType;
|
||||
import org.talend.core.model.components.IComponent;
|
||||
import org.talend.core.model.components.IComponentsFactory;
|
||||
import org.talend.core.model.components.IComponentsService;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.metadata.IMetadataColumn;
|
||||
@@ -84,16 +83,16 @@ import org.talend.core.model.process.JobInfo;
|
||||
import org.talend.core.model.process.ProcessUtils;
|
||||
import org.talend.core.model.process.ReplaceNodesInProcessProvider;
|
||||
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.properties.Property;
|
||||
import org.talend.core.model.relationship.Relation;
|
||||
import org.talend.core.model.relationship.RelationshipItemBuilder;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.repository.RepositoryManager;
|
||||
import org.talend.core.model.repository.job.JobResource;
|
||||
import org.talend.core.model.repository.job.JobResourceManager;
|
||||
import org.talend.core.model.routines.CodesJarInfo;
|
||||
import org.talend.core.model.routines.RoutinesUtil;
|
||||
import org.talend.core.model.utils.JavaResourcesHelper;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
@@ -110,7 +109,6 @@ import org.talend.core.services.ISVNProviderService;
|
||||
import org.talend.core.ui.IJobletProviderService;
|
||||
import org.talend.core.ui.ITestContainerProviderService;
|
||||
import org.talend.core.utils.BitwiseOptionUtils;
|
||||
import org.talend.core.utils.CodesJarResourceCache;
|
||||
import org.talend.designer.core.IDesignerCoreService;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
@@ -176,11 +174,11 @@ public class ProcessorUtilities {
|
||||
|
||||
private static final Set<ModuleNeeded> retrievedJarsForCurrentBuild = new HashSet<ModuleNeeded>();
|
||||
|
||||
private static final Map<String, Integer> esbJobs = new HashMap<String, Integer>();
|
||||
private static final Set<String> esbJobs = new HashSet<String>();
|
||||
|
||||
private static boolean isDebug = false;
|
||||
|
||||
private static boolean isDynamicJobAndCITest = false;
|
||||
private static boolean isCIMode = false;
|
||||
|
||||
private static JobInfo mainJobInfo;
|
||||
|
||||
@@ -423,76 +421,6 @@ public class ProcessorUtilities {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean checkProcessLoopDependencies(IProcess mainProcess, String id, String version,
|
||||
LinkedList<String> pathlink, Map<String, String> idToLatestVersion) {
|
||||
if (ItemCacheManager.LATEST_VERSION.contains(version)) {
|
||||
if (idToLatestVersion.get(id) == null) {
|
||||
ProcessItem processItem = ItemCacheManager.getProcessItem(id);
|
||||
version = processItem.getProperty().getVersion();
|
||||
idToLatestVersion.put(id, version);
|
||||
} else {
|
||||
version = idToLatestVersion.get(id);
|
||||
}
|
||||
}
|
||||
String pathNode = id + "-" + version;
|
||||
if (pathlink.contains(pathNode)) {
|
||||
return true;
|
||||
}
|
||||
pathlink.add(pathNode);
|
||||
|
||||
boolean hasLoop = false;
|
||||
List<? extends INode> processNodes = mainProcess.getProcessNodes();
|
||||
for (INode node : processNodes) {
|
||||
if (!node.isActivate()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
IElementParameter processIdParam = node.getElementParameter("PROCESS_TYPE_PROCESS");
|
||||
if (processIdParam != null && StringUtils.isNotBlank((String) processIdParam.getValue())) {
|
||||
String jobIds = (String) processIdParam.getValue();
|
||||
String subNodeversion = (String) node.getElementParameter("PROCESS_TYPE_VERSION").getValue();
|
||||
for (String jobId : jobIds.split(ProcessorUtilities.COMMA)) {
|
||||
if (StringUtils.isBlank(jobId)) {
|
||||
continue;
|
||||
}
|
||||
ProcessItem processItem = ItemCacheManager.getProcessItem(jobId, subNodeversion);
|
||||
IDesignerCoreService service = CorePlugin.getDefault().getDesignerCoreService();
|
||||
IProcess subProcess = service.getProcessFromProcessItem(processItem);
|
||||
hasLoop = checkProcessLoopDependencies(subProcess, jobId, subNodeversion, pathlink, idToLatestVersion);
|
||||
if (hasLoop) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IJobletProviderService.class)) {
|
||||
IJobletProviderService jobletService = GlobalServiceRegister.getDefault()
|
||||
.getService(IJobletProviderService.class);
|
||||
if (jobletService != null) {
|
||||
IProcess jobletProcess = jobletService.getJobletGEFProcessFromNode(node);
|
||||
if (jobletProcess != null) {
|
||||
String jobletId = jobletProcess.getId();
|
||||
IElementParameter projectTecNameParam = jobletProcess.getElementParameter("PROJECT_TECHNICAL_NAME");
|
||||
if (projectTecNameParam != null && StringUtils.isNotBlank((String) projectTecNameParam.getValue())) {
|
||||
jobletId = projectTecNameParam.getValue() + ":" + jobletId;
|
||||
}
|
||||
hasLoop = checkProcessLoopDependencies(jobletProcess, jobletId, jobletProcess.getVersion(), pathlink,
|
||||
idToLatestVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasLoop) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasLoop) {
|
||||
pathlink.removeLast();
|
||||
}
|
||||
|
||||
return hasLoop;
|
||||
}
|
||||
|
||||
private static IProcessor generateCode(IProcessor processor2, JobInfo jobInfo, String selectedContextName,
|
||||
boolean statistics, boolean trace, boolean needContext, int option, IProgressMonitor progressMonitor)
|
||||
throws ProcessorException {
|
||||
@@ -592,10 +520,11 @@ public class ProcessorUtilities {
|
||||
jobInfo.setProcessor(processor);
|
||||
|
||||
if (isMainJob && selectedProcessItem != null) {
|
||||
Property property = selectedProcessItem.getProperty();
|
||||
String jobId = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel() + ":" + property.getId();
|
||||
hasLoopDependency = checkProcessLoopDependencies(currentProcess, jobId, property.getVersion(),
|
||||
new LinkedList<String>(), new HashMap<String, String>());
|
||||
Relation mainRelation = new Relation();
|
||||
mainRelation.setId(jobInfo.getJobId());
|
||||
mainRelation.setVersion(jobInfo.getJobVersion());
|
||||
mainRelation.setType(RelationshipItemBuilder.JOB_RELATION);
|
||||
hasLoopDependency = checkLoopDependencies(mainRelation, new HashMap<String, String>());
|
||||
// clean the previous code in case it has deleted subjob
|
||||
cleanSourceFolder(progressMonitor, currentProcess, processor);
|
||||
}
|
||||
@@ -698,6 +627,233 @@ public class ProcessorUtilities {
|
||||
return processor;
|
||||
}
|
||||
|
||||
public static boolean checkLoopDependencies(Relation mainJobInfo, Map<String, String> idToLastestVersionMap)
|
||||
throws ProcessorException {
|
||||
List<Relation> itemsJobRelatedTo = getItemsRelation(mainJobInfo, idToLastestVersionMap);
|
||||
List<Relation> relationChecked = new ArrayList<>();
|
||||
relationChecked.add(mainJobInfo);
|
||||
return checkLoopDependencies(mainJobInfo, mainJobInfo, itemsJobRelatedTo, relationChecked, idToLastestVersionMap);
|
||||
}
|
||||
|
||||
private static boolean checkLoopDependencies(Relation mainRelation, Relation currentRelation,
|
||||
List<Relation> itemsJobRelatedTo,
|
||||
List<Relation> relationChecked, Map<String, String> idToLastestVersionMap) throws ProcessorException {
|
||||
boolean hasDependency = false;
|
||||
for (Relation relation : itemsJobRelatedTo) {
|
||||
try {
|
||||
// means the tRunjob deactivate, or one of the specific version tRunjon deactivate, skip
|
||||
Map<String, Set<String>> actTrunjobHM = getActivateTRunjobMap(currentRelation.getId(),
|
||||
currentRelation.getVersion());
|
||||
if (actTrunjobHM.get(relation.getId()) == null
|
||||
|| !actTrunjobHM.get(relation.getId()).contains(relation.getVersion())) {
|
||||
continue;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new ProcessorException(e);
|
||||
}
|
||||
|
||||
hasDependency = relation.getId().equals(mainRelation.getId())
|
||||
&& relation.getVersion().equals(mainRelation.getVersion());
|
||||
if (!hasDependency) {
|
||||
List<Relation> itemsChildJob = getItemsRelation(relation, idToLastestVersionMap);
|
||||
if (!relationChecked.contains(relation)) {
|
||||
relationChecked.add(relation);
|
||||
hasDependency = checkLoopDependencies(mainRelation, relation, itemsChildJob, relationChecked,
|
||||
idToLastestVersionMap);
|
||||
}
|
||||
if (!hasDependency) {
|
||||
for (Relation childRelation : itemsChildJob) {
|
||||
|
||||
try {
|
||||
// means the tRunjob deactivate, or one of the specific version tRunjon deactivate, skip
|
||||
Map<String, Set<String>> activateTRunjobMap = getActivateTRunjobMap(relation.getId(),
|
||||
relation.getVersion());
|
||||
if (activateTRunjobMap.get(childRelation.getId()) == null
|
||||
|| !activateTRunjobMap.get(childRelation.getId()).contains(childRelation.getVersion())) {
|
||||
continue;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new ProcessorException(e);
|
||||
}
|
||||
|
||||
hasDependency = checkLoopDependencies(childRelation, idToLastestVersionMap);
|
||||
if (hasDependency) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasDependency) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return hasDependency;
|
||||
}
|
||||
|
||||
private static Map<String, Set<String>> getActivateTRunjobMap(String id, String version) throws PersistenceException {
|
||||
Map<String, Set<String>> actTrunjobHM = new HashMap<String, Set<String>>();
|
||||
ProcessType processType = null;
|
||||
try {
|
||||
IRepositoryViewObject currentJobObject = ProxyRepositoryFactory.getInstance().getSpecificVersion(id, version, true);
|
||||
if (currentJobObject != null) {
|
||||
Item item = currentJobObject.getProperty().getItem();
|
||||
if (item instanceof ProcessItem) {
|
||||
processType = ((ProcessItem) item).getProcess();
|
||||
} else if (item instanceof JobletProcessItem) {
|
||||
processType = ((JobletProcessItem) item).getJobletProcess();
|
||||
}
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
if (processType != null) {
|
||||
List<Project> allProjects = new ArrayList<Project>();
|
||||
allProjects.add(ProjectManager.getInstance().getCurrentProject());
|
||||
allProjects.addAll(ProjectManager.getInstance().getAllReferencedProjects());
|
||||
|
||||
List<String> jobletsComponentsList = new ArrayList<String>();
|
||||
IComponentsFactory componentsFactory = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IComponentsService.class)) {
|
||||
IComponentsService compService = GlobalServiceRegister.getDefault()
|
||||
.getService(IComponentsService.class);
|
||||
if (compService != null) {
|
||||
componentsFactory = compService.getComponentsFactory();
|
||||
for (IComponent component : componentsFactory.readComponents()) {
|
||||
if (component.getComponentType() == EComponentType.JOBLET) {
|
||||
jobletsComponentsList.add(component.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String jobletPaletteType = null;
|
||||
String frameWork = processType.getFramework();
|
||||
if (StringUtils.isBlank(frameWork)) {
|
||||
jobletPaletteType = ComponentCategory.CATEGORY_4_DI.getName();
|
||||
} else if (frameWork.equals(HadoopConstants.FRAMEWORK_SPARK)) {
|
||||
jobletPaletteType = ComponentCategory.CATEGORY_4_SPARK.getName();
|
||||
} else if (frameWork.equals(HadoopConstants.FRAMEWORK_SPARK_STREAMING)) {
|
||||
jobletPaletteType = ComponentCategory.CATEGORY_4_SPARKSTREAMING.getName();
|
||||
}
|
||||
|
||||
for (Object nodeObject : processType.getNode()) {
|
||||
NodeType node = (NodeType) nodeObject;
|
||||
// not tRunjob && not joblet then continue
|
||||
if (!node.getComponentName().equals("tRunJob") && !jobletsComponentsList.contains(node.getComponentName())) { // $NON-NLS-1$
|
||||
continue;
|
||||
}
|
||||
boolean nodeActivate = true;
|
||||
String processIds = null;
|
||||
String processVersion = null;
|
||||
for (Object elementParam : node.getElementParameter()) {
|
||||
ElementParameterType elemParamType = (ElementParameterType) elementParam;
|
||||
if ("PROCESS:PROCESS_TYPE_PROCESS".equals(elemParamType.getName())) { // $NON-NLS-1$
|
||||
processIds = elemParamType.getValue();
|
||||
if (StringUtils.isNotBlank(processIds)) {
|
||||
for (String jobId : processIds.split(ProcessorUtilities.COMMA)) {
|
||||
if (actTrunjobHM.get(jobId) == null) {
|
||||
actTrunjobHM.put(jobId, new HashSet<String>());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ("PROCESS:PROCESS_TYPE_VERSION".equals(elemParamType.getName()) // $NON-NLS-1$
|
||||
|| "PROCESS_TYPE_VERSION".equals(elemParamType.getName())) { // $NON-NLS-1$
|
||||
processVersion = elemParamType.getValue();
|
||||
} else if ("ACTIVATE".equals(elemParamType.getName())) { // $NON-NLS-1$
|
||||
nodeActivate = Boolean.parseBoolean(elemParamType.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
if (nodeActivate) {
|
||||
if (StringUtils.isNotBlank(processIds)) {
|
||||
for (String jobId : processIds.split(ProcessorUtilities.COMMA)) {
|
||||
String actualVersion = processVersion;
|
||||
if (RelationshipItemBuilder.LATEST_VERSION.equals(processVersion)) {
|
||||
for (Project project : allProjects) {
|
||||
IRepositoryViewObject lastVersion = null;
|
||||
lastVersion = ProxyRepositoryFactory.getInstance().getLastVersion(project, jobId);
|
||||
if (lastVersion != null) {
|
||||
actualVersion = lastVersion.getVersion();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (actTrunjobHM.get(jobId) != null) {
|
||||
actTrunjobHM.get(jobId).add(actualVersion);
|
||||
}
|
||||
|
||||
}
|
||||
} else if (componentsFactory != null && jobletPaletteType != null) {
|
||||
// for joblet
|
||||
IComponent cc = componentsFactory.get(node.getComponentName(), jobletPaletteType);
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IJobletProviderService.class)) {
|
||||
IJobletProviderService jobletService = GlobalServiceRegister.getDefault()
|
||||
.getService(IJobletProviderService.class);
|
||||
Property property = jobletService.getJobletComponentItem(cc);
|
||||
if (property != null && StringUtils.isNotBlank(property.getId())) {
|
||||
String jobletId = property.getId();
|
||||
if (actTrunjobHM.get(jobletId) == null) {
|
||||
actTrunjobHM.put(jobletId, new HashSet<String>());
|
||||
}
|
||||
String actualVersion = processVersion;
|
||||
if (RelationshipItemBuilder.LATEST_VERSION.equals(processVersion)) {
|
||||
for (Project project : allProjects) {
|
||||
IRepositoryViewObject lastVersion = null;
|
||||
lastVersion = ProxyRepositoryFactory.getInstance().getLastVersion(project, jobletId);
|
||||
if (lastVersion != null) {
|
||||
actualVersion = lastVersion.getVersion();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
actTrunjobHM.get(jobletId).add(actualVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return actTrunjobHM;
|
||||
}
|
||||
|
||||
private static List<Relation> getItemsRelation(Relation mainJobInfo, Map<String, String> idToLastestVersionMap) throws ProcessorException {
|
||||
List<Relation> itemsJobRelatedTo = new ArrayList<Relation>();
|
||||
try {
|
||||
List<Project> allProjects = new ArrayList<Project>();
|
||||
allProjects.add(ProjectManager.getInstance().getCurrentProject());
|
||||
allProjects.addAll(ProjectManager.getInstance().getAllReferencedProjects());
|
||||
RelationshipItemBuilder instance = RelationshipItemBuilder.getInstance();
|
||||
if (instance != null) {
|
||||
itemsJobRelatedTo.addAll(instance.getItemsChildRelatedTo(mainJobInfo.getId(), mainJobInfo.getVersion(),
|
||||
mainJobInfo.getType(), RelationshipItemBuilder.JOB_RELATION));
|
||||
itemsJobRelatedTo.addAll(instance.getItemsChildRelatedTo(mainJobInfo.getId(), mainJobInfo.getVersion(),
|
||||
mainJobInfo.getType(), RelationshipItemBuilder.JOBLET_RELATION));
|
||||
for (Relation relation : itemsJobRelatedTo) {
|
||||
if (relation.getVersion().equals(RelationshipItemBuilder.LATEST_VERSION)) {
|
||||
if (idToLastestVersionMap.containsKey(relation.getId())) {
|
||||
relation.setVersion(idToLastestVersionMap.get(relation.getId()));
|
||||
} else {
|
||||
for (Project project : allProjects) {
|
||||
IRepositoryViewObject lastVersion =
|
||||
ProxyRepositoryFactory.getInstance().getLastVersion(project, relation.getId());
|
||||
if (lastVersion != null) {
|
||||
relation.setVersion(lastVersion.getVersion());
|
||||
idToLastestVersionMap.put(relation.getId(), relation.getVersion());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
throw new ProcessorException(e);
|
||||
}
|
||||
|
||||
return itemsJobRelatedTo;
|
||||
}
|
||||
|
||||
private static void setNeededResources(final Map<String, Object> argumentsMap, JobInfo jobInfo) {
|
||||
argumentsMap.put(TalendProcessArgumentConstant.ARG_NEED_XMLMAPPINGS,
|
||||
@@ -943,8 +1099,8 @@ public class ProcessorUtilities {
|
||||
private static IProcessor generateCode(JobInfo jobInfo, String selectedContextName, boolean statistics,
|
||||
boolean trace, boolean needContext, int option, IProgressMonitor progressMonitor)
|
||||
throws ProcessorException {
|
||||
if (!BitwiseOptionUtils.containOption(option, GENERATE_WITHOUT_COMPILING) && jobInfo.getFatherJobInfo() == null) {
|
||||
buildCodesJavaProject(progressMonitor, jobInfo);
|
||||
if (!BitwiseOptionUtils.containOption(option, GENERATE_WITHOUT_COMPILING)) {
|
||||
CorePlugin.getDefault().getRunProcessService().buildCodesJavaProject(progressMonitor);
|
||||
}
|
||||
return generateCode(jobInfo, selectedContextName, statistics, trace, needContext, true, option,
|
||||
progressMonitor);
|
||||
@@ -1046,9 +1202,11 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
if (isMainJob && selectedProcessItem != null) {
|
||||
Property property = selectedProcessItem.getProperty();
|
||||
hasLoopDependency = checkProcessLoopDependencies(currentProcess, property.getId(), property.getVersion(),
|
||||
new LinkedList<String>(), new HashMap<String, String>());
|
||||
Relation mainRelation = new Relation();
|
||||
mainRelation.setId(jobInfo.getJobId());
|
||||
mainRelation.setVersion(jobInfo.getJobVersion());
|
||||
mainRelation.setType(RelationshipItemBuilder.JOB_RELATION);
|
||||
hasLoopDependency = checkLoopDependencies(mainRelation, new HashMap<String, String>());
|
||||
// clean the previous code in case it has deleted subjob
|
||||
cleanSourceFolder(progressMonitor, currentProcess, processor);
|
||||
}
|
||||
@@ -1094,7 +1252,7 @@ public class ProcessorUtilities {
|
||||
checkMetadataDynamic(currentProcess, jobInfo);
|
||||
|
||||
int options = TalendProcessOptionConstants.MODULES_DEFAULT;
|
||||
if (isCIMode() && BitwiseOptionUtils.containOption(option, GENERATE_MAIN_ONLY)) {
|
||||
if (isCIMode && BitwiseOptionUtils.containOption(option, GENERATE_MAIN_ONLY)) {
|
||||
options |= TalendProcessOptionConstants.MODULES_WITH_CHILDREN;
|
||||
}
|
||||
Set<ModuleNeeded> neededLibraries = new HashSet<>();
|
||||
@@ -1545,16 +1703,13 @@ public class ProcessorUtilities {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isEsbComponentName(componentName)) {
|
||||
addEsbJob(jobInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void recordESBIncludingFlag(JobInfo jobInfo, int esbIncludingOption) {
|
||||
int includeESBFlag = jobInfo.getIncludeESBFlag();
|
||||
includeESBFlag |= esbIncludingOption;
|
||||
jobInfo.setIncludeESBFlag(includeESBFlag);
|
||||
}
|
||||
|
||||
static void setGenerationInfoWithChildrenJob(INode node, JobInfo jobInfo, final JobInfo subJobInfo) {
|
||||
final LastGenerationInfo generationInfo = LastGenerationInfo.getInstance();
|
||||
|
||||
@@ -1663,13 +1818,6 @@ public class ProcessorUtilities {
|
||||
|
||||
static boolean hasLoopDependency = false;
|
||||
|
||||
private static void resetBuildFlagsAndCaches() {
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will generate the code of the process and all of this sub process.
|
||||
*
|
||||
@@ -1684,10 +1832,15 @@ public class ProcessorUtilities {
|
||||
if (monitors == null) {
|
||||
monitor = new NullProgressMonitor();
|
||||
}
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
JobInfo jobInfo = new JobInfo(processName, contextName, version);
|
||||
IProcessor process = generateCode(jobInfo, contextName, statistics, trace, true, GENERATE_ALL_CHILDS, monitor);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
return process;
|
||||
}
|
||||
|
||||
@@ -1707,9 +1860,14 @@ public class ProcessorUtilities {
|
||||
}
|
||||
JobInfo jobInfo = new JobInfo(processId, contextName, version);
|
||||
jobInfo.setApplyContextToChildren(applyContextToChildren);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
IProcessor process = generateCode(jobInfo, contextName, statistics, trace, true, GENERATE_ALL_CHILDS, monitor);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
return process;
|
||||
}
|
||||
|
||||
@@ -1724,9 +1882,14 @@ public class ProcessorUtilities {
|
||||
}
|
||||
JobInfo jobInfo = new JobInfo(process, contextName);
|
||||
jobInfo.setApplyContextToChildren(applyContextToChildren);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
IProcessor result = generateCode(jobInfo, contextName, statistics, trace, true, GENERATE_ALL_CHILDS, monitor);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1741,10 +1904,15 @@ public class ProcessorUtilities {
|
||||
}
|
||||
JobInfo jobInfo = new JobInfo(process, contextName, version);
|
||||
jobInfo.setApplyContextToChildren(applyContextToChildren);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
IProcessor result =
|
||||
generateCode(jobInfo, contextName, statistics, trace, needContext, GENERATE_ALL_CHILDS, monitor);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1768,9 +1936,14 @@ public class ProcessorUtilities {
|
||||
ProcessUtils.isOptionChecked(argumentsMap, TalendProcessArgumentConstant.ARG_NEED_CONTEXT);
|
||||
int option = ProcessUtils.getOptionValue(argumentsMap, TalendProcessArgumentConstant.ARG_GENERATE_OPTION, 0);
|
||||
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
IProcessor result = generateCode(jobInfo, contextName, statistics, trace, needContext, option, monitor);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1788,9 +1961,14 @@ public class ProcessorUtilities {
|
||||
JobInfo jobInfo = new JobInfo(process, contextName, version);
|
||||
jobInfo.setContext(context);
|
||||
jobInfo.setApplyContextToChildren(applyContextToChildren);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
result = generateCode(jobInfo, contextName, statistics, trace, true, GENERATE_ALL_CHILDS, monitor);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -1829,9 +2007,14 @@ public class ProcessorUtilities {
|
||||
|
||||
public static IProcessor generateCode(ProcessItem process, String contextName, boolean statistics, boolean trace)
|
||||
throws ProcessorException {
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
IProcessor returnValue = generateCode(process, contextName, statistics, trace, false);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
@@ -1853,19 +2036,29 @@ public class ProcessorUtilities {
|
||||
jobInfo = new JobInfo(process, context);
|
||||
}
|
||||
jobInfo.setApplyContextToChildren(applyToChildren);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
IProcessor genCode = generateCode(jobInfo, context.getName(), statistics, trace, contextProperties,
|
||||
GENERATE_ALL_CHILDS, new NullProgressMonitor());
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
return genCode;
|
||||
}
|
||||
|
||||
public static IProcessor generateCode(IProcess process, IContext context, boolean statistics, boolean trace,
|
||||
boolean properties) throws ProcessorException {
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
IProcessor returnValue =
|
||||
generateCode(process, context, statistics, trace, properties, new NullProgressMonitor());
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
@@ -1886,10 +2079,15 @@ public class ProcessorUtilities {
|
||||
} else {
|
||||
jobInfo = new JobInfo(process, context);
|
||||
}
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
IProcessor genCode = generateCode(jobInfo, context.getName(), statistics, trace, properties,
|
||||
GENERATE_ALL_CHILDS, progressMonitor);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
return genCode;
|
||||
}
|
||||
|
||||
@@ -1898,6 +2096,8 @@ public class ProcessorUtilities {
|
||||
|
||||
updateCodeSources();
|
||||
|
||||
CorePlugin.getDefault().getRunProcessService().buildCodesJavaProject(progressMonitor);
|
||||
|
||||
// achen modify to fix 0006107
|
||||
ProcessItem pItem = null;
|
||||
|
||||
@@ -1915,9 +2115,6 @@ public class ProcessorUtilities {
|
||||
} else {
|
||||
jobInfo = new JobInfo(process, context);
|
||||
}
|
||||
|
||||
buildCodesJavaProject(progressMonitor, jobInfo);
|
||||
|
||||
final boolean oldMeasureActived = TimeMeasure.measureActive;
|
||||
if (!oldMeasureActived) { // not active before.
|
||||
TimeMeasure.display = TimeMeasure.displaySteps = TimeMeasure.measureActive = CommonsPlugin.isDebugMode();
|
||||
@@ -1926,10 +2123,15 @@ public class ProcessorUtilities {
|
||||
+ (jobInfo.getJobName() != null ? jobInfo.getJobName() : jobInfo.getJobId());
|
||||
TimeMeasure.begin(timeMeasureGenerateCodesId);
|
||||
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
IProcessor genCode = generateCode(processor, jobInfo, context.getName(), statistics, trace, properties,
|
||||
GENERATE_ALL_CHILDS, progressMonitor);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
|
||||
TimeMeasure.end(timeMeasureGenerateCodesId);
|
||||
// if active before, not disable and active still.
|
||||
@@ -1945,23 +2147,18 @@ public class ProcessorUtilities {
|
||||
updateCodeSources();
|
||||
// achen modify to fix 0006107
|
||||
JobInfo jobInfo = new JobInfo(process, context);
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
esbJobs.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
IProcessor genCode = generateCode(jobInfo, context.getName(), statistics, trace, properties, option,
|
||||
new NullProgressMonitor());
|
||||
resetBuildFlagsAndCaches();
|
||||
jobList.clear();
|
||||
hasLoopDependency = false;
|
||||
mainJobInfo = null;
|
||||
return genCode;
|
||||
}
|
||||
|
||||
private static void buildCodesJavaProject(IProgressMonitor monitor, JobInfo jobInfo) {
|
||||
Set<JobInfo> allJobInfo = getChildrenJobInfo(jobInfo.getProcessItem(), false, true);
|
||||
allJobInfo.add(jobInfo);
|
||||
Set<CodesJarInfo> toUpdate = allJobInfo.stream().filter(childInfo -> !childInfo.isTestContainer())
|
||||
.flatMap(childInfo -> RoutinesUtil.getRoutinesParametersFromJobInfo(childInfo).stream())
|
||||
.filter(r -> r.getType() != null).map(r -> CodesJarResourceCache.getCodesJarById(r.getId()))
|
||||
.filter(info -> info != null).collect(Collectors.toSet());
|
||||
IRunProcessService.get().buildCodesJavaProject(monitor, toUpdate);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated seems never use this one
|
||||
@@ -2264,15 +2461,8 @@ public class ProcessorUtilities {
|
||||
}
|
||||
JobInfo jobInfo = new JobInfo(testItem, testProcess.getDefaultContext());
|
||||
jobInfo.setTestContainer(true);
|
||||
jobInfos.add(jobInfo);
|
||||
jobInfo.setFatherJobInfo(parentJobInfo);
|
||||
if (!jobInfos.contains(jobInfo)) {
|
||||
jobInfos.add(jobInfo);
|
||||
|
||||
// if job contains testcase, we need to get joblets of testcase and add them to the job pom, we
|
||||
// must
|
||||
// pass parentJobInfo instead of testProcess, otherwise joblet will be filtered out
|
||||
getSubjobInfo(testProcess.getNode(), testProcess, parentJobInfo, jobInfos, firstChildOnly, includeJoblet);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2290,8 +2480,6 @@ public class ProcessorUtilities {
|
||||
} else if (frameWork.equals(HadoopConstants.FRAMEWORK_SPARK_STREAMING)) {
|
||||
jobletPaletteType = ComponentCategory.CATEGORY_4_SPARKSTREAMING.getName();
|
||||
}
|
||||
|
||||
boolean hasChildrenIncludeESB = false;
|
||||
for (NodeType node : nodes) {
|
||||
boolean activate = true;
|
||||
// check if node is active at least.
|
||||
@@ -2306,8 +2494,8 @@ public class ProcessorUtilities {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!firstChildOnly && isEsbComponentName(node.getComponentName())) {
|
||||
recordESBIncludingFlag(parentJobInfo, TalendProcessOptionConstants.ISESB_CURRENT_INCLUDE);
|
||||
if (isEsbComponentName(node.getComponentName())) {
|
||||
addEsbJob(parentJobInfo);
|
||||
}
|
||||
|
||||
boolean isCTalendJob = "cTalendJob".equalsIgnoreCase(node.getComponentName());
|
||||
@@ -2336,18 +2524,6 @@ public class ProcessorUtilities {
|
||||
jobInfo.setFatherJobInfo(parentJobInfo);
|
||||
if (!firstChildOnly) {
|
||||
getAllJobInfo(processItem.getProcess(), jobInfo, jobInfos, firstChildOnly, includeJoblet);
|
||||
if (jobInfo.getIncludeESBFlag() >= 2) {
|
||||
hasChildrenIncludeESB = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Optional<JobInfo> infoOptional = jobInfos.stream().filter(info -> info.equals(jobInfo))
|
||||
.findFirst();
|
||||
if (infoOptional.isPresent()) {
|
||||
JobInfo matchJobInfo = infoOptional.get();
|
||||
if (matchJobInfo.getIncludeESBFlag() >= 2) {
|
||||
hasChildrenIncludeESB = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2399,16 +2575,6 @@ public class ProcessorUtilities {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// checked done set the esb including option
|
||||
if (!firstChildOnly) {
|
||||
recordESBIncludingFlag(parentJobInfo, TalendProcessOptionConstants.ISESB_CHECKED);
|
||||
if (hasChildrenIncludeESB) {
|
||||
recordESBIncludingFlag(parentJobInfo, TalendProcessOptionConstants.ISESB_CHILDREN_INCLUDE);
|
||||
}
|
||||
esbJobs.put(esbJobKey(parentJobInfo.getJobId(), parentJobInfo.getJobVersion()), parentJobInfo.getIncludeESBFlag());
|
||||
}
|
||||
|
||||
return jobInfos;
|
||||
}
|
||||
|
||||
@@ -2625,21 +2791,9 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
public static boolean isEsbJob(IProcess process, boolean checkCurrentProcess) {
|
||||
// get includeESBFlag from cache
|
||||
if (process instanceof IProcess2) {
|
||||
Property property = ((IProcess2) process).getProperty();
|
||||
String esbJobKey = esbJobKey(property.getId(), property.getVersion());
|
||||
if (esbJobs.get(esbJobKey) != null) {
|
||||
Integer esbOptions = esbJobs.get(esbJobKey);
|
||||
if (BitwiseOptionUtils.containOption(esbOptions, TalendProcessOptionConstants.ISESB_CHECKED)) {
|
||||
return checkCurrentProcess
|
||||
? BitwiseOptionUtils.containOption(esbOptions, TalendProcessOptionConstants.ISESB_CURRENT_INCLUDE)
|
||||
: esbOptions > 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (process instanceof IProcess2) {
|
||||
|
||||
if (checkCurrentProcess) {
|
||||
for (INode n : process.getGraphicalNodes()) {
|
||||
if (isEsbComponentName(n.getComponent().getName())) {
|
||||
@@ -2665,6 +2819,17 @@ public class ProcessorUtilities {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void addEsbJob(JobInfo jobInfo) {
|
||||
if (esbJobs.contains(esbJobKey(jobInfo.getJobId(), jobInfo.getJobVersion()))) {
|
||||
return;
|
||||
}
|
||||
|
||||
esbJobs.add(esbJobKey(jobInfo.getJobId(), jobInfo.getJobVersion()));
|
||||
if (jobInfo.getFatherJobInfo() != null) {
|
||||
addEsbJob(jobInfo.getFatherJobInfo());
|
||||
}
|
||||
}
|
||||
|
||||
private static String esbJobKey(String processId, String version) {
|
||||
return processId + "_" + version;
|
||||
}
|
||||
@@ -2692,36 +2857,11 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
public static boolean isCIMode() {
|
||||
// if it's CI mode , then the system property of maven.local.repository will store the value of studio
|
||||
// m2 path,otherwise it's null
|
||||
return System.getProperty("maven.local.repository") != null;
|
||||
return isCIMode;
|
||||
}
|
||||
|
||||
|
||||
public static void setExportConfig(boolean export) {
|
||||
setExportConfig(JavaUtils.JAVA_APP_NAME, null, null, export, new Date());
|
||||
public static void setCIMode(boolean isCIMode) {
|
||||
ProcessorUtilities.isCIMode = isCIMode;
|
||||
}
|
||||
|
||||
public static boolean isJobTest(String processId, String contextName, String version) {
|
||||
for (JobInfo jobInfo : jobList) {
|
||||
if (jobInfo.getJobId().equals(processId)) {
|
||||
if (contextName != null && !contextName.equals("") && !jobInfo.getContextName().equals(contextName)) {
|
||||
continue;
|
||||
}
|
||||
if (version != null && !version.equals(jobInfo.getJobVersion())) {
|
||||
continue;
|
||||
}
|
||||
return jobInfo.isTestContainer();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void setDynamicJobAndCITest(boolean dynamicJobAndCITest) {
|
||||
isDynamicJobAndCITest = dynamicJobAndCITest;
|
||||
}
|
||||
|
||||
public static boolean isDynamicJobAndCITest() {
|
||||
return isDynamicJobAndCITest;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<properties>
|
||||
<maven.resolver.version>1.3.1</maven.resolver.version>
|
||||
<wagon.version>3.4.3</wagon.version>
|
||||
<wagon.version>3.0.0</wagon.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -14,12 +14,6 @@
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@@ -23,10 +23,6 @@
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -95,11 +91,6 @@
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.13</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<dependency>
|
||||
<groupId>com.thoughtworks.xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.4.16</version>
|
||||
<version>1.4.15</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -22,23 +22,11 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -49,12 +37,6 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
||||
@@ -192,12 +192,12 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-core-asl</artifactId>
|
||||
<version>${jackson-codehaus.version}</version>
|
||||
<version>1.9.14-TALEND</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-mapper-asl</artifactId>
|
||||
<version>${jackson-codehaus.version}</version>
|
||||
<version>1.9.14-TALEND</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@@ -21,6 +21,5 @@
|
||||
</modules>
|
||||
<properties>
|
||||
<m2.fasterxml.jackson.version>2.11.4</m2.fasterxml.jackson.version>
|
||||
<jackson-codehaus.version>1.9.15-TALEND</jackson-codehaus.version>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13.2</version>
|
||||
<version>4.13</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<artifactId>studio-tacokit-dependencies</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<properties>
|
||||
<tacokit.components.version>1.21.0-SNAPSHOT</tacokit.components.version>
|
||||
<tacokit.components.version>1.20.0-SNAPSHOT</tacokit.components.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<tcomp.version>1.32.0</tcomp.version>
|
||||
<tcomp.version>1.30.0</tcomp.version>
|
||||
<slf4j.version>1.7.25</slf4j.version>
|
||||
</properties>
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user