Compare commits
31 Commits
patch_clou
...
csun/patch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66158b8091 | ||
|
|
853f0f1a63 | ||
|
|
c8f9544669 | ||
|
|
12a4d97235 | ||
|
|
72d3007836 | ||
|
|
5e10fa5a9d | ||
|
|
1d70b8cf3c | ||
|
|
913513fe52 | ||
|
|
913bb3fd5e | ||
|
|
6739d5d749 | ||
|
|
5029936009 | ||
|
|
592d61efcb | ||
|
|
c990b2f122 | ||
|
|
718442e759 | ||
|
|
e8b24e59bb | ||
|
|
0983f18746 | ||
|
|
dbb993287f | ||
|
|
891db9df9d | ||
|
|
8a761ff57a | ||
|
|
d746cea059 | ||
|
|
2cc77d47d9 | ||
|
|
168c17d65e | ||
|
|
d1e8f8d768 | ||
|
|
9928c659f5 | ||
|
|
23614ad8ad | ||
|
|
b8fce856e5 | ||
|
|
8ef6ea66d5 | ||
|
|
25123e63e3 | ||
|
|
60e25a755b | ||
|
|
121f1198e1 | ||
|
|
87e73138e6 |
@@ -123,6 +123,10 @@ public class FileCopyUtils {
|
||||
if (!resFolder.exists()) {
|
||||
return;
|
||||
}
|
||||
if (resFolder.getAbsolutePath().equals(destFolder.getAbsolutePath())) {// If the source path and target path are
|
||||
// same, don't copy
|
||||
return;
|
||||
}
|
||||
destFolder.mkdirs();
|
||||
String[] file = resFolder.list();
|
||||
File temp = null;
|
||||
|
||||
@@ -120,33 +120,41 @@ public class SAPHanaDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types)
|
||||
throws SQLException {
|
||||
String[] neededTypes = getNeededTypes(types);
|
||||
ResultSet rs = connection.getMetaData().getTables(catalog, schemaPattern, tableNamePattern, neededTypes);
|
||||
List<String[]> list = new ArrayList<String[]>();
|
||||
while (rs.next()) {
|
||||
String name = rs.getString("TABLE_NAME"); //$NON-NLS-1$
|
||||
String schema = rs.getString("TABLE_SCHEM"); //$NON-NLS-1$
|
||||
String type = rs.getString("TABLE_TYPE"); //$NON-NLS-1$
|
||||
// has other types which is not Calculation View
|
||||
if (neededTypes.length > 1 || !ArrayUtils.contains(neededTypes, NEEDED_TYPES[3])) {
|
||||
ResultSet rs = connection.getMetaData().getTables(catalog, schemaPattern, tableNamePattern, neededTypes);
|
||||
while (rs.next()) {
|
||||
String name = rs.getString("TABLE_NAME"); //$NON-NLS-1$
|
||||
String schema = rs.getString("TABLE_SCHEM"); //$NON-NLS-1$
|
||||
String type = rs.getString("TABLE_TYPE"); //$NON-NLS-1$
|
||||
|
||||
String id = ""; //$NON-NLS-1$
|
||||
String remarks = ""; //$NON-NLS-1$
|
||||
try {
|
||||
remarks = rs.getString("REMARKS"); //$NON-NLS-1$
|
||||
} catch (Exception e) {
|
||||
// nothing
|
||||
}
|
||||
String id = ""; //$NON-NLS-1$
|
||||
String remarks = ""; //$NON-NLS-1$
|
||||
try {
|
||||
remarks = rs.getString("REMARKS"); //$NON-NLS-1$
|
||||
} catch (Exception e) {
|
||||
// nothing
|
||||
}
|
||||
|
||||
if (ArrayUtils.contains(neededTypes, type)) {
|
||||
// check if the type is contained is in the types needed.
|
||||
// since sybase can return some system views as "SYSTEM VIEW" instead of "VIEW/TABLE" from the request.
|
||||
String[] r = new String[] { id, schema, name, type, remarks, null };
|
||||
list.add(r);
|
||||
if (ArrayUtils.contains(neededTypes, type)) {
|
||||
// check if the type is contained is in the types needed.
|
||||
// since sybase can return some system views as "SYSTEM VIEW" instead of "VIEW/TABLE" from the
|
||||
// request.
|
||||
String[] r = new String[] { id, schema, name, type, remarks, null };
|
||||
list.add(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// For Calculation View
|
||||
if (ArrayUtils.contains(neededTypes, NEEDED_TYPES[3])) {
|
||||
// check if the type is contained is in the types needed.
|
||||
String sqlcv = "SELECT CATALOG_NAME,SCHEMA_NAME,CUBE_NAME, COLUMN_OBJECT,CUBE_TYPE,DESCRIPTION from _SYS_BI.BIMC_CUBES"; //$NON-NLS-1$
|
||||
String sqlcv = "SELECT OBJECT_NAME,PACKAGE_ID FROM _SYS_REPO.ACTIVE_OBJECT WHERE OBJECT_SUFFIX = 'calculationview'"; //$NON-NLS-1$
|
||||
if (tableNamePattern != null && !tableNamePattern.equals("%")) { //$NON-NLS-1$
|
||||
sqlcv += " AND (OBJECT_NAME LIKE '" + tableNamePattern + "'"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sqlcv += " OR PACKAGE_ID LIKE '" + tableNamePattern + "')"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
ResultSet rscv = null;
|
||||
Statement stmtcv = null;
|
||||
List<String[]> listcv = new ArrayList<String[]>();
|
||||
@@ -154,25 +162,16 @@ public class SAPHanaDataBaseMetadata extends FakeDatabaseMetaData {
|
||||
stmtcv = connection.createStatement();
|
||||
rscv = stmtcv.executeQuery(sqlcv);
|
||||
while (rscv.next()) {
|
||||
String catalogName = rscv.getString("CATALOG_NAME"); //$NON-NLS-1$
|
||||
if (catalogName != null) {
|
||||
catalogName = catalogName.trim();
|
||||
String objectName = rscv.getString("OBJECT_NAME"); //$NON-NLS-1$
|
||||
if (objectName != null) {
|
||||
objectName = objectName.trim();
|
||||
}
|
||||
String schemaName = rscv.getString("SCHEMA_NAME"); //$NON-NLS-1$
|
||||
if (schemaName != null) {
|
||||
schemaName = schemaName.trim();
|
||||
String packageId = rscv.getString("PACKAGE_ID"); //$NON-NLS-1$
|
||||
if (packageId != null) {
|
||||
packageId = packageId.trim();
|
||||
}
|
||||
String cubeName = rscv.getString("CUBE_NAME"); //$NON-NLS-1$
|
||||
if (cubeName != null) {
|
||||
cubeName = cubeName.trim();
|
||||
}
|
||||
String id = ""; //$NON-NLS-1$
|
||||
// String type = rscv.getString("CUBE_TYPE"); //$NON-NLS-1$
|
||||
|
||||
String remarks = rscv.getString("DESCRIPTION"); //$NON-NLS-1$
|
||||
String name = catalogName + "/" + cubeName;//$NON-NLS-1$
|
||||
|
||||
String[] r = new String[] { id, schemaName, name, NEEDED_TYPES[3], remarks, catalogName };
|
||||
String name = packageId + "/" + objectName; //$NON-NLS-1$
|
||||
String[] r = new String[] { "", "_SYS_BIC", name, NEEDED_TYPES[3], "", packageId }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
listcv.add(r);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
|
||||
@@ -42,13 +42,15 @@ public class NetworkUtil {
|
||||
|
||||
private static final String TALEND_DISABLE_INTERNET = "talend.disable.internet";//$NON-NLS-1$
|
||||
|
||||
private static final String HTTP_NETWORK_URL = "https://talend-update.talend.com";
|
||||
|
||||
public static boolean isNetworkValid() {
|
||||
String disableInternet = System.getProperty(TALEND_DISABLE_INTERNET);
|
||||
if ("true".equals(disableInternet)) { //$NON-NLS-1$
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
URL url = new URL("https://www.talend.com"); //$NON-NLS-1$
|
||||
URL url = new URL(HTTP_NETWORK_URL);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setConnectTimeout(4000);
|
||||
conn.setReadTimeout(4000);
|
||||
|
||||
@@ -19,7 +19,10 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
@@ -221,20 +224,37 @@ public class ProjectDataJsonProvider {
|
||||
|
||||
public static void loadMigrationTaskSetting(Project project, InputStream input) throws PersistenceException {
|
||||
try {
|
||||
project.eSetDeliver(false);
|
||||
MigrationTaskSetting migrationTaskSetting = null;
|
||||
if (input != null) {
|
||||
migrationTaskSetting = new ObjectMapper().readValue(input, MigrationTaskSetting.class);
|
||||
}
|
||||
if (migrationTaskSetting != null) {
|
||||
MigrationTask fakeTask = createFakeMigrationTask();
|
||||
List<MigrationTask> allRealTask = new ArrayList<MigrationTask>();
|
||||
MigrationTask existingFakeTask = null;
|
||||
for (int i = 0; i < project.getMigrationTask().size(); i++) {
|
||||
MigrationTask task = (MigrationTask) project.getMigrationTask().get(i);
|
||||
if (!StringUtils.equals(fakeTask.getId(), task.getId())) {
|
||||
allRealTask.add(task);
|
||||
if (StringUtils.equals(fakeTask.getId(), task.getId())) {
|
||||
existingFakeTask = task;
|
||||
break;
|
||||
}
|
||||
}
|
||||
project.getMigrationTask().removeAll(allRealTask);
|
||||
// remove all the migrations from the project
|
||||
project.getMigrationTask().clear();
|
||||
if (existingFakeTask != null) {
|
||||
// keep only the fake migration task of 7.1.1 with new migration index
|
||||
// re-use the same instance to make sure we keep the same emf id.
|
||||
project.getMigrationTask().add(existingFakeTask);
|
||||
}
|
||||
Set<String> tasksIds = new HashSet<>();
|
||||
Iterator<MigrationTaskJson> it = migrationTaskSetting.getMigrationTaskList().iterator();
|
||||
while (it.hasNext()) { // remove duplicates to fix issues found in TUP-22735
|
||||
MigrationTaskJson task = it.next();
|
||||
if (tasksIds.contains(task.getId())) {
|
||||
it.remove();
|
||||
}
|
||||
tasksIds.add(task.getId());
|
||||
}
|
||||
project.getMigrationTasks().clear();
|
||||
if (migrationTaskSetting.getMigrationTaskList() != null) {
|
||||
for (MigrationTaskJson json : migrationTaskSetting.getMigrationTaskList()) {
|
||||
@@ -252,6 +272,7 @@ public class ProjectDataJsonProvider {
|
||||
} catch (Exception e) {
|
||||
throw new PersistenceException(e);
|
||||
} finally {
|
||||
project.eSetDeliver(true);
|
||||
closeInputStream(input);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,8 @@ public class RepositoryContext {
|
||||
|
||||
private Map<String, String> fields;
|
||||
|
||||
private boolean token = false;
|
||||
|
||||
/**
|
||||
* DOC smallet RepositoryContext constructor comment.
|
||||
*
|
||||
@@ -246,4 +248,12 @@ public class RepositoryContext {
|
||||
public void setNoUpdateWhenLogon(boolean noUpdateWhenLogon) {
|
||||
this.noUpdateWhenLogon = noUpdateWhenLogon;
|
||||
}
|
||||
|
||||
public boolean isToken() {
|
||||
return this.token;
|
||||
}
|
||||
|
||||
public void setToken(boolean token) {
|
||||
this.token = token;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,8 @@ public interface IComponentsFactory {
|
||||
*/
|
||||
public Set<IComponent> getComponents();
|
||||
|
||||
public boolean isInitialising();
|
||||
|
||||
/**
|
||||
* Get a readonly components collection to avoid ConcurrentModificationException caused by multiple thread
|
||||
* access;<br/>
|
||||
|
||||
@@ -54,6 +54,8 @@ public class ConnectionBean implements Cloneable {
|
||||
|
||||
private Map<String, String> dynamicFields = new HashMap<String, String>();
|
||||
|
||||
private static final String TOKEN = "token"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* DOC smallet ConnectionBean constructor comment.
|
||||
*/
|
||||
@@ -281,6 +283,25 @@ public class ConnectionBean implements Cloneable {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isToken() {
|
||||
try {
|
||||
if (conDetails.has(TOKEN)) {
|
||||
return (Boolean) conDetails.get(TOKEN);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setToken(boolean token) {
|
||||
try {
|
||||
conDetails.put(TOKEN, token);
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConnectionBean clone() throws CloneNotSupportedException {
|
||||
return writeFromJSON(this.getConDetails());
|
||||
@@ -303,6 +324,7 @@ public class ConnectionBean implements Cloneable {
|
||||
toReturn.setPassword(st[i++]);
|
||||
toReturn.setWorkSpace(st[i++]);
|
||||
toReturn.setComplete(new Boolean(st[i++]));
|
||||
toReturn.setToken(new Boolean(st[i++]));
|
||||
JSONObject dynamicJson = new JSONObject();
|
||||
toReturn.getConDetails().put(DYNAMICFIELDS, dynamicJson);
|
||||
while (i < st.length) {
|
||||
|
||||
@@ -434,9 +434,9 @@ public class ModuleNeeded {
|
||||
if (this.getModuleLocaion() != null) {
|
||||
hashCode *= this.getModuleLocaion().hashCode();
|
||||
}
|
||||
|
||||
hashCode *= this.getDefaultMavenURI().hashCode();
|
||||
|
||||
if(this.getDefaultMavenURI() != null){
|
||||
hashCode *= this.getDefaultMavenURI().hashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
|
||||
@@ -519,8 +519,16 @@ public class ModuleNeeded {
|
||||
}
|
||||
|
||||
// maven uri
|
||||
if (!other.getDefaultMavenURI().equals(this.getDefaultMavenURI())) {
|
||||
return false;
|
||||
if (other.getDefaultMavenURI() == null) {
|
||||
if (this.getDefaultMavenURI() != null) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (this.getDefaultMavenURI() == null) {
|
||||
return false;
|
||||
} else if (!other.getDefaultMavenURI().equals(this.getDefaultMavenURI())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -153,7 +153,7 @@ public class MetadataTable implements IMetadataTable, Cloneable {
|
||||
List<IMetadataColumn> temp = new ArrayList<IMetadataColumn>();
|
||||
temp.addAll(this.listColumns);
|
||||
temp.addAll(this.unusedColumns);
|
||||
if (isRepository && originalColumns != null) {
|
||||
if (originalColumns != null) {
|
||||
Collections.sort(temp, new Comparator<IMetadataColumn>() {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -211,6 +211,7 @@ public final class MetadataToolAvroHelper {
|
||||
//ignore it now as we can't process the complex expression for the default value, and the default value is not useful for runtime like the old javajet tjdbcxxx
|
||||
//TODO support the expression calculate, not sure it's necessary and sometimes, more complex like globalMap.get(xxx) which only have meaning after running the job.
|
||||
ExceptionHandler.process(e, Level.WARN);
|
||||
defaultValue = null;
|
||||
}
|
||||
|
||||
// Types with Document/Unknown elements, store as binary
|
||||
|
||||
@@ -614,7 +614,12 @@ public final class MetadataToolHelper {
|
||||
target.getListColumns().addAll(columnsTAdd);
|
||||
target.sortCustomColumns();
|
||||
target.setLabel(source.getLabel());
|
||||
target.setOriginalColumns(source.getOriginalColumns());
|
||||
List<String> originalColumnsList = null;
|
||||
if (source.getOriginalColumns() != null) {
|
||||
originalColumnsList = new ArrayList<String>();
|
||||
originalColumnsList.addAll(source.getOriginalColumns());
|
||||
}
|
||||
target.setOriginalColumns(originalColumnsList);
|
||||
Map<String, String> targetProperties = target.getAdditionalProperties();
|
||||
Map<String, String> sourceProperties = source.getAdditionalProperties();
|
||||
for (Entry<String, String> entry : sourceProperties.entrySet()) {
|
||||
|
||||
@@ -308,7 +308,8 @@ public abstract class AbstractNode implements INode {
|
||||
return mapMerge.keySet().iterator().next().getSubProcessStartNode(withConditions);
|
||||
}
|
||||
}
|
||||
if ((getCurrentActiveLinksNbInput(EConnectionType.MAIN) == 0)) {
|
||||
if ((getCurrentActiveLinksNbInput(EConnectionType.MAIN) == 0)
|
||||
&& !checkIfCurrentActiveLinksIsLookup()) {
|
||||
return this; // main branch here, so we got the correct sub
|
||||
// process start.
|
||||
}
|
||||
@@ -327,9 +328,13 @@ public abstract class AbstractNode implements INode {
|
||||
|
||||
for (IConnection connec : getIncomingConnections()) {
|
||||
if (((AbstractNode) connec.getSource()).isOnMainMergeBranch()) {
|
||||
// with lookup, tMap incoming connection contains FLOW_MAIN and FLOW_REF,
|
||||
// should take care of FLOW_MAIN only
|
||||
if (!connec.getLineStyle().equals(EConnectionType.FLOW_REF)) {
|
||||
return connec.getSource().getSubProcessStartNode(withConditions);
|
||||
}
|
||||
} else if (connec.getLineStyle().equals(EConnectionType.RUN_AFTER)) {
|
||||
return connec.getSource().getSubProcessStartNode(withConditions);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -345,6 +350,27 @@ public abstract class AbstractNode implements INode {
|
||||
return nb;
|
||||
}
|
||||
|
||||
private boolean checkIfCurrentActiveLinksIsLookup() {
|
||||
boolean flag = false;
|
||||
int input = 0;
|
||||
for (IConnection inConnection : getIncomingConnections()) {
|
||||
// refer to DataProcess.checkFlowRefLink() added RUN_AFTER for incoming connection
|
||||
if (inConnection.isActivate() && inConnection.getLineStyle().getId() == EConnectionType.RUN_AFTER.getId()) {
|
||||
input++;
|
||||
}
|
||||
}
|
||||
// check if run_after is for lookup
|
||||
if (input > 0) {
|
||||
for (IConnection outConnection : getOutgoingConnections()) {
|
||||
if (outConnection.isActivate() && outConnection.getLineStyle().getId() == EConnectionType.FLOW_REF.getId()) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Level;
|
||||
@@ -128,8 +129,6 @@ public class RelationshipItemBuilder {
|
||||
|
||||
private Map<Relation, Set<Relation>> referencesItemsRelations;
|
||||
|
||||
private Map<String, String> hadoopItemReferences = new HashMap<String, String>();
|
||||
|
||||
private boolean loaded = false;
|
||||
|
||||
private boolean loading = false;
|
||||
@@ -643,8 +642,8 @@ public class RelationshipItemBuilder {
|
||||
return;
|
||||
}
|
||||
loading = true;
|
||||
currentProjectItemsRelations = new HashMap<Relation, Set<Relation>>();
|
||||
referencesItemsRelations = new HashMap<Relation, Set<Relation>>();
|
||||
currentProjectItemsRelations = new ConcurrentHashMap<Relation, Set<Relation>>();
|
||||
referencesItemsRelations = new ConcurrentHashMap<Relation, Set<Relation>>();
|
||||
|
||||
loadRelations(currentProjectItemsRelations, getAimProject());
|
||||
|
||||
@@ -1097,10 +1096,11 @@ public class RelationshipItemBuilder {
|
||||
Map<Relation, Set<Relation>> relations = handler.find(item);
|
||||
mergeRelationship(itemRelations, relations);
|
||||
}
|
||||
|
||||
if (oldProjectRelations != null) {
|
||||
// check if there is any changes on the relations.
|
||||
Set<Relation> newProjectRelations = currentProjectItemsRelations.get(relation);
|
||||
// check if there is any changes on the relations.
|
||||
Set<Relation> newProjectRelations = currentProjectItemsRelations.get(relation);
|
||||
if (oldProjectRelations == null && newProjectRelations == null) {
|
||||
relationsModified = false;
|
||||
} else if (oldProjectRelations != null) {
|
||||
if (oldProjectRelations.size() == newProjectRelations.size()) {
|
||||
relationsModified = false;
|
||||
for (Relation newRelation : newProjectRelations) {
|
||||
|
||||
@@ -79,6 +79,11 @@ public class ArtifactRepositoryBean implements Cloneable {
|
||||
if (index > 0) {
|
||||
nexusUrl = url.substring(0, index + ARTIFACT_MIDDLE_PATH.length());
|
||||
repoId = StringUtilities.removeEndingString(url.substring(index + ARTIFACT_MIDDLE_PATH.length()), "/");
|
||||
} else {
|
||||
// can be non-default contextpath or root
|
||||
String tempurl = StringUtilities.removeEndingString(url, "/");
|
||||
repoId = tempurl.substring(tempurl.lastIndexOf("/") + 1);
|
||||
nexusUrl = url.substring(0, url.indexOf(repoId));
|
||||
}
|
||||
}
|
||||
return new String[] { nexusUrl, repoId };
|
||||
|
||||
@@ -62,6 +62,8 @@ public interface TalendProcessArgumentConstant {
|
||||
|
||||
static final String ARG_LAUNCHER_NAME = "LAUNCHER_NAME";
|
||||
|
||||
static final String ARG_AVOID_BRANCH_NAME = "AVOID_BRANCH_NAME";
|
||||
|
||||
static final String CMD_ARG_STATS_PORT_PARAM = "stat_port";
|
||||
|
||||
static final String CMD_ARG_TRACE_PORT_PARAM = "trace_port";
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.util.Map;
|
||||
|
||||
import org.talend.core.IService;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.process.INode;
|
||||
|
||||
/**
|
||||
* created by ycbai on 2016年3月24日 Detailled comment
|
||||
@@ -38,5 +39,7 @@ public interface IGenericService extends IService {
|
||||
*
|
||||
*/
|
||||
public List<Map<String, String>> getAllGenericComponentsInfo();
|
||||
|
||||
public void resetReferenceValue(INode curNode, String oldConnectionName, String newConnectionName);
|
||||
|
||||
}
|
||||
|
||||
@@ -725,6 +725,8 @@ public class MetadataDialog extends Dialog {
|
||||
}
|
||||
|
||||
IDesignerCoreService designerCoreService = CoreUIPlugin.getDefault().getDesignerCoreService();
|
||||
updateTableOriginalColumns(outputTable);
|
||||
updateTableOriginalColumns(inputTable);
|
||||
designerCoreService.setTraceFilterParameters(outputNode, outputTable, preOutputColumnSet, changedNameColumnsForOutput);
|
||||
designerCoreService.setTraceFilterParameters(inputNode, inputTable, preInputColumnSet, changedNameColumnsForInput);
|
||||
if (outputTable != null && inputTable != null) {
|
||||
@@ -745,6 +747,16 @@ public class MetadataDialog extends Dialog {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateTableOriginalColumns(IMetadataTable table) {
|
||||
if (table != null && table.getListColumns() != null) {
|
||||
List<String> columnNames = new ArrayList<String>();
|
||||
for (IMetadataColumn column : table.getListColumns()) {
|
||||
columnNames.add(column.getLabel());
|
||||
}
|
||||
table.setOriginalColumns(columnNames);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC wzhang Comment method "getPreColumnsSet".
|
||||
|
||||
@@ -72,10 +72,20 @@ public class JavaSimpleDateFormatProposalProvider implements IContentProposalPro
|
||||
"\"dd/MM/yyyy\" : common format", "dd/MM/yyyy", "Date\n Examples : \n 01/01/2007\n 31/12/2007"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
new DateFormatContentProposal(
|
||||
"\"MM/dd/yyyy\" : common format", "MM/dd/yyyy", "Date\n Examples : \n 01/01/2007\n 12/31/2007"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
new DateFormatContentProposal("\"yyyy-MM-dd'T'HH:mm:ss\" : common format", "yyyy-MM-dd'T'HH:mm:ss", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new DateFormatContentProposal(
|
||||
"\"yyyy-MM-dd\" : common format", "yyyy-MM-dd", "Date\n Examples : \n 2007-01-01\n 2007-12-31"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
new DateFormatContentProposal("\"yyyy-MM-dd HH:mm:ss\" : common format", "yyyy-MM-dd HH:mm:ss",
|
||||
"Date\n Examples : \n 2014-08-19 07:41:35\n 2014-12-31 07:41:35"),//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
new DateFormatContentProposal("\"yyyy-MM-dd'T'HH:mm:ss\" : common format", "yyyy-MM-dd'T'HH:mm:ss",
|
||||
"Date\n Examples : \n 2007-01-01T00:00:00\n 2007-12-31T23:59:59"), // hywang //$NON-NLS-1$
|
||||
new DateFormatContentProposal("\"yyyy-MM-dd'T'HH:mm:ss'000Z'\" : common format", "yyyy-MM-dd'T'HH:mm:ss'000Z'", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"Date\n Examples : \n 2007-01-01T00:00:00000Z\n 2007-12-31T23:59:59000Z"), // hywang //$NON-NLS-1$
|
||||
new DateFormatContentProposal("\"yyyy-MM-dd'T'HH:mm:ss.SSSSSS\" : common format", "yyyy-MM-dd'T'HH:mm:ss.SSSSSS",
|
||||
"Date\n Examples : \n 2019-04-18T09:47:49.568095"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
new DateFormatContentProposal("\"yyyy-MM-dd HH:mm:ss zzz\" : common format", "yyyy-MM-dd HH:mm:ss zzz", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"Date\n Examples : \n 2008-01-01 00:00:00 UTC\n 2008-12-31 04:08:00 PDT"),
|
||||
new DateFormatContentProposal("\"yyyy-MM-dd HH:mm:ss.SSSXXX\" : common format", "yyyy-MM-dd HH:mm:ss.SSSXXX", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"Date\n Examples : \n 2014-08-19 07:41:35.220 -05:00"),
|
||||
new DateFormatContentProposal(
|
||||
"\"HH:mm:ss\" : common format", "HH:mm:ss", "Date\n Examples : \n 00:00:00 \n 23:59:59"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
new DateFormatContentProposal("\"yy\" : Year (00-99)", "yy", "Year \nExamples : \n 98\n 07"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
@@ -507,7 +507,7 @@ public class ProcessorUtilities {
|
||||
mainRelation.setId(jobInfo.getJobId());
|
||||
mainRelation.setVersion(jobInfo.getJobVersion());
|
||||
mainRelation.setType(RelationshipItemBuilder.JOB_RELATION);
|
||||
hasLoopDependency = checkLoopDependencies(mainRelation);
|
||||
hasLoopDependency = checkLoopDependencies(mainRelation, new HashMap<String, String>());
|
||||
// clean the previous code in case it has deleted subjob
|
||||
cleanSourceFolder(progressMonitor, currentProcess, processor);
|
||||
}
|
||||
@@ -607,28 +607,29 @@ public class ProcessorUtilities {
|
||||
return processor;
|
||||
}
|
||||
|
||||
private static boolean checkLoopDependencies(Relation mainJobInfo) throws ProcessorException {
|
||||
List<Relation> itemsJobRelatedTo = getItemsRelation(mainJobInfo);
|
||||
private 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, itemsJobRelatedTo, relationChecked);
|
||||
return checkLoopDependencies(mainJobInfo, itemsJobRelatedTo, relationChecked, idToLastestVersionMap);
|
||||
}
|
||||
|
||||
private static boolean checkLoopDependencies(Relation mainRelation, List<Relation> itemsJobRelatedTo,
|
||||
List<Relation> relationChecked) throws ProcessorException {
|
||||
List<Relation> relationChecked, Map<String, String> idToLastestVersionMap) throws ProcessorException {
|
||||
boolean hasDependency = false;
|
||||
for (Relation relation : itemsJobRelatedTo) {
|
||||
hasDependency = relation.getId().equals(mainRelation.getId())
|
||||
&& relation.getVersion().equals(mainRelation.getVersion());
|
||||
if (!hasDependency) {
|
||||
List<Relation> itemsChildJob = getItemsRelation(relation);
|
||||
List<Relation> itemsChildJob = getItemsRelation(relation, idToLastestVersionMap);
|
||||
if (!relationChecked.contains(relation)) {
|
||||
relationChecked.add(relation);
|
||||
hasDependency = checkLoopDependencies(mainRelation, itemsChildJob, relationChecked);
|
||||
hasDependency = checkLoopDependencies(mainRelation, itemsChildJob, relationChecked, idToLastestVersionMap);
|
||||
}
|
||||
if (!hasDependency) {
|
||||
for (Relation childRelation : itemsChildJob) {
|
||||
hasDependency = checkLoopDependencies(childRelation);
|
||||
hasDependency = checkLoopDependencies(childRelation, idToLastestVersionMap);
|
||||
if (hasDependency) {
|
||||
break;
|
||||
}
|
||||
@@ -643,7 +644,7 @@ public class ProcessorUtilities {
|
||||
return hasDependency;
|
||||
}
|
||||
|
||||
private static List<Relation> getItemsRelation(Relation mainJobInfo) throws ProcessorException {
|
||||
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>();
|
||||
@@ -657,12 +658,17 @@ public class ProcessorUtilities {
|
||||
mainJobInfo.getType(), RelationshipItemBuilder.JOBLET_RELATION));
|
||||
for (Relation relation : itemsJobRelatedTo) {
|
||||
if (relation.getVersion().equals(RelationshipItemBuilder.LATEST_VERSION)) {
|
||||
for (Project project : allProjects) {
|
||||
IRepositoryViewObject lastVersion =
|
||||
ProxyRepositoryFactory.getInstance().getLastVersion(project, relation.getId());
|
||||
if (lastVersion != null) {
|
||||
relation.setVersion(lastVersion.getVersion());
|
||||
break;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1017,7 +1023,7 @@ public class ProcessorUtilities {
|
||||
mainRelation.setId(jobInfo.getJobId());
|
||||
mainRelation.setVersion(jobInfo.getJobVersion());
|
||||
mainRelation.setType(RelationshipItemBuilder.JOB_RELATION);
|
||||
hasLoopDependency = checkLoopDependencies(mainRelation);
|
||||
hasLoopDependency = checkLoopDependencies(mainRelation, new HashMap<String, String>());
|
||||
// clean the previous code in case it has deleted subjob
|
||||
cleanSourceFolder(progressMonitor, currentProcess, processor);
|
||||
}
|
||||
@@ -2150,7 +2156,7 @@ public class ProcessorUtilities {
|
||||
EList<NodeType> nodes = ptype.getNode();
|
||||
String jobletPaletteType = null;
|
||||
String frameWork = ptype.getFramework();
|
||||
if (frameWork == null) {
|
||||
if (StringUtils.isBlank(frameWork)) {
|
||||
jobletPaletteType = ComponentCategory.CATEGORY_4_DI.getName();
|
||||
} else if (frameWork.equals(HadoopConstants.FRAMEWORK_SPARK)) {
|
||||
jobletPaletteType = ComponentCategory.CATEGORY_4_SPARK.getName();
|
||||
|
||||
@@ -393,8 +393,13 @@ public abstract class MavenCommandLauncher {
|
||||
public void waitFinish(ILaunch launch) {
|
||||
|
||||
try {
|
||||
boolean isCommandLine = CommonsPlugin.isHeadless();
|
||||
while (!launchFinished) {
|
||||
Thread.sleep(100);
|
||||
if (isCommandLine) {
|
||||
Thread.sleep(100);
|
||||
} else {
|
||||
waitStudioFinish();
|
||||
}
|
||||
// if terminated also
|
||||
if (launch.getProcesses() != null && launch.getProcesses().length > 0) {
|
||||
if (launch.getProcesses()[0].isTerminated()) {
|
||||
@@ -409,5 +414,16 @@ public abstract class MavenCommandLauncher {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void waitStudioFinish() throws InterruptedException {
|
||||
org.eclipse.swt.widgets.Display display = org.eclipse.swt.widgets.Display.getCurrent();
|
||||
if (display != null) {
|
||||
if (!display.readAndDispatch()) {
|
||||
display.sleep();
|
||||
}
|
||||
} else {
|
||||
Thread.sleep(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +182,14 @@ public class AggregatorPomsHelper {
|
||||
private void updateCodeProject(IProgressMonitor monitor, ERepositoryObjectType codeType, boolean forceBuild) {
|
||||
try {
|
||||
ITalendProcessJavaProject codeProject = getCodesProject(codeType);
|
||||
updateCodeProjectPom(monitor, codeType, codeProject.getProjectPom());
|
||||
IFile pomFile;
|
||||
if (codeProject == null) {
|
||||
// try to recover from any damage of pom.
|
||||
pomFile = getCodeFolder(codeType).getFile(TalendMavenConstants.POM_FILE_NAME);
|
||||
} else {
|
||||
pomFile = codeProject.getProjectPom();
|
||||
}
|
||||
updateCodeProjectPom(monitor, codeType, pomFile);
|
||||
buildAndInstallCodesProject(monitor, codeType, true, forceBuild);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.Set;
|
||||
|
||||
import org.apache.maven.model.Model;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
@@ -47,7 +46,6 @@ import org.talend.designer.maven.utils.MavenProjectUtils;
|
||||
import org.talend.designer.maven.utils.PomUtil;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.model.IRepositoryService;
|
||||
|
||||
/**
|
||||
* DOC zwxue class global comment. Detailled comment
|
||||
@@ -271,6 +269,7 @@ public class BuildCacheManager {
|
||||
|
||||
public void clearAllCaches() {
|
||||
jobCache.clear();
|
||||
clearCurrentJobletCache();
|
||||
jobletCache.clear();
|
||||
codesLastBuildCache.clear();
|
||||
}
|
||||
@@ -330,38 +329,9 @@ public class BuildCacheManager {
|
||||
}
|
||||
|
||||
private String getModulePath(Property property) {
|
||||
String modulePath = null;
|
||||
IPath basePath = null;
|
||||
IPath jobProjectPath = AggregatorPomsHelper.getItemPomFolder(property).getLocation();
|
||||
ProjectManager proManager = ProjectManager.getInstance();
|
||||
if (!proManager.isInCurrentMainProject(property)) {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRepositoryService.class)) {
|
||||
IRepositoryService service = (IRepositoryService) GlobalServiceRegister.getDefault()
|
||||
.getService(IRepositoryService.class);
|
||||
if (service.isGIT()) {
|
||||
String refProjectTechName = proManager.getCurrentProject().getTechnicalLabel();
|
||||
String mainProjectBranch = proManager.getMainProjectBranch(refProjectTechName);
|
||||
if ("master".equals(mainProjectBranch)) {
|
||||
modulePath = "../../../../"; //$NON-NLS-1$
|
||||
} else {
|
||||
modulePath = "../../../../../"; //$NON-NLS-1$
|
||||
}
|
||||
basePath = ResourcesPlugin.getWorkspace().getRoot().getLocation().append("/.repositories"); //$NON-NLS-1$
|
||||
} else if (service.isSVN()) {
|
||||
modulePath = "../../"; //$NON-NLS-1$
|
||||
basePath = ResourcesPlugin.getWorkspace().getRoot().getLocation();
|
||||
}
|
||||
}
|
||||
if (modulePath == null || basePath == null) {
|
||||
throw new RuntimeException("modulePath or basePath can not be null!"); //$NON-NLS-1$
|
||||
}
|
||||
} else {
|
||||
modulePath = ""; //$NON-NLS-1$
|
||||
basePath = getAggregatorPomsHelper().getProjectPomsFolder().getLocation();
|
||||
}
|
||||
jobProjectPath = jobProjectPath.makeRelativeTo(basePath);
|
||||
modulePath += jobProjectPath.toPortableString();
|
||||
|
||||
IPath basePath = getAggregatorPomsHelper().getProjectPomsFolder().getLocation();
|
||||
String modulePath = jobProjectPath.makeRelativeTo(basePath).toPortableString();
|
||||
return modulePath;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ import org.talend.designer.maven.template.ETalendMavenVariables;
|
||||
import org.talend.designer.maven.template.MavenTemplateManager;
|
||||
import org.talend.designer.maven.utils.PomIdsHelper;
|
||||
import org.talend.designer.maven.utils.PomUtil;
|
||||
import org.talend.designer.maven.utils.SortableDependency;
|
||||
import org.talend.designer.runprocess.IProcessor;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
@@ -595,7 +596,10 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
mainProjectBranch = "";
|
||||
}
|
||||
}
|
||||
jobInfoContent = StringUtils.replace(jobInfoContent, "${talend.project.branch}", mainProjectBranch);
|
||||
|
||||
if (!isOptionChecked(TalendProcessArgumentConstant.ARG_AVOID_BRANCH_NAME)) {
|
||||
jobInfoContent = StringUtils.replace(jobInfoContent, "${talend.project.branch}", mainProjectBranch);
|
||||
}
|
||||
|
||||
IFolder templateFolder = codeProject.getTemplatesFolder();
|
||||
IFile shFile = templateFolder.getFile(IProjectSettingTemplateConstants.JOB_RUN_SH_TEMPLATE_FILE_NAME);
|
||||
@@ -610,7 +614,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
}
|
||||
|
||||
protected void updateDependencySet(IFile assemblyFile) {
|
||||
Set<String> jobCoordinate = new HashSet<>();
|
||||
Map<String, Dependency> jobCoordinateMap = new HashMap<String, Dependency>();
|
||||
Set<JobInfo> childrenJobInfo = new HashSet<>();
|
||||
if (!hasLoopDependency()) {
|
||||
childrenJobInfo = getJobProcessor().getBuildChildrenJobs();
|
||||
@@ -619,20 +623,25 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
// add children jobs
|
||||
for (JobInfo jobInfo : childrenJobInfo) {
|
||||
Property property = jobInfo.getProcessItem().getProperty();
|
||||
String coordinate = getCoordinate(PomIdsHelper.getJobGroupId(property), PomIdsHelper.getJobArtifactId(jobInfo),
|
||||
MavenConstants.PACKAGING_JAR, PomIdsHelper.getJobVersion(property));
|
||||
jobCoordinate.add(coordinate);
|
||||
String coordinate =
|
||||
getCoordinate(PomIdsHelper.getJobGroupId(property), PomIdsHelper.getJobArtifactId(jobInfo),
|
||||
MavenConstants.PACKAGING_JAR, PomIdsHelper.getJobVersion(property));
|
||||
Dependency dependency = getDependencyObject(PomIdsHelper.getJobGroupId(property), PomIdsHelper.getJobArtifactId(jobInfo), PomIdsHelper.getJobVersion(property),
|
||||
MavenConstants.PACKAGING_JAR, null);
|
||||
jobCoordinateMap.put(coordinate, dependency);
|
||||
}
|
||||
|
||||
// add parent job
|
||||
Property parentProperty = this.getJobProcessor().getProperty();
|
||||
String parentCoordinate = getCoordinate(PomIdsHelper.getJobGroupId(parentProperty),
|
||||
PomIdsHelper.getJobArtifactId(parentProperty), MavenConstants.PACKAGING_JAR,
|
||||
PomIdsHelper.getJobVersion(parentProperty));
|
||||
jobCoordinate.add(parentCoordinate);
|
||||
String parentCoordinate =
|
||||
getCoordinate(PomIdsHelper.getJobGroupId(parentProperty), PomIdsHelper.getJobArtifactId(parentProperty),
|
||||
MavenConstants.PACKAGING_JAR, PomIdsHelper.getJobVersion(parentProperty));
|
||||
Dependency parentDependency = getDependencyObject(PomIdsHelper.getJobGroupId(parentProperty), PomIdsHelper.getJobArtifactId(parentProperty), PomIdsHelper.getJobVersion(parentProperty),
|
||||
MavenConstants.PACKAGING_JAR, null);
|
||||
jobCoordinateMap.put(parentCoordinate, parentDependency);
|
||||
|
||||
// add talend libraries and codes
|
||||
Set<String> talendLibCoordinate = new HashSet<>();
|
||||
Map<String, Dependency> talendLibCoordinateMap = new HashMap<String, Dependency>();
|
||||
String projectTechName = ProjectManager.getInstance().getProject(parentProperty).getTechnicalLabel();
|
||||
String projectGroupId = PomIdsHelper.getProjectGroupId(projectTechName);
|
||||
|
||||
@@ -640,7 +649,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
List<Dependency> dependencies = new ArrayList<>();
|
||||
addCodesDependencies(dependencies);
|
||||
for (Dependency dependency : dependencies) {
|
||||
talendLibCoordinate.add(getCoordinate(dependency));
|
||||
talendLibCoordinateMap.put(getCoordinate(dependency), dependency);
|
||||
}
|
||||
|
||||
// libraries
|
||||
@@ -659,23 +668,23 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
}
|
||||
String dependencyGroupId = dependency.getGroupId();
|
||||
String coordinate = getCoordinate(dependency);
|
||||
if (!jobCoordinate.contains(coordinate)) {
|
||||
if (!jobCoordinateMap.containsKey(coordinate)) {
|
||||
if (MavenConstants.DEFAULT_LIB_GROUP_ID.equals(dependencyGroupId)) {
|
||||
talendLibCoordinate.add(coordinate);
|
||||
talendLibCoordinateMap.put(coordinate, dependency);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add 3rd party libraries
|
||||
Set<String> _3rdDepLib = new HashSet<>();
|
||||
Map<String, Dependency> _3rdDepLibMap = new HashMap<String, Dependency>();
|
||||
Map<String, Set<Dependency>> duplicateLibs = new HashMap<>();
|
||||
for (Dependency dependency : dependencies) {
|
||||
if (MavenConstants.PACKAGING_POM.equals(dependency.getType())) {
|
||||
continue;
|
||||
}
|
||||
String coordinate = getCoordinate(dependency);
|
||||
if (!jobCoordinate.contains(coordinate) && !talendLibCoordinate.contains(coordinate)) {
|
||||
_3rdDepLib.add(coordinate);
|
||||
if (!jobCoordinateMap.containsKey(coordinate) && !talendLibCoordinateMap.containsKey(coordinate)) {
|
||||
_3rdDepLibMap.put(coordinate, dependency);
|
||||
addToDuplicateLibs(duplicateLibs, dependency);
|
||||
}
|
||||
}
|
||||
@@ -693,15 +702,17 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
MavenArtifact artifact = MavenUrlHelper.parseMvnUrl(moduleNeeded.getMavenUri());
|
||||
String coordinate = getCoordinate(artifact.getGroupId(), artifact.getArtifactId(), artifact.getType(),
|
||||
artifact.getVersion());
|
||||
if (!jobCoordinate.contains(coordinate) && !talendLibCoordinate.contains(coordinate)
|
||||
&& !_3rdDepLib.contains(coordinate)) {
|
||||
if (!jobCoordinateMap.containsKey(coordinate) && !talendLibCoordinateMap.containsKey(coordinate)
|
||||
&& !_3rdDepLibMap.containsKey(coordinate)) {
|
||||
Dependency dependencyObject = getDependencyObject(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier());
|
||||
if (MavenConstants.DEFAULT_LIB_GROUP_ID.equals(artifact.getGroupId())
|
||||
|| artifact.getGroupId().startsWith(projectGroupId)) {
|
||||
talendLibCoordinate.add(coordinate);
|
||||
talendLibCoordinateMap.put(coordinate, dependencyObject);
|
||||
} else {
|
||||
_3rdDepLib.add(coordinate);
|
||||
Dependency dependency = PomUtil.createDependency(artifact.getGroupId(), artifact.getArtifactId(),
|
||||
artifact.getVersion(), artifact.getType(), artifact.getClassifier());
|
||||
_3rdDepLibMap.put(coordinate, dependencyObject);
|
||||
Dependency dependency = PomUtil
|
||||
.createDependency(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
|
||||
artifact.getType(), artifact.getClassifier());
|
||||
addToDuplicateLibs(duplicateLibs, dependency);
|
||||
}
|
||||
}
|
||||
@@ -717,7 +728,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
} else {
|
||||
// remove duplicated dependencies from 3rd lib list
|
||||
for (Dependency dependency : dupDependencies) {
|
||||
_3rdDepLib.remove(getCoordinate(dependency));
|
||||
_3rdDepLibMap.remove(getCoordinate(dependency));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -725,11 +736,12 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
try {
|
||||
Document document = PomUtil.loadAssemblyFile(null, assemblyFile);
|
||||
// add talend libs & codes
|
||||
setupDependencySetNode(document, talendLibCoordinate, "lib", "${artifact.artifactId}.${artifact.extension}", false);
|
||||
setupDependencySetNode(document, talendLibCoordinateMap, "lib", "${artifact.artifactId}.${artifact.extension}",
|
||||
false);
|
||||
// add 3rd party libs <dependencySet>
|
||||
setupDependencySetNode(document, _3rdDepLib, "lib", null, false);
|
||||
setupDependencySetNode(document, _3rdDepLibMap, "lib", null, false);
|
||||
// add jobs
|
||||
setupDependencySetNode(document, jobCoordinate, "${talend.job.name}",
|
||||
setupDependencySetNode(document, jobCoordinateMap, "${talend.job.name}",
|
||||
"${artifact.build.finalName}.${artifact.extension}", true);
|
||||
// add duplicate dependencies if exists
|
||||
setupFileNode(document, duplicateLibs);
|
||||
@@ -751,11 +763,41 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
if (type != null) {
|
||||
coordinate += type;
|
||||
}
|
||||
|
||||
if (version != null) {
|
||||
coordinate += separator + version;
|
||||
}
|
||||
|
||||
return coordinate;
|
||||
}
|
||||
|
||||
protected String getAssemblyCoordinate(Dependency dependency) {
|
||||
String separator = ":"; //$NON-NLS-1$
|
||||
String coordinate = dependency.getGroupId() + separator;
|
||||
coordinate += dependency.getArtifactId() + separator;
|
||||
if (dependency.getType() != null) {
|
||||
coordinate += dependency.getType();
|
||||
}
|
||||
if (dependency.getClassifier() != null) {
|
||||
coordinate += separator + "*";
|
||||
}
|
||||
if (dependency.getVersion() != null) {
|
||||
coordinate += separator + dependency.getVersion();
|
||||
}
|
||||
|
||||
return coordinate;
|
||||
}
|
||||
|
||||
protected Dependency getDependencyObject(String groupId, String artifactId, String version, String type, String classifier) {
|
||||
Dependency object = new SortableDependency();
|
||||
object.setGroupId(groupId);
|
||||
object.setArtifactId(artifactId);
|
||||
object.setVersion(version);
|
||||
object.setType(type);
|
||||
object.setClassifier(classifier);
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
private void addToDuplicateLibs(Map<String, Set<Dependency>> map, Dependency dependency) {
|
||||
String coordinate = getCoordinate(dependency.getGroupId(), dependency.getArtifactId(), dependency.getType(), null);
|
||||
@@ -766,8 +808,8 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
map.get(coordinate).add(dependency);
|
||||
}
|
||||
|
||||
protected void setupDependencySetNode(Document document, Set<String> libIncludes, String outputDir, String fileNameMapping,
|
||||
boolean useProjectArtifact) {
|
||||
protected void setupDependencySetNode(Document document, Map<String, Dependency> libIncludes, String outputDir,
|
||||
String fileNameMapping, boolean useProjectArtifact) {
|
||||
if (libIncludes.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
@@ -785,9 +827,9 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
Node includesNode = document.createElement("includes");
|
||||
dependencySetNode.appendChild(includesNode);
|
||||
|
||||
for (String include : libIncludes) {
|
||||
for (Dependency dependency : libIncludes.values()) {
|
||||
Node includeNode = document.createElement("include");
|
||||
includeNode.setTextContent(include);
|
||||
includeNode.setTextContent(getAssemblyCoordinate(dependency));
|
||||
includesNode.appendChild(includeNode);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.maven.model.Build;
|
||||
import org.apache.maven.model.Dependency;
|
||||
import org.apache.maven.model.Model;
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.model.PluginExecution;
|
||||
@@ -213,7 +213,7 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
|
||||
|
||||
@Override
|
||||
protected void updateDependencySet(IFile assemblyFile) {
|
||||
Set<String> jobCoordinate = new HashSet<>();
|
||||
Map<String, Dependency> jobCoordinateMap = new HashMap<String, Dependency>();
|
||||
if (!hasLoopDependency()) {
|
||||
// add children jobs
|
||||
Set<JobInfo> childrenJobInfo = getJobProcessor().getBuildChildrenJobs();
|
||||
@@ -221,7 +221,9 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
|
||||
Property property = jobInfo.getProcessItem().getProperty();
|
||||
String coordinate = getCoordinate(PomIdsHelper.getJobGroupId(property), PomIdsHelper.getJobArtifactId(jobInfo),
|
||||
MavenConstants.PACKAGING_JAR, PomIdsHelper.getJobVersion(property));
|
||||
jobCoordinate.add(coordinate);
|
||||
Dependency dependency = getDependencyObject(PomIdsHelper.getJobGroupId(property), PomIdsHelper.getJobArtifactId(jobInfo), PomIdsHelper.getJobVersion(property),
|
||||
MavenConstants.PACKAGING_JAR, null);
|
||||
jobCoordinateMap.put(coordinate, dependency);
|
||||
}
|
||||
}
|
||||
// add parent job
|
||||
@@ -229,11 +231,13 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
|
||||
String parentCoordinate = getCoordinate(PomIdsHelper.getJobGroupId(parentProperty),
|
||||
PomIdsHelper.getJobArtifactId(parentProperty), MavenConstants.PACKAGING_JAR,
|
||||
PomIdsHelper.getJobVersion(parentProperty));
|
||||
jobCoordinate.add(parentCoordinate);
|
||||
Dependency parentDependency = getDependencyObject(PomIdsHelper.getJobGroupId(parentProperty), PomIdsHelper.getJobArtifactId(parentProperty), PomIdsHelper.getJobVersion(parentProperty),
|
||||
MavenConstants.PACKAGING_JAR, null);
|
||||
jobCoordinateMap.put(parentCoordinate, parentDependency);
|
||||
try {
|
||||
Document document = PomUtil.loadAssemblyFile(null, assemblyFile);
|
||||
// add jobs
|
||||
setupDependencySetNode(document, jobCoordinate, "${talend.job.name}",
|
||||
setupDependencySetNode(document, jobCoordinateMap, "${talend.job.name}",
|
||||
"${artifact.build.finalName}.${artifact.extension}", true);
|
||||
PomUtil.saveAssemblyFile(assemblyFile, document);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -31,6 +31,7 @@ import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
@@ -116,7 +117,9 @@ public class PomUtil {
|
||||
if (pomFile == null) {
|
||||
throw new NullPointerException("the output file is null.");
|
||||
}
|
||||
|
||||
Properties properties = new Properties();
|
||||
properties.putAll(model.getProperties());
|
||||
model.setProperties(properties);
|
||||
/*
|
||||
* copied the codes from createMavenModel of MavenModelManager
|
||||
*/
|
||||
@@ -138,7 +141,9 @@ public class PomUtil {
|
||||
if (pomFile == null) {
|
||||
throw new NullPointerException("the output file is null.");
|
||||
}
|
||||
|
||||
Properties properties = new Properties();
|
||||
properties.putAll(model.getProperties());
|
||||
model.setProperties(properties);
|
||||
ByteArrayOutputStream buf = new ByteArrayOutputStream();
|
||||
MavenPlugin.getMaven().writeModel(model, buf);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2018 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2019 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
@@ -75,4 +75,6 @@ public class PasswordEncryptUtil {
|
||||
return input;
|
||||
}
|
||||
|
||||
public static final String PASSWORD_FOR_LOGS_VALUE = "...";
|
||||
|
||||
}
|
||||
|
||||
@@ -919,6 +919,9 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
|
||||
if (ModuleStatusProvider.getDeployStatus(mvnUriStatusKey) == ELibraryInstallStatus.NOT_DEPLOYED) {
|
||||
return null;
|
||||
}
|
||||
if(mvnUriStatusKey == null){
|
||||
return null;
|
||||
}
|
||||
// then try to resolve locally
|
||||
String localMavenUri = mvnUriStatusKey.replace("mvn:", "mvn:" + MavenConstants.LOCAL_RESOLUTION_URL + "!"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
try {
|
||||
|
||||
@@ -349,6 +349,10 @@ public class DatabaseForm extends AbstractForm {
|
||||
private final String originalUischema;
|
||||
|
||||
private final String originalURL;
|
||||
|
||||
private final String orginalDBVersion;
|
||||
|
||||
private final String originalPort;
|
||||
|
||||
private final Boolean originalIsNeedReload;
|
||||
|
||||
@@ -558,6 +562,8 @@ public class DatabaseForm extends AbstractForm {
|
||||
|
||||
originalUischema = metadataconnection.getUiSchema() == null ? "" : metadataconnection.getUiSchema();
|
||||
originalURL = metadataconnection.getUrl();
|
||||
originalPort = metadataconnection.getPort() == null ? "" : metadataconnection.getPort();
|
||||
orginalDBVersion = metadataconnection.getDbVersionString() == null ? "" : metadataconnection.getDbVersionString();
|
||||
originalIsNeedReload = ConnectionHelper.getIsConnNeedReload(getConnection());
|
||||
|
||||
this.typeName = EDatabaseTypeName.getTypeFromDbType(metadataconnection.getDbType());
|
||||
@@ -4706,7 +4712,6 @@ public class DatabaseForm extends AbstractForm {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Db version
|
||||
dbVersionCombo.addModifyListener(new ModifyListener() {
|
||||
|
||||
@@ -4715,14 +4720,17 @@ public class DatabaseForm extends AbstractForm {
|
||||
if (!isContextMode()) {
|
||||
EDatabaseVersion4Drivers version = EDatabaseVersion4Drivers.indexOfByVersionDisplay(dbVersionCombo.getText());
|
||||
if (version != null) {
|
||||
if(EDatabaseTypeName.SYBASEASE.getDisplayName().equals(getConnectionDBType())) {
|
||||
if(version.getVersionValue().equals( EDatabaseVersion4Drivers.SYBASEIQ_16_SA.getVersionValue())) {
|
||||
portText.setText(EDatabaseConnTemplate.SYBASEASE_16_SA.getDefaultPort());
|
||||
}else {
|
||||
portText.setText(EDatabaseConnTemplate.SYBASEASE.getDefaultPort());
|
||||
}
|
||||
}
|
||||
|
||||
if (EDatabaseTypeName.SYBASEASE.getDisplayName().equals(getConnectionDBType())) {
|
||||
if (version.getVersionValue().equals(orginalDBVersion) && StringUtils.isNotEmpty(originalPort)) {
|
||||
portText.setText(originalPort);
|
||||
} else if (version.getVersionValue()
|
||||
.equals(EDatabaseVersion4Drivers.SYBASEIQ_16_SA.getVersionValue())) {
|
||||
portText.setText(EDatabaseConnTemplate.SYBASEASE_16_SA.getDefaultPort());
|
||||
} else {
|
||||
portText.setText(EDatabaseConnTemplate.SYBASEASE.getDefaultPort());
|
||||
}
|
||||
}
|
||||
|
||||
getConnection().setDbVersionString(version.getVersionValue());
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2019 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.nexus;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.talend.core.nexus.ArtifactRepositoryBean.NexusType;
|
||||
|
||||
/**
|
||||
* DOC jding class global comment. Detailled comment
|
||||
*/
|
||||
public class ArtifactRepositoryBeanTest {
|
||||
|
||||
@Test
|
||||
public void testSplitRepositoryUrl() {
|
||||
String repositoryType = ArtifactRepositoryBean.NexusType.ARTIFACTORY.name();
|
||||
// default contextpath artifactory
|
||||
String urlCase = "http://localhost:8081/artifactory/Releases/";
|
||||
// non-default contextpath
|
||||
String urlCase1 = "http://localhost:8081/artifacts/Releases/";
|
||||
// root contextpath
|
||||
String urlCase2 = "http://localhost:8081/Releases/";
|
||||
|
||||
String[] splitedUrl = NexusType.splitRepositoryUrl(urlCase, repositoryType);
|
||||
Assert.assertEquals("http://localhost:8081/artifactory/", splitedUrl[0]);
|
||||
Assert.assertEquals("Releases", splitedUrl[1]);
|
||||
|
||||
String[] splitedUrl_1 = NexusType.splitRepositoryUrl(urlCase1, repositoryType);
|
||||
Assert.assertEquals("http://localhost:8081/artifacts/", splitedUrl_1[0]);
|
||||
Assert.assertEquals("Releases", splitedUrl_1[1]);
|
||||
|
||||
String[] splitedUrl_2 = NexusType.splitRepositoryUrl(urlCase2, repositoryType);
|
||||
Assert.assertEquals("http://localhost:8081/", splitedUrl_2[0]);
|
||||
Assert.assertEquals("Releases", splitedUrl_2[1]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user