Compare commits

..

12 Commits

Author SHA1 Message Date
apoltavtsev
526a25c1d6 Update LocalRepositoryFactory.java 2021-04-21 10:56:21 +02:00
apoltavtsev
032815cee6 Update PropertiesPackageImpl.java 2021-04-21 10:54:24 +02:00
apoltavtsev
f6bb55ee73 Update ProjectImpl.java 2021-04-21 10:53:17 +02:00
apoltavtsev
384437ce2f Update PropertiesPackage.java 2021-04-21 10:51:50 +02:00
apoltavtsev
cd1a6f1941 Update PropertiesPackage.java 2021-04-21 10:51:15 +02:00
apoltavtsev
15b909fefc Update Project.java 2021-04-21 10:47:27 +02:00
apoltavtsev
76782144d2 Update properties.genmodel 2021-04-21 10:46:43 +02:00
apoltavtsev
6f726b2c57 Update properties.ecore 2021-04-21 10:45:59 +02:00
apoltavtsev
dde0daffd2 Update ModulesNeededProvider.java 2021-04-21 10:44:35 +02:00
apoltavtsev
aaf34ef8ca Update ExtensionModuleManager.java 2021-04-21 10:43:41 +02:00
apoltavtsev
6a272cdb18 Update ProcessUtils.java 2021-04-21 10:43:03 +02:00
apoltavtsev
f38d25fbfc Update Project.java 2021-04-21 10:42:02 +02:00
28 changed files with 1856 additions and 1899 deletions

View File

@@ -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.

View File

