Compare commits
86 Commits
patch/TPS-
...
release/8.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
177287eebf | ||
|
|
c4ee889b3e | ||
|
|
26ead1e043 | ||
|
|
5553ce8694 | ||
|
|
caa99b5658 | ||
|
|
057580aa9e | ||
|
|
d66aa2af38 | ||
|
|
95f7b845b3 | ||
|
|
21d1ea7f84 | ||
|
|
d3a6096bc0 | ||
|
|
5705ca4789 | ||
|
|
4a7a831c77 | ||
|
|
e169b49a01 | ||
|
|
d302023eea | ||
|
|
2256de6b73 | ||
|
|
c2162b4074 | ||
|
|
2ee30fecd0 | ||
|
|
340a06876c | ||
|
|
f3c39d14d5 | ||
|
|
9c2e26bcab | ||
|
|
65e7cfb71e | ||
|
|
b338afee4c | ||
|
|
87d7a849ac | ||
|
|
73a2ac7971 | ||
|
|
e22dfb1215 | ||
|
|
9781e2fe08 | ||
|
|
60cc7742ad | ||
|
|
5369ee2142 | ||
|
|
4406d35a69 | ||
|
|
33d797e16c | ||
|
|
c282d32a80 | ||
|
|
543c5a29f8 | ||
|
|
f91f791c24 | ||
|
|
be96adb142 | ||
|
|
33d1276627 | ||
|
|
f6d544c5e3 | ||
|
|
2b8777269d | ||
|
|
fb360093a8 | ||
|
|
38fdc62738 | ||
|
|
8f1cc68be3 | ||
|
|
f34bb8520c | ||
|
|
888c3281f6 | ||
|
|
db614cc415 | ||
|
|
5210b033d0 | ||
|
|
e91b347450 | ||
|
|
ea459b8710 | ||
|
|
2ee58ac9d0 | ||
|
|
0e668b3239 | ||
|
|
1fe8bec5cf | ||
|
|
74d5eb4d90 | ||
|
|
12a842a565 | ||
|
|
9419f94c07 | ||
|
|
0beef6b531 | ||
|
|
d19f0dbce7 | ||
|
|
6ff18c0449 | ||
|
|
4c93a1bed0 | ||
|
|
2462a7a792 | ||
|
|
e18ffe5f0f | ||
|
|
b22b9decce | ||
|
|
9a3307bace | ||
|
|
dd5400af61 | ||
|
|
505609aa4b | ||
|
|
99da8e2286 | ||
|
|
239ece2966 | ||
|
|
ce4740ce83 | ||
|
|
7c795f724c | ||
|
|
67784188df | ||
|
|
248a7d74dc | ||
|
|
c09c406c32 | ||
|
|
bd5b8b0f51 | ||
|
|
eb7c195d3e | ||
|
|
33162c8be4 | ||
|
|
7169a3101a | ||
|
|
192e47b6a3 | ||
|
|
28eda4c880 | ||
|
|
309c2ac056 | ||
|
|
64c530b6b4 | ||
|
|
71f93b5165 | ||
|
|
41b50e16c1 | ||
|
|
b7711e1dd5 | ||
|
|
8ed759c0d8 | ||
|
|
3ff40da876 | ||
|
|
da6a983f29 | ||
|
|
2913c80aef | ||
|
|
fa2abaf8f3 | ||
|
|
81e63ecab0 |
BIN
main/plugins/org.talend.common.ui.runtime/icons/moreInfo.png
Normal file
BIN
main/plugins/org.talend.common.ui.runtime/icons/moreInfo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 288 B |
Binary file not shown.
|
After Width: | Height: | Size: 627 B |
@@ -115,6 +115,8 @@ public enum ECoreImage implements IImage {
|
||||
|
||||
METADATA_SAPCONNECTION_ICON("/icons1/sapconnection.png"), //$NON-NLS-1$
|
||||
METADATA_SAPCONNECTION_WIZ("/icons1/connection_wiz.gif"), //$NON-NLS-1$
|
||||
|
||||
METADATA_BIGQUERYCONNECTION_ICON("/icons1/bigqueryconnection.png"), //$NON-NLS-1$
|
||||
|
||||
METADATA_HEADERFOOTER_ICON("/icons1/headerfooter_icon32.png"), //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ public enum EImage implements IImage {
|
||||
READ_ICON("/icons/read_obj.gif"), //$NON-NLS-1$
|
||||
|
||||
QUESTION_ICON("/icons/question.gif"), //$NON-NLS-1$
|
||||
|
||||
HELP_ICON("/icons/help.png"), //$NON-NLS-1$
|
||||
MOREINFO_ICON("/icons/moreInfo.png"), //$NON-NLS-1$
|
||||
|
||||
CREATE_CONNECTION_ICON("/icons/connection.gif"), //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.12.0</version>
|
||||
<version>2.12.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.reload4j</groupId>
|
||||
@@ -125,7 +125,7 @@
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>30.0-jre</version>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
|
||||
@@ -145,7 +145,30 @@ public class DB2ForZosDataBaseMetadata extends PackageFakeDatabaseMetadata {
|
||||
*/
|
||||
@Override
|
||||
public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException {
|
||||
return new DB2ForZosResultSet();
|
||||
ResultSet rs = super.getPrimaryKeys(catalog, schema, table);
|
||||
if (rs == null) {
|
||||
rs = new DB2ForZosResultSet();
|
||||
}
|
||||
return rs;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.utils.database.FakeDatabaseMetaData#getExportedKeys(java.lang.String, java.lang.String,
|
||||
* java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException {
|
||||
ResultSet rs = super.getExportedKeys(catalog, schema, table);
|
||||
if (rs == null) {
|
||||
if (this.metaData != null) {
|
||||
rs = this.metaData.getExportedKeys(catalog, schema, table);
|
||||
} else {
|
||||
rs = new DB2ForZosResultSet();
|
||||
}
|
||||
}
|
||||
return rs;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -174,17 +197,6 @@ public class DB2ForZosDataBaseMetadata extends PackageFakeDatabaseMetadata {
|
||||
return tableResultSet;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.utils.database.FakeDatabaseMetaData#getExportedKeys(java.lang.String, java.lang.String,
|
||||
* java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException {
|
||||
return new DB2ForZosResultSet();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
||||
@@ -130,11 +130,10 @@ public abstract class ExportPushButtonForExtendedTable extends ExportPushButton
|
||||
AbstractExtendedTableViewer extendedTableViewer = (AbstractExtendedTableViewer) extendedControlViewer;
|
||||
ExtendedTableModel extendedTableModel = extendedTableViewer.getExtendedTableModel();
|
||||
boolean enabled = false;
|
||||
if (extendedTableModel != null && extendedTableModel.isDataRegistered()
|
||||
&& extendedTableModel.getBeansList().size() > 0) {
|
||||
if (extendedTableModel != null && extendedTableModel.isDataRegistered() && extendedTableModel.getBeansList().size() > 0) {
|
||||
enabled = true;
|
||||
}
|
||||
return super.getEnabledState() && enabled;
|
||||
return extendedTableModel != null || enabled;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
|
||||
/**
|
||||
* DOC Administrator class global comment. Detailled comment <br/>
|
||||
@@ -33,4 +34,11 @@ public abstract class SaveAsGenericSchemaPushButton extends ExtendedPushButton {
|
||||
|
||||
@Override
|
||||
protected abstract Command getCommandToExecute();
|
||||
|
||||
@Override
|
||||
public boolean getEnabledState() {
|
||||
AbstractExtendedTableViewer extendedTableViewer = (AbstractExtendedTableViewer) extendedControlViewer;
|
||||
ExtendedTableModel extendedTableModel = extendedTableViewer.getExtendedTableModel();
|
||||
return extendedTableModel != null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.preference.PreferenceConverter;
|
||||
import org.eclipse.jface.resource.StringConverter;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
@@ -94,8 +93,6 @@ public class ColorManager {
|
||||
public static final String BOLD_SUFFIX = "Bold"; //$NON-NLS-1$
|
||||
|
||||
private Map<String, Color> colorMap;
|
||||
|
||||
private static Map<String, Color> THEME_COLOR_MAP = new HashMap<String, Color>();
|
||||
|
||||
private IPreferenceStore store;
|
||||
|
||||
@@ -119,12 +116,9 @@ public class ColorManager {
|
||||
}
|
||||
|
||||
private static Color getThemeColor(String colorName) {
|
||||
if (!THEME_COLOR_MAP.containsKey(colorName)) {
|
||||
Color c = ITalendThemeService.getColor(colorName)
|
||||
.orElse(Display.getDefault().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
|
||||
THEME_COLOR_MAP.put(colorName, c);
|
||||
}
|
||||
return THEME_COLOR_MAP.get(colorName);
|
||||
Color c = ITalendThemeService.getColor(colorName)
|
||||
.orElse(Display.getDefault().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
|
||||
return c;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
@@ -135,7 +129,6 @@ public class ColorManager {
|
||||
color.dispose();
|
||||
}
|
||||
colorMap = null;
|
||||
THEME_COLOR_MAP.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -156,6 +156,7 @@ ProjectRepositoryNode.invalidItem=Invalid item
|
||||
ProjectRepositoryNode.columns=Columns
|
||||
ProjectRepositoryNode.validationRules=Validation Rules
|
||||
ProjectRepositoryNode.cdcFoundation=CDC Foundation
|
||||
ProjectRepositoryNode.cdcFoundation.deprecated=CDC Foundation (deprecated)
|
||||
ProjectRepositoryNode.genericSchema=Generic schemas
|
||||
ProjectRepositoryNode.queries=Queries
|
||||
ProjectRepositoryNode.synonymSchemas=Synonym schemas
|
||||
@@ -175,6 +176,7 @@ ProjectRepositoryNode.sapBWDataStoreObject=SAP DSO
|
||||
ProjectRepositoryNode.sapBWInfoCube=SAP InfoCube
|
||||
ProjectRepositoryNode.sapBWInfoObject=SAP InfoObject
|
||||
ProjectRepositoryNode.sapContentExtractor=SAP BI Content Extractor
|
||||
ProjectRepositoryNode.sapCDSView=SAP CDS View
|
||||
RepositoryDropAdapter_copyingItems=Copying items...
|
||||
RepositoryDropAdapter_errorMsg=This directory contains the locked item,it can not be moved now
|
||||
RepositoryDropAdapter_lockedByOthers=This item is locked by other users, it can not be moved now.
|
||||
|
||||
@@ -175,6 +175,7 @@ ProjectRepositoryNode.sapBWDataStoreObject=Objet Data Store SAP
|
||||
ProjectRepositoryNode.sapBWInfoCube=InfoCube SAP
|
||||
ProjectRepositoryNode.sapBWInfoObject=InfoObject SAP
|
||||
ProjectRepositoryNode.sapContentExtractor=Extracteur SAP BI Content
|
||||
ProjectRepositoryNode.sapCDSView=Vue SAP CDS
|
||||
RepositoryDropAdapter_copyingItems=Copie des \u00E9l\u00E9ments...
|
||||
RepositoryDropAdapter_errorMsg=Ce r\u00E9pertoire contient l'\u00E9l\u00E9ment verrouill\u00E9, il ne peut \u00EAtre d\u00E9plac\u00E9
|
||||
RepositoryDropAdapter_lockedByOthers=Cet \u00E9l\u00E9ment est verrouill\u00E9 par d'autres utilisateurs, impossible de le d\u00E9placer.
|
||||
|
||||
@@ -156,6 +156,7 @@ ProjectRepositoryNode.invalidItem=\u7121\u52B9\u306A\u30A2\u30A4\u30C6\u30E0
|
||||
ProjectRepositoryNode.columns=\u30AB\u30E9\u30E0
|
||||
ProjectRepositoryNode.validationRules=\u691C\u8A3C\u30EB\u30FC\u30EB
|
||||
ProjectRepositoryNode.cdcFoundation=CDC Foundation
|
||||
ProjectRepositoryNode.cdcFoundation.deprecated=CDC Foundation (\u975E\u63A8\u5968)
|
||||
ProjectRepositoryNode.genericSchema=\u30B8\u30A7\u30CD\u30EA\u30C3\u30AF\u30B9\u30AD\u30FC\u30DE
|
||||
ProjectRepositoryNode.queries=\u30AF\u30A8\u30EA\u30FC
|
||||
ProjectRepositoryNode.synonymSchemas=\u30B7\u30CE\u30CB\u30E0\u30B9\u30AD\u30FC\u30DE
|
||||
@@ -175,6 +176,7 @@ ProjectRepositoryNode.sapBWDataStoreObject=SAP DSO
|
||||
ProjectRepositoryNode.sapBWInfoCube=SAP InfoCube
|
||||
ProjectRepositoryNode.sapBWInfoObject=SAP InfoObject
|
||||
ProjectRepositoryNode.sapContentExtractor=SAP BI\u30B3\u30F3\u30C6\u30F3\u30C4\u30A8\u30AF\u30B9\u30C8\u30E9\u30AF\u30BF\u30FC
|
||||
ProjectRepositoryNode.sapCDSView=SAP CDS\u30D3\u30E5\u30FC
|
||||
RepositoryDropAdapter_copyingItems=\u30A2\u30A4\u30C6\u30E0\u3092\u30B3\u30D4\u30FC\u4E2D...
|
||||
RepositoryDropAdapter_errorMsg=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FC\u306B\u30ED\u30C3\u30AF\u3055\u308C\u305F\u30A2\u30A4\u30C6\u30E0\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002\u73FE\u5728\u3001\u79FB\u52D5\u3067\u304D\u307E\u305B\u3093,
|
||||
RepositoryDropAdapter_lockedByOthers=\u3053\u306E\u30A2\u30A4\u30C6\u30E0\u304C\u4ED6\u306E\u30E6\u30FC\u30B6\u30FC\u306B\u3088\u3063\u3066\u30ED\u30C3\u30AF\u3055\u308C\u307E\u3057\u305F\u3002\u73FE\u5728\u3001\u79FB\u52D5\u3067\u304D\u307E\u305B\u3093\u3002
|
||||
|
||||
@@ -175,6 +175,7 @@ ProjectRepositoryNode.sapBWDataStoreObject=SAP DSO
|
||||
ProjectRepositoryNode.sapBWInfoCube=SAP InfoCube
|
||||
ProjectRepositoryNode.sapBWInfoObject=SAP InfoObject
|
||||
ProjectRepositoryNode.sapContentExtractor=SAP BI \u5185\u5BB9\u63D0\u53D6\u5668
|
||||
ProjectRepositoryNode.sapCDSView=SAP CDS \u89C6\u56FE
|
||||
RepositoryDropAdapter_copyingItems=\u6B63\u5728\u590D\u5236\u9879\u76EE...
|
||||
RepositoryDropAdapter_errorMsg=\u6B64\u76EE\u5F55\u5305\u542B\u9501\u5B9A\u7684\u9879\u76EE\uFF0C\u73B0\u5728\u65E0\u6CD5\u79FB\u52A8
|
||||
RepositoryDropAdapter_lockedByOthers=\u6B64\u9879\u76EE\u88AB\u5176\u4ED6\u7528\u6237\u9501\u5B9A\uFF0C\u73B0\u5728\u65E0\u6CD5\u79FB\u52A8\u3002
|
||||
|
||||
@@ -67,7 +67,6 @@ import org.talend.core.model.repository.Folder;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.repository.LockInfo;
|
||||
import org.talend.core.model.repository.RepositoryViewObject;
|
||||
import org.talend.core.model.routines.RoutinesUtil;
|
||||
import org.talend.core.repository.i18n.Messages;
|
||||
import org.talend.core.repository.utils.XmiResourceManager;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
@@ -131,7 +130,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
ERepositoryObjectType.METADATA_FILE_RULES, ERepositoryObjectType.METADATA_FILE_HL7,
|
||||
ERepositoryObjectType.METADATA_FILE_FTP, ERepositoryObjectType.METADATA_FILE_BRMS,
|
||||
ERepositoryObjectType.METADATA_MDMCONNECTION, ERepositoryObjectType.METADATA_HEADER_FOOTER,
|
||||
ERepositoryObjectType.JOB_SCRIPT };
|
||||
ERepositoryObjectType.JOB_SCRIPT, ERepositoryObjectType.METADATA_BIGQUERYCONNECTIONS };
|
||||
|
||||
List<IRepositoryViewObject> deletedItems = new ArrayList<IRepositoryViewObject>();
|
||||
for (ERepositoryObjectType type : types) {
|
||||
@@ -874,25 +873,38 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
@Override
|
||||
public IRepositoryViewObject getLastVersion(Project project, String id, String relativeFolder, ERepositoryObjectType type)
|
||||
throws PersistenceException {
|
||||
List<IRepositoryViewObject> serializableAllVersion = null;
|
||||
Object fullFolder = getFullFolder(project, type, relativeFolder);
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, false, true, true);
|
||||
List<IRepositoryViewObject> serializableAllVersion = new ArrayList<>();
|
||||
if (lastFolderForItemMap.containsKey(id)) {
|
||||
ERepositoryObjectType itemType = lastRepositoryTypeForItemMap.get(id);
|
||||
String currentPath = lastFolderForItemMap.get(id);
|
||||
Object fullFolder = getFullFolder(project, itemType, currentPath);
|
||||
try {
|
||||
if (fullFolder != null && (fullFolder instanceof FolderItem || ((IFolder) fullFolder).exists())) {
|
||||
serializableAllVersion.addAll(getSerializableFromFolder(project, fullFolder, id, itemType, false, false, true, true));
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
// do nothing.
|
||||
// if any exception happen or can't find the item, just try to look for it everywhere.
|
||||
}
|
||||
}
|
||||
if (serializableAllVersion.isEmpty()) {
|
||||
// look in all folders for this item type
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, true, true, true, true);
|
||||
Object fullFolder = getFullFolder(project, type, relativeFolder);
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, false, true, true);
|
||||
if (serializableAllVersion.isEmpty()) {
|
||||
// look in all folders for this item type
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, true, true, true, true);
|
||||
}
|
||||
}
|
||||
int size = serializableAllVersion.size();
|
||||
|
||||
if (size > 1) {
|
||||
String message = getItemsMessages(serializableAllVersion, size);
|
||||
|
||||
throw new PersistenceException(Messages.getString(
|
||||
"AbstractEMFRepositoryFactory.presistenceException.OnlyOneOccurenceMustbeFound", message)); //$NON-NLS-1$
|
||||
} else if (size == 1) {
|
||||
return serializableAllVersion.get(0);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if (size == 1) {
|
||||
return serializableAllVersion.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void computePropertyMaxInformationLevel(Property property) {
|
||||
|
||||
@@ -184,6 +184,7 @@ public abstract class AbstractRepositoryFactory implements IRepositoryFactory {
|
||||
collect(getMetadata(project, ERepositoryObjectType.METADATA_FILE_LDIF), result);
|
||||
collect(getMetadata(project, ERepositoryObjectType.METADATA_CONNECTIONS), result);
|
||||
collect(getMetadata(project, ERepositoryObjectType.METADATA_SAPCONNECTIONS), result);
|
||||
collect(getMetadata(project, ERepositoryObjectType.METADATA_BIGQUERYCONNECTIONS), result);
|
||||
collect(getMetadata(project, ERepositoryObjectType.METADATA_HEADER_FOOTER), result);
|
||||
collect(getMetadata(project, ERepositoryObjectType.METADATA_LDAP_SCHEMA), result);
|
||||
collect(getMetadata(project, ERepositoryObjectType.METADATA_GENERIC_SCHEMA), result);
|
||||
|
||||
@@ -102,6 +102,7 @@ import org.talend.cwm.helper.ConnectionHelper;
|
||||
import org.talend.cwm.helper.SAPBWTableHelper;
|
||||
import org.talend.cwm.helper.SubItemHelper;
|
||||
import org.talend.cwm.helper.TableHelper;
|
||||
import org.talend.cwm.helper.TaggedValueHelper;
|
||||
import org.talend.designer.core.IDesignerCoreService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.model.BinRepositoryNode;
|
||||
@@ -1349,6 +1350,8 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
connection = dbMetadataConnection;
|
||||
} else if (type == ERepositoryObjectType.METADATA_SAPCONNECTIONS) {
|
||||
connection = ((ConnectionItem) repositoryObject.getProperty().getItem()).getConnection();
|
||||
} else if (type == ERepositoryObjectType.METADATA_BIGQUERYCONNECTIONS) {
|
||||
connection = ((ConnectionItem) repositoryObject.getProperty().getItem()).getConnection();
|
||||
} else if (type == ERepositoryObjectType.METADATA_FILE_DELIMITED) {
|
||||
connection = ((ConnectionItem) repositoryObject.getProperty().getItem()).getConnection();
|
||||
} else if (type == ERepositoryObjectType.METADATA_FILE_POSITIONAL) {
|
||||
@@ -1700,11 +1703,11 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
DatabaseConnectionItem connectionItem = (DatabaseConnectionItem) item;
|
||||
DatabaseConnection connection = (DatabaseConnection) connectionItem.getConnection();
|
||||
if (PluginChecker.isCDCPluginLoaded()) {
|
||||
ICDCProviderService service = GlobalServiceRegister.getDefault()
|
||||
.getService(ICDCProviderService.class);
|
||||
ICDCProviderService service = GlobalServiceRegister.getDefault().getService(ICDCProviderService.class);
|
||||
|
||||
if (service != null && service.canCreateCDCConnection(connection)) {
|
||||
RepositoryNode cdcNode = new StableRepositoryNode(node,
|
||||
Messages.getString("ProjectRepositoryNode.cdcFoundation"), //$NON-NLS-1$
|
||||
Messages.getString("ProjectRepositoryNode.cdcFoundation.deprecated"), //$NON-NLS-1$
|
||||
ECoreImage.FOLDER_CLOSE_ICON);
|
||||
node.getChildren().add(cdcNode);
|
||||
service.createCDCTypes(recBinNode, cdcNode, connection.getCdcConns());
|
||||
@@ -1751,6 +1754,9 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
|
||||
// 10. BW Business Content Extractor:
|
||||
createSAPContentExtractorNodes(repObj, metadataConnection, node, validationRules);
|
||||
|
||||
// 11. CDS views:
|
||||
createSAPCDSViewNodes(repObj, metadataConnection, node, validationRules);
|
||||
} else if (metadataConnection instanceof SalesforceSchemaConnection) {
|
||||
createSalesforceModuleNodes(repObj, metadataConnection, node, validationRules);
|
||||
} else {
|
||||
@@ -1784,7 +1790,9 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
for (MetadataTable tablesWithOrder : tablesWithOrders) {
|
||||
EMap<String, String> properties = tablesWithOrder.getAdditionalProperties();
|
||||
String partitionKey = properties.get(EProperties.CONTENT_TYPE.name());
|
||||
if (!ERepositoryObjectType.METADATA_SAP_CONTENT_EXTRACTOR.name().equals(partitionKey)) {
|
||||
String cdsType = TaggedValueHelper.getValueString(EProperties.CONTENT_TYPE.name(), tablesWithOrder);
|
||||
if (!ERepositoryObjectType.METADATA_SAP_CONTENT_EXTRACTOR.name().equals(partitionKey)
|
||||
&& !ERepositoryObjectType.METADATA_SAP_CDS_VIEW.name().equals(cdsType)) {
|
||||
tables.add(tablesWithOrder);
|
||||
}
|
||||
}
|
||||
@@ -1967,6 +1975,32 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
createTables(tableContainer, repObj, tables, ERepositoryObjectType.METADATA_CON_TABLE, validationRules);
|
||||
}
|
||||
|
||||
private void createSAPCDSViewNodes(IRepositoryViewObject repObj, Connection metadataConnection, RepositoryNode node,
|
||||
List<IRepositoryViewObject> validationRules) {
|
||||
StableRepositoryNode tableContainer = new StableRepositoryNode(node,
|
||||
Messages.getString("ProjectRepositoryNode.sapCDSView"), ECoreImage.FOLDER_CLOSE_ICON); //$NON-NLS-1$
|
||||
tableContainer.setChildrenObjectType(ERepositoryObjectType.METADATA_CON_TABLE);
|
||||
tableContainer.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_SAP_CDS_VIEW);
|
||||
IRepositoryNode cacheNode = nodeCache.getCache(tableContainer);
|
||||
if (cacheNode != null && cacheNode instanceof StableRepositoryNode) {
|
||||
tableContainer = (StableRepositoryNode) cacheNode;
|
||||
tableContainer.getChildren().clear();
|
||||
} else {
|
||||
nodeCache.addCache(tableContainer, true);
|
||||
}
|
||||
|
||||
node.getChildren().add(tableContainer);
|
||||
List<MetadataTable> tablesWithOrders = ConnectionHelper.getTablesWithOrders(metadataConnection);
|
||||
EList<MetadataTable> tables = new BasicEList<>();
|
||||
for (MetadataTable tablesWithOrder : tablesWithOrders) {
|
||||
String cdsType = TaggedValueHelper.getValueString(EProperties.CONTENT_TYPE.name(), tablesWithOrder);
|
||||
if (ERepositoryObjectType.METADATA_SAP_CDS_VIEW.name().equals(cdsType)) {
|
||||
tables.add(tablesWithOrder);
|
||||
}
|
||||
}
|
||||
createTables(tableContainer, repObj, tables, ERepositoryObjectType.METADATA_CON_TABLE, validationRules);
|
||||
}
|
||||
|
||||
private void createSalesforceModuleNodes(IRepositoryViewObject rebObj, Connection metadataConnection,
|
||||
RepositoryNode connectionNode, List<IRepositoryViewObject> validationRules) {
|
||||
EList modules = ((SalesforceSchemaConnection) metadataConnection).getModules();
|
||||
|
||||
@@ -54,9 +54,7 @@ import org.eclipse.jface.dialogs.InputDialog;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.osgi.internal.serviceregistry.ServiceReferenceImpl;
|
||||
import org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.MessageBox;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.navigator.CommonNavigator;
|
||||
import org.eclipse.ui.navigator.CommonViewer;
|
||||
@@ -447,12 +445,10 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
if (currentShell == null) {
|
||||
currentShell = DisplayUtils.getDefaultShell(false);
|
||||
}
|
||||
MessageBox box = new MessageBox(currentShell, SWT.ICON_WARNING | SWT.OK | SWT.CANCEL);
|
||||
box.setText(Messages.getString("ProxyRepositoryFactory.JobNameErroe")); //$NON-NLS-1$
|
||||
box.setMessage(Messages.getString("ProxyRepositoryFactory.Label") + " " + name + " " + Messages.getString("ProxyRepositoryFactory.ReplaceJob")); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$
|
||||
|
||||
if (box.open() == SWT.OK) {
|
||||
|
||||
if (MessageDialog.openQuestion(currentShell,
|
||||
Messages.getString("ProxyRepositoryFactory.JobNameErroe"), //$NON-NLS-1$
|
||||
Messages.getString("ProxyRepositoryFactory.Label") + " " + name + " " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ Messages.getString("ProxyRepositoryFactory.ReplaceJob"))) { //$NON-NLS-1$
|
||||
ok[0] = true;
|
||||
}
|
||||
}
|
||||
@@ -2211,6 +2207,13 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
if (IHadoopDistributionService.get() != null) {
|
||||
try {
|
||||
IHadoopDistributionService.get().checkAndMigrateDistributionProxyCredential(project);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
// init dynamic distirbution after `beforeLogon`, before loading libraries.
|
||||
initDynamicDistribution(monitor);
|
||||
|
||||
|
||||
@@ -606,6 +606,8 @@ public class DuplicateAction extends AContextualAction {
|
||||
item = PropertiesFactory.eINSTANCE.createSalesforceSchemaConnectionItem();
|
||||
} else if (repositoryType == ERepositoryObjectType.METADATA_SAPCONNECTIONS) {
|
||||
item = PropertiesFactory.eINSTANCE.createSAPConnectionItem();
|
||||
} else if (repositoryType == ERepositoryObjectType.METADATA_BIGQUERYCONNECTIONS) {
|
||||
item = PropertiesFactory.eINSTANCE.createBigQueryConnectionItem();
|
||||
} else if (repositoryType == ERepositoryObjectType.METADATA_WSDL_SCHEMA) {
|
||||
item = PropertiesFactory.eINSTANCE.createWSDLSchemaConnectionItem();
|
||||
} else if (repositoryType == ERepositoryObjectType.PROCESS) {
|
||||
|
||||
@@ -40,6 +40,7 @@ import org.talend.core.model.utils.CloneConnectionUtils;
|
||||
import org.talend.core.model.utils.ContextParameterUtils;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
import org.talend.cwm.helper.StudioEncryptionHelper;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.model.bridge.ReponsitoryContextBridge;
|
||||
|
||||
@@ -67,6 +68,7 @@ public class StandaloneConnectionContextUtils {
|
||||
String server = getOriginalValue(contextProperties, dbConn.getServerName());
|
||||
String username = getOriginalValue(contextProperties, dbConn.getUsername());
|
||||
String password = getOriginalValue(contextProperties, dbConn.getRawPassword());
|
||||
String originEncryptedPassword = getOriginalValue(contextProperties, dbConn.getPassword());
|
||||
String port = getOriginalValue(contextProperties, dbConn.getPort());
|
||||
String sidOrDatabase = getOriginalValue(contextProperties, dbConn.getSID());
|
||||
String datasource = getOriginalValue(contextProperties, dbConn.getDatasourceName());
|
||||
@@ -87,6 +89,8 @@ public class StandaloneConnectionContextUtils {
|
||||
cloneConn.setDatasourceName(datasource);
|
||||
cloneConn.setDBRootPath(dbRootPath);
|
||||
cloneConn.setFileFieldName(filePath);
|
||||
//To avoid encrypt the same value
|
||||
cloneConn.setPassword(originEncryptedPassword);
|
||||
cloneConn.setRawPassword(password); // the password is raw.
|
||||
cloneConn.setPort(port);
|
||||
cloneConn.setUiSchema(schemaOracle);
|
||||
|
||||
@@ -43,6 +43,8 @@ public class PluginChecker {
|
||||
private static final String CDC_PLUGIN_ID = "org.talend.designer.cdc"; //$NON-NLS-1$
|
||||
|
||||
private static final String SAP_WZIARD_PLUGIN_ID = "org.talend.repository.sap"; //$NON-NLS-1$
|
||||
|
||||
private static final String BIGQUERY_WZIARD_PLUGIN_ID = "org.talend.repository.bigquery"; //$NON-NLS-1$
|
||||
|
||||
private static final String EBCDIC_PLUGIN_ID = "org.talend.repository.ebcdic"; //$NON-NLS-1$
|
||||
|
||||
@@ -246,6 +248,10 @@ public class PluginChecker {
|
||||
public static boolean isSAPWizardPluginLoaded() {
|
||||
return isPluginLoaded(SAP_WZIARD_PLUGIN_ID);
|
||||
}
|
||||
|
||||
public static boolean isBigQueryWizardPluginLoaded() {
|
||||
return isPluginLoaded(BIGQUERY_WZIARD_PLUGIN_ID);
|
||||
}
|
||||
|
||||
public static boolean isEBCDICPluginLoaded() {
|
||||
return isPluginLoaded(EBCDIC_PLUGIN_ID);
|
||||
@@ -268,7 +274,7 @@ public class PluginChecker {
|
||||
}
|
||||
|
||||
public static boolean isExchangeSystemLoaded() {
|
||||
return isPluginLoaded(EXCHANGE_SYSTEM_PLUGIN_ID);
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isRulesPluginLoaded() { // added by hyWang
|
||||
|
||||
@@ -52,6 +52,7 @@ public enum EDatabase4DriverClassName {
|
||||
MYSQL8(EDatabaseTypeName.MYSQL, "com.mysql.cj.jdbc.Driver"), //$NON-NLS-1$
|
||||
MARIADB(EDatabaseTypeName.MYSQL, "org.mariadb.jdbc.Driver"), //$NON-NLS-1$
|
||||
AMAZON_AURORA(EDatabaseTypeName.AMAZON_AURORA, "org.gjt.mm.mysql.Driver"), //$NON-NLS-1$
|
||||
AMAZON_AURORA_3(EDatabaseTypeName.AMAZON_AURORA, "com.mysql.cj.jdbc.Driver"), //$NON-NLS-1$
|
||||
NETEZZA(EDatabaseTypeName.NETEZZA, "org.netezza.Driver"), //$NON-NLS-1$
|
||||
|
||||
ORACLEFORSID(EDatabaseTypeName.ORACLEFORSID, "oracle.jdbc.OracleDriver", "oracle.jdbc.driver.OracleDriver"), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
@@ -87,8 +88,8 @@ public enum EDatabase4DriverClassName {
|
||||
// MOD klliu 2010-06-04 bug 12819: upgrade jdbc driver class used in sql explorer
|
||||
TERADATA(EDatabaseTypeName.TERADATA, "com.teradata.jdbc.TeraDriver"), //$NON-NLS-1$
|
||||
|
||||
VERTICA(EDatabaseTypeName.VERTICA, "com.vertica.Driver"), //$NON-NLS-1$
|
||||
VERTICA2(EDatabaseTypeName.VERTICA, "com.vertica.jdbc.Driver"), //$NON-NLS-1$
|
||||
// VERTICA(EDatabaseTypeName.VERTICA, "com.vertica.Driver"), //$NON-NLS-1$
|
||||
VERTICA(EDatabaseTypeName.VERTICA, "com.vertica.jdbc.Driver"), //$NON-NLS-1$
|
||||
|
||||
HIVE(EDatabaseTypeName.HIVE, "org.apache.hadoop.hive.jdbc.HiveDriver"), //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -252,6 +252,8 @@ public class ConnParameterKeys {
|
||||
|
||||
public static final String CONN_PARA_KEY_EXECUTOR_MEMORY = "CONN_PARA_KEY_EXECUTOR_MEMORY"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_EXECUTOR_CORES = "CONN_PARA_KEY_EXECUTOR_CORES";
|
||||
|
||||
public static final String CONN_PARA_KEY_TUNING_PROPERTIES = "CONN_PARA_KEY_TUNING_PROPERTIES"; //$NON-NLS-1$
|
||||
|
||||
/******************************************/
|
||||
@@ -453,6 +455,9 @@ public class ConnParameterKeys {
|
||||
public static final String CONN_PARA_KEY_UNIV_STANDALONE_EXEC_MEMORY="CONN_PARA_KEY_UNIV_STANDALONE_EXEC_MEMORY";
|
||||
public static final String CONN_PARA_KEY_UNIV_STANDALONE_EXEC_CORE="CONN_PARA_KEY_UNIV_STANDALONE_EXEC_CORE";
|
||||
|
||||
|
||||
// Spark Submit Scripts
|
||||
public static final String CONN_PARA_KEY_UNIV_SPARK_SUBMIT_SCRIPT_HOME="CONN_PARA_KEY_UNIV_SPARK_SUBMIT_SCRIPT_HOME";
|
||||
/**
|
||||
* Redshift
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,7 @@ public enum EDatabaseVersion4Drivers {
|
||||
ACCESS_2007(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, "Access 2007", "Access_2007")), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
// oracle
|
||||
ORACLE_18(new DbVersion4Drivers(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID, EDatabaseTypeName.ORACLESN,
|
||||
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 18 and above", "ORACLE_18", "ojdbc8-19.3.0.0.jar")),
|
||||
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 18 and above", "ORACLE_18", "ojdbc8-19.19.0.0.jar")),
|
||||
ORACLE_12(new DbVersion4Drivers(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID, EDatabaseTypeName.ORACLESN,
|
||||
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 12 (Deprecated)", "ORACLE_12",
|
||||
"ojdbc7.jar")),
|
||||
@@ -69,9 +69,9 @@ public enum EDatabaseVersion4Drivers {
|
||||
"SAS 9.2", "SAS_9.2", new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar", "reload4j-1.2.22.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
SAPHana(new DbVersion4Drivers(EDatabaseTypeName.SAPHana, "HDB 1.0", "HDB_1_0", "ngdbc.jar")), //$NON-NLS-1$
|
||||
// MYSQL, add for 9594
|
||||
MYSQL_8(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 8", "MYSQL_8", "mysql-connector-java-8.0.18.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MYSQL_8(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 8", "MYSQL_8", "mysql-connector-j-8.0.33.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MYSQL_5(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 5", "MYSQL_5", "mysql-connector-java-5.1.49.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MARIADB(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MariaDB", "MARIADB", "mariadb-java-client-2.5.3.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MARIADB(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MariaDB", "MARIADB", "mariadb-java-client-3.1.4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
// add for 9594
|
||||
MSSQL(new DbVersion4Drivers(EDatabaseTypeName.MSSQL,"Open source JTDS", "JTDS", "jtds-1.3.1-patch-20190523.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MSSQL_2012(new DbVersion4Drivers(EDatabaseTypeName.MSSQL,
|
||||
@@ -81,10 +81,13 @@ public enum EDatabaseVersion4Drivers {
|
||||
new String[] { "mssql-jdbc.jar", "slf4j-api-1.7.34.jar", "slf4j-reload4j-1.7.34.jar", "msal4j-1.11.0.jar", //$NON-NLS-1$
|
||||
"oauth2-oidc-sdk-9.7.jar", "reload4j-1.2.22.jar", "jackson-core-2.13.4.jar",
|
||||
"jackson-databind-2.13.4.2.jar", "jackson-annotations-2.13.4.jar", "jcip-annotations-1.0-1.jar",
|
||||
"json-smart-2.4.7.jar", "nimbus-jose-jwt-9.22.jar", "accessors-smart-2.4.7.jar", "asm-9.1.jar",
|
||||
"json-smart-2.4.11.jar", "nimbus-jose-jwt-9.22.jar", "accessors-smart-2.4.11.jar", "asm-9.5.jar",
|
||||
"content-type-2.1.jar", "lang-tag-1.5.jar" })),
|
||||
|
||||
VERTICA_9(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 9.X", "VERTICA_9_0", "vertica-jdbc-9.3.1-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
// VERTICA_9(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 9.X (Deprecated)", "VERTICA_9_0", "vertica-jdbc-9.3.1-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
//https://mvnrepository.com/artifact/com.vertica.jdbc/vertica-jdbc/12.0.4-0
|
||||
VERTICA_12(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 12.X", "VERTICA_12_0", "vertica-jdbc-12.0.4-0.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$
|
||||
@@ -156,7 +159,10 @@ public enum EDatabaseVersion4Drivers {
|
||||
"aws-java-sdk-redshift-internal-1.12.x.jar", "aws-java-sdk-core-1.12.315.jar", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"aws-java-sdk-sts-1.12.315.jar", "aws-java-sdk-redshift-1.12.315.jar", "jmespath-java-1.12.315.jar" })), //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||
|
||||
AMAZON_AURORA(new DbVersion4Drivers(EDatabaseTypeName.AMAZON_AURORA, "mysql-connector-java-5.1.49.jar")); //$NON-NLS-1$
|
||||
AMAZON_AURORA(new DbVersion4Drivers(EDatabaseTypeName.AMAZON_AURORA, "MySQL 5", "MYSQL_5", //$NON-NLS-1$
|
||||
"mysql-connector-java-5.1.49.jar")),
|
||||
AMAZON_AURORA_3(new DbVersion4Drivers(EDatabaseTypeName.AMAZON_AURORA, "MySQL 8", "MYSQL_8", //$NON-NLS-1$
|
||||
"mysql-connector-j-8.0.33.jar"));
|
||||
|
||||
private DbVersion4Drivers dbVersionBean;
|
||||
|
||||
|
||||
@@ -15,8 +15,10 @@ package org.talend.core.hadoop;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.emf.common.util.EMap;
|
||||
import org.talend.commons.exception.CommonExceptionHandler;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
@@ -25,6 +27,9 @@ import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.runtime.hd.IDynamicDistributionManager;
|
||||
import org.talend.core.runtime.i18n.Messages;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.TalendFileFactory;
|
||||
|
||||
/**
|
||||
* created by cmeng on Jul 20, 2015 Detailled comment
|
||||
@@ -145,4 +150,58 @@ public class BigDataBasicUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static String getDistributionByVersion(String version) {
|
||||
if (StringUtils.isEmpty(version))
|
||||
return null;
|
||||
if (version.startsWith("EMR")) {
|
||||
return "AMAZON_EMR";
|
||||
} else if (version.equals("SYNAPSE")) {
|
||||
return "AZURE_SYNAPSE";
|
||||
} else if (version.contains("CDH") || version.contains("CDP")) {
|
||||
return "CLOUDERA";
|
||||
} else if (version.startsWith("Databricks")) {
|
||||
return "DATABRICKS";
|
||||
} else if (version.contains("HDP")) {
|
||||
return "HORTONWORKS";
|
||||
} else if (version.startsWith("MICROSOFT_HD_INSIGHT")) {
|
||||
return "MICROSOFT_HD_INSIGHT";
|
||||
} else if (version.startsWith("SPARK")) {
|
||||
return "SPARK";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void setDistribution(NodeType node, String dbVersionName) {
|
||||
if (node == null || dbVersionName == null) {
|
||||
return;
|
||||
}
|
||||
EList<ElementParameterType> elementParameters = node.getElementParameter();
|
||||
String distribution = null;
|
||||
String dbVersion = null;
|
||||
// Iterate over the item elementParameters in order to find the "DISTRIBUTION" and "SPARK_VERSION"
|
||||
// parameters values.
|
||||
for (int i = 0; i < elementParameters.size(); i++) {
|
||||
ElementParameterType param = elementParameters.get(i);
|
||||
if (dbVersionName.equals(param.getName())) {
|
||||
dbVersion = param.getValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
try {
|
||||
ElementParameterType property = TalendFileFactory.eINSTANCE.createElementParameterType();
|
||||
distribution = BigDataBasicUtil.getDistributionByVersion(dbVersion);
|
||||
if (distribution != null) {
|
||||
property.setName("DISTRIBUTION"); //$NON-NLS-1$
|
||||
property.setField("CLOSED_LIST"); //$NON-NLS-1$
|
||||
property.setValue(distribution);
|
||||
elementParameters.add(property);
|
||||
} else {
|
||||
ExceptionHandler.log("no matched distribution for version " + dbVersion);//$NON-NLS-1$
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.log(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ public class HadoopConstants {
|
||||
public static final String SPARK_MODE_DATAPROC = "DATAPROC";
|
||||
|
||||
public static final String SPARK_MODE_SYNAPSE = "SYNAPSE";
|
||||
|
||||
public static final String SPARK_MODE_HDI = "HDI";
|
||||
|
||||
public static final String FRAMEWORK = "FRAMEWORK";
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.Map;
|
||||
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IService;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.runtime.hd.IDistributionsManager;
|
||||
import org.talend.core.runtime.hd.IDynamicDistributionManager;
|
||||
import org.talend.core.runtime.hd.IHDistribution;
|
||||
@@ -132,6 +133,8 @@ public interface IHadoopDistributionService extends IService {
|
||||
|
||||
IDynamicDistributionManager getDynamicDistributionManager();
|
||||
|
||||
void checkAndMigrateDistributionProxyCredential(Project project) throws Exception;
|
||||
|
||||
public static IHadoopDistributionService get() {
|
||||
GlobalServiceRegister gsr = GlobalServiceRegister.getDefault();
|
||||
if (gsr.isServiceRegistered(IHadoopDistributionService.class)) {
|
||||
|
||||
@@ -142,6 +142,8 @@ public enum EHadoopProperties {
|
||||
|
||||
SPARK_EXECUTOR_MEMORY,
|
||||
|
||||
SPARK_EXECUTOR_CORES,
|
||||
|
||||
DATABRICKS_ENDPOINT,
|
||||
|
||||
DATABRICKS_CLOUD_PROVIDER,
|
||||
@@ -212,7 +214,9 @@ public enum EHadoopProperties {
|
||||
|
||||
UNIV_STANDALONE_EXEC_MEMORY,
|
||||
|
||||
UNIV_STANDALONE_EXEC_CORE;
|
||||
UNIV_STANDALONE_EXEC_CORE,
|
||||
|
||||
UNIV_SPARK_SUBMIT_SCRIPT_HOME;
|
||||
|
||||
public String getName() {
|
||||
return this.name();
|
||||
|
||||
@@ -522,10 +522,16 @@ public class ContextUtils {
|
||||
return itemMap;
|
||||
}
|
||||
|
||||
|
||||
private static Set<String> missingContexts = new HashSet<>();
|
||||
|
||||
public static void clearMissingContextCache() {
|
||||
missingContexts.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get the repository context item,now contextId can be either joblet node or context node.
|
||||
*/
|
||||
* get the repository context item, now contextId can be either joblet node or context node.
|
||||
*/
|
||||
public static Item getRepositoryContextItemById(String contextId) {
|
||||
if (IContextParameter.BUILT_IN.equals(contextId)) {
|
||||
return null;
|
||||
@@ -533,6 +539,9 @@ public class ContextUtils {
|
||||
if (checkObject(contextId)) {
|
||||
return null;
|
||||
}
|
||||
if (missingContexts.contains(contextId)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<ERepositoryObjectType> possibleTypes = new ArrayList<ERepositoryObjectType>();
|
||||
possibleTypes.add(ERepositoryObjectType.CONTEXT);
|
||||
@@ -547,6 +556,8 @@ public class ContextUtils {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
missingContexts.add(contextId);
|
||||
ExceptionHandler.log("Can't find Context item[id=" + contextId + "].");
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
@@ -857,6 +868,7 @@ public class ContextUtils {
|
||||
ItemContextLink itemContextLink) {
|
||||
Map<String, String> renamedMap = new HashMap<String, String>();
|
||||
Map<String, Item> tempItemMap = new HashMap<String, Item>();
|
||||
clearMissingContextCache();
|
||||
for (ContextType contextType : contextTypeList) {
|
||||
for (Object obj : contextType.getContextParameter()) {
|
||||
if (obj instanceof ContextParameterType) {
|
||||
@@ -919,6 +931,7 @@ public class ContextUtils {
|
||||
*/
|
||||
public static Map<String, String> calculateRenamedMapFromLinkFile(String projectLabel, String itemId,
|
||||
List<IContext> contextList) {
|
||||
clearMissingContextCache();
|
||||
Map<String, String> renamedMap = new HashMap<String, String>();
|
||||
Map<String, Item> idToItemMap = new HashMap<String, Item>();
|
||||
try {
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.utils.ContextParameterUtils;
|
||||
import org.talend.cwm.helper.ResourceHelper;
|
||||
import org.talend.cwm.helper.StudioEncryptionHelper;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.TalendFileFactory;
|
||||
@@ -299,6 +300,7 @@ public class JobContextManager implements IContextManager {
|
||||
}
|
||||
List<ContextItem> contextItemList = ContextUtils.getAllContextItem();
|
||||
boolean setDefault = false;
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (int i = 0; i < contextTypeList.size(); i++) {
|
||||
contextType = (ContextType) contextTypeList.get(i);
|
||||
String name = contextType.getName();
|
||||
@@ -335,6 +337,8 @@ public class JobContextManager implements IContextManager {
|
||||
} else {
|
||||
contextParam.setType(MetadataTalendType.getDefaultTalendType());
|
||||
}
|
||||
//To avoid encrypt the same value}
|
||||
contextParam.setOriginEncryptedValue(contextParamType.getValue());
|
||||
contextParam.setValue(contextParamType.getRawValue());
|
||||
|
||||
contextParam.setPromptNeeded(contextParamType.isPromptNeeded());
|
||||
@@ -526,6 +530,7 @@ public class JobContextManager implements IContextManager {
|
||||
|
||||
EList newcontextTypeList = new BasicEList();
|
||||
Map<String, Item> idToItemMap = new HashMap<String, Item>();
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (int i = 0; i < listContext.size(); i++) {
|
||||
IContext context = listContext.get(i);
|
||||
String contextGroupName = renameGroupContext.get(context);
|
||||
@@ -560,7 +565,10 @@ public class JobContextManager implements IContextManager {
|
||||
contextParamType.setName(contextParam.getName());
|
||||
contextParamType.setPrompt(contextParam.getPrompt());
|
||||
contextParamType.setType(contextParam.getType());
|
||||
//To avoid encrypt the same value
|
||||
contextParamType.setValue(contextParam.getOriginEncryptedValue());
|
||||
contextParamType.setRawValue(contextParam.getValue());
|
||||
contextParam.setOriginEncryptedValue(contextParamType.getValue()); // For origin encrypted value is null or encryption key upgrade
|
||||
contextParamType.setPromptNeeded(contextParam.isPromptNeeded());
|
||||
contextParamType.setComment(contextParam.getComment());
|
||||
if (!contextParam.isBuiltIn()) {
|
||||
|
||||
@@ -46,6 +46,9 @@ public class JobContextParameter implements IContextParameter, Cloneable {
|
||||
String[] valueList;
|
||||
|
||||
String internalId;
|
||||
|
||||
/*This value may dirty, only use to cache encrypted value*/
|
||||
String originEncryptedValue;
|
||||
|
||||
/**
|
||||
* change to save id always for bug 13184.
|
||||
@@ -301,6 +304,15 @@ public class JobContextParameter implements IContextParameter, Cloneable {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getOriginEncryptedValue() {
|
||||
return originEncryptedValue;
|
||||
}
|
||||
|
||||
|
||||
public void setOriginEncryptedValue(String originEncryptedValue) {
|
||||
this.originEncryptedValue = originEncryptedValue;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
||||
@@ -51,6 +51,7 @@ public abstract class AbstractItemContextLinkService implements IItemContextLink
|
||||
itemContextLink.setItemId(itemId);
|
||||
Map<String, Item> tempCache = new HashMap<String, Item>();
|
||||
if (contextTypeList != null && contextTypeList.size() > 0) {
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (Object object : contextTypeList) {
|
||||
if (object instanceof ContextType) {
|
||||
ContextType jobContextType = (ContextType) object;
|
||||
|
||||
@@ -206,6 +206,7 @@ public class ContextLinkService {
|
||||
Map<String, Map<String, String>> changedContextParameterId) throws PersistenceException {
|
||||
List<Relation> relationList = RelationshipItemBuilder.getInstance()
|
||||
.getItemsHaveRelationWith(sourceId, RelationshipItemBuilder.LATEST_VERSION, false);
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (Relation relation : relationList) {
|
||||
String id = relation.getId();
|
||||
IFile linkFile = calContextLinkFile(ProjectManager.getInstance().getCurrentProject().getTechnicalLabel(), id);
|
||||
|
||||
@@ -463,29 +463,31 @@ public final class MetadataTalendType {
|
||||
return list;
|
||||
}
|
||||
|
||||
public static URL getSystemFolderURLOfMappingsFile() throws SystemException {
|
||||
public static File getSystemFolderURLOfMappingsFile() throws SystemException {
|
||||
String dirPath = "/" + INTERNAL_MAPPINGS_FOLDER; //$NON-NLS-1$
|
||||
URL url = null;
|
||||
Path filePath = new Path(dirPath);
|
||||
Bundle b = Platform.getBundle(CoreRuntimePlugin.PLUGIN_ID);
|
||||
if (b != null) {
|
||||
try {
|
||||
// Enumeration<URL> entries = b.findEntries(dirPath, "mapping_*.xml", false);
|
||||
url = FileLocator.toFileURL(FileLocator.find(b, filePath, null));
|
||||
return new File(FileLocator.toFileURL(FileLocator.find(b, filePath, null)).getFile());
|
||||
} catch (IOException e) {
|
||||
throw new SystemException(e);
|
||||
}
|
||||
}
|
||||
return url;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static URL getProjectFolderURLOfMappingsFile() throws SystemException {
|
||||
public static File getProjectFolderURLOfMappingsFile() throws SystemException {
|
||||
try {
|
||||
String dirPath = "/" + INTERNAL_MAPPINGS_FOLDER; //$NON-NLS-1$
|
||||
IProject project = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject());
|
||||
IPath settingPath = new ProjectScope(project).getLocation();
|
||||
File mappingFolder = settingPath.append(dirPath).toFile();
|
||||
return mappingFolder.toURI().toURL();
|
||||
if (!mappingFolder.exists()) {
|
||||
mappingFolder.mkdirs();
|
||||
}
|
||||
return mappingFolder;
|
||||
} catch (Exception e) {
|
||||
throw new SystemException(e);
|
||||
}
|
||||
@@ -592,8 +594,7 @@ public final class MetadataTalendType {
|
||||
|
||||
public static JSONObject getRevisionObject() {
|
||||
try {
|
||||
File revisonFile = new File(MetadataTalendType.getSystemFolderURLOfMappingsFile().getFile(),
|
||||
MetadataTalendType.FILE_MAPPING_REVISION);
|
||||
File revisonFile = new File(getSystemFolderURLOfMappingsFile(), FILE_MAPPING_REVISION);
|
||||
String jsonStr = new String(Files.readAllBytes(revisonFile.toPath()));
|
||||
return new JSONObject(jsonStr);
|
||||
} catch (Exception e) {
|
||||
@@ -605,13 +606,13 @@ public final class MetadataTalendType {
|
||||
public static boolean restoreMappingFiles() throws Exception {
|
||||
List<File> toDelete = new ArrayList<>();
|
||||
JSONObject revision = getRevisionObject();
|
||||
File projectMappingFolder = new File(getProjectFolderURLOfMappingsFile().getFile());
|
||||
File projectMappingFolder = getProjectFolderURLOfMappingsFile();
|
||||
if (projectMappingFolder.exists()) {
|
||||
File[] projectMappingFiles = projectMappingFolder.listFiles(f -> f.getName().matches(MAPPING_FILE_PATTERN));
|
||||
if (projectMappingFiles != null) {
|
||||
for (File file : projectMappingFiles) {
|
||||
if (revision.has(file.getName())) {
|
||||
String sha1 = MetadataTalendType.getSha1OfFile(file);
|
||||
String sha1 = getSha1OfFile(file);
|
||||
if (revision.getJSONObject(file.getName()).has(sha1)) {
|
||||
toDelete.add(file);
|
||||
}
|
||||
@@ -668,9 +669,9 @@ public final class MetadataTalendType {
|
||||
}
|
||||
|
||||
public static List<File> getWorkingMappingFiles() throws SystemException {
|
||||
File projectMappingFolder = new File(getProjectFolderURLOfMappingsFile().getFile());
|
||||
File projectMappingFolder = getProjectFolderURLOfMappingsFile();
|
||||
File[] projectMappingFiles = projectMappingFolder.listFiles(f -> f.getName().matches(MAPPING_FILE_PATTERN));
|
||||
File systemMappingFolder = new File(getSystemFolderURLOfMappingsFile().getFile());
|
||||
File systemMappingFolder = getSystemFolderURLOfMappingsFile();
|
||||
File[] systemMappingFiles = systemMappingFolder.listFiles(f -> f.getName().matches(MAPPING_FILE_PATTERN));
|
||||
if (projectMappingFiles == null || projectMappingFiles.length == 0) {
|
||||
return Arrays.asList(systemMappingFiles);
|
||||
@@ -686,7 +687,7 @@ public final class MetadataTalendType {
|
||||
|
||||
public static String getSha1OfSystemMappingFile(String fileName) {
|
||||
try {
|
||||
return getSha1OfFile(new File(getSystemFolderURLOfMappingsFile().getFile(), fileName));
|
||||
return getSha1OfFile(new File(getSystemFolderURLOfMappingsFile(), fileName));
|
||||
} catch (SystemException e) {
|
||||
ExceptionHandler.process(e);
|
||||
return null;
|
||||
|
||||
@@ -156,6 +156,7 @@ public final class MetadataToolAvroHelper {
|
||||
copyColumnProperties(fb, in);
|
||||
|
||||
fb.prop(DiSchemaConstants.TALEND6_LABEL, label);
|
||||
|
||||
|
||||
Object defaultValue = null;
|
||||
Expression initialValue = in.getInitialValue();
|
||||
@@ -369,6 +370,7 @@ public final class MetadataToolAvroHelper {
|
||||
*/
|
||||
private static <T extends PropBuilder<T>> PropBuilder<T> copyColumnProperties(PropBuilder<T> builder,
|
||||
org.talend.core.model.metadata.builder.connection.MetadataColumn in) {
|
||||
|
||||
// Properties common to tables and columns.
|
||||
if (in.getId() != null) {
|
||||
builder.prop(DiSchemaConstants.TALEND6_ID, in.getId());
|
||||
@@ -385,6 +387,8 @@ public final class MetadataToolAvroHelper {
|
||||
builder.prop(DiSchemaConstants.TALEND6_IS_READ_ONLY, tv.getValue());
|
||||
}else if(DiSchemaConstants.AVRO_TECHNICAL_KEY.equals(additionalTag)){
|
||||
builder.prop(DiSchemaConstants.AVRO_TECHNICAL_KEY, tv.getValue());
|
||||
}else if(DiSchemaConstants.LOGICAL_TIME_TYPE_AS.equals(additionalTag)) {
|
||||
builder.prop(DiSchemaConstants.LOGICAL_TIME_TYPE_AS, tv.getValue());
|
||||
}else if (tv.getValue() != null) {
|
||||
builder.prop(DiSchemaConstants.TALEND6_ADDITIONAL_PROPERTIES + additionalTag, tv.getValue());
|
||||
}
|
||||
@@ -626,6 +630,7 @@ public final class MetadataToolAvroHelper {
|
||||
} else if (AvroUtils.isSameType(nonnullable, AvroUtils._float())) {
|
||||
col.setTalendType(JavaTypesManager.FLOAT.getId());
|
||||
} else if (AvroUtils.isSameType(nonnullable, AvroUtils._int())) {
|
||||
|
||||
if (logicalType == LogicalTypes.date()) {
|
||||
col.setTalendType(JavaTypesManager.DATE.getId());
|
||||
TaggedValue tv = TaggedValueHelper.createTaggedValue(DiSchemaConstants.TALEND6_COLUMN_DATE_DATE, "true");
|
||||
@@ -637,6 +642,8 @@ public final class MetadataToolAvroHelper {
|
||||
String logical_time_type_as = field.getProp(DiSchemaConstants.LOGICAL_TIME_TYPE_AS);
|
||||
if(DiSchemaConstants.AS_TALEND_DATE.equals(logical_time_type_as)) {
|
||||
col.setTalendType(JavaTypesManager.DATE.getId());
|
||||
TaggedValue tv2 = TaggedValueHelper.createTaggedValue(DiSchemaConstants.LOGICAL_TIME_TYPE_AS, DiSchemaConstants.AS_TALEND_DATE);
|
||||
col.getTaggedValue().add(tv2);
|
||||
} else {
|
||||
col.setTalendType(JavaTypesManager.INTEGER.getId());
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.talend.core.database.EDatabaseTypeName;
|
||||
import org.talend.core.database.ERedshiftDriver;
|
||||
import org.talend.core.database.conn.ConnParameterKeys;
|
||||
import org.talend.core.database.conn.template.EDatabaseConnTemplate;
|
||||
import org.talend.core.database.conn.version.EDatabaseVersion4Drivers;
|
||||
import org.talend.core.model.metadata.Dbms;
|
||||
import org.talend.core.model.metadata.DiSchemaConstants;
|
||||
import org.talend.core.model.metadata.IConvertionConstants;
|
||||
@@ -272,7 +273,7 @@ public final class ConvertionHelper {
|
||||
|
||||
}
|
||||
|
||||
private static String getDriverVersionString(DatabaseConnection dbConn) {
|
||||
public static String getDriverVersionString(DatabaseConnection dbConn) {
|
||||
String dbVersionString = dbConn.getDbVersionString();
|
||||
if (EDatabaseTypeName.REDSHIFT.getDisplayName().equals(dbConn.getDatabaseType())
|
||||
|| EDatabaseTypeName.REDSHIFT_SSO.getDisplayName().equals(dbConn.getDatabaseType())) {
|
||||
@@ -286,6 +287,9 @@ public final class ConvertionHelper {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (EDatabaseTypeName.VERTICA.getDisplayName().equals(dbConn.getDatabaseType())) {
|
||||
dbVersionString = EDatabaseVersion4Drivers.VERTICA_12.getVersionValue();
|
||||
}
|
||||
return dbVersionString;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.talend.core.model.metadata.IMetadataTable;
|
||||
import org.talend.core.model.metadata.MetadataTalendType;
|
||||
import org.talend.core.model.metadata.builder.ConvertionHelper;
|
||||
import org.talend.core.model.metadata.builder.connection.BRMSConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.BigQueryConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.Connection;
|
||||
import org.talend.core.model.metadata.builder.connection.ConnectionFactory;
|
||||
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
|
||||
@@ -213,6 +214,8 @@ public class ComponentToRepositoryProperty {
|
||||
setFileExcelValue((FileExcelConnection) connection, node, param);
|
||||
} else if (connection instanceof SAPConnection) {
|
||||
setSAPValue((SAPConnection) connection, node, param);
|
||||
} else if (connection instanceof BigQueryConnection) {
|
||||
setBigQueryValue((BigQueryConnection) connection, node, param);
|
||||
} else if (connection instanceof SalesforceSchemaConnection) {
|
||||
setSalesforceSchema((SalesforceSchemaConnection) connection, node, param);
|
||||
} else if (connection instanceof MDMConnection) {
|
||||
@@ -1793,6 +1796,30 @@ public class ComponentToRepositoryProperty {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void setBigQueryValue(BigQueryConnection connection, INode node, IElementParameter param) {
|
||||
if ("SERVICE_ACCOUNT_CREDENTIALS_FILE".equals(param.getRepositoryValue())) {
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.setServiceAccountCredentialsFile(value);
|
||||
}
|
||||
} else if ("PROJECT_ID".equals(param.getRepositoryValue())) {
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.setProjectId(value);
|
||||
}
|
||||
} else if ("USE_REGION_ENDPOINT".equals(param.getRepositoryValue())) {
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.setUseRegionEndpoint(Boolean.valueOf(value));
|
||||
}
|
||||
} else if ("REGION_ENDPOINT_BQ".equals(param.getRepositoryValue())) {
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.setRegionEndpoint(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
@@ -47,6 +48,7 @@ import org.talend.core.model.metadata.MultiSchemasUtil;
|
||||
import org.talend.core.model.metadata.builder.ConvertionHelper;
|
||||
import org.talend.core.model.metadata.builder.connection.AdditionalConnectionProperty;
|
||||
import org.talend.core.model.metadata.builder.connection.BRMSConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.BigQueryConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.Concept;
|
||||
import org.talend.core.model.metadata.builder.connection.ConceptTarget;
|
||||
import org.talend.core.model.metadata.builder.connection.Connection;
|
||||
@@ -148,6 +150,10 @@ public class RepositoryToComponentProperty {
|
||||
if (connection instanceof SAPConnection) {
|
||||
return getSAPValue((SAPConnection) connection, value);
|
||||
}
|
||||
|
||||
if (connection instanceof BigQueryConnection) {
|
||||
return getBigQueryValue((BigQueryConnection) connection, value, table);
|
||||
}
|
||||
|
||||
if (connection instanceof SalesforceSchemaConnection) {
|
||||
return getSalesforceSchemaValue((SalesforceSchemaConnection) connection, value, table);
|
||||
@@ -456,6 +462,62 @@ public class RepositoryToComponentProperty {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Object getBigQueryValue(BigQueryConnection connection, String value, IMetadataTable table) {
|
||||
if ("SERVICE_ACCOUNT_CREDENTIALS_FILE".equals(value)) {
|
||||
if (isContextMode(connection, connection.getServiceAccountCredentialsFile())) {
|
||||
return connection.getServiceAccountCredentialsFile();
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getServiceAccountCredentialsFile());
|
||||
}
|
||||
} else if ("PROJECT_ID".equals(value)) {
|
||||
if (isContextMode(connection, connection.getProjectId())) {
|
||||
return connection.getProjectId();
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getProjectId());
|
||||
}
|
||||
} else if ("USE_REGION_ENDPOINT".equals(value)) {
|
||||
return connection.isUseRegionEndpoint();
|
||||
} else if ("REGION_ENDPOINT_BQ".equals(value)) {
|
||||
if (isContextMode(connection, connection.getRegionEndpoint())) {
|
||||
return connection.getRegionEndpoint();
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getRegionEndpoint());
|
||||
}
|
||||
} else if ("DATASET".equals(value)) {
|
||||
if(table!=null) {
|
||||
Map<String, String> properties = table.getAdditionalProperties();
|
||||
if(properties!=null) {
|
||||
String dataSet = properties.get("dataSet");
|
||||
if (isContextMode(connection, dataSet)) {
|
||||
return dataSet;
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(dataSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ("QUERY".equals(value)) {
|
||||
if(table!=null) {
|
||||
Map<String, String> properties = table.getAdditionalProperties();
|
||||
if(properties!=null) {
|
||||
String dataSet = properties.get("dataSet");
|
||||
String tableName = table.getLabel();
|
||||
if(dataSet!=null && tableName!=null) {
|
||||
List<IMetadataColumn> columns = table.getListColumns();
|
||||
StringBuilder strBuilder = new StringBuilder();
|
||||
strBuilder.append("SELECT");
|
||||
if(columns!=null) {
|
||||
strBuilder.append(columns.stream().map(column -> column.getOriginalDbColumnName()).collect(Collectors.joining(",", " ", " ")));
|
||||
}
|
||||
strBuilder.append("FROM ").append(dataSet).append('.').append(tableName);
|
||||
return TalendQuoteUtils.addQuotes(strBuilder.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC gcui Comment method "getHL7Value".
|
||||
@@ -1091,6 +1153,10 @@ public class RepositoryToComponentProperty {
|
||||
if (dbVersionString != null) {
|
||||
return dbVersionString.toUpperCase();
|
||||
}
|
||||
} else if (EDatabaseConnTemplate.AMAZON_AURORA.getDBDisplayName().equals(databaseType)) {
|
||||
if (dbVersionString != null) {
|
||||
return dbVersionString.toUpperCase();
|
||||
}
|
||||
} else if (EDatabaseTypeName.HIVE.getDisplayName().equals(databaseType)) {
|
||||
return connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_VERSION);
|
||||
} else if (EDatabaseTypeName.HBASE.getDisplayName().equals(databaseType)) {
|
||||
|
||||
@@ -75,4 +75,9 @@ public interface IContextParameter {
|
||||
public String getInternalId();
|
||||
|
||||
public void setInternalId(String internalId);
|
||||
|
||||
/*This value may dirty, only use to cache encrypted value*/
|
||||
public String getOriginEncryptedValue();
|
||||
|
||||
public void setOriginEncryptedValue(String originEncryptedValue);
|
||||
}
|
||||
|
||||
@@ -234,4 +234,9 @@ public interface IElementParameter {
|
||||
public void setSerialized(boolean isSerialized);
|
||||
|
||||
public boolean isSelectedFromItemValue();
|
||||
|
||||
/*This value may dirty, only use to cache encrypted value*/
|
||||
public String getOrignEncryptedValue();
|
||||
|
||||
public void setOrignEncryptedValue(String value);
|
||||
}
|
||||
|
||||
@@ -71,6 +71,9 @@ public interface IProcess2 extends IRepositoryObject, IProcess {
|
||||
@Override
|
||||
void setActivate(boolean b);
|
||||
|
||||
public boolean isRefactoringToJoblet();
|
||||
|
||||
public void refactoringToJoblet(boolean isRefactoring);
|
||||
/**
|
||||
* DOC qzhang Comment method "checkStartNodes".
|
||||
*/
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.talend.core.IESBService;
|
||||
import org.talend.core.PluginChecker;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.properties.BRMSConnectionItem;
|
||||
import org.talend.core.model.properties.BigQueryConnectionItem;
|
||||
import org.talend.core.model.properties.CSVFileConnectionItem;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
@@ -360,14 +361,17 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
|
||||
public final static ERepositoryObjectType METADATA_SAP_TABLE = new ERepositoryObjectType("repository.SAPTable", //$NON-NLS-1$
|
||||
"METADATA_SAP_TABLE", 104, true, true, new String[] { PROD_DI }, new String[] {}, false);
|
||||
|
||||
|
||||
public final static ERepositoryObjectType METADATA_SAP_CONTENT_EXTRACTOR = new ERepositoryObjectType("repository.SAPTable", //$NON-NLS-1$
|
||||
"METADATA_SAP_CONTENT_EXTRACTOR", 105, true, true, new String[] { PROD_DI }, new String[] {}, false);
|
||||
|
||||
|
||||
public final static ERepositoryObjectType METADATA_CON_CALCULATION_VIEW = new ERepositoryObjectType(
|
||||
"repository.metadataCalculationView", "METADATA_CON_CALCULATION_VIEW", 106, true, true, new String[] { PROD_DI },
|
||||
new String[] {}, false);
|
||||
|
||||
public final static ERepositoryObjectType METADATA_SAP_CDS_VIEW = new ERepositoryObjectType("repository.SAPTable", //$NON-NLS-1$
|
||||
"METADATA_SAP_CDS_VIEW", 107, true, true, new String[] { PROD_DI }, new String[] {}, false);
|
||||
|
||||
private String label;
|
||||
|
||||
private String alias;
|
||||
@@ -505,6 +509,8 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
public final static ERepositoryObjectType METADATA_FILE_FTP = ERepositoryObjectType.valueOf("METADATA_FILE_FTP");
|
||||
|
||||
public final static ERepositoryObjectType METADATA_SAPCONNECTIONS = ERepositoryObjectType.valueOf("METADATA_SAPCONNECTIONS");
|
||||
|
||||
public final static ERepositoryObjectType METADATA_BIGQUERYCONNECTIONS = ERepositoryObjectType.valueOf("METADATA_BIGQUERYCONNECTIONS");
|
||||
|
||||
public final static ERepositoryObjectType METADATA_FILE_EBCDIC = ERepositoryObjectType.valueOf("METADATA_FILE_EBCDIC");
|
||||
|
||||
@@ -865,6 +871,8 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
return "DB connection"; //$NON-NLS-1$
|
||||
} else if (type == METADATA_SAPCONNECTIONS) {
|
||||
return "SAPconnection"; //$NON-NLS-1$
|
||||
} else if (type == METADATA_BIGQUERYCONNECTIONS) {
|
||||
return "BigQueryconnection"; //$NON-NLS-1$
|
||||
} else if (type == METADATA_FILE_EBCDIC) {
|
||||
return "fileEBCDIC"; //$NON-NLS-1$
|
||||
} else if (type == METADATA_FILE_HL7) {
|
||||
@@ -1076,6 +1084,11 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
public Object caseSAPConnectionItem(SAPConnectionItem object) {
|
||||
return METADATA_SAPCONNECTIONS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseBigQueryConnectionItem(BigQueryConnectionItem object) {
|
||||
return METADATA_BIGQUERYCONNECTIONS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseDelimitedFileConnectionItem(DelimitedFileConnectionItem object) {
|
||||
|
||||
@@ -770,6 +770,15 @@ public abstract class RepositoryUpdateManager {
|
||||
updateConnectionContextParam((ConnectionItem) item, citem, valueMap);
|
||||
}
|
||||
}
|
||||
|
||||
List<IRepositoryViewObject> bigqueryConnList = FACTORY.getAll(ERepositoryObjectType.METADATA_BIGQUERYCONNECTIONS, true);
|
||||
for (IRepositoryViewObject obj : bigqueryConnList) {
|
||||
Item item = obj.getProperty().getItem();
|
||||
if (item instanceof ConnectionItem) {
|
||||
updateConnectionContextParam((ConnectionItem) item, citem, valueMap);
|
||||
}
|
||||
}
|
||||
|
||||
for (String updateType : UpdateRepositoryHelper.getAllHadoopConnectionTypes()) {
|
||||
List<IRepositoryViewObject> hadoopConnList = FACTORY
|
||||
.getAll(ERepositoryObjectType.valueOf(ERepositoryObjectType.class, updateType), true);
|
||||
|
||||
@@ -35,7 +35,7 @@ public final class TalendPropertiesUtil {
|
||||
* @return
|
||||
*/
|
||||
public static boolean isHideExchange() {
|
||||
return isEnabled("talend.hide.exchange") || isEnabled("talend.disable.internet"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return true; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.nexus;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
@@ -25,9 +27,9 @@ import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.i18n.Messages;
|
||||
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
|
||||
import org.talend.core.service.IRemoteService;
|
||||
import org.talend.core.utils.SecurityStorageUtil;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
import org.talend.utils.security.StudioEncryption;
|
||||
|
||||
/**
|
||||
* created by wchen on 2015年6月16日 Detailled comment
|
||||
@@ -81,6 +83,8 @@ public class TalendLibsServerManager {
|
||||
|
||||
public static final String ENABLE_PROXY_SETTING = "nexus.proxy.enable";
|
||||
|
||||
public static final String NEXUS_PROXY_STORAGE_CATEGORY = "org.talend.artifact.proxy.setting";
|
||||
|
||||
public static final String TALEND_LIB_USER = "";//$NON-NLS-1$
|
||||
|
||||
public static final String TALEND_LIB_PASSWORD = "";//$NON-NLS-1$
|
||||
@@ -255,10 +259,14 @@ public class TalendLibsServerManager {
|
||||
boolean enableProxyFlag = prefManager.getBoolean(TalendLibsServerManager.ENABLE_PROXY_SETTING);
|
||||
if (enableProxyFlag) {
|
||||
serverBean.setServer(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_URL));
|
||||
serverBean.setUserName(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_USERNAME));
|
||||
serverBean.setPassword(StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM).decrypt(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_PASSWORD)));
|
||||
serverBean.setRepositoryId(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_REPOSITORY_ID));
|
||||
serverBean.setType(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_TYPE));
|
||||
String[] credentials = getProxyArtifactCredentials(serverBean.getServer(), serverBean.getRepositoryId(),
|
||||
NEXUS_PROXY_USERNAME, NEXUS_PROXY_PASSWORD);
|
||||
if (credentials != null) {
|
||||
serverBean.setUserName(credentials[0]);
|
||||
serverBean.setPassword(credentials[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(serverBean.getServer())) {
|
||||
@@ -267,6 +275,89 @@ public class TalendLibsServerManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String[] getProxyArtifactCredentials(String url, String repositoryId, String usernameKey, String passwordKey) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
String path = getStoragePath(url, repositoryId);
|
||||
Map<String, String> storageNodePairs = SecurityStorageUtil.getSecurityStorageNodePairs(path);
|
||||
if (storageNodePairs != null) {
|
||||
String username = storageNodePairs.get(usernameKey);
|
||||
String password = storageNodePairs.get(passwordKey);
|
||||
if (username == null && password == null) {
|
||||
return null;
|
||||
}
|
||||
return new String[] { username, password };
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void saveProxyArtifactCredentials(String url, String repositoryId, String usernameKey, String username,
|
||||
String passwordKey, String password) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String path = getStoragePath(url, repositoryId);
|
||||
SecurityStorageUtil.saveToSecurityStorage(path, usernameKey, username, false, false);
|
||||
SecurityStorageUtil.saveToSecurityStorage(path, passwordKey, password, true, false);
|
||||
SecurityStorageUtil.flushSecurityStorage();
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void saveProxyArtifactCredentialsUserName(String url, String repositoryId, String usernameKey, String username,
|
||||
boolean flush) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String path = getStoragePath(url, repositoryId);
|
||||
SecurityStorageUtil.saveToSecurityStorage(path, usernameKey, username, false, flush);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void saveProxyArtifactCredentialsPassword(String url, String repositoryId, String passwordKey, String password,
|
||||
boolean flush) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String path = getStoragePath(url, repositoryId);
|
||||
SecurityStorageUtil.saveToSecurityStorage(path, passwordKey, password, true, flush);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void flushSecurityStorage() {
|
||||
try {
|
||||
SecurityStorageUtil.flushSecurityStorage();
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
private String getStoragePath(String url, String repositoryId) throws Exception {
|
||||
String node = url;
|
||||
if (StringUtils.isNotBlank(repositoryId)) {
|
||||
if (!url.endsWith("/")) {
|
||||
node = node + "/";
|
||||
}
|
||||
node = node + repositoryId;
|
||||
}
|
||||
node = URLEncoder.encode(node, "UTF-8");
|
||||
String path = NEXUS_PROXY_STORAGE_CATEGORY + "/" + node;
|
||||
return path;
|
||||
}
|
||||
|
||||
public ArtifactRepositoryBean getTalentArtifactServer() {
|
||||
ArtifactRepositoryBean serverBean = getProxyArtifactServer();
|
||||
if (serverBean == null) {
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2023 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.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.talend.core.IProviderService;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.properties.BigQueryConnectionItem;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
|
||||
public interface IBigQueryProviderService extends IProviderService {
|
||||
|
||||
public BigQueryConnectionItem getRepositoryItem(final INode node);
|
||||
|
||||
public boolean isBigQueryNode(final INode node);
|
||||
|
||||
public boolean isBigQueryNode(final RepositoryNode node);
|
||||
|
||||
public boolean isRepositorySchemaLine(INode node, Map<String, Object> lineValue);
|
||||
}
|
||||
@@ -39,6 +39,8 @@ import org.talend.core.model.update.IStudioUpdateConfig;
|
||||
*/
|
||||
public interface IStudioLiteP2Service extends IService {
|
||||
|
||||
public static final String PROP_CLEARPERSISTEDSTATE = "talend.studio.switchProject.clearPersistedState";
|
||||
|
||||
public static final String CONFIG_STORAGE_FOLDER = "talend/studioLite/";
|
||||
|
||||
public static final String BUNDLES_INFOS_STORAGE_FOLDER = CONFIG_STORAGE_FOLDER + "bundlesInfo/";
|
||||
@@ -137,6 +139,10 @@ public interface IStudioLiteP2Service extends IService {
|
||||
|
||||
void setupTmcUpdate(IProgressMonitor monitor, IStudioUpdateConfig updateConfig) throws Exception;
|
||||
|
||||
void handleTmcUpdateObserve(boolean trunOn);
|
||||
|
||||
boolean isUpdateManagedByTmc(IProgressMonitor monitor);
|
||||
|
||||
boolean removeM2() throws Exception;
|
||||
|
||||
void saveRemoveM2(boolean remove) throws Exception;
|
||||
|
||||
@@ -53,6 +53,8 @@ public class RepositoryImageProvider {
|
||||
return ECoreImage.METADATA_CONNECTION_ICON;
|
||||
} else if (type == ERepositoryObjectType.METADATA_SAPCONNECTIONS || type == ERepositoryObjectType.METADATA_SAP_FUNCTION) {
|
||||
return ECoreImage.METADATA_SAPCONNECTION_ICON;
|
||||
} else if (type == ERepositoryObjectType.METADATA_BIGQUERYCONNECTIONS) {
|
||||
return ECoreImage.METADATA_BIGQUERYCONNECTION_ICON;
|
||||
} else if (type == ERepositoryObjectType.SQLPATTERNS) {
|
||||
return ECoreImage.METADATA_SQLPATTERN_ICON;
|
||||
} else if (type == ERepositoryObjectType.METADATA_CON_TABLE || type == ERepositoryObjectType.METADATA_SAP_IDOC) {
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2023 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.utils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.equinox.security.storage.ISecurePreferences;
|
||||
import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
|
||||
|
||||
/**
|
||||
* DOC jding class global comment. Detailled comment
|
||||
*/
|
||||
public class SecurityStorageUtil {
|
||||
|
||||
public static void saveToSecurityStorage(String pathName, String key, String value, boolean encrypt) throws Exception {
|
||||
saveToSecurityStorage(pathName, key, value, encrypt, true);
|
||||
}
|
||||
|
||||
public static void saveToSecurityStorage(String pathName, String key, String value, boolean encrypt, boolean flush)
|
||||
throws Exception {
|
||||
ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
|
||||
ISecurePreferences node = securePreferences.node(pathName);
|
||||
node.put(key, value, encrypt);
|
||||
if (flush) {
|
||||
securePreferences.flush();
|
||||
}
|
||||
}
|
||||
|
||||
public static void flushSecurityStorage() throws Exception {
|
||||
ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
|
||||
securePreferences.flush();
|
||||
}
|
||||
|
||||
public static String getValueFromSecurityStorage(String pathName, String key) throws Exception {
|
||||
ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
|
||||
if (!securePreferences.nodeExists(pathName)) {
|
||||
return null;
|
||||
}
|
||||
ISecurePreferences node = securePreferences.node(pathName);
|
||||
return node.get(key, null);
|
||||
}
|
||||
|
||||
public static Map<String, String> getSecurityStorageNodePairs(String pathName) throws Exception {
|
||||
ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
|
||||
if (!securePreferences.nodeExists(pathName)) {
|
||||
return null;
|
||||
}
|
||||
Map<String, String> keyValuePair = new HashMap<String, String>();
|
||||
ISecurePreferences node = securePreferences.node(pathName);
|
||||
for (String key : node.keys()) {
|
||||
keyValuePair.put(key, node.get(key, null));
|
||||
}
|
||||
return keyValuePair;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,8 +37,6 @@ public class FunctionManager {
|
||||
|
||||
public static final String PURE_PERL_DESC = Messages.getString("FunctionManager.PurePerl.Desc"); //$NON-NLS-1$
|
||||
|
||||
public static final String PURE_PERL_PARAM = Messages.getString("FunctionManager.PurePerl.ParaName"); //$NON-NLS-1$
|
||||
|
||||
private List<TalendType> talendTypes = null;
|
||||
|
||||
public static final String PERL_FUN_PREFIX = "sub{"; //$NON-NLS-1$
|
||||
@@ -55,6 +53,37 @@ public class FunctionManager {
|
||||
|
||||
public static final String EMPTY_STRING = " "; //$NON-NLS-1$
|
||||
|
||||
public static enum EFunctionParameter {
|
||||
|
||||
CUSTOMIZE_PARAM("customize parameter", Messages.getString("FunctionManager.PurePerl.ParaName")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
private String paramName;
|
||||
|
||||
private String paramDisplayName;
|
||||
|
||||
EFunctionParameter(String paramName, String paramDisplayName) {
|
||||
this.paramName = paramName;
|
||||
this.paramDisplayName = paramDisplayName;
|
||||
}
|
||||
|
||||
public String getParamName() {
|
||||
return paramName;
|
||||
}
|
||||
|
||||
public String getParamDisplayName() {
|
||||
return paramDisplayName;
|
||||
}
|
||||
|
||||
public static String getDisplayNameByName(String name) {
|
||||
for (EFunctionParameter eParameter : values()) {
|
||||
if (eParameter.getParamName().equals(name)) {
|
||||
return eParameter.getParamDisplayName();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* qzhang Comment method "getFunctionByName".
|
||||
*
|
||||
@@ -80,7 +109,7 @@ public class FunctionManager {
|
||||
function.setDescription(PURE_PERL_DESC);
|
||||
StringParameter param = new StringParameter();
|
||||
List<Parameter> params = new ArrayList<Parameter>();
|
||||
param.setName(PURE_PERL_PARAM);
|
||||
param.setName(EFunctionParameter.CUSTOMIZE_PARAM.getParamName());
|
||||
params.add(param);
|
||||
function.setParameters(params);
|
||||
return function;
|
||||
|
||||
@@ -86,43 +86,47 @@ public class RoutineJarsFunctionParser extends AbstractTalendFunctionParser {
|
||||
Set<RoutinesParameterType> rps = new HashSet<RoutinesParameterType>();
|
||||
if (processItem instanceof ProcessItem) {
|
||||
ProcessType pt = ((ProcessItem) processItem).getProcess();
|
||||
if (pt != null) {
|
||||
if (pt.getParameters() != null) {
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
}
|
||||
// if it is test process
|
||||
int pidFeature = TalendFilePackage.PROCESS_TYPE_FEATURE_COUNT + 2;
|
||||
int versionFeature = TalendFilePackage.PROCESS_TYPE_FEATURE_COUNT + 4;
|
||||
ProcessTypeImpl pi = (ProcessTypeImpl) pt;
|
||||
if (pi.eClass() != null && StringUtils.equals(pi.eClass().getName(), "TestContainer")) {
|
||||
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
|
||||
// if it is test process
|
||||
int pidFeature = TalendFilePackage.PROCESS_TYPE_FEATURE_COUNT + 2;
|
||||
int versionFeature = TalendFilePackage.PROCESS_TYPE_FEATURE_COUNT + 4;
|
||||
ProcessTypeImpl pi = (ProcessTypeImpl) pt;
|
||||
if (pi.eClass() != null && StringUtils.equals(pi.eClass().getName(), "TestContainer")) {
|
||||
|
||||
try {
|
||||
Object pid = pi.eGet(pidFeature, true, false);
|
||||
Object version = pi.eGet(versionFeature, true, false);
|
||||
if (pid != null) {
|
||||
IProxyRepositoryService svc = IProxyRepositoryService.get();
|
||||
try {
|
||||
List<IRepositoryViewObject> vos = svc.getProxyRepositoryFactory().getAllVersion(pid.toString());
|
||||
for (IRepositoryViewObject vo : vos) {
|
||||
if (StringUtils.equals(vo.getVersion(), String.valueOf(version))) {
|
||||
Item parentProcessItem = vo.getProperty().getItem();
|
||||
if (parentProcessItem instanceof ProcessItem) {
|
||||
pt = ((ProcessItem) parentProcessItem).getProcess();
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
try {
|
||||
Object pid = pi.eGet(pidFeature, true, false);
|
||||
Object version = pi.eGet(versionFeature, true, false);
|
||||
if (pid != null) {
|
||||
IProxyRepositoryService svc = IProxyRepositoryService.get();
|
||||
try {
|
||||
List<IRepositoryViewObject> vos = svc.getProxyRepositoryFactory().getAllVersion(pid.toString());
|
||||
for (IRepositoryViewObject vo : vos) {
|
||||
if (StringUtils.equals(vo.getVersion(), String.valueOf(version))) {
|
||||
Item parentProcessItem = vo.getProperty().getItem();
|
||||
if (parentProcessItem instanceof ProcessItem) {
|
||||
pt = ((ProcessItem) parentProcessItem).getProcess();
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
// ignore
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
// ignore
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
} else if (processItem instanceof JobletProcessItem) {
|
||||
ProcessType pt = ((JobletProcessItem) processItem).getJobletProcess();
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
if (pt != null && pt.getParameters() != null) {
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
}
|
||||
}
|
||||
|
||||
if (!rps.isEmpty()) {
|
||||
|
||||
@@ -512,6 +512,7 @@ public class RepositoryNodeUtilities {
|
||||
|| curType == ERepositoryObjectType.METADATA_FILE_RULES
|
||||
|| curType == ERepositoryObjectType.METADATA_FILE_LINKRULES
|
||||
|| curType == ERepositoryObjectType.METADATA_SAPCONNECTIONS
|
||||
|| curType == ERepositoryObjectType.METADATA_BIGQUERYCONNECTIONS
|
||||
|| curType == ERepositoryObjectType.METADATA_HEADER_FOOTER) {
|
||||
tmpType = ERepositoryObjectType.METADATA;
|
||||
} else if (curType == ERepositoryObjectType.ROUTINES || curType == ERepositoryObjectType.SNIPPETS) {
|
||||
|
||||
@@ -77,6 +77,7 @@ public class StatusHelper {
|
||||
case PropertiesPackage.CSV_FILE_CONNECTION_ITEM:
|
||||
case PropertiesPackage.DATABASE_CONNECTION_ITEM:
|
||||
case PropertiesPackage.SAP_CONNECTION_ITEM:
|
||||
case PropertiesPackage.BIG_QUERY_CONNECTION_ITEM:
|
||||
case PropertiesPackage.DELIMITED_FILE_CONNECTION_ITEM:
|
||||
case PropertiesPackage.POSITIONAL_FILE_CONNECTION_ITEM:
|
||||
case PropertiesPackage.CONTEXT_ITEM:
|
||||
|
||||
@@ -648,6 +648,7 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
helper.initHelper(contextManager);
|
||||
Map<String, Item> items = new HashMap<String, Item>();
|
||||
boolean needRefresh = false;
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (IContextParameter param : contextManager.getDefaultContext().getContextParameterList()) {
|
||||
if (!param.isBuiltIn()) {
|
||||
String source = param.getSource();
|
||||
|
||||
@@ -522,6 +522,7 @@ public class SelectRepositoryContextDialog extends SelectionDialog {
|
||||
// remove the params which is unchecked
|
||||
Set<String> jobletIds = new HashSet<String>();
|
||||
Set<String> chekedIds = new HashSet<String>();
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (IContextParameter param : existParas) {
|
||||
if (param.isBuiltIn()) {
|
||||
continue;
|
||||
|
||||
@@ -184,6 +184,7 @@ public class AddRepositoryContextGroupCommand extends Command {
|
||||
// remove the params which is unchecked
|
||||
Set<String> nonContextIds = new HashSet<String>();
|
||||
Set<String> chekedIds = new HashSet<String>();
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (IContextParameter param : existParas) {
|
||||
if (param.isBuiltIn()) {
|
||||
continue;
|
||||
|
||||
@@ -92,6 +92,7 @@ public class ContextNatTableUtils {
|
||||
List<ContextTableTabParentModel> output = new ArrayList<ContextTableTabParentModel>();
|
||||
if (!contextDatas.isEmpty()) {
|
||||
int i = 0;
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (IContextParameter para : contextDatas) {
|
||||
String sourceId = para.getSource();
|
||||
if (IContextParameter.BUILT_IN.equals(sourceId)) {
|
||||
|
||||
@@ -411,6 +411,7 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
|
||||
|
||||
if (modified) {
|
||||
updateRelation();
|
||||
modelManager.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -425,7 +426,6 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
|
||||
&& jobContextManager.isOriginalParameter(param.getName())) {
|
||||
jobContextManager.setModified(true);
|
||||
manager.fireContextsChangedEvent();
|
||||
modelManager.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -494,6 +494,7 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
|
||||
}
|
||||
if (modified) {
|
||||
updateRelation();
|
||||
modelManager.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -508,7 +509,6 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
|
||||
&& jobContextManager.isOriginalParameter(param.getName())) {
|
||||
jobContextManager.setModified(true);
|
||||
manager.fireContextsChangedEvent();
|
||||
modelManager.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -576,6 +576,7 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
|
||||
}
|
||||
if (modified) {
|
||||
updateRelation();
|
||||
modelManager.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -590,7 +591,6 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
|
||||
&& jobContextManager.isOriginalParameter(param.getName())) {
|
||||
jobContextManager.setModified(true);
|
||||
manager.fireContextsChangedEvent();
|
||||
modelManager.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -673,6 +673,7 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
|
||||
if (modified) {
|
||||
// it is undo, so the order changed
|
||||
updateRelation(newName, originalName);
|
||||
modelManager.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -687,7 +688,6 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
|
||||
&& jobContextManager.isOriginalParameter(param.getName())) {
|
||||
jobContextManager.setModified(true);
|
||||
manager.fireContextsChangedEvent();
|
||||
modelManager.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.eclipse.ui.IViewPart;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.IWorkbenchPart;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.core.model.context.ContextUtils;
|
||||
import org.talend.core.ui.branding.IBrandingConfiguration;
|
||||
|
||||
/**
|
||||
@@ -51,6 +52,7 @@ public class Contexts {
|
||||
public void run() {
|
||||
if (cxtView != null) {
|
||||
updateTitle(cxtView);
|
||||
ContextUtils.clearMissingContextCache();
|
||||
cxtView.refresh(part);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,9 +175,28 @@ public class ExternalNodeComponentHandler extends AbstractComponentHandler {
|
||||
generateComponentSchemaInfo(externalNode, componentElement);
|
||||
generateComponentElementParamInfo(parametersElement, elementParameterList);
|
||||
} else {
|
||||
boolean isSCDComponent = externalNode.getComponent().getName().endsWith("SCD");
|
||||
if (isSCDComponent) {
|
||||
Element parametersElement = componentElement.addElement("parameters"); //$NON-NLS-1$
|
||||
List elementParameterList = externalNode.getElementParameters();
|
||||
generateComponentSchemaInfo(externalNode, componentElement);
|
||||
generateComponentElementParamInfo(parametersElement, elementParameterList);
|
||||
}
|
||||
URL fileURL = componentDocumentation.getHTMLFile();
|
||||
if (fileURL != null) {
|
||||
this.externalNodeHTMLMap.put(componentName, fileURL);
|
||||
if (isSCDComponent) {
|
||||
// add extra check and uncheck icon for SCDComponent
|
||||
File picPath = new File(
|
||||
HTMLDocUtils.getTmpFolder() + File.separatorChar + IHTMLDocConstants.PICTUREFOLDERPATH);
|
||||
if (picPath.exists()) {
|
||||
for (File f : picPath.listFiles()) {
|
||||
if (!picFilePathMap.containsKey(f.getName())) {
|
||||
picFilePathMap.put(f.getName(), f.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
componentElement.addComment(componentName);
|
||||
|
||||
@@ -134,7 +134,7 @@ public final class TokenInforUtil {
|
||||
targetArray = new JSONArray();
|
||||
Map<String,List<JSONObject>> objectMap = new HashMap<String,List<JSONObject>>();
|
||||
for (Object obj : data) {
|
||||
if((obj instanceof JSONObject) && ((JSONObject)obj).get("component_name")!=null){//$NON-NLS-1$
|
||||
if((obj instanceof JSONObject) && ((JSONObject)obj).has("component_name") && ((JSONObject)obj).get("component_name")!=null){//$NON-NLS-1$
|
||||
List<JSONObject> dataList = new ArrayList<JSONObject>();
|
||||
String componentName = (String) ((JSONObject)obj).get("component_name");//$NON-NLS-1$
|
||||
if(objectMap.containsKey(componentName)){
|
||||
|
||||
@@ -317,3 +317,4 @@ ActionBarBuildHelper.SaveAll_toolTip=Save All
|
||||
ContextOrderProperty.BuiltInComment=Built-in context variables
|
||||
ContextOrderProperty.RepositoryComment=Context variables from repository context:
|
||||
BaseComponentInstallerTask.installComponent=Installing component {0}
|
||||
ApplicationWorkbenchWindowAdvisor.repositoryConnection=Connection
|
||||
|
||||
@@ -317,3 +317,4 @@ ActionBarBuildHelper.SaveAll_toolTip=Sauvegarder tout
|
||||
ContextOrderProperty.BuiltInComment=Variables de contexte built-in
|
||||
ContextOrderProperty.RepositoryComment=Variables de contexte du contexte du r\u00E9f\u00E9rentiel :
|
||||
BaseComponentInstallerTask.installComponent=Installation du composant {0}
|
||||
ApplicationWorkbenchWindowAdvisor.repositoryConnection=Connexion
|
||||
|
||||
@@ -317,3 +317,4 @@ ActionBarBuildHelper.SaveAll_toolTip=\u3059\u3079\u3066\u4FDD\u5B58
|
||||
ContextOrderProperty.BuiltInComment=\u7D44\u307F\u8FBC\u307F\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u5909\u6570
|
||||
ContextOrderProperty.RepositoryComment=\u30EA\u30DD\u30B8\u30C8\u30EA\u30FC\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u304B\u3089\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u5909\u6570:
|
||||
BaseComponentInstallerTask.installComponent=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8{0}\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u4E2D
|
||||
ApplicationWorkbenchWindowAdvisor.repositoryConnection=\u63A5\u7D9A
|
||||
|
||||
@@ -317,3 +317,4 @@ ActionBarBuildHelper.SaveAll_toolTip=\u4FDD\u5B58\u5168\u90E8
|
||||
ContextOrderProperty.BuiltInComment=\u5185\u7F6E\u4E0A\u4E0B\u6587\u53D8\u91CF
|
||||
ContextOrderProperty.RepositoryComment=\u6765\u81EA\u5B58\u50A8\u5E93\u4E0A\u4E0B\u6587\u7684\u4E0A\u4E0B\u6587\u53D8\u91CF\uFF1A
|
||||
BaseComponentInstallerTask.installComponent=\u6B63\u5728\u5B89\u88C5\u7EC4\u4EF6 {0}
|
||||
ApplicationWorkbenchWindowAdvisor.repositoryConnection=\u8FDE\u63A5
|
||||
|
||||
@@ -30,6 +30,7 @@ public enum ERepositoryCategoryType {
|
||||
DATABASE,
|
||||
SAP,
|
||||
SAPIDOC,
|
||||
BIGQUERY,
|
||||
EBCDIC,
|
||||
HL7,
|
||||
FTP,
|
||||
|
||||
@@ -47,6 +47,8 @@ public class ObjectElementParameter implements IElementParameter {
|
||||
|
||||
private boolean enable = true;
|
||||
|
||||
private String originEncryptedValue;
|
||||
|
||||
/**
|
||||
* Constructs a new TextElementParameter.
|
||||
*/
|
||||
@@ -1052,4 +1054,15 @@ public class ObjectElementParameter implements IElementParameter {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOrignEncryptedValue() {
|
||||
return originEncryptedValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOrignEncryptedValue(String value) {
|
||||
this.originEncryptedValue = value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2023 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.model.utils;
|
||||
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.utils.VersionUtils;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.context.Context;
|
||||
import org.talend.core.context.RepositoryContext;
|
||||
import org.talend.core.i18n.Messages;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.service.IRemoteService;
|
||||
import org.talend.core.service.IStudioLiteP2Service;
|
||||
import org.talend.core.ui.IInstalledPatchService;
|
||||
import org.talend.core.ui.branding.IBrandingService;
|
||||
import org.talend.repository.ui.login.connections.ConnectionUserPerReader;
|
||||
|
||||
/**
|
||||
* DOC jding class global comment. Detailled comment
|
||||
*/
|
||||
public class TalendWorkbenchUtil {
|
||||
|
||||
public static final String MANAGED_BY_ADMIN = " Managed by administrator"; //$NON-NLS-1$
|
||||
|
||||
public static String getWorkbenchWindowTitle() {
|
||||
String title = "";
|
||||
RepositoryContext repositoryContext = (RepositoryContext) CorePlugin.getContext()
|
||||
.getProperty(Context.REPOSITORY_CONTEXT_KEY);
|
||||
Project project = repositoryContext.getProject();
|
||||
String appName = IBrandingService.get().getFullProductName();
|
||||
// TDI-18644
|
||||
ProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
boolean localProvider = false;
|
||||
try {
|
||||
localProvider = factory.isLocalConnectionProvider();
|
||||
} catch (PersistenceException e) {
|
||||
localProvider = true;
|
||||
}
|
||||
|
||||
String buildIdField = " (" + VersionUtils.getVersion() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IInstalledPatchService.class)) {
|
||||
IInstalledPatchService pachService = (IInstalledPatchService) GlobalServiceRegister.getDefault()
|
||||
.getService(IInstalledPatchService.class);
|
||||
if (pachService != null) {
|
||||
String patchVersion = pachService.getLatestInstalledVersion(true);
|
||||
if (patchVersion != null) {
|
||||
buildIdField = " (" + patchVersion + ")"; //$NON-NLS-1$ //$NON-NLS-2$ ;
|
||||
if (IRemoteService.get() != null && IRemoteService.get().isCloudConnection()) {
|
||||
IStudioLiteP2Service liteP2Service = IStudioLiteP2Service.get();
|
||||
if (liteP2Service != null && liteP2Service.isUpdateManagedByTmc(new NullProgressMonitor())) {
|
||||
buildIdField += MANAGED_BY_ADMIN;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (TalendPropertiesUtil.isHideBuildNumber()) {
|
||||
buildIdField = ""; //$NON-NLS-1$
|
||||
}
|
||||
if (localProvider) {
|
||||
title = appName + buildIdField + " | " + project.getLabel() + " (" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ Messages.getString("ApplicationWorkbenchWindowAdvisor.repositoryConnection") + ": " //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ ConnectionUserPerReader.getInstance().readLastConncetion() + ")"; //$NON-NLS-1$
|
||||
} else {
|
||||
title = appName + buildIdField + " | " + repositoryContext.getUser() + " | " + project.getLabel() + " (" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ Messages.getString("ApplicationWorkbenchWindowAdvisor.repositoryConnection") + ": " //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ ConnectionUserPerReader.getInstance().readLastConncetion() + ")"; //$NON-NLS-1$
|
||||
}
|
||||
return title;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -95,4 +95,6 @@ public interface IGITProviderService extends IService {
|
||||
}
|
||||
return register.getService(IGITProviderService.class);
|
||||
}
|
||||
|
||||
public void clearOldStorage(IProgressMonitor monitor, Project project) throws PersistenceException;
|
||||
}
|
||||
|
||||
@@ -1076,6 +1076,21 @@ public class ProcessorUtilities {
|
||||
}
|
||||
progressMonitor.subTask(Messages.getString("ProcessorUtilities.loadingJob") + currentJobName); //$NON-NLS-1$
|
||||
|
||||
//APPINT-35554 correct build type for child job of Route
|
||||
JobInfo parentJobInfo = jobInfo.getFatherJobInfo();
|
||||
if (selectedProcessItem != null && parentJobInfo != null
|
||||
&& parentJobInfo.getProcessor() != null && parentJobInfo.getProcessor().getProperty() != null ) {
|
||||
Property childProperty = selectedProcessItem.getProperty();
|
||||
String childBuildType = (String)childProperty.getAdditionalProperties().get(TalendProcessArgumentConstant.ARG_BUILD_TYPE);
|
||||
if (childBuildType == null) {
|
||||
Property parentProperty = parentJobInfo.getProcessor().getProperty();
|
||||
String parentBuildType = (String)parentProperty.getAdditionalProperties().get(TalendProcessArgumentConstant.ARG_BUILD_TYPE);
|
||||
if ("ROUTE".equalsIgnoreCase(parentBuildType)) {
|
||||
childProperty.getAdditionalProperties().put(TalendProcessArgumentConstant.ARG_BUILD_TYPE, "OSGI");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (jobInfo.getProcess() == null) {
|
||||
if (selectedProcessItem != null) {
|
||||
IDesignerCoreService service = CorePlugin.getDefault().getDesignerCoreService();
|
||||
|
||||
@@ -553,7 +553,7 @@ _UI_Column_length_feature=Longueur
|
||||
_UI_Column_collationName_feature=Nom de l'interclassement
|
||||
_UI_Column_characterSetName_feature=Nom du jeu de caract\u00E8res
|
||||
_UI_Column_referencedTableType_feature=Type de la table r\u00E9f\u00E9renc\u00E9e
|
||||
_UI_Column_optionScopeColumnSet_feature=Scope des options sur le jeu de colonnes
|
||||
_UI_Column_optionScopeColumnSet_feature=P\u00E9rim\u00E8tre des options sur le jeu de colonnes
|
||||
_UI_Procedure_type_feature=Type
|
||||
_UI_Trigger_eventManipulation_feature=Manipulation d'\u00E9v\u00E9nement
|
||||
_UI_Trigger_actionCondition_feature=Condition d'action
|
||||
|
||||
@@ -22,7 +22,7 @@ _UI_Dependency_type=\u4F9D\u5B58\u9805\u76EE
|
||||
_UI_Expression_type=\u5F0F
|
||||
_UI_BooleanExpression_type=\u30D6\u30FC\u30EB\u5024\u306E\u5F0F
|
||||
_UI_ProcedureExpression_type=\u30D7\u30ED\u30B7\u30FC\u30B8\u30E3\u30FC\u30A8\u30AF\u30B9\u30D7\u30EC\u30C3\u30B7\u30E7\u30F3
|
||||
_UI_Multiplicity_type=\u591A\u69D8\u6027
|
||||
_UI_Multiplicity_type=\u591A\u91CD\u5EA6
|
||||
_UI_MultiplicityRange_type=\u591A\u69D8\u6027\u30EC\u30F3\u30B8
|
||||
_UI_Stereotype_type=\u30B9\u30C6\u30EC\u30AA\u30BF\u30A4\u30D7
|
||||
_UI_TaggedValue_type=\u30BF\u30B0\u4ED8\u3051\u3055\u308C\u305F\u5024
|
||||
@@ -151,7 +151,7 @@ _UI_ApplicationInputSpecification_type=\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E
|
||||
_UI_AttributeUsageRelation_type=\u5C5E\u6027\u7528\u6CD5\u95A2\u4FC2
|
||||
_UI_Category_type=\u30AB\u30C6\u30B4\u30EA\u30FC
|
||||
_UI_CategoryHierarchy_type=\u30AB\u30C6\u30B4\u30EA\u30FC\u968E\u5C64
|
||||
_UI_CostMatrix_type=\u30B3\u30B9\u30C8\u30DE\u30C8\u30EA\u30C3\u30AF\u30B9
|
||||
_UI_CostMatrix_type=\u30B3\u30B9\u30C8\u30DE\u30C8\u30EA\u30AF\u30B9
|
||||
_UI_MiningAttribute_type=\u30DE\u30A4\u30CB\u30F3\u30B0\u5C5E\u6027
|
||||
_UI_MiningDataSpecification_type=\u30DE\u30A4\u30CB\u30F3\u30B0\u30C7\u30FC\u30BF\u4ED5\u69D8
|
||||
_UI_MiningModel_type=\u30DE\u30A4\u30CB\u30F3\u30B0\u30E2\u30C7\u30EB
|
||||
@@ -367,7 +367,7 @@ _UI_Feature_featureNode_feature=\u6A5F\u80FD\u30CE\u30FC\u30C9
|
||||
_UI_Feature_featureMap_feature=\u6A5F\u80FD\u30DE\u30C3\u30D7
|
||||
_UI_Feature_cfMap_feature=Cf\u30DE\u30C3\u30D7
|
||||
_UI_StructuralFeature_changeability_feature=\u53EF\u5909\u6027
|
||||
_UI_StructuralFeature_multiplicity_feature=\u591A\u69D8\u6027
|
||||
_UI_StructuralFeature_multiplicity_feature=\u591A\u91CD\u5EA6
|
||||
_UI_StructuralFeature_ordering_feature=\u9806\u5E8F\u4ED8\u3051
|
||||
_UI_StructuralFeature_targetScope_feature=\u30BF\u30FC\u30B2\u30C3\u30C8\u30B9\u30B3\u30FC\u30D7
|
||||
_UI_StructuralFeature_type_feature=\u30BF\u30A4\u30D7
|
||||
@@ -390,7 +390,7 @@ _UI_Expression_language_feature=\u8A00\u8A9E
|
||||
_UI_Multiplicity_range_feature=\u7BC4\u56F2
|
||||
_UI_MultiplicityRange_lower_feature=\u4E0B\u65B9
|
||||
_UI_MultiplicityRange_upper_feature=\u4E0A\u65B9
|
||||
_UI_MultiplicityRange_multiplicity_feature=\u591A\u69D8\u6027
|
||||
_UI_MultiplicityRange_multiplicity_feature=\u591A\u91CD\u5EA6
|
||||
_UI_Stereotype_baseClass_feature=\u30D9\u30FC\u30B9\u30AF\u30E9\u30B9
|
||||
_UI_Stereotype_stereotypeConstraint_feature=\u30B9\u30C6\u30EC\u30AA\u30BF\u30A4\u30D7\u5236\u7D04
|
||||
_UI_Stereotype_extendedElement_feature=\u62E1\u5F35\u3055\u308C\u305F\u30A8\u30EC\u30E1\u30F3\u30C8
|
||||
@@ -418,7 +418,7 @@ _UI_Parameter_behavioralFeature_feature=\u52D5\u4F5C\u6A5F\u80FD
|
||||
_UI_Parameter_event_feature=\u30A4\u30D9\u30F3\u30C8
|
||||
_UI_Parameter_type_feature=\u30BF\u30A4\u30D7
|
||||
_UI_AssociationEnd_aggregation_feature=\u96C6\u7D04
|
||||
_UI_AssociationEnd_isNavigable_feature=Navigable\u3067\u3042\u308B
|
||||
_UI_AssociationEnd_isNavigable_feature=\u8A98\u5C0E\u53EF\u80FD\u3067\u3042\u308B
|
||||
_UI_Generalization_child_feature=\u5B50
|
||||
_UI_Generalization_parent_feature=\u89AA
|
||||
_UI_Instance_valueSlot_feature=\u5024\u30BB\u30C3\u30C8
|
||||
@@ -552,7 +552,7 @@ _UI_Column_isNullable_feature=NULL\u53EF\u80FD
|
||||
_UI_Column_length_feature=\u9577\u3055
|
||||
_UI_Column_collationName_feature=\u7167\u5408\u540D
|
||||
_UI_Column_characterSetName_feature=\u6587\u5B57\u30BB\u30C3\u30C8\u540D
|
||||
_UI_Column_referencedTableType_feature=\u53C2\u7167\u3055\u308C\u308B\u30C6\u30FC\u30D6\u30EB\u30BF\u30A4\u30D7
|
||||
_UI_Column_referencedTableType_feature=\u53C2\u7167\u30C6\u30FC\u30D6\u30EB\u30BF\u30A4\u30D7
|
||||
_UI_Column_optionScopeColumnSet_feature=\u30AA\u30D7\u30B7\u30E7\u30F3\u30B9\u30B3\u30FC\u30D7\u30AB\u30E9\u30E0\u30BB\u30C3\u30C8
|
||||
_UI_Procedure_type_feature=\u30BF\u30A4\u30D7
|
||||
_UI_Trigger_eventManipulation_feature=\u30A4\u30D9\u30F3\u30C8\u64CD\u4F5C
|
||||
@@ -743,7 +743,7 @@ _UI_ClusteringSettings_clusterIdAttributeName_feature=\u30AF\u30E9\u30B9\u30BF\u
|
||||
_UI_SupervisedMiningSettings_confidenceAttributeName_feature=\u4FE1\u7528\u5C5E\u6027\u540D
|
||||
_UI_SupervisedMiningSettings_predictedAttributeName_feature=\u4E88\u6E2C\u3055\u308C\u308B\u5C5E\u6027\u540D
|
||||
_UI_SupervisedMiningSettings_costFunction_feature=\u30B3\u30B9\u30C8\u95A2\u6570
|
||||
_UI_ClassificationSettings_costMatrix_feature=\u30B3\u30B9\u30C8\u30DE\u30C8\u30EA\u30C3\u30AF\u30B9
|
||||
_UI_ClassificationSettings_costMatrix_feature=\u30B3\u30B9\u30C8\u30DE\u30C8\u30EA\u30AF\u30B9
|
||||
_UI_AssociationRulesSettings_minimumSupport_feature=\u6700\u5C0F\u30B5\u30DD\u30FC\u30C8
|
||||
_UI_AssociationRulesSettings_minimumConfidence_feature=\u6700\u5C0F\u306E\u4FE1\u7528
|
||||
_UI_AssociationRulesSettings_itemId_feature=\u30A2\u30A4\u30C6\u30E0ID
|
||||
|
||||
@@ -184,10 +184,10 @@ _UI_RecordEditor_label = \u30EC\u30B3\u30FC\u30C9\u30E2\u30C7\u30EB\u30A8\u30C7\
|
||||
_UI_RecordEditorFilenameDefaultBase = My
|
||||
_UI_RecordEditorFilenameExtension = \u30EC\u30B3\u30FC\u30C9
|
||||
|
||||
_UI_MultidimensionalModelWizard_label = \u591A\u6B21\u5143\u7684\u30E2\u30C7\u30EB
|
||||
_UI_MultidimensionalModelWizard_description = \u65B0\u898F\u306E\u591A\u6B21\u5143\u7684\u30E2\u30C7\u30EB\u3092\u4F5C\u6210
|
||||
_UI_MultidimensionalModelWizard_label = \u591A\u6B21\u5143\u30E2\u30C7\u30EB
|
||||
_UI_MultidimensionalModelWizard_description = \u65B0\u898F\u306E\u591A\u6B21\u5143\u30E2\u30C7\u30EB\u3092\u4F5C\u6210
|
||||
|
||||
_UI_MultidimensionalEditor_label = \u591A\u6B21\u5143\u7684\u30E2\u30C7\u30EB\u30A8\u30C7\u30A3\u30BF
|
||||
_UI_MultidimensionalEditor_label = \u591A\u6B21\u5143\u30E2\u30C7\u30EB\u30A8\u30C7\u30A3\u30BF\u30FC
|
||||
|
||||
_UI_MultidimensionalEditorFilenameDefaultBase = My
|
||||
_UI_MultidimensionalEditorFilenameExtension = \u591A\u6B21\u5143\u7684
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
<geronimo.version>1.0.2</geronimo.version>
|
||||
<jcache.version>1.0.5</jcache.version>
|
||||
<jcache_spec.version>1.0-alpha-1</jcache_spec.version>
|
||||
<johnzon.version>1.2.19</johnzon.version>
|
||||
<johnzon.version>1.2.20</johnzon.version>
|
||||
<meecrowave.version>1.2.15</meecrowave.version>
|
||||
<microprofile.version>1.2.1</microprofile.version>
|
||||
<owb.version>2.0.27</owb.version>
|
||||
<slf4j.version>1.7.34</slf4j.version>
|
||||
<tomcat.version>9.0.73</tomcat.version>
|
||||
<tomcat.version>9.0.75</tomcat.version>
|
||||
<xbean.version>4.20</xbean.version>
|
||||
<reload4j.version>1.2.22</reload4j.version>
|
||||
<log4j2.version>2.20.0</log4j2.version>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<talend_releases>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease/</talend_releases>
|
||||
<talend_snapshots_ee>https://artifacts-zl.talend.com/nexus/content/repositories/snapshots/</talend_snapshots_ee>
|
||||
<talend_releases_ee>https://artifacts-zl.talend.com/nexus/content/repositories/releases/</talend_releases_ee>
|
||||
<tycho.buildtimestamp.format>${timestamp}</tycho.buildtimestamp.format>
|
||||
<tycho.buildtimestamp.format>${timestamp}</tycho.buildtimestamp.format>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
@@ -72,15 +72,15 @@
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20140107</version>
|
||||
<version>20230227</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-cbor</artifactId>
|
||||
<version>${m2.fasterxml.jackson.version}</version>
|
||||
</dependency>
|
||||
<!-- It fixes provided dependency scope to compile, because maven-dependency-plugin is setup to include
|
||||
only compile and runtime scopes, but provided is also required. It's not possible to setup plugin to
|
||||
<!-- It fixes provided dependency scope to compile, because maven-dependency-plugin is setup to include
|
||||
only compile and runtime scopes, but provided is also required. It's not possible to setup plugin to
|
||||
include all: compile, runtime and provided dependencies -->
|
||||
<dependency>
|
||||
<groupId>biz.aQute.bnd</groupId>
|
||||
@@ -99,7 +99,7 @@
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<!-- Dependencies in provided scope should be explicitly added as dependency in this module,
|
||||
<!-- Dependencies in provided scope should be explicitly added as dependency in this module,
|
||||
because provided scope is not transitive -->
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
|
||||
@@ -52,8 +52,17 @@
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<version>2.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
@@ -67,13 +76,18 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-framework-bom</artifactId>
|
||||
<version>5.2.7.RELEASE</version>
|
||||
<version>5.2.9.RELEASE</version>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>4.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-xml</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
|
||||
@@ -59,8 +59,17 @@
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<version>2.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
@@ -99,7 +108,7 @@
|
||||
<dependency>
|
||||
<groupId>com.thoughtworks.xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.4.16</version>
|
||||
<version>1.4.20</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.6</version>
|
||||
<version>3.8.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.6</version>
|
||||
<version>3.8.8</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-io</groupId>
|
||||
@@ -123,7 +123,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-compat</artifactId>
|
||||
<version>3.8.6</version>
|
||||
<version>3.8.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
@@ -133,7 +133,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20</version>
|
||||
<version>2.22.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.sonatype.plexus</groupId>
|
||||
@@ -141,6 +141,21 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-booter</artifactId>
|
||||
<version>2.22.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-api</artifactId>
|
||||
<version>2.22.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-junit4</artifactId>
|
||||
<version>2.22.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-cipher</artifactId>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20140107</version>
|
||||
<version>20230227</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.2.6</version>
|
||||
<version>4.5.13</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<tcomp.version>1.55.2</tcomp.version>
|
||||
<tcomp.version>1.59.0</tcomp.version>
|
||||
<slf4j.version>1.7.34</slf4j.version>
|
||||
<reload4j.version>1.2.22</reload4j.version>
|
||||
</properties>
|
||||
|
||||
@@ -37,3 +37,4 @@ Export-Package: org.talend.designer.maven,
|
||||
org.talend.designer.maven.tools.extension,
|
||||
org.talend.designer.maven.utils
|
||||
Import-Package: org.slf4j
|
||||
|
||||
|
||||
@@ -26,5 +26,4 @@
|
||||
serviceId="IDesignerMavenService">
|
||||
</Service>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
||||
@@ -44,7 +44,12 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.24</version>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-xml</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
@@ -54,12 +59,12 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>4.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-compat</artifactId>
|
||||
<version>3.8.6</version>
|
||||
<version>3.8.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
@@ -69,12 +74,12 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.6</version>
|
||||
<version>3.8.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>30.0-jre</version>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
@@ -101,12 +106,12 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.6</version>
|
||||
<version>3.8.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>30.0-jre</version>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
@@ -123,7 +128,12 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.24</version>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-xml</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
@@ -138,22 +148,22 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>4.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-io</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.6</version>
|
||||
<version>3.8.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>30.0-jre</version>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
@@ -165,7 +175,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.6.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
@@ -175,7 +185,17 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.24</version>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-io</artifactId>
|
||||
<version>3.4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-xml</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
@@ -195,29 +215,29 @@
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>4.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-compat</artifactId>
|
||||
<version>3.8.6</version>
|
||||
<version>3.8.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.6</version>
|
||||
<version>3.8.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>30.0-jre</version>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20</version>
|
||||
<version>2.22.2</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.sonatype.plexus</groupId>
|
||||
|
||||
@@ -216,7 +216,7 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
|
||||
Dependency guavaDep = new Dependency();
|
||||
guavaDep.setGroupId("com.google.guava");
|
||||
guavaDep.setArtifactId("guava");
|
||||
guavaDep.setVersion("30.0-jre");
|
||||
guavaDep.setVersion("32.0.1-jre");
|
||||
|
||||
Dependency ioDep = new Dependency();
|
||||
ioDep.setGroupId("commons-io");
|
||||
@@ -231,7 +231,7 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
|
||||
Dependency mavenCoreDep = new Dependency();
|
||||
mavenCoreDep.setGroupId("org.apache.maven");
|
||||
mavenCoreDep.setArtifactId("maven-core");
|
||||
mavenCoreDep.setVersion("3.8.6");
|
||||
mavenCoreDep.setVersion("3.8.8");
|
||||
|
||||
shade.getDependencies().add(guavaDep);
|
||||
shade.getDependencies().add(codecDep);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -18,11 +18,11 @@
|
||||
</libraryNeeded>
|
||||
<libraryNeeded
|
||||
context="plugin:org.talend.libraries.jdbc.mysql"
|
||||
id="mariadb-java-client-2.5.3.jar"
|
||||
id="mariadb-java-client-3.1.4.jar"
|
||||
language="java"
|
||||
message="Needed for Mysql jdbc plugin"
|
||||
mvn_uri="mvn:org.mariadb.jdbc/mariadb-java-client/2.5.3"
|
||||
name="mariadb-java-client-2.5.3.jar"
|
||||
mvn_uri="mvn:org.mariadb.jdbc/mariadb-java-client/3.1.4"
|
||||
name="mariadb-java-client-3.1.4.jar"
|
||||
required="true">
|
||||
</libraryNeeded>
|
||||
<libraryNeeded
|
||||
|
||||
@@ -1,223 +0,0 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2008, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Project Info: http://www.jfree.org/jfreechart/index.html
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*
|
||||
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
|
||||
* in the United States and other countries.]
|
||||
*
|
||||
* ------------------------------
|
||||
* CombinedCategoryPlotDemo1.java
|
||||
* ------------------------------
|
||||
* (C) Copyright 2008, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): ;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 05-May-2008 : Version 1 (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.experimental.chart.demo;
|
||||
|
||||
import java.awt.Font;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import org.jfree.chart.ChartPanel;
|
||||
import org.jfree.chart.JFreeChart;
|
||||
import org.jfree.chart.axis.CategoryAxis;
|
||||
import org.jfree.chart.axis.NumberAxis;
|
||||
import org.jfree.chart.labels.StandardCategoryToolTipGenerator;
|
||||
import org.jfree.chart.plot.CategoryPlot;
|
||||
import org.jfree.chart.renderer.category.BarRenderer;
|
||||
import org.jfree.chart.renderer.category.LineAndShapeRenderer;
|
||||
import org.jfree.data.category.CategoryDataset;
|
||||
import org.jfree.data.category.DefaultCategoryDataset;
|
||||
import org.jfree.experimental.chart.plot.CombinedCategoryPlot;
|
||||
import org.jfree.ui.ApplicationFrame;
|
||||
import org.jfree.ui.RefineryUtilities;
|
||||
|
||||
/**
|
||||
* A demo for the {@link CombinedCategoryPlot} class.
|
||||
*/
|
||||
public class CombinedCategoryPlotDemo1 extends ApplicationFrame {
|
||||
|
||||
/**
|
||||
* Creates a new demo instance.
|
||||
*
|
||||
* @param title the frame title.
|
||||
*/
|
||||
public CombinedCategoryPlotDemo1(String title) {
|
||||
super(title);
|
||||
JPanel chartPanel = createDemoPanel();
|
||||
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
|
||||
setContentPane(chartPanel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a dataset.
|
||||
*
|
||||
* @return A dataset.
|
||||
*/
|
||||
public static CategoryDataset createDataset1() {
|
||||
DefaultCategoryDataset result = new DefaultCategoryDataset();
|
||||
String series1 = "First";
|
||||
String series2 = "Second";
|
||||
String type1 = "Type 1";
|
||||
String type2 = "Type 2";
|
||||
String type3 = "Type 3";
|
||||
String type4 = "Type 4";
|
||||
String type5 = "Type 5";
|
||||
String type6 = "Type 6";
|
||||
String type7 = "Type 7";
|
||||
String type8 = "Type 8";
|
||||
|
||||
result.addValue(1.0, series1, type1);
|
||||
result.addValue(4.0, series1, type2);
|
||||
result.addValue(3.0, series1, type3);
|
||||
result.addValue(5.0, series1, type4);
|
||||
result.addValue(5.0, series1, type5);
|
||||
result.addValue(7.0, series1, type6);
|
||||
result.addValue(7.0, series1, type7);
|
||||
result.addValue(8.0, series1, type8);
|
||||
|
||||
result.addValue(5.0, series2, type1);
|
||||
result.addValue(7.0, series2, type2);
|
||||
result.addValue(6.0, series2, type3);
|
||||
result.addValue(8.0, series2, type4);
|
||||
result.addValue(4.0, series2, type5);
|
||||
result.addValue(4.0, series2, type6);
|
||||
result.addValue(2.0, series2, type7);
|
||||
result.addValue(1.0, series2, type8);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a dataset.
|
||||
*
|
||||
* @return A dataset.
|
||||
*/
|
||||
public static CategoryDataset createDataset2() {
|
||||
|
||||
DefaultCategoryDataset result = new DefaultCategoryDataset();
|
||||
|
||||
String series1 = "Third";
|
||||
String series2 = "Fourth";
|
||||
|
||||
String type1 = "Type 1";
|
||||
String type2 = "Type 2";
|
||||
String type3 = "Type 3";
|
||||
String type4 = "Type 4";
|
||||
String type5 = "Type 5";
|
||||
String type6 = "Type 6";
|
||||
String type7 = "Type 7";
|
||||
String type8 = "Type 8";
|
||||
|
||||
result.addValue(11.0, series1, type1);
|
||||
result.addValue(14.0, series1, type2);
|
||||
result.addValue(13.0, series1, type3);
|
||||
result.addValue(15.0, series1, type4);
|
||||
result.addValue(15.0, series1, type5);
|
||||
result.addValue(17.0, series1, type6);
|
||||
result.addValue(17.0, series1, type7);
|
||||
result.addValue(18.0, series1, type8);
|
||||
|
||||
result.addValue(15.0, series2, type1);
|
||||
result.addValue(17.0, series2, type2);
|
||||
result.addValue(16.0, series2, type3);
|
||||
result.addValue(18.0, series2, type4);
|
||||
result.addValue(14.0, series2, type5);
|
||||
result.addValue(14.0, series2, type6);
|
||||
result.addValue(12.0, series2, type7);
|
||||
result.addValue(11.0, series2, type8);
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a chart.
|
||||
*
|
||||
* @return A chart.
|
||||
*/
|
||||
private static JFreeChart createChart() {
|
||||
|
||||
CategoryDataset dataset1 = createDataset1();
|
||||
NumberAxis rangeAxis1 = new NumberAxis("Value");
|
||||
rangeAxis1.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
|
||||
LineAndShapeRenderer renderer1 = new LineAndShapeRenderer();
|
||||
renderer1.setBaseToolTipGenerator(
|
||||
new StandardCategoryToolTipGenerator());
|
||||
CategoryPlot subplot1 = new CategoryPlot(dataset1, null, rangeAxis1,
|
||||
renderer1);
|
||||
subplot1.setDomainGridlinesVisible(true);
|
||||
|
||||
CategoryDataset dataset2 = createDataset2();
|
||||
NumberAxis rangeAxis2 = new NumberAxis("Value");
|
||||
rangeAxis2.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
|
||||
BarRenderer renderer2 = new BarRenderer();
|
||||
renderer2.setBaseToolTipGenerator(
|
||||
new StandardCategoryToolTipGenerator());
|
||||
CategoryPlot subplot2 = new CategoryPlot(dataset2, null, rangeAxis2,
|
||||
renderer2);
|
||||
subplot2.setDomainGridlinesVisible(true);
|
||||
|
||||
CategoryAxis domainAxis = new CategoryAxis("Category");
|
||||
CombinedCategoryPlot plot = new CombinedCategoryPlot(
|
||||
domainAxis, new NumberAxis("Range"));
|
||||
plot.add(subplot1, 2);
|
||||
plot.add(subplot2, 1);
|
||||
|
||||
JFreeChart result = new JFreeChart(
|
||||
"Combined Domain Category Plot Demo",
|
||||
new Font("SansSerif", Font.BOLD, 12), plot, true);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a panel for the demo (used by SuperDemo.java).
|
||||
*
|
||||
* @return A panel.
|
||||
*/
|
||||
public static JPanel createDemoPanel() {
|
||||
JFreeChart chart = createChart();
|
||||
return new ChartPanel(chart);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starting point for the demonstration application.
|
||||
*
|
||||
* @param args ignored.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
String title = "Combined Category Plot Demo 1";
|
||||
CombinedCategoryPlotDemo1 demo = new CombinedCategoryPlotDemo1(title);
|
||||
demo.pack();
|
||||
RefineryUtilities.centerFrameOnScreen(demo);
|
||||
demo.setVisible(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,262 +0,0 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2008, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Project Info: http://www.jfree.org/jfreechart/index.html
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*
|
||||
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
|
||||
* in the United States and other countries.]
|
||||
*
|
||||
* ------------------------
|
||||
* CombinedXYPlotDemo1.java
|
||||
* ------------------------
|
||||
* (C) Copyright 2008, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Original Author: David Gilbert (for Object Refinery Limited);
|
||||
* Contributor(s): ;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 05-May-2008 : Version 1 (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.experimental.chart.demo;
|
||||
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Paint;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import org.jfree.chart.ChartPanel;
|
||||
import org.jfree.chart.JFreeChart;
|
||||
import org.jfree.chart.axis.DateAxis;
|
||||
import org.jfree.chart.axis.NumberAxis;
|
||||
import org.jfree.chart.axis.ValueAxis;
|
||||
import org.jfree.chart.labels.StandardXYToolTipGenerator;
|
||||
import org.jfree.chart.plot.XYPlot;
|
||||
import org.jfree.chart.renderer.xy.XYBarRenderer;
|
||||
import org.jfree.chart.renderer.xy.XYItemRenderer;
|
||||
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
|
||||
import org.jfree.chart.title.LegendTitle;
|
||||
import org.jfree.data.time.Month;
|
||||
import org.jfree.data.time.TimeSeries;
|
||||
import org.jfree.data.time.TimeSeriesCollection;
|
||||
import org.jfree.data.xy.IntervalXYDataset;
|
||||
import org.jfree.data.xy.XYDataset;
|
||||
import org.jfree.experimental.chart.plot.CombinedXYPlot;
|
||||
import org.jfree.ui.ApplicationFrame;
|
||||
import org.jfree.ui.RefineryUtilities;
|
||||
|
||||
/**
|
||||
* A demonstration application showing a {@link CombinedXYPlot} with
|
||||
* two subplots.
|
||||
*/
|
||||
public class CombinedXYPlotDemo1 extends ApplicationFrame {
|
||||
|
||||
/**
|
||||
* Constructs a new demonstration application.
|
||||
*
|
||||
* @param title the frame title.
|
||||
*/
|
||||
public CombinedXYPlotDemo1(String title) {
|
||||
super(title);
|
||||
JPanel panel = createDemoPanel();
|
||||
panel.setPreferredSize(new java.awt.Dimension(500, 270));
|
||||
setContentPane(panel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an overlaid chart.
|
||||
*
|
||||
* @return The chart.
|
||||
*/
|
||||
private static JFreeChart createCombinedChart() {
|
||||
|
||||
// create plot ...
|
||||
IntervalXYDataset data1 = createDataset1();
|
||||
XYItemRenderer renderer1 = new XYLineAndShapeRenderer(true, false);
|
||||
renderer1.setBaseToolTipGenerator(new StandardXYToolTipGenerator(
|
||||
StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT,
|
||||
new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.00")));
|
||||
renderer1.setSeriesStroke(0, new BasicStroke(4.0f,
|
||||
BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
|
||||
renderer1.setSeriesPaint(0, Color.blue);
|
||||
|
||||
DateAxis domainAxis = new DateAxis("Year");
|
||||
domainAxis.setLowerMargin(0.0);
|
||||
domainAxis.setUpperMargin(0.02);
|
||||
ValueAxis rangeAxis = new NumberAxis("$billion");
|
||||
XYPlot plot1 = new XYPlot(data1, null, rangeAxis, renderer1);
|
||||
plot1.setBackgroundPaint(Color.lightGray);
|
||||
plot1.setDomainGridlinePaint(Color.white);
|
||||
plot1.setRangeGridlinePaint(Color.white);
|
||||
|
||||
// add a second dataset and renderer...
|
||||
IntervalXYDataset data2 = createDataset2();
|
||||
XYBarRenderer renderer2 = new XYBarRenderer() {
|
||||
public Paint getItemPaint(int series, int item) {
|
||||
XYDataset dataset = getPlot().getDataset();
|
||||
if (dataset.getYValue(series, item) >= 0.0) {
|
||||
return Color.red;
|
||||
}
|
||||
else {
|
||||
return Color.green;
|
||||
}
|
||||
}
|
||||
};
|
||||
renderer2.setSeriesPaint(0, Color.red);
|
||||
renderer2.setDrawBarOutline(false);
|
||||
renderer2.setBaseToolTipGenerator(new StandardXYToolTipGenerator(
|
||||
StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT,
|
||||
new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.00")));
|
||||
|
||||
XYPlot plot2 = new XYPlot(data2, null, new NumberAxis("$billion"),
|
||||
renderer2);
|
||||
plot2.setBackgroundPaint(Color.lightGray);
|
||||
plot2.setDomainGridlinePaint(Color.white);
|
||||
plot2.setRangeGridlinePaint(Color.white);
|
||||
|
||||
CombinedXYPlot cplot = new CombinedXYPlot(domainAxis, rangeAxis);
|
||||
cplot.add(plot1, 3);
|
||||
cplot.add(plot2, 2);
|
||||
cplot.setGap(8.0);
|
||||
cplot.setDomainGridlinePaint(Color.white);
|
||||
cplot.setDomainGridlinesVisible(true);
|
||||
|
||||
// return a new chart containing the overlaid plot...
|
||||
JFreeChart chart = new JFreeChart("CombinedXYPlotDemo1",
|
||||
JFreeChart.DEFAULT_TITLE_FONT, cplot, false);
|
||||
chart.setBackgroundPaint(Color.white);
|
||||
LegendTitle legend = new LegendTitle(cplot);
|
||||
chart.addSubtitle(legend);
|
||||
return chart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sample dataset. You wouldn't normally hard-code the
|
||||
* population of a dataset in this way (it would be better to read the
|
||||
* values from a file or a database query), but for a self-contained demo
|
||||
* this is the least complicated solution.
|
||||
*
|
||||
* @return The dataset.
|
||||
*/
|
||||
private static IntervalXYDataset createDataset1() {
|
||||
|
||||
// create dataset 1...
|
||||
TimeSeries series1 = new TimeSeries("Series 1", Month.class);
|
||||
series1.add(new Month(1, 2005), 7627.743);
|
||||
series1.add(new Month(2, 2005), 7713.138);
|
||||
series1.add(new Month(3, 2005), 6776.939);
|
||||
series1.add(new Month(4, 2005), 5764.537);
|
||||
series1.add(new Month(5, 2005), 4777.880);
|
||||
series1.add(new Month(6, 2005), 4836.496);
|
||||
series1.add(new Month(7, 2005), 3887.618);
|
||||
series1.add(new Month(8, 2005), 3926.933);
|
||||
series1.add(new Month(9, 2005), 4932.710);
|
||||
series1.add(new Month(10, 2005), 4027.123);
|
||||
series1.add(new Month(11, 2005), 8092.322);
|
||||
series1.add(new Month(12, 2005), 8170.414);
|
||||
series1.add(new Month(1, 2006), 8196.070);
|
||||
series1.add(new Month(2, 2006), 8269.886);
|
||||
series1.add(new Month(3, 2006), 5371.156);
|
||||
series1.add(new Month(4, 2006), 5355.718);
|
||||
series1.add(new Month(5, 2006), 5356.777);
|
||||
series1.add(new Month(6, 2006), 8420.042);
|
||||
series1.add(new Month(7, 2006), 8444.347);
|
||||
series1.add(new Month(8, 2006), 8515.034);
|
||||
series1.add(new Month(9, 2006), 8506.974);
|
||||
series1.add(new Month(10, 2006), 8584.329);
|
||||
series1.add(new Month(11, 2006), 8633.246);
|
||||
series1.add(new Month(12, 2006), 8680.224);
|
||||
series1.add(new Month(1, 2007), 8707.561);
|
||||
return new TimeSeriesCollection(series1);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a sample dataset. You wouldn't normally hard-code the
|
||||
* population of a dataset in this way (it would be better to read the
|
||||
* values from a file or a database query), but for a self-contained demo
|
||||
* this is the least complicated solution.
|
||||
*
|
||||
* @return A sample dataset.
|
||||
*/
|
||||
private static IntervalXYDataset createDataset2() {
|
||||
TimeSeriesCollection dataset = new TimeSeriesCollection();
|
||||
|
||||
TimeSeries series1 = new TimeSeries("Series 2", Month.class);
|
||||
series1.add(new Month(1, 2005), 1200);
|
||||
series1.add(new Month(2, 2005), 1400);
|
||||
series1.add(new Month(3, 2005), 1500);
|
||||
series1.add(new Month(4, 2005), 1700);
|
||||
series1.add(new Month(5, 2005), 1600);
|
||||
series1.add(new Month(6, 2005), 2400);
|
||||
series1.add(new Month(7, 2005), 2100);
|
||||
series1.add(new Month(8, 2005), 2200);
|
||||
series1.add(new Month(9, 2005), 800);
|
||||
series1.add(new Month(10, 2005), 2350);
|
||||
series1.add(new Month(11, 2005), 500);
|
||||
series1.add(new Month(12, 2005), 700);
|
||||
series1.add(new Month(1, 2006), 900);
|
||||
series1.add(new Month(2, 2006), 1500);
|
||||
series1.add(new Month(3, 2006), 2100);
|
||||
series1.add(new Month(4, 2006), 2200);
|
||||
series1.add(new Month(5, 2006), 1900);
|
||||
series1.add(new Month(6, 2006), 3000);
|
||||
series1.add(new Month(7, 2006), 3780);
|
||||
series1.add(new Month(8, 2006), 4000);
|
||||
series1.add(new Month(9, 2006), 4500);
|
||||
series1.add(new Month(10, 2006), 7000);
|
||||
series1.add(new Month(11, 2006), 5500);
|
||||
series1.add(new Month(12, 2006), 6000);
|
||||
series1.add(new Month(1, 2007), 6500);
|
||||
dataset.addSeries(series1);
|
||||
return dataset;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a panel for the demo (used by SuperDemo.java).
|
||||
*
|
||||
* @return A panel.
|
||||
*/
|
||||
public static JPanel createDemoPanel() {
|
||||
JFreeChart chart = createCombinedChart();
|
||||
return new ChartPanel(chart);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starting point for the demonstration application.
|
||||
*
|
||||
* @param args ignored.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
CombinedXYPlotDemo1 demo = new CombinedXYPlotDemo1(
|
||||
"JFreeChart : CombinedXYPlotDemo1");
|
||||
demo.pack();
|
||||
RefineryUtilities.centerFrameOnScreen(demo);
|
||||
demo.setVisible(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2008, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Project Info: http://www.jfree.org/jfreechart/index.html
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*
|
||||
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
|
||||
* in the United States and other countries.]
|
||||
*
|
||||
* -------------------------
|
||||
* CombinedCategoryPlot.java
|
||||
* -------------------------
|
||||
* (C) Copyright 2008, by Richard West and Contributors.
|
||||
*
|
||||
* Original Author: Richard West, Advanced Micro Devices, Inc.;
|
||||
* Contributor(s): David Gilbert (for Object Refinery Limited);
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 02-Feb-2007 : Version 1, contributed by Richard West - see
|
||||
* patch 1924543 (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.experimental.chart.plot;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.jfree.chart.axis.CategoryAxis;
|
||||
import org.jfree.chart.axis.ValueAxis;
|
||||
import org.jfree.chart.plot.CategoryPlot;
|
||||
import org.jfree.chart.plot.CombinedDomainCategoryPlot;
|
||||
import org.jfree.data.Range;
|
||||
|
||||
/**
|
||||
* A specialised form of {@link CombinedDomainCategoryPlot} where the
|
||||
* subplots share not only the same x-axis, but also the same y-axis.
|
||||
*/
|
||||
public class CombinedCategoryPlot extends CombinedDomainCategoryPlot {
|
||||
|
||||
/**
|
||||
* Creates a new instance with the specified axes.
|
||||
*
|
||||
* @param domainAxis the x-axis.
|
||||
* @param rangeAxis the y-axis.
|
||||
*/
|
||||
public CombinedCategoryPlot (CategoryAxis domainAxis, ValueAxis rangeAxis) {
|
||||
super(domainAxis);
|
||||
super.setGap(10.0);
|
||||
super.setRangeAxis(rangeAxis);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new subplot with weight <code>1</code>.
|
||||
*
|
||||
* @param subplot the subplot.
|
||||
*/
|
||||
public void add(CategoryPlot subplot) {
|
||||
this.add(subplot, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new subplot with the specified weight.
|
||||
*
|
||||
* @param subplot the subplot.
|
||||
* @param weight the weight for the subplot.
|
||||
*/
|
||||
public void add(CategoryPlot subplot, int weight) {
|
||||
super.add(subplot, weight);
|
||||
|
||||
ValueAxis l_range = super.getRangeAxis();
|
||||
subplot.setRangeAxis(0, l_range, false);
|
||||
|
||||
super.setRangeAxis(l_range);
|
||||
if (null == l_range) {
|
||||
return;
|
||||
}
|
||||
|
||||
l_range.configure();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the bounds of the data values that will be plotted against
|
||||
* the specified axis.
|
||||
*
|
||||
* @param axis the axis.
|
||||
*
|
||||
* @return The bounds.
|
||||
*/
|
||||
public Range getDataRange(ValueAxis axis) {
|
||||
Range l_result = null;
|
||||
Iterator l_itr = getSubplots().iterator();
|
||||
while (l_itr.hasNext()) {
|
||||
CategoryPlot l_subplot = (CategoryPlot) l_itr.next();
|
||||
|
||||
l_result = Range.combine(l_result, l_subplot.getDataRange(axis));
|
||||
}
|
||||
return l_result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the range axis that is shared by all the subplots.
|
||||
*
|
||||
* @param axis the axis.
|
||||
*/
|
||||
public void setRangeAxis(ValueAxis axis) {
|
||||
Iterator l_itr = getSubplots().iterator();
|
||||
while (l_itr.hasNext()) {
|
||||
CategoryPlot l_subplot = (CategoryPlot) l_itr.next();
|
||||
l_subplot.setRangeAxis(0, axis, false);
|
||||
}
|
||||
|
||||
super.setRangeAxis(axis);
|
||||
if (null == axis) {
|
||||
return;
|
||||
}
|
||||
|
||||
axis.configure();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,139 +0,0 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2008, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Project Info: http://www.jfree.org/jfreechart/index.html
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*
|
||||
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
|
||||
* in the United States and other countries.]
|
||||
*
|
||||
* -------------------
|
||||
* CombinedXYPlot.java
|
||||
* -------------------
|
||||
* (C) Copyright 2008, by Richard West and Contributors.
|
||||
*
|
||||
* Original Author: Richard West, Advanced Micro Devices, Inc.;
|
||||
* Contributor(s): David Gilbert (for Object Refinery Limited);
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 05-May-2008 : Version 1, contributed by Richard West - see
|
||||
* patch 1924543 (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.experimental.chart.plot;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.jfree.chart.axis.ValueAxis;
|
||||
import org.jfree.chart.plot.CombinedDomainCategoryPlot;
|
||||
import org.jfree.chart.plot.CombinedDomainXYPlot;
|
||||
import org.jfree.chart.plot.XYPlot;
|
||||
import org.jfree.data.Range;
|
||||
|
||||
/**
|
||||
* A specialised form of {@link CombinedDomainCategoryPlot} where the
|
||||
* subplots share not only the same x-axis, but also the same y-axis.
|
||||
*/
|
||||
public class CombinedXYPlot extends CombinedDomainXYPlot {
|
||||
|
||||
/**
|
||||
* Creates a new instance with the specified axes.
|
||||
*
|
||||
* @param domainAxis the x-axis.
|
||||
* @param rangeAxis the y-axis.
|
||||
*/
|
||||
public CombinedXYPlot(ValueAxis domainAxis, ValueAxis rangeAxis) {
|
||||
super(domainAxis);
|
||||
super.setGap(10.0);
|
||||
super.setRangeAxis(rangeAxis);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new subplot with weight <code>1</code>.
|
||||
*
|
||||
* @param subplot the subplot.
|
||||
*/
|
||||
public void add(XYPlot subplot) {
|
||||
this.add(subplot, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new subplot with the specified weight.
|
||||
*
|
||||
* @param subplot the subplot.
|
||||
* @param weight the weight for the subplot.
|
||||
*/
|
||||
public void add(XYPlot subplot, int weight) {
|
||||
super.add(subplot, weight);
|
||||
|
||||
ValueAxis l_range = super.getRangeAxis();
|
||||
subplot.setRangeAxis(0, l_range, false);
|
||||
|
||||
super.setRangeAxis(l_range);
|
||||
if (null == l_range) {
|
||||
return;
|
||||
}
|
||||
|
||||
l_range.configure();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the bounds of the data values that will be plotted against
|
||||
* the specified axis.
|
||||
*
|
||||
* @param axis the axis.
|
||||
*
|
||||
* @return The bounds.
|
||||
*/
|
||||
public Range getDataRange(ValueAxis axis) {
|
||||
Range l_result = null;
|
||||
Iterator l_itr = getSubplots().iterator();
|
||||
while (l_itr.hasNext()) {
|
||||
XYPlot l_subplot = (XYPlot) l_itr.next();
|
||||
|
||||
l_result = Range.combine(l_result, l_subplot.getDataRange(axis));
|
||||
}
|
||||
return l_result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the range axis that is shared by all the subplots.
|
||||
*
|
||||
* @param axis the axis.
|
||||
*/
|
||||
public void setRangeAxis(ValueAxis axis) {
|
||||
Iterator l_itr = getSubplots().iterator();
|
||||
while (l_itr.hasNext()) {
|
||||
XYPlot l_subplot = (XYPlot) l_itr.next();
|
||||
l_subplot.setRangeAxis(0, axis, false);
|
||||
}
|
||||
|
||||
super.setRangeAxis(axis);
|
||||
if (null == axis) {
|
||||
return;
|
||||
}
|
||||
|
||||
axis.configure();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,298 +0,0 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2007, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Project Info: http://www.jfree.org/jfreechart/index.html
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*
|
||||
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
|
||||
* in the United States and other countries.]
|
||||
*
|
||||
* ---------------------------------
|
||||
* XYSmoothLineAndShapeRenderer.java
|
||||
* ---------------------------------
|
||||
* (C) Copyright 2007, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Original Author: -;
|
||||
* Contributor(s): -;
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 14-Jun-2007 : Version 1;
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.experimental.chart.renderer.xy;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
||||
import org.jfree.chart.axis.ValueAxis;
|
||||
import org.jfree.chart.entity.EntityCollection;
|
||||
import org.jfree.chart.plot.CrosshairState;
|
||||
import org.jfree.chart.plot.PlotOrientation;
|
||||
import org.jfree.chart.plot.XYPlot;
|
||||
import org.jfree.chart.renderer.xy.XYItemRendererState;
|
||||
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
|
||||
import org.jfree.data.xy.XYDataset;
|
||||
import org.jfree.ui.RectangleEdge;
|
||||
|
||||
/**
|
||||
* A line and shape renderer that performs line smoothing. See
|
||||
* http://www.jfree.org/phpBB2/viewtopic.php?t=20671
|
||||
*
|
||||
* WARNING: THIS CLASS IS NOT PART OF THE STANDARD JFREECHART API AND IS
|
||||
* SUBJECT TO ALTERATION OR REMOVAL. DO NOT RELY ON THIS CLASS FOR
|
||||
* PRODUCTION USE. Please experiment with this code and provide feedback.
|
||||
*/
|
||||
public class XYSmoothLineAndShapeRenderer extends XYLineAndShapeRenderer {
|
||||
|
||||
/**
|
||||
* Draws the item (first pass). This method draws the lines
|
||||
* connecting the items.
|
||||
*
|
||||
* @param g2 the graphics device.
|
||||
* @param state the renderer state.
|
||||
* @param dataArea the area within which the data is being drawn.
|
||||
* @param plot the plot (can be used to obtain standard color
|
||||
* information etc).
|
||||
* @param domainAxis the domain axis.
|
||||
* @param rangeAxis the range axis.
|
||||
* @param dataset the dataset.
|
||||
* @param pass the pass.
|
||||
* @param series the series index (zero-based).
|
||||
* @param item the item index (zero-based).
|
||||
*/
|
||||
protected void drawPrimaryLine(XYItemRendererState state, Graphics2D g2,
|
||||
XYPlot plot, XYDataset dataset, int pass, int series, int item,
|
||||
ValueAxis domainAxis, ValueAxis rangeAxis, Rectangle2D dataArea) {
|
||||
|
||||
if (item == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// get the data point...
|
||||
double x1 = dataset.getXValue(series, item);
|
||||
double y1 = dataset.getYValue(series, item);
|
||||
if (Double.isNaN(y1) || Double.isNaN(x1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
double x0 = dataset.getXValue(series, item - 1);
|
||||
double y0 = dataset.getYValue(series, item - 1);
|
||||
if (Double.isNaN(y0) || Double.isNaN(x0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
RectangleEdge xAxisLocation = plot.getDomainAxisEdge();
|
||||
RectangleEdge yAxisLocation = plot.getRangeAxisEdge();
|
||||
|
||||
double transX0 = domainAxis.valueToJava2D(x0, dataArea, xAxisLocation);
|
||||
double transY0 = rangeAxis.valueToJava2D(y0, dataArea, yAxisLocation);
|
||||
|
||||
double transX1 = domainAxis.valueToJava2D(x1, dataArea, xAxisLocation);
|
||||
double transY1 = rangeAxis.valueToJava2D(y1, dataArea, yAxisLocation);
|
||||
|
||||
// only draw if we have good values
|
||||
if (Double.isNaN(transX0) || Double.isNaN(transY0)
|
||||
|| Double.isNaN(transX1) || Double.isNaN(transY1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Point2D.Double point0 = new Point2D.Double();
|
||||
Point2D.Double point1 = new Point2D.Double();
|
||||
Point2D.Double point2 = new Point2D.Double();
|
||||
Point2D.Double point3 = new Point2D.Double();
|
||||
|
||||
if (item == 1) {
|
||||
point0 = null;
|
||||
}
|
||||
else {
|
||||
point0.x = domainAxis.valueToJava2D(dataset.getXValue(series,
|
||||
item - 2), dataArea, xAxisLocation);
|
||||
point0.y = rangeAxis.valueToJava2D(dataset.getYValue(series,
|
||||
item - 2), dataArea, yAxisLocation);
|
||||
}
|
||||
|
||||
point1.x = transX0;
|
||||
point1.y = transY0;
|
||||
|
||||
point2.x = transX1;
|
||||
point2.y = transY1;
|
||||
|
||||
if ((item + 1) == dataset.getItemCount(series)) {
|
||||
point3 = null;
|
||||
}
|
||||
else {
|
||||
point3.x = domainAxis.valueToJava2D(dataset.getXValue(series,
|
||||
item + 1), dataArea, xAxisLocation);
|
||||
point3.y = rangeAxis.valueToJava2D(dataset.getYValue(series,
|
||||
item + 1), dataArea, yAxisLocation);
|
||||
}
|
||||
|
||||
int steps = ((int) ((point2.x - point1.x) / 0.2) < 30)
|
||||
? (int) ((point2.x - point1.x) / 0.2) : 30;
|
||||
|
||||
Point2D.Double[] points = getBezierCurve(point0, point1, point2,
|
||||
point3, 1, steps);
|
||||
|
||||
for (int i = 1; i < points.length; i++) {
|
||||
transX0 = points[i - 1].x;
|
||||
transY0 = points[i - 1].y;
|
||||
transX1 = points[i].x;
|
||||
transY1 = points[i].y;
|
||||
|
||||
PlotOrientation orientation = plot.getOrientation();
|
||||
if (orientation == PlotOrientation.HORIZONTAL) {
|
||||
state.workingLine.setLine(transY0, transX0, transY1, transX1);
|
||||
}
|
||||
else if (orientation == PlotOrientation.VERTICAL) {
|
||||
state.workingLine.setLine(transX0, transY0, transX1, transY1);
|
||||
}
|
||||
|
||||
if (state.workingLine.intersects(dataArea)) {
|
||||
drawFirstPassShape(g2, pass, series, item, state.workingLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the item shapes and adds chart entities (second pass). This method
|
||||
* draws the shapes which mark the item positions. If <code>entities</code>
|
||||
* is not <code>null</code> it will be populated with entity information
|
||||
* for points that fall within the data area.
|
||||
*
|
||||
* @param g2 the graphics device.
|
||||
* @param plot the plot (can be used to obtain standard color
|
||||
* information etc).
|
||||
* @param domainAxis the domain axis.
|
||||
* @param dataArea the area within which the data is being drawn.
|
||||
* @param rangeAxis the range axis.
|
||||
* @param dataset the dataset.
|
||||
* @param pass the pass.
|
||||
* @param series the series index (zero-based).
|
||||
* @param item the item index (zero-based).
|
||||
* @param crosshairState the crosshair state.
|
||||
* @param entities the entity collection.
|
||||
*/
|
||||
protected void drawSecondaryPass(Graphics2D g2, XYPlot plot,
|
||||
XYDataset dataset, int pass, int series, int item,
|
||||
ValueAxis domainAxis, Rectangle2D dataArea,
|
||||
ValueAxis rangeAxis, CrosshairState crosshairState,
|
||||
EntityCollection entities) {
|
||||
// super.drawSecondaryPass(g2, plot, dataset, pass, series, item,
|
||||
// domainAxis, dataArea, rangeAxis, crosshairState, entities);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the control points.
|
||||
*
|
||||
* @param point0
|
||||
* @param point1
|
||||
* @param point2
|
||||
* @param point3
|
||||
* @param control1
|
||||
* @param control2
|
||||
* @param smooth
|
||||
*/
|
||||
public static void getControlPoints(Point2D.Double point0,
|
||||
Point2D.Double point1, Point2D.Double point2,
|
||||
Point2D.Double point3, Point2D.Double control1,
|
||||
Point2D.Double control2, double smooth) {
|
||||
|
||||
// Reference: http://www.antigrain.com/research/bezier_interpolation/
|
||||
|
||||
if (point0 == null) point0 = point1; //new Point2D.Double(0, 0);
|
||||
if (point3 == null) point3 = point2; //new Point2D.Double(0, 0);
|
||||
|
||||
Point2D.Double c1 = new Point2D.Double(
|
||||
(point0.x + point1.x) / 2.0, (point0.y + point1.y) / 2.0);
|
||||
Point2D.Double c2 = new Point2D.Double(
|
||||
(point1.x + point2.x) / 2.0, (point1.y + point2.y) / 2.0);
|
||||
Point2D.Double c3 = new Point2D.Double(
|
||||
(point2.x + point3.x) / 2.0, (point2.y + point3.y) / 2.0);
|
||||
|
||||
double len1 = point1.distance(point0);
|
||||
double len2 = point2.distance(point1);
|
||||
double len3 = point3.distance(point2);
|
||||
|
||||
double k1 = len1 / (len1 + len2);
|
||||
double k2 = len2 / (len2 + len3);
|
||||
|
||||
Point2D.Double m1 = new Point2D.Double(
|
||||
c1.x + (c2.x - c1.x) * k1, c1.y + (c2.y - c1.y) * k1);
|
||||
Point2D.Double m2 = new Point2D.Double(
|
||||
c2.x + (c3.x - c2.x) * k2, c2.y + (c3.y - c2.y) * k2);
|
||||
|
||||
control1.setLocation(new Point2D.Double(
|
||||
m1.x + (c2.x - m1.x) * smooth + point1.x - m1.x,
|
||||
m1.y + (c2.y - m1.y) * smooth + point1.y - m1.y));
|
||||
control2.setLocation(new Point2D.Double(
|
||||
m2.x + (c2.x - m2.x) * smooth + point2.x - m2.x,
|
||||
m2.y + (c2.y - m2.y) * smooth + point2.y - m2.y));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the points for a bezier curve.
|
||||
*
|
||||
* @param point0
|
||||
* @param point1
|
||||
* @param point2
|
||||
* @param point3
|
||||
* @param smooth
|
||||
* @param steps
|
||||
*
|
||||
* @return The curve points.
|
||||
*/
|
||||
public static Point2D.Double[] getBezierCurve(Point2D.Double point0,
|
||||
Point2D.Double point1, Point2D.Double point2,
|
||||
Point2D.Double point3, double smooth, int steps) {
|
||||
Point2D.Double control1 = new Point2D.Double();
|
||||
Point2D.Double control2 = new Point2D.Double();
|
||||
|
||||
getControlPoints(point0, point1, point2, point3, control1, control2,
|
||||
smooth);
|
||||
|
||||
Point2D.Double C = new Point2D.Double(
|
||||
3 * (control1.x - point1.x), 3 * (control1.y - point1.y));
|
||||
Point2D.Double B = new Point2D.Double(3 * (control2.x - control1.x)
|
||||
- C.x, 3 * (control2.y - control1.y) - C.y);
|
||||
Point2D.Double A = new Point2D.Double(point2.x - point1.x - C.x - B.x,
|
||||
point2.y - point1.y - C.y - B.y);
|
||||
|
||||
Point2D.Double[] res = new Point2D.Double[steps + 1];
|
||||
double stepSize = 1.0 / steps;
|
||||
double step = stepSize;
|
||||
|
||||
res[0] = point1;
|
||||
for (int i = 1; i < steps; i++) {
|
||||
res[i] = new Point2D.Double(A.x * Math.pow(step, 3) + B.x
|
||||
* Math.pow(step, 2) + C.x * step + point1.x, A.y
|
||||
* Math.pow(step, 3) + B.y * Math.pow(step, 2) + C.y * step
|
||||
+ point1.y);
|
||||
//System.out.println(step + " : " + res[i]);
|
||||
step += stepSize;
|
||||
}
|
||||
res[steps] = point2;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,189 +0,0 @@
|
||||
/* ===========================================================
|
||||
* JFreeChart : a free chart library for the Java(tm) platform
|
||||
* ===========================================================
|
||||
*
|
||||
* (C) Copyright 2000-2008, by Object Refinery Limited and Contributors.
|
||||
*
|
||||
* Project Info: http://www.jfree.org/jfreechart/index.html
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
* USA.
|
||||
*
|
||||
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
|
||||
* in the United States and other countries.]
|
||||
*
|
||||
* ---------------
|
||||
* ChartColor.java
|
||||
* ---------------
|
||||
* (C) Copyright 2003-2008, by Cameron Riley and Contributors.
|
||||
*
|
||||
* Original Author: Cameron Riley;
|
||||
* Contributor(s): David Gilbert (for Object Refinery Limited);
|
||||
*
|
||||
* Changes
|
||||
* -------
|
||||
* 23-Jan-2003 : Version 1, contributed by Cameron Riley (DG);
|
||||
* 25-Nov-2004 : Changed first 7 colors to softer shades (DG);
|
||||
* 03-Nov-2005 : Removed orange color, too close to yellow - see bug
|
||||
* report 1328408 (DG);
|
||||
* ------------- JFREECHART 1.0.x ---------------------------------------------
|
||||
* 02-Feb-2007 : Removed author tags all over JFreeChart sources (DG);
|
||||
*
|
||||
*/
|
||||
|
||||
package org.jfree.chart;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Paint;
|
||||
|
||||
/**
|
||||
* Class to extend the number of Colors available to the charts. This
|
||||
* extends the java.awt.Color object and extends the number of final
|
||||
* Colors publically accessible.
|
||||
*/
|
||||
public class ChartColor extends Color {
|
||||
|
||||
/** A very dark red color. */
|
||||
public static final Color VERY_DARK_RED = new Color(0x80, 0x00, 0x00);
|
||||
|
||||
/** A dark red color. */
|
||||
public static final Color DARK_RED = new Color(0xc0, 0x00, 0x00);
|
||||
|
||||
/** A light red color. */
|
||||
public static final Color LIGHT_RED = new Color(0xFF, 0x40, 0x40);
|
||||
|
||||
/** A very light red color. */
|
||||
public static final Color VERY_LIGHT_RED = new Color(0xFF, 0x80, 0x80);
|
||||
|
||||
/** A very dark yellow color. */
|
||||
public static final Color VERY_DARK_YELLOW = new Color(0x80, 0x80, 0x00);
|
||||
|
||||
/** A dark yellow color. */
|
||||
public static final Color DARK_YELLOW = new Color(0xC0, 0xC0, 0x00);
|
||||
|
||||
/** A light yellow color. */
|
||||
public static final Color LIGHT_YELLOW = new Color(0xFF, 0xFF, 0x40);
|
||||
|
||||
/** A very light yellow color. */
|
||||
public static final Color VERY_LIGHT_YELLOW = new Color(0xFF, 0xFF, 0x80);
|
||||
|
||||
/** A very dark green color. */
|
||||
public static final Color VERY_DARK_GREEN = new Color(0x00, 0x80, 0x00);
|
||||
|
||||
/** A dark green color. */
|
||||
public static final Color DARK_GREEN = new Color(0x00, 0xC0, 0x00);
|
||||
|
||||
/** A light green color. */
|
||||
public static final Color LIGHT_GREEN = new Color(0x40, 0xFF, 0x40);
|
||||
|
||||
/** A very light green color. */
|
||||
public static final Color VERY_LIGHT_GREEN = new Color(0x80, 0xFF, 0x80);
|
||||
|
||||
/** A very dark cyan color. */
|
||||
public static final Color VERY_DARK_CYAN = new Color(0x00, 0x80, 0x80);
|
||||
|
||||
/** A dark cyan color. */
|
||||
public static final Color DARK_CYAN = new Color(0x00, 0xC0, 0xC0);
|
||||
|
||||
/** A light cyan color. */
|
||||
public static final Color LIGHT_CYAN = new Color(0x40, 0xFF, 0xFF);
|
||||
|
||||
/** Aa very light cyan color. */
|
||||
public static final Color VERY_LIGHT_CYAN = new Color(0x80, 0xFF, 0xFF);
|
||||
|
||||
/** A very dark blue color. */
|
||||
public static final Color VERY_DARK_BLUE = new Color(0x00, 0x00, 0x80);
|
||||
|
||||
/** A dark blue color. */
|
||||
public static final Color DARK_BLUE = new Color(0x00, 0x00, 0xC0);
|
||||
|
||||
/** A light blue color. */
|
||||
public static final Color LIGHT_BLUE = new Color(0x40, 0x40, 0xFF);
|
||||
|
||||
/** A very light blue color. */
|
||||
public static final Color VERY_LIGHT_BLUE = new Color(0x80, 0x80, 0xFF);
|
||||
|
||||
/** A very dark magenta/purple color. */
|
||||
public static final Color VERY_DARK_MAGENTA = new Color(0x80, 0x00, 0x80);
|
||||
|
||||
/** A dark magenta color. */
|
||||
public static final Color DARK_MAGENTA = new Color(0xC0, 0x00, 0xC0);
|
||||
|
||||
/** A light magenta color. */
|
||||
public static final Color LIGHT_MAGENTA = new Color(0xFF, 0x40, 0xFF);
|
||||
|
||||
/** A very light magenta color. */
|
||||
public static final Color VERY_LIGHT_MAGENTA = new Color(0xFF, 0x80, 0xFF);
|
||||
|
||||
/**
|
||||
* Creates a Color with an opaque sRGB with red, green and blue values in
|
||||
* range 0-255.
|
||||
*
|
||||
* @param r the red component in range 0x00-0xFF.
|
||||
* @param g the green component in range 0x00-0xFF.
|
||||
* @param b the blue component in range 0x00-0xFF.
|
||||
*/
|
||||
public ChartColor(int r, int g, int b) {
|
||||
super(r, g, b);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method to return an array of <code>Paint</code> objects that
|
||||
* represent the pre-defined colors in the <code>Color<code> and
|
||||
* <code>ChartColor</code> objects.
|
||||
*
|
||||
* @return An array of objects with the <code>Paint</code> interface.
|
||||
*/
|
||||
public static Paint[] createDefaultPaintArray() {
|
||||
|
||||
return new Paint[] {
|
||||
new Color(0xFF, 0x55, 0x55),
|
||||
new Color(0x55, 0x55, 0xFF),
|
||||
new Color(0x55, 0xFF, 0x55),
|
||||
new Color(0xFF, 0xFF, 0x55),
|
||||
new Color(0xFF, 0x55, 0xFF),
|
||||
new Color(0x55, 0xFF, 0xFF),
|
||||
Color.pink,
|
||||
Color.gray,
|
||||
ChartColor.DARK_RED,
|
||||
ChartColor.DARK_BLUE,
|
||||
ChartColor.DARK_GREEN,
|
||||
ChartColor.DARK_YELLOW,
|
||||
ChartColor.DARK_MAGENTA,
|
||||
ChartColor.DARK_CYAN,
|
||||
Color.darkGray,
|
||||
ChartColor.LIGHT_RED,
|
||||
ChartColor.LIGHT_BLUE,
|
||||
ChartColor.LIGHT_GREEN,
|
||||
ChartColor.LIGHT_YELLOW,
|
||||
ChartColor.LIGHT_MAGENTA,
|
||||
ChartColor.LIGHT_CYAN,
|
||||
Color.lightGray,
|
||||
ChartColor.VERY_DARK_RED,
|
||||
ChartColor.VERY_DARK_BLUE,
|
||||
ChartColor.VERY_DARK_GREEN,
|
||||
ChartColor.VERY_DARK_YELLOW,
|
||||
ChartColor.VERY_DARK_MAGENTA,
|
||||
ChartColor.VERY_DARK_CYAN,
|
||||
ChartColor.VERY_LIGHT_RED,
|
||||
ChartColor.VERY_LIGHT_BLUE,
|
||||
ChartColor.VERY_LIGHT_GREEN,
|
||||
ChartColor.VERY_LIGHT_YELLOW,
|
||||
ChartColor.VERY_LIGHT_MAGENTA,
|
||||
ChartColor.VERY_LIGHT_CYAN
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user