@@ -58,6 +58,21 @@ public class Project {
private IReferenceProjectProvider referenceProjectProvider;
private boolean camel3 = false;
public boolean isCamel3() {
return "3".equals(project.getCamelFamilyVersion());
}
public void setCamel3(boolean camel3) {
if (camel3) {
project.setCamelFamilyVersion("3");
}
this.camel3 = camel3;
}
/**
* Getter for mainProject.
*

View File

@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.text.StringEscapeUtils;
import org.eclipse.emf.common.util.EList;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
@@ -62,7 +63,6 @@ import org.talend.designer.core.model.utils.emf.talendfile.RoutinesParameterType
import org.talend.designer.runprocess.ItemCacheManager;
import org.talend.repository.ProjectManager;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.apache.commons.text.StringEscapeUtils;
/**
* DOC bqian class global comment. Detailled comment
@@ -1032,6 +1032,12 @@ public final class ProcessUtils {
return hasJettyEndpoint;
}
public static boolean isCamel3(IProcess process) {
Project project = ProjectManager.getInstance().getCurrentProject();
return project.isCamel3();
}
private static boolean hasJettyEndpoint(EList<NodeType> nodesList) {
for (NodeType node : nodesList) {
if ("cMessagingEndpoint".equals(node.getComponentName())) {

View File

@@ -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()) {

View File

@@ -67,6 +67,9 @@ 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.context.ContextUtils;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.Project;
import org.talend.core.model.metadata.IMetadataColumn;
@@ -180,6 +183,8 @@ public class ProcessorUtilities {
private static boolean isDebug = false;
private static boolean isCIMode = false;
private static boolean isDynamicJobAndCITest = false;
private static JobInfo mainJobInfo;
@@ -1094,7 +1099,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<>();
@@ -2692,11 +2697,12 @@ 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 setCIMode(boolean isCIMode) {
ProcessorUtilities.isCIMode = isCIMode;
}
public static void setExportConfig(boolean export) {
setExportConfig(JavaUtils.JAVA_APP_NAME, null, null, export, new Date());

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -11,7 +11,7 @@
<packaging>pom</packaging>
<properties>
<tcomp.version>1.32.0</tcomp.version>
<tcomp.version>1.31.0</tcomp.version>
<slf4j.version>1.7.25</slf4j.version>
</properties>

View File

@@ -33,7 +33,7 @@
<artifactItem>
<groupId>org.talend.studio</groupId>
<artifactId>studio-maven-repository</artifactId>
<version>7.4.1.v20210427</version>
<version>7.4.1.v20210416</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.basedir}/../repository</outputDirectory>

View File

@@ -31,11 +31,6 @@
</configuration>
<dependencies>
<!-- This dependency provides the implementation of compiler "jdt": -->
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-jdt</artifactId>
@@ -58,11 +53,6 @@
<artifactId>plexus-utils</artifactId>
<version>3.0.24</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.3.3</version>
</dependency>
</dependencies>
</plugin>
<plugin>
@@ -70,11 +60,6 @@
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
@@ -97,11 +82,6 @@
<artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
@@ -128,11 +108,6 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.24</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
</dependencies>
</plugin>

View File

@@ -97,7 +97,7 @@ public abstract class MavenCommandLauncher {
private Map<String, Object> argumentsMap;
private static final String REGEX_TEST_CASE_FAILURES_STR = "\\[ERROR\\] There are test failures.*\n";
private static final String REGEX_TEST_CASE_FAILURES_STR = "\\[ERROR\\] Tests run:.*\\[ERROR\\] There are test\\p{Print}+\n";
private static final Pattern REGEX_TEST_CASE_FAILURES = Pattern.compile(REGEX_TEST_CASE_FAILURES_STR, Pattern.DOTALL);

View File

@@ -355,9 +355,8 @@ public class PomIdsHelper {
public static boolean skipFolders() {
String projectTechName = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();
Project project = ProjectManager.getInstance().getProjectFromProjectTechLabel(projectTechName);
ProjectPreferenceManager preferenceManager = new ProjectPreferenceManager(project, DesignerMavenPlugin.PLUGIN_ID, false);
return preferenceManager.getBoolean(MavenConstants.SKIP_FOLDERS);
ProjectPreferenceManager manager = getPreferenceManager(projectTechName);
return manager.getBoolean(MavenConstants.SKIP_FOLDERS);
}
public static boolean isValidGroupId(String text) {

View File

@@ -22,7 +22,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.RegExUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
import org.talend.commons.exception.ExceptionHandler;
@@ -32,8 +33,10 @@ import org.talend.commons.utils.workbench.extensions.IExtensionPointLimiter;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ILibraryManagerService;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.Project;
import org.talend.designer.core.model.utils.emf.component.IMPORTType;
import org.talend.librariesmanager.i18n.Messages;
import org.talend.repository.ProjectManager;
/**
*
@@ -158,6 +161,8 @@ public class ExtensionModuleManager {
return clonedList;
}
Project project = ProjectManager.getInstance().getCurrentProject();
public List<ModuleNeeded> getModuleNeededForComponent(String context, IMPORTType importType) {
List<ModuleNeeded> importNeedsList = new ArrayList<ModuleNeeded>();
String id = null;
@@ -170,6 +175,12 @@ public class ExtensionModuleManager {
id = moduleGroup;
isGroup = true;
}
if (project != null && project.isCamel3() && StringUtils.startsWith(context, "c")
&& StringUtils.startsWith(id, "camel-")) {
id = RegExUtils.replaceFirst(id, "camel-", "camel3-");
}
List<ModuleNeeded> modulesNeeded = getModuleNeeded(id, isGroup);
for (ModuleNeeded moduleNeeded : modulesNeeded) {
String msg = importType.getMESSAGE();

View File

@@ -63,6 +63,7 @@ import org.talend.core.model.components.ComponentManager;
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.ILibrariesService;
import org.talend.core.model.general.ILibrariesService.IChangedLibrariesListener;
import org.talend.core.model.general.LibraryInfo;
import org.talend.core.model.general.ModuleNeeded;
@@ -83,7 +84,6 @@ import org.talend.core.model.routines.IRoutinesProvider;
import org.talend.core.runtime.maven.MavenArtifact;
import org.talend.core.runtime.maven.MavenUrlHelper;
import org.talend.core.runtime.process.TalendProcessOptionConstants;
import org.talend.core.ui.ITestContainerProviderService;
import org.talend.core.utils.CodesJarResourceCache;
import org.talend.core.utils.TalendCacheUtils;
import org.talend.core.utils.TalendQuoteUtils;
@@ -95,6 +95,7 @@ import org.talend.librariesmanager.model.service.CustomUriManager;
import org.talend.librariesmanager.model.service.LibrariesIndexManager;
import org.talend.librariesmanager.prefs.LibrariesManagerUtils;
import org.talend.repository.ProjectManager;
import org.talend.repository.documentation.ExportFileResource;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.IRepositoryService;
@@ -305,6 +306,7 @@ public class ModulesNeededProvider {
for (ModuleNeeded neededLibrary : neededLibraries) {
boolean alreadyInImports = false;
for (ModuleNeeded module : getModulesNeeded()) {
if (module == null) continue;
if (module != null && module.getModuleName() != null
&& module.getModuleName().equals(neededLibrary.getModuleName())) {
if (StringUtils.equals(module.getMavenUri(), neededLibrary.getMavenUri())) {
@@ -521,7 +523,7 @@ public class ModulesNeededProvider {
if (ComponentCategory.CATEGORY_4_CAMEL.getName().equals(process.getComponentsType())) {
// route do not save any relationship with beans , so add all for now
modulesNeeded.addAll(getCodesModuleNeededs(ERepositoryObjectType.BEANS));
modulesNeeded.addAll(getModulesNeededForRoutes());
modulesNeeded.addAll(getModulesNeededForRoutes(processItem));
}
return modulesNeeded;
}
@@ -576,14 +578,6 @@ public class ModulesNeededProvider {
}
EList<RoutinesParameterType> routinesParameterTypes = null;
if (item instanceof ProcessItem) {
ITestContainerProviderService testcaseService = ITestContainerProviderService.get();
if (testcaseService != null && testcaseService.isTestContainerItem(item)) {
try {
item = testcaseService.getParentJobItem(item);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
if (((ProcessItem) item).getProcess() != null && ((ProcessItem) item).getProcess().getParameters() != null) {
routinesParameterTypes = ((ProcessItem) item).getProcess().getParameters().getRoutinesParameter();
}
@@ -782,12 +776,33 @@ public class ModulesNeededProvider {
return null;
}
public static List<ModuleNeeded> getModulesNeededForRoutes() {
/**
* DOC sunchaoqun Comment method "getModulesNeededForRoutes".
*
* @param processes
* @return
*/
private static List<ModuleNeeded> getModulesNeededForRoutes(ProcessItem processItem) {
ILibrariesService service = null;
if (!GlobalServiceRegister.getDefault().isServiceRegistered(ILibrariesService.class)) {
return null;
}
service = (ILibrariesService) GlobalServiceRegister.getDefault().getService(ILibrariesService.class);
Project project = ProjectManager.getInstance().getCurrentProject();
if (importNeedsListForRoutes == null) {
importNeedsListForRoutes = new ArrayList<ModuleNeeded>();
importNeedsListForRoutes.add(getComponentModuleById("CAMEL", "camel-core"));
importNeedsListForRoutes.add(getComponentModuleById("CAMEL", "camel-spring"));
if (processItem != null && project.isCamel3()) {
importNeedsListForRoutes.addAll(service.getModuleNeeded("camel3-core", true));
importNeedsListForRoutes.addAll(service.getModuleNeeded("camel3-spring", true));
} else {
importNeedsListForRoutes.add(getComponentModuleById("CAMEL", "camel-core"));
importNeedsListForRoutes.add(getComponentModuleById("CAMEL", "camel-spring"));
}
importNeedsListForRoutes.add(getComponentModuleById("CAMEL", "spring-context"));
importNeedsListForRoutes.add(getComponentModuleById("CAMEL", "spring-beans"));
importNeedsListForRoutes.add(getComponentModuleById("CAMEL", "spring-core"));
@@ -800,9 +815,16 @@ public class ModulesNeededProvider {
}
}
}
importNeedsListForRoutes.removeIf(m-> (m==null));
return importNeedsListForRoutes;
}
public static List<ModuleNeeded> getModulesNeededForRoutes() {
return getModulesNeededForRoutes(null);
}
private static void getModulesNeededForRoutesJava11() {
/**
* importNeedsListForRoutes.add(getModuleNeededForName("istack-commons-runtime-3.0.8.jar"));
@@ -838,9 +860,32 @@ public class ModulesNeededProvider {
}
public static List<ModuleNeeded> getModulesNeededForBeans() {
return getModulesNeededForBeans(null);
}
public static List<ModuleNeeded> getModulesNeededForBeans(ExportFileResource[] processes) {
ProcessItem processItem = null;
if (processes != null && processes.length > 0) {
if (processes[0].getItem() instanceof ProcessItem) {
processItem = (ProcessItem) processes[0].getItem();
}
}
if (importNeedsListForBeans == null) {
importNeedsListForBeans = getModulesNeededForRoutes();
importNeedsListForBeans.add(getComponentModuleById("CAMEL", "camel-cxf"));
importNeedsListForBeans = getModulesNeededForRoutes(processItem);
Project project = ProjectManager.getInstance().getCurrentProject();
boolean camel3 = true;
if (processItem != null && project.isCamel3()) {
camel3 = true;
}
if (camel3) {
importNeedsListForBeans.add(getComponentModuleById("CAMEL", "camel3-cxf"));
} else {
importNeedsListForBeans.add(getComponentModuleById("CAMEL", "camel-cxf"));
}
importNeedsListForBeans.add(getComponentModuleById("CAMEL", "cxf-core"));
importNeedsListForBeans.add(getComponentModuleById("CAMEL", "javax.ws.rs-api"));
for (ModuleNeeded need : importNeedsListForBeans) {

View File

@@ -64,6 +64,8 @@
eType="#//MigrationTask" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="bigData" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
defaultValueLiteral="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="camelFamilyVersion" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
defaultValueLiteral="2"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ProjectComponentAuthorisation">
<eStructuralFeatures xsi:type="ecore:EReference" name="project" lowerBound="1"

View File

@@ -67,6 +67,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//Project/migrationTasks"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference properties.ecore#//Project/migrationTask"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//Project/bigData"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute properties.ecore#//Project/camelFamilyVersion"/>
</genClasses>
<genClasses ecoreClass="properties.ecore#//ProjectComponentAuthorisation">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference properties.ecore#//ProjectComponentAuthorisation/project"/>

View File

@@ -373,13 +373,22 @@ public interface PropertiesPackage extends EPackage {
*/
int PROJECT__BIG_DATA = 34;
/**
* The feature id for the '<em><b>Camel Family Version</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PROJECT__CAMEL_FAMILY_VERSION = 35;
/**
* The number of structural features of the '<em>Project</em>' class.
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
* @ordered
*/
int PROJECT_FEATURE_COUNT = 35;
int PROJECT_FEATURE_COUNT = 36;
/**
* The meta object id for the '{@link org.talend.core.model.properties.impl.PropertyImpl <em>Property</em>}' class.
@@ -9966,6 +9975,17 @@ public interface PropertiesPackage extends EPackage {
*/
EAttribute getProject_Description();
/**
* Returns the meta object for the attribute '{@link org.talend.core.model.properties.Project#getCamelFamilyVersion <em>Camel Family Version</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Camel Family Version</em>'.
* @see org.talend.core.model.properties.Project#getCamelFamilyVersion()
* @see #getProject()
* @generated
*/
EAttribute getProject_CamelFamilyVersion();
/**
* Returns the meta object for the attribute '{@link org.talend.core.model.properties.Project#getLanguage <em>Language</em>}'.
* <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -16094,6 +16114,14 @@ public interface PropertiesPackage extends EPackage {
*/
EAttribute PROJECT__DESCRIPTION = eINSTANCE.getProject_Description();
/**
* The meta object literal for the '<em><b>Camel Family Version</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute PROJECT__CAMEL_FAMILY_VERSION = eINSTANCE.getProject_CamelFamilyVersion();
/**
* The meta object literal for the '<em><b>Language</b></em>' attribute feature.
* <!-- begin-user-doc --> <!--

View File

@@ -1098,6 +1098,15 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac
return (EAttribute)projectEClass.getEStructuralFeatures().get(4);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getProject_CamelFamilyVersion() {
return (EAttribute)projectEClass.getEStructuralFeatures().get(35);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -6382,6 +6391,7 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac
createEAttribute(projectEClass, PROJECT__MIGRATION_TASKS);
createEReference(projectEClass, PROJECT__MIGRATION_TASK);
createEAttribute(projectEClass, PROJECT__BIG_DATA);
createEAttribute(projectEClass, PROJECT__CAMEL_FAMILY_VERSION);
projectComponentAuthorisationEClass = createEClass(PROJECT_COMPONENT_AUTHORISATION);
createEReference(projectComponentAuthorisationEClass, PROJECT_COMPONENT_AUTHORISATION__PROJECT);
@@ -7161,6 +7171,7 @@ public class PropertiesPackageImpl extends EPackageImpl implements PropertiesPac
initEAttribute(getProject_MigrationTasks(), theEcorePackage.getEString(), "migrationTasks", null, 0, -1, Project.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getProject_MigrationTask(), this.getMigrationTask(), null, "migrationTask", null, 0, -1, Project.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getProject_BigData(), ecorePackage.getEBoolean(), "bigData", "true", 0, 1, Project.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getProject_CamelFamilyVersion(), ecorePackage.getEString(), "camelFamilyVersion", "2", 0, 1, Project.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(projectComponentAuthorisationEClass, ProjectComponentAuthorisation.class, "ProjectComponentAuthorisation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getProjectComponentAuthorisation_Project(), this.getProject(), this.getProject_AllowedComponents(), "project", null, 1, 1, ProjectComponentAuthorisation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

View File

@@ -1,15 +1,7 @@
package org.talend.platform.logging;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.Platform;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.talend.utils.format.PresentableBox;
@@ -26,8 +18,6 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
private static String version = null;// studio version
/**
* The constructor
*/
@@ -43,7 +33,6 @@ public class Activator extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
version = null;
if (log.isInfoEnabled()) {
Object version = getVersion();
String mess = "Starting Talend's platform log system."; //$NON-NLS-1$
@@ -62,7 +51,6 @@ public class Activator extends AbstractUIPlugin {
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
version = null;
super.stop(context);
}
@@ -76,43 +64,10 @@ public class Activator extends AbstractUIPlugin {
}
public static String getVersion() {
if (version == null) {
try {
File file = null;
try {
file = new File(Platform.getInstallLocation().getDataArea(".eclipseproduct").getPath());
} catch (IOException e1) {
//
}
Properties prop = new Properties();
if (file != null && file.exists()) {
try (FileInputStream fis = new FileInputStream(file)) {
prop.load(fis);
} catch (Exception e) {
//
}
}
version = prop.getProperty("version");
if (StringUtils.isEmpty(version)) {
version = System.getProperty("talend.studio.version"); //$NON-NLS-1$
}
if (StringUtils.isEmpty(version)) {
Bundle b = Platform.getBundle("org.talend.commons.runtime");
if (b != null) {
version = b.getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
}
}
} catch (Exception e) {
//
}
if (version == null || "".equals(version.trim())) { //$NON-NLS-1$
version = (String) getDefault().getBundle().getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
}
String version = System.getProperty("talend.studio.version"); //$NON-NLS-1$
if (version == null || "".equals(version.trim())) { //$NON-NLS-1$
version = (String) getDefault().getBundle().getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
}
return version;
}
}

View File

@@ -17,8 +17,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;

View File

@@ -61,7 +61,6 @@ import org.talend.commons.utils.workbench.resources.ResourceUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.context.Context;
import org.talend.core.context.RepositoryContext;
import org.talend.core.database.EDatabaseTypeName;
import org.talend.core.model.context.ContextUtils;
import org.talend.core.model.context.link.ContextLinkService;
import org.talend.core.model.metadata.builder.connection.Connection;
@@ -71,7 +70,6 @@ import org.talend.core.model.properties.BusinessProcessItem;
import org.talend.core.model.properties.ByteArray;
import org.talend.core.model.properties.ConnectionItem;
import org.talend.core.model.properties.ContextItem;
import org.talend.core.model.properties.DatabaseConnectionItem;
import org.talend.core.model.properties.FileItem;
import org.talend.core.model.properties.FolderItem;
import org.talend.core.model.properties.FolderType;
@@ -369,14 +367,6 @@ public class ImportBasicHandler extends AbstractImportExecutableHandler {
return false;
}
if (ERepositoryObjectType.METADATA_CONNECTIONS.equals(itemType) && (item instanceof DatabaseConnectionItem)) {
DatabaseConnectionItem connItem = (DatabaseConnectionItem) item;
if (EDatabaseTypeName.isDeprecateDbType(connItem.getTypeName())) {
importItem.addError(Messages.getString("AbstractImportHandler_deprecateItem"));
return false;
}
}
final RepositoryObjectCache repObjectcache = ImportCacheHelper.getInstance().getRepObjectcache();
IRepositoryViewObject itemWithSameIdObj = null;

View File

@@ -1,7 +1,6 @@
AbstractImportHandler_cannotImportMessage=from the project {0} use a more recent version of studio so cannot import it.
AbstractImportHandler_persistenceException=A newer version of {0} already exist.
AbstractImportHandler_unsupportItem=Can not import the item, Please ensure the items are valid in current product.
AbstractImportHandler_deprecateItem=Can not import the item, the item is deprecate in current product.
AbstractImportHandler_itemLocked=The item is locked.
AbstractImportHandler_nameUsed=This item already exists. Check the Recycle bin and empty it if needed.
AbstractImportHandler_nameUsed.differentRepositoryType=An item with the same name already exists. Check the Recycle bin and empty it if needed.

View File

@@ -832,6 +832,7 @@ public class LocalRepositoryFactory extends AbstractEMFRepositoryFactory impleme
project.setAuthor(projectInfor.getAuthor());
project.setLocal(true);
project.setTechnicalLabel(technicalLabel);
project.setCamel3(true);
saveProject(prj, project);

View File

@@ -85,14 +85,6 @@
name="AccessMigrationTask"
version="6.0.0">
</projecttask>
<projecttask
beforeLogon="false"
breaks="7.4.0"
class="org.talend.repository.metadata.migration.RemoveDeprecateSASItemMigrationTask"
id="org.talend.repository.metadata.migration.RemoveDeprecateSASItemMigrationTask"
name="RemoveDeprecateSASItemMigrationTask"
version="7.4.1">
</projecttask>
</extension>
<extension
point="org.talend.core.repositoryContextualsActions">

View File

@@ -1,76 +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.repository.metadata.migration;
import java.util.Date;
import java.util.GregorianCalendar;
import org.apache.commons.lang.StringUtils;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.database.EDatabaseTypeName;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.migration.AbstractItemMigrationTask;
import org.talend.core.model.properties.DatabaseConnectionItem;
import org.talend.core.model.properties.Item;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.repository.model.ProxyRepositoryFactory;
/**
* DOC jding class global comment. Detailled comment
*/
public class RemoveDeprecateSASItemMigrationTask extends AbstractItemMigrationTask {
@Override
public Date getOrder() {
GregorianCalendar gc = new GregorianCalendar(2021, 4, 20, 17, 50, 30);
return gc.getTime();
}
@Override
public ExecutionResult execute(Item item) {
if (item instanceof DatabaseConnectionItem) {
String typeName = null;
DatabaseConnectionItem connItem = (DatabaseConnectionItem) item;
typeName = connItem.getTypeName();
if (StringUtils.isBlank(typeName)) {
Connection connection = connItem.getConnection();
if (connection instanceof DatabaseConnection) {
typeName = ((DatabaseConnection) connection).getDatabaseType();
}
}
if (StringUtils.isBlank(typeName) || item.getProperty() == null
|| !EDatabaseTypeName.SAS.getXmlName().equals(typeName)) {
return ExecutionResult.NOTHING_TO_DO;
}
ProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
try {
IRepositoryViewObject repositoryObject = factory.getSpecificVersion(item.getProperty().getId(),
item.getProperty().getVersion(), true);
// to delete all version items
factory.deleteObjectPhysical(repositoryObject);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
} else {
return ExecutionResult.NOTHING_TO_DO;
}
return ExecutionResult.SUCCESS_NO_ALERT;
}
}