Compare commits
30 Commits
release/8.
...
release/8.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90f2bd86e6 | ||
|
|
0e5021cb70 | ||
|
|
938039f350 | ||
|
|
26b3f749f5 | ||
|
|
8a0b38d076 | ||
|
|
ad085163f9 | ||
|
|
4ba9104034 | ||
|
|
216082efac | ||
|
|
d652f86bf2 | ||
|
|
c6620e03e6 | ||
|
|
d44180bf64 | ||
|
|
e754516075 | ||
|
|
e192a5a747 | ||
|
|
9e602c54ad | ||
|
|
0d098da3bc | ||
|
|
8843c51255 | ||
|
|
3207338fe6 | ||
|
|
aed39722eb | ||
|
|
6e0d5400bf | ||
|
|
afa700b229 | ||
|
|
bb48918802 | ||
|
|
54e08f8d10 | ||
|
|
ce221bc5b3 | ||
|
|
45ee6a61eb | ||
|
|
d03c572ed4 | ||
|
|
5cd44b8318 | ||
|
|
e4cff52913 | ||
|
|
21a9fcae19 | ||
|
|
4c2ed00331 | ||
|
|
b16c6c5d0e |
@@ -16,7 +16,6 @@ import java.beans.PropertyChangeListener;
|
||||
import java.beans.PropertyChangeSupport;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Dictionary;
|
||||
@@ -99,7 +98,6 @@ import org.talend.core.model.components.IComponentsService;
|
||||
import org.talend.core.model.general.ILibrariesService;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.metadata.MetadataTalendType;
|
||||
import org.talend.core.model.metadata.builder.connection.AbstractMetadataObject;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataTable;
|
||||
import org.talend.core.model.migration.IMigrationToolService;
|
||||
@@ -2278,14 +2276,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
// for new added mapping file, sync to project mapping folder
|
||||
MetadataTalendType.syncNewMappingFileToProject();
|
||||
} catch (SystemException e) {
|
||||
// ignore
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
|
||||
currentMonitor.beginTask("Execute before logon migrations tasks", 1); //$NON-NLS-1$
|
||||
ProjectManager.getInstance().getMigrationRecords().clear();
|
||||
@@ -2363,17 +2353,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
TimeMeasurePerformance.step("logOnProject", "sync log4j"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
try {
|
||||
URL url = MetadataTalendType.getProjectForderURLOfMappingsFile();
|
||||
if (url != null) {
|
||||
// set the project mappings url
|
||||
System.setProperty("talend.mappings.url", url.toString()); // $NON-NLS-1$
|
||||
}
|
||||
} catch (SystemException e) {
|
||||
// ignore
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
|
||||
ITDQRepositoryService tdqRepositoryService = GlobalServiceRegister.getDefault()
|
||||
.getService(ITDQRepositoryService.class);
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.RoutinesJarItem;
|
||||
import org.talend.core.model.repository.AbstractRepositoryContentHandler;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import java.io.IOException;
|
||||
|
||||
public abstract class AbstractResourceRepositoryContentHandler extends AbstractRepositoryContentHandler {
|
||||
|
||||
@@ -83,6 +84,10 @@ public abstract class AbstractResourceRepositoryContentHandler extends AbstractR
|
||||
}
|
||||
return itemResource;
|
||||
}
|
||||
|
||||
protected void copyScreenshotFile(Item originalItem, Item newItem) throws IOException {
|
||||
getXmiResourceManager().copyScreenshotFile(originalItem, newItem);
|
||||
}
|
||||
|
||||
protected XmiResourceManager getXmiResourceManager() {
|
||||
if (null == xmiResourceManager) {
|
||||
|
||||
@@ -52,6 +52,7 @@ Export-Package: org.talend.analysistask,
|
||||
org.talend.core.model.xml,
|
||||
org.talend.core.nexus,
|
||||
org.talend.core.pendo,
|
||||
org.talend.core.pendo.mapper,
|
||||
org.talend.core.pendo.properties,
|
||||
org.talend.core.prefs,
|
||||
org.talend.core.repository,
|
||||
|
||||
@@ -0,0 +1,238 @@
|
||||
{
|
||||
"mapping_AS400.xml": {
|
||||
"28fe6b6c94e4e486d431873ba556c1c18ae09140": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"3d4845af057220e02773029683a0fd99dee489e5": "a9861e98b581dfdafa7839238710bd930989960a",
|
||||
"458d597928478f43c94098dfe47d9bb8d07e89e2": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8",
|
||||
"76a4aa354d986ed5682797337817a8ddbb80ae89": "d568bf814d7b27fc7c63cbd07ea6b4a3b0ad3ff8"
|
||||
},
|
||||
"mapping_Access.xml": {
|
||||
"55d314ed9708263bfcec193abb57a1e25806626e": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"718db25f8e86d6b61284a4ffdc1fd19faffb98a9": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8"
|
||||
},
|
||||
"mapping_AmazonAurora.xml": {
|
||||
"a93c809bdf8e5df8095580e3f23b29658e044302": "ebc9394c2728a3f3850fcbafac4156ef15aab37f",
|
||||
"ba16c203a8a993e13ebab0da5cccb7a5e1c01e56": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_BigQuery.xml": {
|
||||
"db723e5b4a38bbc8316593be33ab9d74f57776e6": "e1770847f656589810753c19d420228326462f34",
|
||||
"e12df204d9f5081971d03c64b43de2456557e02e": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"e9c02d3e9bc3a3649fd33803353e61db6fcd2ea8": "01749151dcc171ebb6457ba872ee352d58a1dfd4"
|
||||
},
|
||||
"mapping_Cassandra.xml": {
|
||||
"20ed188f8824c14852304920cf82ca7119eb1be0": "ab7b23e6c94946ca2358cc0cfd82c4d77a4c5839",
|
||||
"692353c474569bafd44854b7f7343929beddee83": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"e42bdadd0009e7595773edcc1652f181a8fdf151": "76ed27054255165c23d8c0c8db081a41a50430c9",
|
||||
"ff005c2bfc47789e5715e949f98bd6d72c934b54": "ebe76b0edd0eda3488527b95f2a6d925d091a408"
|
||||
},
|
||||
"mapping_Cassandra22_datastax.xml": {
|
||||
"2ddd561eac2a04a7b08949c0764c5e76f80c89f5": "b0378fb45ae238b884417db468872341e156f138",
|
||||
"33b483680a44a8229b09698df3803f5834987f18": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_Cassandra40.xml": {
|
||||
"e92b373950021eb425db9e3eba8391f98ce7e4a8": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_Cassandra_datastax.xml": {
|
||||
"3cb6b5cf167fb5ba82b3ebdc602f22ecdacdafb5": "56fad9370b27d03a9636d8368350274480fc2bce",
|
||||
"ca09b169eee6e6dcfa81f976bd98ef4aae81cdf2": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"e1620c54d6793c6d1885e3e2fcdf242c0e3a4059": "df28e2b92f57ba0486215f334edb649a58788712"
|
||||
},
|
||||
"mapping_Databricks_Delta_Lake.xml": {
|
||||
"d48793d7173ea7d07090f5e683045c3f60cc12c8": "21f5ac777158fc55288af7337737aa675e20bdf3",
|
||||
"dcbe4533fe16fee70f24702edddec78b81e26463": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_Exasol.xml": {
|
||||
"21ff2b1a69b7242fa48a1218b0d5f8a6b0ba607e": "a0d36282ff5d6825b206ab6f794d13e048ac2192",
|
||||
"3768b1e7a941e66f8a70ad7e1a65aa7d2b598daa": "7ef9ede0f988f10489c1f5ffe16ea24d2d14ecdd",
|
||||
"6babf3080a3baa05bcd8a2815d2f31a0b15e1550": "02a98e53d3b6457272768ce0ae5c82992b403465",
|
||||
"7de8a81bc2eb7c4da639af148c2c67b5c6de4bc0": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"a728306274b817e8afa0101d3b7621398addc2f3": "b5b116b3758f58e7500058e1805bf93bf5a2f0c1",
|
||||
"dc2eba14e50ce7c413fb7696355e67d26fe5fb9b": "57bacf1f97951fcf6f650f1afdec35b5ea22638c",
|
||||
"f670268dfd5a8f80fbdbe6fe4ad668cb6c8f25d6": "ead0fb11f124cf05ad0f7fde21cdedbb3cf2160b"
|
||||
},
|
||||
"mapping_Firebird.xml": {
|
||||
"51a041d0b43678433f6303aebac5f92bfdb7b8a6": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"d504ece6ca9e10e23f5e0f05660e5f49e7d999ff": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8"
|
||||
},
|
||||
"mapping_Greenplum.xml": {
|
||||
"16418522006e4505c7fb7d44c4d06928de20eaf8": "ec04f46618ef0586081fd3b17ad7b85239958194",
|
||||
"4f3e1b53baca729eef796979e97592c8724a2d91": "caf54e3d2b6c6d685cdcf2a243c28c408a9cd652",
|
||||
"525a7ca1a48599a840b1feca641ef6a413d7384b": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"c4ed635e67d7d82c24008677f313e17df98f5d08": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8"
|
||||
},
|
||||
"mapping_H2.xml": {
|
||||
"4e3ed630d3133326a0cf4728865b3efa4cbecc63": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8",
|
||||
"84b0b863c0532f93bffc0ab54d98a449f331e319": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"cb093084dc1dc3f999707a1b9d1474f87bbf6d17": "341b1220b6bc6bf59eef81e97c694d06134bd8a2"
|
||||
},
|
||||
"mapping_HSQLDB.xml": {
|
||||
"0a37e2aec423d0c401aff092e4fda9e01c5dd4ff": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8",
|
||||
"73af8e3e8646ea58f4cfe60fe4905e90340b3e12": "890a391388725c112ffbbd2dd8b8d267305df4a7",
|
||||
"98819a80cd8994a02579ea1d9b0992a0b68a5403": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_Hive.xml": {
|
||||
"0265c6f16ab2c9eea7da660e4e1c8a3ec7bc0ab3": "37ef13c438cda4cd1c3e091d99a00036b328e57f",
|
||||
"1f5811f41b2836cd7baeb23daef91d2ea313f2c6": "3646a1bcd980a3209501a5c846338823f55d74b2",
|
||||
"21a44cd9d32a5478a4de61a86b398a9ef80401ac": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"5444fa9a484704d774259430623e0db1495a867f": "ef872732cde37c6c7684dc773641be0b78f5c57c",
|
||||
"e7f128915578dd29538a7debeb5f47528b5a6e59": "86ba7c19d9300a02dbcb0801852e728acd261132"
|
||||
},
|
||||
"mapping_IBMDB2.xml": {
|
||||
"dc42cf143f3a0f10ad8c280f16ef44ae1f907123": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8",
|
||||
"f8aea23cc5b48ebb3cdd229be3f66b28890ff4f8": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_Impala.xml": {
|
||||
"55ed99aa28c989bd5777f41b7c87ed4eb9f245a8": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_Informix.xml": {
|
||||
"40da9213cf85b1712f38474dea4f2ec3447dfe3c": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"938e41f3719c29248d4f58c303464bbfb50e343a": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8"
|
||||
},
|
||||
"mapping_Ingres.xml": {
|
||||
"811e8bf4e7bc2e6b9c3fcb5f074601a873f15e1d": "15afc1b074c8a6e4aee39c1d5a3347555dbe36a0",
|
||||
"95873faa81ee3de2eea02efab5c127e6188df796": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8",
|
||||
"9c5682f564e861e1db3b5184fd40e718e0912a4a": "d51edc7e08871897572c9b1f1cd2d2d2df347dfb"
|
||||
},
|
||||
"mapping_Interbase.xml": {
|
||||
"4d37474d07991154aa0148e7a030c4725d45ef0d": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8",
|
||||
"71e8386c3e21f726550234c52d3ca50dcfa655de": "d51edc7e08871897572c9b1f1cd2d2d2df347dfb"
|
||||
},
|
||||
"mapping_JavaDB.xml": {
|
||||
"652fd7f2f11fc27903d333e1699cc419804caa66": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"66dbe13a0043798498f37b6e5495bc3aaa8fb90b": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8"
|
||||
},
|
||||
"mapping_MSSQL.xml": {
|
||||
"305eeb294ae8bb07bee7d1e182e431e2e7f6273d": "d7761630e63b399f89eaaeb9e19e775bf1579dde",
|
||||
"b93c0825ffd799d89608239385d7e4b60de96209": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_MaxDB.xml": {
|
||||
"586fc7ac94a9abec8a76a587dc6aa0fae0079bf3": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_MicrosoftCrm.xml": {
|
||||
"e1c5e77e19adea1406e5bb511a1c6adb8b610bfe": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_MicrosoftCrm_odata.xml": {
|
||||
"1166b9ce6ce163d11a57046db5ee2dc9d5e496df": "e86fd3fd5c3b4ba9ff613155fba014a80c40cf01",
|
||||
"3f25ced1039b99d1c07b23e3d27cac1562e52a6f": "c1190dfa35e839496745516dbcfeb8a309fa49d0",
|
||||
"750541f00f3c5da6007623f3514add6dc3417a5f": "54331fa4ec501557eb9c32d434c332cf3d121349",
|
||||
"9612a2611bd29461dd46fc70f0e2841892f3f096": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_MsOdbc.xml": {
|
||||
"01561cb7b5630a4a6aed576215ccdb3991d2db52": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8",
|
||||
"a9c94a6255061e8100b15590da35196464b77d46": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_Mysql.xml": {
|
||||
"128d7d66eb994a032128949fcbe0c953c158beaa": "956802047d6623ba61e2da68aba2db8f38bca48a",
|
||||
"522654fad6fa3d008ef386fc9360ae51df910729": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8",
|
||||
"5dfc7b71e1f6a9fad6ebf47a1d748893c85bbe5e": "341b1220b6bc6bf59eef81e97c694d06134bd8a2",
|
||||
"894b0d1d2c23c98f2e14920013b82524334dd255": "74b3640e2923d4c60c92042ff03d15b4ac4e9341",
|
||||
"8cb3d2b06d8a2b12e8673e6e9519f85ec08b35ec": "f22d442cbde13623a1b96c15ea2df8dd1a7d755e",
|
||||
"a94341e5bd6c4ba0eef57f9d6d3cc6c0006c785b": "ebc9394c2728a3f3850fcbafac4156ef15aab37f",
|
||||
"d7e74c8e9f8a47ab258472ec43236d2933c70838": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"edc9d1453c8f9ac8548822ff2f90a4defcd02094": "fd4d974c755ced1969b27126844b3f462bca1a52"
|
||||
},
|
||||
"mapping_Netezza.xml": {
|
||||
"0c769aa277190990fb33a918cc57189b9ba6306f": "c8ca64da55ceb677fd97169f6a924ec80f01b2fc",
|
||||
"0f5e9677f936a5414ce6593229aa47ea5b757276": "3074a57eee1407a413e460ed27e31d48d21d609b",
|
||||
"b3e25e55f8281cb616b3f549e6a2e5a83d4ad62a": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_Oracle.xml": {
|
||||
"0407cea7e87144cb601bc9a3f039121feca79b65": "cb6b87dabdc71be0f1db4bdca694bcb61b679c05",
|
||||
"064d2a5940379346638412dd7f4cb7dbcc30e672": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"26a2295f6401de6e17feb61b261f7fbdfc4d609d": "e7604a488f339028a3cf14ae4031b0fb3fd50bcc",
|
||||
"9b0306aacec772d9d82be49ab702254ce1e08bea": "912702dc8ea921a34ea0522235db65f8655bf8e9",
|
||||
"df2537b329d0b09828c281e62208daf379f7b60a": "544faa63bbe63dd070a94c84139c705ac6432314"
|
||||
},
|
||||
"mapping_ParAccel.xml": {
|
||||
"1ba71027d3a60773c7c008143c2146e4db2ef112": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8",
|
||||
"5085a1e922f77895a2f7c85e2347acfe03034493": "d51edc7e08871897572c9b1f1cd2d2d2df347dfb"
|
||||
},
|
||||
"mapping_Postgres.xml": {
|
||||
"ce8b7f58644b8f7814a5522d172b4192ff89bd4f": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"e1c1f04f95222bcadda336d6a4f0ea07c6ebb08e": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8"
|
||||
},
|
||||
"mapping_PostgresPlus.xml": {
|
||||
"69b7d7f722538a322fb0bf867177d1ce5a0d7ad6": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"f576a7bb0327eeff1fd63a9a09106ae33f3ec90e": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8"
|
||||
},
|
||||
"mapping_Redshift.xml": {
|
||||
"0cc6e153fe35041a009cb222e0276e35ddbc92f1": "2023289b9965fc14b959463ba5050be6aead361a",
|
||||
"3b941be88a5f13bd8fd905fb1fa5f2a241e89ed9": "915a307b629c7a75bcbedc86267db1e8995b77f3",
|
||||
"85ba89fdadfca4a2d755856a75e904f6015926a9": "de08533f6561319fc2914181a2705ccd75e29c40",
|
||||
"8f3eda24c1f413b17b2b8c48695dbd786fa29b6b": "93112768d7eea6df44d92a3efbd4f1dfa20e06b6",
|
||||
"ab86d7fda94e0b368f739f73994ce2a2147be12d": "0fd3f58b7aa78aaae6fb40d042780bec64da75e6",
|
||||
"ad0eecc7e9f25c3b904cc11b062a8185456478ee": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_Redshift_new.xml": {
|
||||
"43085952e178e2c570ab7d2a262278dd2896dd96": "699efe42a33aab3ca0bbaa7a1abee23368e61606"
|
||||
},
|
||||
"mapping_SAPHana.xml": {
|
||||
"1a07a8174468a5a1d55378dd0e21d7c1f9e531bc": "48ea42be6b348a3c993760e7f2c94c58ac08fdae",
|
||||
"331ae8a035e6b1f2cd722be6411df4ae4a95bb33": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_SQLite.xml": {
|
||||
"0a97b6e8acf8bd16aa34a3c01707f1e2a9eeff1f": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"b7b7b7c690efacc208316c911571a8513b5ea713": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8"
|
||||
},
|
||||
"mapping_SingleStore.xml": {
|
||||
"9da7d92af5e9b0697436f74fffd190e8af061567": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_Snowflake.xml": {
|
||||
"d459c6be3786f9358615eaf692a1c7920b4c6e74": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_Sybase.xml": {
|
||||
"081038547cac8342cf5cadf8bfd02fe4d2929323": "1ff9877dce90e2ef39b267ea60de534796035a95",
|
||||
"09a0f4dc71ff9a844e1162600409317e92e1ff18": "28534ffb4ae599adec53853776856e82c23c815a",
|
||||
"4ee2c12f372953e77404481a962b3aca14abadb0": "f02b1b6902098b2da90cde6b22a9a49ec328970a",
|
||||
"5752dcfa409e903af77587f151d580c68c9e4ac7": "3db0fa1fbed8ae378d52aa8c36b6fed55d184e5b",
|
||||
"6f4e7913b4b31e8fb4e097690c8b903a58842283": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8",
|
||||
"7676e2d94473564322ce37cad92b7f8b09751b1b": "1cc6237de63892e097c77637ac8457cf8fefbf6f",
|
||||
"8bbad7895713f3a399ddb195c40353e18d3e83b9": "984ca27e4ee0177793b2111797700390424cb746",
|
||||
"bbc091c50a7bd8a8fe630d99a9c2e3f2f878ac88": "67a9b521c9d698b3411fb49410ac61a15f4bc7db",
|
||||
"d841719dcf79a12d0189301e40c0e9e973a45c4f": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"e103a9671d9bcf360fd2e61ee97f4547d0d52241": "e19031add3dc54bf9d0e731f3a05738af48ebb6d",
|
||||
"e1c42d74cc0dc3681b5bd45a901a3bedeb53ec68": "75df15acaa5c8d1dcd4a8e855e0df969fdea25d5",
|
||||
"e30d1f01e88bdaf926855e00d1aef3a37a7eb6e4": "c91dd79086a42dce5417de77bb7ce61c0bd6cbbf",
|
||||
"ee5d7f5f9510f63c340f87862327b869bf4cb743": "607764748cdbff669d2ccfcbaafdaa0d83598f32"
|
||||
},
|
||||
"mapping_Teradata.xml": {
|
||||
"10ed107c1d66b38d51739ffdd0820db676c42cef": "45dbf10541f6dd32283038bcc5b04b10e305770a",
|
||||
"55e6a511c2cb39aca11de302a3850eb2d1f6e3a5": "fc652f1cc70f6caa05d5c65e57115f86653f7841",
|
||||
"ac9ffae887ab4d20d4eca0eddc83163e99507ec8": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"f9b0367424f721cd8029d3540c9a82f39d74a6b4": "c002b50a69b8a0193780e7c0d1788bbd9a5145c3"
|
||||
},
|
||||
"mapping_VectorWise.xml": {
|
||||
"06f86121a9492b3104047691b19718a5d9d49be9": "d51edc7e08871897572c9b1f1cd2d2d2df347dfb",
|
||||
"edf255202bcfad77ff6f3fac11714891934225c4": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8"
|
||||
},
|
||||
"mapping_Vertica.xml": {
|
||||
"28153eaab1c47b8718ca3c49553ec40b047d2878": "d4655e28a5da3e6a2cc03a1305cc1c2970d8e9b8",
|
||||
"2ee78d7679d4201ad29adba4cc0a48084f161e25": "eecc481d671d330bfb46406ab2533830c668bf22",
|
||||
"819be4680c04a7f77c51fc65ebd1d964a714aa78": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"9218d5e7b682513ddf1b891f5f0467ab9938fec3": "341b1220b6bc6bf59eef81e97c694d06134bd8a2",
|
||||
"d9745a57d9f1b6c638ebd57cd5281be020e0614c": "e8f788c5c260f9b82eaaa88d0402423d86a5680d",
|
||||
"dec55a19094d1bcc20f12a8888b27460e83c2e67": "3b582b21fc5ac7ccfb05321c7923591433ced716"
|
||||
},
|
||||
"mapping_XSD.xml": {
|
||||
"1ef837521e274c5b93f5f228955204285b3dd28a": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"9c454252343dfe1400d356cbf41bf88e842b4e1e": "c615b3a622e2f6ba8577e812e71977d9f1b1930d"
|
||||
},
|
||||
"mapping_dynamodb.xml": {
|
||||
"891099e88d8074570dc029f9b7d8b04bbc241383": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_ebcdic.xml": {
|
||||
"b47b25edc9e40d312b548270dbb3f978475be4e7": "7007071c9cf718d34da7d61208ceea7f05de94d0"
|
||||
},
|
||||
"mapping_sap.xml": {
|
||||
"0339bc60ae47e3796c343eee7e2fb1cb1869cefa": "ee49a27e5c3ba3217ab497b1cd4467c088e59f5e",
|
||||
"1f41a55f6f7f1d6d2118e766daf7e3dbfd77551d": "7007071c9cf718d34da7d61208ceea7f05de94d0",
|
||||
"64c23be0c363ab703528677c999e4ef707d54497": "27908d5685066221f02cd3890a5319838215eb8b",
|
||||
"83688cf3134e60d9f5a08b316643a41246717e92": "740c431e0b623cc7d41166588961028ad3efab80",
|
||||
"9df72b6a1f1a72d9be1a4a7fd428873ad9b75bff": "94804b5e96a71d63a294eb9bcfbbb5290824009f",
|
||||
"a300fcd290aa65c254c44d683d30a9fa6ae14a2f": "45e5d88e9c49cb87b47413468073c571f60c0117",
|
||||
"b74c01dff88a52afca5f8c84fbe41d71a34eb6b5": "32832fe0edfbd10d50ed85528481e5c9ca2ec8e0",
|
||||
"c814f616005e1637ec107dd8c0f269bd69661d2e": "7d07608dceb06f7364b5bb8babc0f6e921fc443a"
|
||||
},
|
||||
"mapping_sas.xml": {
|
||||
"4aeb0deb41f61dbe69e85e780fb1e985c9f3d758": "fd44bfb0ee3fc8288465507b937c53619f43c0ec"
|
||||
}
|
||||
}
|
||||
@@ -116,6 +116,7 @@ public interface ICoreService extends IService {
|
||||
|
||||
public String validateValueForDBType(String columnName);
|
||||
|
||||
@Deprecated
|
||||
public void synchronizeMapptingXML(ITalendProcessJavaProject talendJavaProject);
|
||||
|
||||
public IPreferenceStore getPreferenceStore();
|
||||
@@ -124,6 +125,7 @@ public interface ICoreService extends IService {
|
||||
|
||||
public IMetadataTable convert(MetadataTable originalTable);
|
||||
|
||||
@Deprecated
|
||||
public void syncMappingsFileFromSystemToProject();
|
||||
|
||||
/**
|
||||
@@ -132,4 +134,11 @@ public interface ICoreService extends IService {
|
||||
*/
|
||||
void installComponents(IProgressMonitor monitor);
|
||||
|
||||
public static ICoreService get() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
|
||||
return GlobalServiceRegister.getDefault().getService(ICoreService.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -154,6 +154,10 @@ public interface ILibraryManagerService extends IService {
|
||||
public boolean contains(String jarName);
|
||||
|
||||
public void clearCache();
|
||||
|
||||
public void clearCache(boolean cleanIndex);
|
||||
|
||||
public void deployLibsFromCustomComponents();
|
||||
|
||||
@Deprecated
|
||||
public Set<String> list(boolean withComponent, IProgressMonitor... monitorWrap);
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
// ============================================================================
|
||||
package org.talend.core;
|
||||
|
||||
import org.talend.core.model.process.AbstractExternalNode;
|
||||
import org.talend.core.model.process.IExternalNode;
|
||||
import org.talend.core.model.process.INode;
|
||||
|
||||
public interface ITDQComponentService extends IService {
|
||||
|
||||
public boolean isTDQExternalComponent(String componentName);
|
||||
|
||||
public AbstractExternalNode createExternalComponent(INode node);
|
||||
public IExternalNode createExternalComponent(INode node);
|
||||
}
|
||||
|
||||
@@ -238,6 +238,10 @@ public class ConnParameterKeys {
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_CLIENT_KEY = "CONN_PARA_KEY_SYNAPSE_CLIENT_KEY"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_USE_SYNAPSE_CLIENT_CERTIFICATE = "CONN_PARA_KEY_USE_SYNAPSE_CLIENT_CERTIFICATE"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_CLIENT_CERTIFICATE = "CONN_PARA_KEY_SYNAPSE_CLIENT_CERTIFICATE"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_FS_STORAGE = "CONN_PARA_KEY_SYNAPSE_FS_STORAGE"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_SYNAPSE_DEPLOY_BLOB = "CONN_PARA_KEY_SYNAPSE_DEPLOY_BLOB"; //$NON-NLS-1$
|
||||
|
||||
@@ -86,7 +86,7 @@ public enum EDatabaseVersion4Drivers {
|
||||
new String[] { "mssql-jdbc.jar", "slf4j-api-1.7.29.jar", "slf4j-log4j12-1.7.29.jar", "msal4j-1.11.0.jar", //$NON-NLS-1$
|
||||
"oauth2-oidc-sdk-9.7.jar", "reload4j-1.2.19.jar", "jackson-core-2.13.2.jar",
|
||||
"jackson-databind-2.13.2.2.jar", "jackson-annotations-2.13.2.jar", "jcip-annotations-1.0-1.jar",
|
||||
"json-smart-2.4.7.jar", "nimbus-jose-jwt-9.9.3.jar", "accessors-smart-2.4.7.jar", "asm-9.1.jar",
|
||||
"json-smart-2.4.7.jar", "nimbus-jose-jwt-9.22.jar", "accessors-smart-2.4.7.jar", "asm-9.1.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$
|
||||
|
||||
@@ -130,6 +130,10 @@ public enum EHadoopProperties {
|
||||
|
||||
SYNAPSE_CLIENT_KEY,
|
||||
|
||||
SYNAPSE_USE_CERTIFICATE,
|
||||
|
||||
SYNAPSE_CLIENT_CERTIFICATE,
|
||||
|
||||
DEPLOY_FOLDER,
|
||||
|
||||
SPARK_DRIVER_MEM,
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@@ -24,18 +25,20 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.ProjectScope;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
@@ -46,9 +49,9 @@ import org.eclipse.core.runtime.Platform;
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.SystemException;
|
||||
import org.talend.commons.runtime.xml.XmlUtil;
|
||||
import org.talend.commons.utils.io.FilesUtils;
|
||||
import org.talend.commons.utils.workbench.resources.ResourceUtils;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ICoreService;
|
||||
import org.talend.core.database.EDatabaseTypeName;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
@@ -59,6 +62,8 @@ import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.i18n.Messages;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
import org.talend.utils.json.JSONObject;
|
||||
import org.talend.utils.xml.XmlUtils;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
@@ -75,14 +80,13 @@ import org.xml.sax.SAXException;
|
||||
*/
|
||||
public final class MetadataTalendType {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static final String INTERNAL_MAPPINGS_FOLDER = "mappings"; //$NON-NLS-1$
|
||||
|
||||
public static final String PROJECT_MAPPING_FOLDER = ".settings/mappings"; //$NON-NLS-1$
|
||||
|
||||
public static final String UPDATED_MAPPING_FILES = "updated.mapping.files"; //$NON-NLS-1$
|
||||
public static final String FILE_MAPPING_REVISION = "mapping_revision.json"; //$NON-NLS-1$
|
||||
|
||||
public static final String MAPPING_FILE_PATTERN = "^mapping_.*\\.xml$"; //$NON-NLS-1$
|
||||
|
||||
private static ECodeLanguage codeLanguage;
|
||||
|
||||
@@ -459,13 +463,14 @@ public final class MetadataTalendType {
|
||||
return list;
|
||||
}
|
||||
|
||||
public static URL getSystemForderURLOfMappingsFile() throws SystemException {
|
||||
public static URL 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));
|
||||
} catch (IOException e) {
|
||||
throw new SystemException(e);
|
||||
@@ -474,46 +479,169 @@ public final class MetadataTalendType {
|
||||
return url;
|
||||
}
|
||||
|
||||
public static URL getProjectForderURLOfMappingsFile() throws SystemException {
|
||||
public static URL 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();
|
||||
IPath mappingPath = settingPath.append(dirPath);
|
||||
File mappingFolder = mappingPath.toFile();
|
||||
if (!mappingFolder.exists() || mappingFolder.listFiles().length < 1) {
|
||||
ICoreService service = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
|
||||
service = GlobalServiceRegister.getDefault().getService(ICoreService.class);
|
||||
service.syncMappingsFileFromSystemToProject();
|
||||
}
|
||||
}
|
||||
return mappingFolder.toURL();
|
||||
File mappingFolder = settingPath.append(dirPath).toFile();
|
||||
return mappingFolder.toURI().toURL();
|
||||
} catch (Exception e) {
|
||||
throw new SystemException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static String getSha1OfFile(File file) {
|
||||
String sha1 = null;
|
||||
FileInputStream fileInputStream = null;
|
||||
public static URL getProjectTempMappingFolder() {
|
||||
try {
|
||||
fileInputStream = new FileInputStream(file);
|
||||
sha1 = DigestUtils.shaHex(fileInputStream);
|
||||
IProject project = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject());
|
||||
File folder = ResourceUtils
|
||||
.getFolder(project, RepositoryConstants.TEMP_DIRECTORY + "/" + INTERNAL_MAPPINGS_FOLDER, false).getLocation()
|
||||
.toFile();
|
||||
syncMappingFiles(folder, false);
|
||||
return folder.toURI().toURL();
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
} finally {
|
||||
if (fileInputStream != null) {
|
||||
try {
|
||||
fileInputStream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace(); // Just print the exception for debug.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void syncMappingFiles(File target, boolean rename) {
|
||||
if (!target.exists()) {
|
||||
target.mkdir();
|
||||
}
|
||||
File[] arr = target.listFiles(f -> f.getName().matches(MAPPING_FILE_PATTERN));
|
||||
if (arr == null) {
|
||||
arr = new File[0];
|
||||
}
|
||||
try {
|
||||
Map<String, File> targetFileMap = Stream.of(arr).collect(Collectors.toMap(File::getName, Function.identity()));
|
||||
Map<String, File> workingFileMap = getWorkingMappingFiles().stream()
|
||||
.collect(Collectors.toMap(f -> getTargetName(f, rename), Function.identity(), (f1, f2) -> f1));
|
||||
|
||||
targetFileMap.entrySet().stream().filter(entry -> !workingFileMap.containsKey(entry.getKey()))
|
||||
.forEach(entry -> entry.getValue().delete());
|
||||
|
||||
for (Entry<String, File> entry : workingFileMap.entrySet()) {
|
||||
String targetName = entry.getKey();
|
||||
File workingMappingFile = entry.getValue();
|
||||
boolean needUpdate = false;
|
||||
File targetMappingFile = targetFileMap.get(targetName);
|
||||
if (targetMappingFile == null) {
|
||||
targetMappingFile = new File(target, targetName);
|
||||
needUpdate = true;
|
||||
} else if (!getSha1OfFile(workingMappingFile).equals(getSha1OfFile(targetMappingFile))) {
|
||||
needUpdate = true;
|
||||
}
|
||||
if (needUpdate) {
|
||||
if (targetMappingFile.exists()) {
|
||||
targetMappingFile.delete();
|
||||
}
|
||||
FilesUtils.copyFile(workingMappingFile, targetMappingFile);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return sha1;
|
||||
}
|
||||
|
||||
public static String getTargetName(File file, boolean rename) {
|
||||
String targetName = file.getName();
|
||||
if (!rename) {
|
||||
return targetName;
|
||||
}
|
||||
try {
|
||||
DocumentBuilderFactory documentBuilderFactory = XmlUtils.getSecureDocumentBuilderFactory();
|
||||
DocumentBuilder analyser = documentBuilderFactory.newDocumentBuilder();
|
||||
Document document = analyser.parse(file);
|
||||
NodeList dbmsNodes = document.getElementsByTagName("dbms"); //$NON-NLS-1$
|
||||
String dbmsIdValue = "";
|
||||
for (int iDbms = 0; iDbms < dbmsNodes.getLength(); iDbms++) {
|
||||
Node dbmsNode = dbmsNodes.item(iDbms);
|
||||
NamedNodeMap dbmsAttributes = dbmsNode.getAttributes();
|
||||
dbmsIdValue = dbmsAttributes.getNamedItem("id").getNodeValue(); //$NON-NLS-1$
|
||||
|
||||
}
|
||||
if (dbmsIdValue != null && !"".equals(dbmsIdValue)) {
|
||||
final String[] fileNameSplit = targetName.split("_");
|
||||
String idA = "_id";
|
||||
String idB = "id_";
|
||||
final int indexA = dbmsIdValue.indexOf(idA);
|
||||
final int indexB = dbmsIdValue.indexOf(idB);
|
||||
String secondeName = "";
|
||||
if (indexA > 0) {
|
||||
secondeName = dbmsIdValue.substring(0, dbmsIdValue.length() - idA.length());
|
||||
} else if (indexB == 0) {
|
||||
secondeName = dbmsIdValue.substring(idB.length(), dbmsIdValue.length());
|
||||
} else if (indexA == -1 && indexB == -1) {
|
||||
secondeName = dbmsIdValue;
|
||||
}
|
||||
if (secondeName != null && !"".equals(secondeName)) {
|
||||
targetName = fileNameSplit[0] + "_" + secondeName.toLowerCase() + XmlUtil.FILE_XML_SUFFIX;
|
||||
}
|
||||
|
||||
}
|
||||
} catch (ParserConfigurationException e) {
|
||||
ExceptionHandler.process(e);
|
||||
} catch (SAXException e) {
|
||||
ExceptionHandler.process(e);
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return targetName;
|
||||
}
|
||||
|
||||
public static JSONObject getRevisionObject() {
|
||||
try {
|
||||
File revisonFile = new File(MetadataTalendType.getSystemFolderURLOfMappingsFile().getFile(),
|
||||
MetadataTalendType.FILE_MAPPING_REVISION);
|
||||
String jsonStr = new String(Files.readAllBytes(revisonFile.toPath()));
|
||||
return new JSONObject(jsonStr);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return new JSONObject();
|
||||
}
|
||||
|
||||
public static boolean restoreMappingFiles() throws Exception {
|
||||
List<File> toDelete = new ArrayList<>();
|
||||
JSONObject revision = getRevisionObject();
|
||||
File projectMappingFolder = new File(getProjectFolderURLOfMappingsFile().getFile());
|
||||
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);
|
||||
if (revision.getJSONObject(file.getName()).has(sha1)) {
|
||||
toDelete.add(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File xsd = new File(projectMappingFolder, "mapping_validate.xsd"); //$NON-NLS-1$
|
||||
if (xsd.exists()) {
|
||||
xsd.delete();
|
||||
}
|
||||
}
|
||||
toDelete.forEach(File::delete);
|
||||
return !toDelete.isEmpty();
|
||||
}
|
||||
|
||||
public static String getSha1OfFile(File file) {
|
||||
try {
|
||||
String text = new String(Files.readAllBytes(file.toPath()));
|
||||
return getSha1OfText(text);
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getSha1OfText(String text) {
|
||||
text = text.replace("\r\n", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return DigestUtils.sha1Hex(text);
|
||||
}
|
||||
|
||||
public static void copyFile(File in, IFile out) throws CoreException, IOException {
|
||||
FileInputStream fis = new FileInputStream(in);
|
||||
if (out.exists()) {
|
||||
@@ -524,49 +652,6 @@ public final class MetadataTalendType {
|
||||
fis.close();
|
||||
}
|
||||
|
||||
public static void syncNewMappingFileToProject() throws SystemException {
|
||||
try {
|
||||
File sysMappingFiles = new File(MetadataTalendType.getSystemForderURLOfMappingsFile().getPath());
|
||||
IFolder projectMappingFolder = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject())
|
||||
.getFolder(MetadataTalendType.PROJECT_MAPPING_FOLDER);
|
||||
File projectMappingFiles = new File(projectMappingFolder.getLocationURI());
|
||||
if (!sysMappingFiles.exists() || !projectMappingFiles.exists()) {
|
||||
return;
|
||||
}
|
||||
for (File sysMapping : sysMappingFiles.listFiles()) {
|
||||
IFile projectMapping = projectMappingFolder.getFile(sysMapping.getName());
|
||||
if (projectMapping.exists() && StringUtils.equals(sysMapping.getName(), "mapping_Greenplum.xml")) {
|
||||
|
||||
String sha1OfFile = DigestUtils.shaHex(projectMapping.getContents());
|
||||
String shalOfOldSystem = "8431f19215dacb3caa126778ae695954552cce2a";
|
||||
if (StringUtils.equals(sha1OfFile, shalOfOldSystem)) {
|
||||
copyFile(sysMapping, projectMapping);
|
||||
}
|
||||
}
|
||||
if (!projectMapping.exists()) {
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
fis = new FileInputStream(sysMapping);
|
||||
projectMapping.create(fis, true, null);
|
||||
} catch (CoreException coreExc) {
|
||||
throw new SystemException(coreExc);
|
||||
} finally {
|
||||
if (fis != null) {
|
||||
try {
|
||||
fis.close();
|
||||
} catch (IOException ioExc) {
|
||||
throw new SystemException(ioExc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new SystemException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Load db types and mapping with the current activated language (Java, Perl, ...).
|
||||
@@ -574,20 +659,38 @@ public final class MetadataTalendType {
|
||||
* @throws SystemException
|
||||
*/
|
||||
public static void loadCommonMappings() throws SystemException {
|
||||
URL url = getProjectForderURLOfMappingsFile();
|
||||
File dir = new File(url.getPath());
|
||||
metadataMappingFiles = new ArrayList<File>();
|
||||
dbmsSet.clear();
|
||||
if (dir.isDirectory()) {
|
||||
File[] files = dir.listFiles();
|
||||
for (File file : files) {
|
||||
if (file.getName().matches("^mapping_.*\\.xml$")) { //$NON-NLS-1$
|
||||
loadMapping(file);
|
||||
metadataMappingFiles.add(file);
|
||||
}
|
||||
}
|
||||
for (File file : getWorkingMappingFiles()) {
|
||||
loadMapping(file);
|
||||
metadataMappingFiles.add(file);
|
||||
}
|
||||
}
|
||||
|
||||
public static List<File> getWorkingMappingFiles() throws SystemException {
|
||||
File projectMappingFolder = new File(getProjectFolderURLOfMappingsFile().getFile());
|
||||
File[] projectMappingFiles = projectMappingFolder.listFiles(f -> f.getName().matches(MAPPING_FILE_PATTERN));
|
||||
File systemMappingFolder = new File(getSystemFolderURLOfMappingsFile().getFile());
|
||||
File[] systemMappingFiles = systemMappingFolder.listFiles(f -> f.getName().matches(MAPPING_FILE_PATTERN));
|
||||
if (projectMappingFiles == null || projectMappingFiles.length == 0) {
|
||||
return Arrays.asList(systemMappingFiles);
|
||||
}
|
||||
List<File> workingMappingFiles = new ArrayList<>();
|
||||
Map<String, File> projectMappingFilesMap = Stream.of(projectMappingFiles)
|
||||
.collect(Collectors.toMap(File::getName, Function.identity()));
|
||||
workingMappingFiles.addAll(projectMappingFilesMap.values());
|
||||
Stream.of(systemMappingFiles).filter(f -> !projectMappingFilesMap.containsKey(f.getName()))
|
||||
.forEach(f -> workingMappingFiles.add(f));
|
||||
return workingMappingFiles;
|
||||
}
|
||||
|
||||
public static String getSha1OfSystemMappingFile(String fileName) {
|
||||
try {
|
||||
return getSha1OfFile(new File(getSystemFolderURLOfMappingsFile().getFile(), fileName));
|
||||
} catch (SystemException e) {
|
||||
ExceptionHandler.process(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static void loadMapping(File file) throws SystemException {
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2022 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.process;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
/**
|
||||
* DOC jding class global comment. Detailled comment
|
||||
*/
|
||||
public class ElementParameterValueModel {
|
||||
|
||||
private String label;
|
||||
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* Getter for lebel.
|
||||
*
|
||||
* @return the lebel
|
||||
*/
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the lebel.
|
||||
*
|
||||
* @param lebel the lebel to set
|
||||
*/
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for value.
|
||||
*
|
||||
* @return the value
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value.
|
||||
*
|
||||
* @param value the value to set
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return StringUtils.isNotBlank(this.label) ? this.label : this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(label, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
ElementParameterValueModel other = (ElementParameterValueModel) obj;
|
||||
return Objects.equals(label, other.label) && Objects.equals(value, other.value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,6 +30,7 @@ import org.talend.core.ui.IInstalledPatchService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.utils.json.JSONObject;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
/**
|
||||
@@ -138,6 +139,19 @@ public class PendoTrackDataUtil {
|
||||
|
||||
}
|
||||
|
||||
public static String convertEntityJsonString(Object entity) {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
try {
|
||||
String content = mapper.writeValueAsString(entity);
|
||||
if (StringUtils.isNotBlank(content)) {
|
||||
return content;
|
||||
}
|
||||
} catch (JsonProcessingException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public enum TrackEvent {
|
||||
|
||||
PROJECT_LOGIN("Project Login"),
|
||||
@@ -146,7 +160,9 @@ public class PendoTrackDataUtil {
|
||||
USE_API_DEF("Use API Definition"),
|
||||
OPEN_IN_APIDesigner("Open in API Designer"),
|
||||
OPEN_IN_APITester("Open in API Tester"),
|
||||
OPEN_API_DOCUMENTATION("Open API Documentation");
|
||||
OPEN_API_DOCUMENTATION("Open API Documentation"),
|
||||
AUTOMAP("tMap Automap"),
|
||||
TMAP("Studio tMap");
|
||||
|
||||
private String event;
|
||||
|
||||
|
||||
@@ -55,6 +55,10 @@ import org.talend.utils.json.JSONObject;
|
||||
*/
|
||||
public class PendoTrackSender {
|
||||
|
||||
private static final String PROP_PENDO_LOCAL_CHECK = "talend.pendo.localDebug";
|
||||
|
||||
private static final String PROP_PENDO_LOG_DATA = "talend.pendo.logRuntimeData";
|
||||
|
||||
private static final String PREFIX_API = "api";
|
||||
|
||||
private static final String PENDO_INFO = "/monitoring/pendo/info";
|
||||
@@ -75,6 +79,9 @@ public class PendoTrackSender {
|
||||
|
||||
private static String pendoInfo;
|
||||
|
||||
public PendoTrackSender() {
|
||||
}
|
||||
|
||||
public static PendoTrackSender getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new PendoTrackSender();
|
||||
@@ -94,7 +101,9 @@ public class PendoTrackSender {
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
try {
|
||||
sendTrackData(event, properties);
|
||||
if (isTrackSendAvailable()) {
|
||||
sendTrackData(event, properties);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// warning only
|
||||
ExceptionHandler.process(e, Level.WARN);
|
||||
@@ -108,10 +117,10 @@ public class PendoTrackSender {
|
||||
}
|
||||
|
||||
public void sendTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception {
|
||||
if (!checkTokenUsed(adminUrl) || !NetworkUtil.isNetworkValid()) {
|
||||
if (isPendoLocalDebug()) {
|
||||
ExceptionHandler.log(PendoTrackDataUtil.convertEntityJsonString(properties));
|
||||
return;
|
||||
}
|
||||
|
||||
DefaultHttpClient client = null;
|
||||
CloseableHttpResponse response = null;
|
||||
IProxySelectorProvider proxySelectorProvider = null;
|
||||
@@ -141,6 +150,9 @@ public class PendoTrackSender {
|
||||
response = client.execute(httpPost, HttpClientContext.create());
|
||||
StatusLine statusLine = response.getStatusLine();
|
||||
String responseStr = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
|
||||
if (isLogPendoData()) {
|
||||
ExceptionHandler.log(trackData);
|
||||
}
|
||||
if (HttpURLConnection.HTTP_OK != statusLine.getStatusCode()) {
|
||||
throw new Exception(statusLine.toString() + ", server message: [" + responseStr + "]");
|
||||
}
|
||||
@@ -164,6 +176,21 @@ public class PendoTrackSender {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isTrackSendAvailable() throws Exception {
|
||||
if (isPendoLocalDebug() || checkTokenUsed(adminUrl) && NetworkUtil.isNetworkValid()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isPendoLocalDebug() {
|
||||
return Boolean.TRUE.toString().equals(System.getProperty(PROP_PENDO_LOCAL_CHECK));
|
||||
}
|
||||
|
||||
public boolean isLogPendoData() {
|
||||
return Boolean.TRUE.toString().equals(System.getProperty(PROP_PENDO_LOG_DATA));
|
||||
}
|
||||
|
||||
private String getPendoInfo() throws Exception {
|
||||
if (StringUtils.isBlank(pendoInfo)) {
|
||||
pendoInfo = getPendoInfo(getBaseUrl(), getToken());
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2022 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.pendo.mapper;
|
||||
|
||||
import org.apache.log4j.Level;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.core.pendo.PendoTrackDataUtil.TrackEvent;
|
||||
import org.talend.core.pendo.PendoTrackSender;
|
||||
import org.talend.core.pendo.properties.PendoTMapProperties;
|
||||
|
||||
/**
|
||||
* DOC jding class global comment. Detailled comment
|
||||
*/
|
||||
public abstract class AbstractPendoTMapManager {
|
||||
|
||||
protected abstract PendoTMapProperties calculateProperties();
|
||||
|
||||
public void sendTrackToPendo() {
|
||||
Job job = new Job("send pendo track") {
|
||||
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
try {
|
||||
if (PendoTrackSender.getInstance().isTrackSendAvailable()) {
|
||||
PendoTMapProperties properties = calculateProperties();
|
||||
PendoTrackSender.getInstance().sendTrackData(TrackEvent.TMAP, properties);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// warning only
|
||||
ExceptionHandler.process(e, Level.WARN);
|
||||
}
|
||||
return Status.OK_STATUS;
|
||||
}
|
||||
};
|
||||
job.setUser(false);
|
||||
job.setPriority(Job.INTERACTIVE);
|
||||
job.schedule();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2022 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.pendo.mapper;
|
||||
|
||||
import org.talend.core.pendo.PendoTrackDataUtil.TrackEvent;
|
||||
import org.talend.core.pendo.PendoTrackSender;
|
||||
import org.talend.core.pendo.properties.PendoAutoMapProperties;
|
||||
|
||||
/**
|
||||
* Assume no multiple thread, one AutoMapper one PendoAutoMapManager
|
||||
*
|
||||
* DOC jding class global comment. Detailled comment
|
||||
*/
|
||||
public class PendoAutoMapManager {
|
||||
|
||||
private int mappingChangeCount = 0;
|
||||
|
||||
public void setMappingChangeCount(int mappingChangeCount) {
|
||||
this.mappingChangeCount = mappingChangeCount;
|
||||
}
|
||||
|
||||
public void incrementMappingChangeCount() {
|
||||
this.mappingChangeCount++;
|
||||
}
|
||||
|
||||
public void resetMappingChangeCount() {
|
||||
this.mappingChangeCount = 0;
|
||||
}
|
||||
|
||||
public int getMappingChangeCount() {
|
||||
return mappingChangeCount;
|
||||
}
|
||||
|
||||
public void sendTrackToPendo() {
|
||||
if (mappingChangeCount < 1) {
|
||||
return;
|
||||
}
|
||||
PendoAutoMapProperties properties = new PendoAutoMapProperties();
|
||||
properties.setAutoMappings(mappingChangeCount);
|
||||
PendoTrackSender.getInstance().sendToPendo(TrackEvent.AUTOMAP, properties);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2022 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.pendo.properties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* DOC jding class global comment. Detailled comment
|
||||
*/
|
||||
public class PendoAutoMapProperties implements IPendoDataProperties {
|
||||
|
||||
@JsonProperty("auto_mapping")
|
||||
private int autoMappings;
|
||||
|
||||
/**
|
||||
* Getter for autoMappings.
|
||||
*
|
||||
* @return the autoMappings
|
||||
*/
|
||||
public int getAutoMappings() {
|
||||
return autoMappings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the autoMappings.
|
||||
*
|
||||
* @param autoMappings the autoMappings to set
|
||||
*/
|
||||
public void setAutoMappings(int autoMappings) {
|
||||
this.autoMappings = autoMappings;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,462 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2022 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.pendo.properties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* DOC jding class global comment. Detailled comment
|
||||
*/
|
||||
public class PendoTMapProperties implements IPendoDataProperties {
|
||||
|
||||
/**
|
||||
* Number of input columns
|
||||
*/
|
||||
@JsonProperty("input_columns")
|
||||
private int inputColumns;
|
||||
|
||||
/**
|
||||
* Number of output columns
|
||||
*/
|
||||
@JsonProperty("output_columns")
|
||||
private int outputColumns;
|
||||
|
||||
/**
|
||||
* Number of var columns
|
||||
*/
|
||||
@JsonProperty("var_columns")
|
||||
private int varColumns;
|
||||
|
||||
/**
|
||||
* Number of input tables which have at least 1 mapping to an output table
|
||||
*/
|
||||
@JsonProperty("number_of_sources")
|
||||
private int sourceNumber;
|
||||
|
||||
/**
|
||||
* Number of output tables have mapping from the main input table
|
||||
*/
|
||||
@JsonProperty("number_of_destinations")
|
||||
private int destinationNumber;
|
||||
|
||||
/**
|
||||
* Number of output tables
|
||||
*/
|
||||
@JsonProperty("number_of_outputs")
|
||||
private int outputNumber;
|
||||
|
||||
/**
|
||||
* Number of expressions without java transformation(expressions in input_columns/var_columns/output_columns but not
|
||||
* include filter expressions)
|
||||
*/
|
||||
@JsonProperty("simple_expressions")
|
||||
private int simpleExpressions;
|
||||
|
||||
/**
|
||||
* Number of expressions with java transformation(expressions in input_columns/var_columns/output_columns but not
|
||||
* include filter expressions)
|
||||
*/
|
||||
@JsonProperty("transformed_expressions")
|
||||
private int transformExpressions;
|
||||
|
||||
/**
|
||||
* Number of mappings(links) between input and var
|
||||
*/
|
||||
@JsonProperty("input_var_mapping")
|
||||
private int inputVarMappings;
|
||||
|
||||
/**
|
||||
* Number of mappings(links) between var and output
|
||||
*/
|
||||
@JsonProperty("var_output_mapping")
|
||||
private int varOutputMappings;
|
||||
|
||||
/**
|
||||
* Number of mappings(links) between input and output
|
||||
*/
|
||||
@JsonProperty("input_output_mapping")
|
||||
private int inputOutputMappings;
|
||||
|
||||
/**
|
||||
* Number of input columns which are mapped to multiple output columns, either mapped directly or mapped through the
|
||||
* Var column
|
||||
*/
|
||||
@JsonProperty("1-to-n mapping")
|
||||
private int oneToNMappings;
|
||||
|
||||
/**
|
||||
* Number of output columns which have multiple source columns, either input columns or var columns
|
||||
*/
|
||||
@JsonProperty("n-to-1 mapping")
|
||||
private int nToOneMappings;
|
||||
|
||||
/**
|
||||
* Number of mappings(links) between main input table and join tables
|
||||
*/
|
||||
@JsonProperty("join_mappings")
|
||||
private int joinMappingCounts;
|
||||
|
||||
/**
|
||||
* Number of left out join used in join table
|
||||
*/
|
||||
@JsonProperty("left_joins")
|
||||
private int leftJoinCounts;
|
||||
|
||||
/**
|
||||
* Number of inner join used in join table
|
||||
*/
|
||||
@JsonProperty("inner_joins")
|
||||
private int innerJoinCounts;
|
||||
|
||||
/**
|
||||
* Number of filter activated on input/output tables
|
||||
*/
|
||||
@JsonProperty("filters")
|
||||
private int filterCounts;
|
||||
|
||||
/**
|
||||
* Number of field types for each type in OUTPUT tables
|
||||
*/
|
||||
@JsonProperty("field_types")
|
||||
private String outputFieldTypes;
|
||||
|
||||
|
||||
/**
|
||||
* Getter for inputColumns.
|
||||
* @return the inputColumns
|
||||
*/
|
||||
public int getInputColumns() {
|
||||
return inputColumns;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the inputColumns.
|
||||
* @param inputColumns the inputColumns to set
|
||||
*/
|
||||
public void setInputColumns(int inputColumns) {
|
||||
this.inputColumns = inputColumns;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for outputColumns.
|
||||
* @return the outputColumns
|
||||
*/
|
||||
public int getOutputColumns() {
|
||||
return outputColumns;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the outputColumns.
|
||||
* @param outputColumns the outputColumns to set
|
||||
*/
|
||||
public void setOutputColumns(int outputColumns) {
|
||||
this.outputColumns = outputColumns;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for varColumns.
|
||||
* @return the varColumns
|
||||
*/
|
||||
public int getVarColumns() {
|
||||
return varColumns;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the varColumns.
|
||||
* @param varColumns the varColumns to set
|
||||
*/
|
||||
public void setVarColumns(int varColumns) {
|
||||
this.varColumns = varColumns;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for sourceNumber.
|
||||
* @return the sourceNumber
|
||||
*/
|
||||
public int getSourceNumber() {
|
||||
return sourceNumber;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the sourceNumber.
|
||||
* @param sourceNumber the sourceNumber to set
|
||||
*/
|
||||
public void setSourceNumber(int sourceNumber) {
|
||||
this.sourceNumber = sourceNumber;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for destinationNumber.
|
||||
* @return the destinationNumber
|
||||
*/
|
||||
public int getDestinationNumber() {
|
||||
return destinationNumber;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the destinationNumber.
|
||||
* @param destinationNumber the destinationNumber to set
|
||||
*/
|
||||
public void setDestinationNumber(int destinationNumber) {
|
||||
this.destinationNumber = destinationNumber;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for outputNumber.
|
||||
* @return the outputNumber
|
||||
*/
|
||||
public int getOutputNumber() {
|
||||
return outputNumber;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the outputNumber.
|
||||
* @param outputNumber the outputNumber to set
|
||||
*/
|
||||
public void setOutputNumber(int outputNumber) {
|
||||
this.outputNumber = outputNumber;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for simpleExpressions.
|
||||
*
|
||||
* @return the simpleExpressions
|
||||
*/
|
||||
public int getSimpleExpressions() {
|
||||
return simpleExpressions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the simpleExpressions.
|
||||
*
|
||||
* @param simpleExpressions the simpleExpressions to set
|
||||
*/
|
||||
public void setSimpleExpressions(int simpleExpressions) {
|
||||
this.simpleExpressions = simpleExpressions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for transformExpressions.
|
||||
*
|
||||
* @return the transformExpressions
|
||||
*/
|
||||
public int getTransformExpressions() {
|
||||
return transformExpressions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the transformExpressions.
|
||||
*
|
||||
* @param transformExpressions the transformExpressions to set
|
||||
*/
|
||||
public void setTransformExpressions(int transformExpressions) {
|
||||
this.transformExpressions = transformExpressions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for inputVarMappings.
|
||||
* @return the inputVarMappings
|
||||
*/
|
||||
public int getInputVarMappings() {
|
||||
return inputVarMappings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the inputVarMappings.
|
||||
* @param inputVarMappings the inputVarMappings to set
|
||||
*/
|
||||
public void setInputVarMappings(int inputVarMappings) {
|
||||
this.inputVarMappings = inputVarMappings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for varOutputMappings.
|
||||
* @return the varOutputMappings
|
||||
*/
|
||||
public int getVarOutputMappings() {
|
||||
return varOutputMappings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the varOutputMappings.
|
||||
* @param varOutputMappings the varOutputMappings to set
|
||||
*/
|
||||
public void setVarOutputMappings(int varOutputMappings) {
|
||||
this.varOutputMappings = varOutputMappings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for inputOutputMappings.
|
||||
* @return the inputOutputMappings
|
||||
*/
|
||||
public int getInputOutputMappings() {
|
||||
return inputOutputMappings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the inputOutputMappings.
|
||||
* @param inputOutputMappings the inputOutputMappings to set
|
||||
*/
|
||||
public void setInputOutputMappings(int inputOutputMappings) {
|
||||
this.inputOutputMappings = inputOutputMappings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for oneToNMappings.
|
||||
* @return the oneToNMappings
|
||||
*/
|
||||
public int getOneToNMappings() {
|
||||
return oneToNMappings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the oneToNMappings.
|
||||
* @param oneToNMappings the oneToNMappings to set
|
||||
*/
|
||||
public void setOneToNMappings(int oneToNMappings) {
|
||||
this.oneToNMappings = oneToNMappings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for nToOneMappings.
|
||||
* @return the nToOneMappings
|
||||
*/
|
||||
public int getnToOneMappings() {
|
||||
return nToOneMappings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the nToOneMappings.
|
||||
* @param nToOneMappings the nToOneMappings to set
|
||||
*/
|
||||
public void setnToOneMappings(int nToOneMappings) {
|
||||
this.nToOneMappings = nToOneMappings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for joinMappingCounts.
|
||||
* @return the joinMappingCounts
|
||||
*/
|
||||
public int getJoinMappingCounts() {
|
||||
return joinMappingCounts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the joinMappingCounts.
|
||||
* @param joinMappingCounts the joinMappingCounts to set
|
||||
*/
|
||||
public void setJoinMappingCounts(int joinMappingCounts) {
|
||||
this.joinMappingCounts = joinMappingCounts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for leftJoinCounts.
|
||||
* @return the leftJoinCounts
|
||||
*/
|
||||
public int getLeftJoinCounts() {
|
||||
return leftJoinCounts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the leftJoinCounts.
|
||||
* @param leftJoinCounts the leftJoinCounts to set
|
||||
*/
|
||||
public void setLeftJoinCounts(int leftJoinCounts) {
|
||||
this.leftJoinCounts = leftJoinCounts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for innerJoinCounts.
|
||||
* @return the innerJoinCounts
|
||||
*/
|
||||
public int getInnerJoinCounts() {
|
||||
return innerJoinCounts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the innerJoinCounts.
|
||||
* @param innerJoinCounts the innerJoinCounts to set
|
||||
*/
|
||||
public void setInnerJoinCounts(int innerJoinCounts) {
|
||||
this.innerJoinCounts = innerJoinCounts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for filterCounts.
|
||||
* @return the filterCounts
|
||||
*/
|
||||
public int getFilterCounts() {
|
||||
return filterCounts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the filterCounts.
|
||||
* @param filterCounts the filterCounts to set
|
||||
*/
|
||||
public void setFilterCounts(int filterCounts) {
|
||||
this.filterCounts = filterCounts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for outputFieldTypes.
|
||||
* @return the outputFieldTypes
|
||||
*/
|
||||
public String getOutputFieldTypes() {
|
||||
return outputFieldTypes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the outputFieldTypes.
|
||||
* @param outputFieldTypes the outputFieldTypes to set
|
||||
*/
|
||||
public void setOutputFieldTypes(String outputFieldTypes) {
|
||||
this.outputFieldTypes = outputFieldTypes;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -94,7 +94,11 @@ public interface IDetectCVEService extends IService {
|
||||
if (art == null) {
|
||||
return null;
|
||||
}
|
||||
return String.format("%s:%s:%s", art.getGroupId(), art.getArtifactId(), art.getVersion());
|
||||
String gavc = String.format("%s:%s:%s", art.getGroupId(), art.getArtifactId(), art.getVersion());
|
||||
if (!StringUtils.isEmpty(art.getClassifier())) {
|
||||
gavc += ":" + art.getClassifier();
|
||||
}
|
||||
return gavc;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -112,6 +116,8 @@ public interface IDetectCVEService extends IService {
|
||||
private String a;
|
||||
|
||||
private String v;
|
||||
|
||||
private String c;
|
||||
|
||||
/**
|
||||
* @return the g
|
||||
@@ -155,8 +161,28 @@ public interface IDetectCVEService extends IService {
|
||||
this.v = v;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the c
|
||||
*/
|
||||
public String getC() {
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param c the c to set
|
||||
*/
|
||||
public void setC(String c) {
|
||||
this.c = c;
|
||||
}
|
||||
|
||||
public String getGAVString() {
|
||||
return String.format("%s:%s:%s", g, a, v);
|
||||
String gav = String.format("%s:%s:%s", g, a, v);
|
||||
if (!StringUtils.isEmpty(c)) {
|
||||
gav += ":" + c;
|
||||
}
|
||||
return gav;
|
||||
}
|
||||
|
||||
public String getGA() {
|
||||
@@ -168,13 +194,16 @@ public interface IDetectCVEService extends IService {
|
||||
return null;
|
||||
}
|
||||
String[] gavs = gav.split(":");
|
||||
if (gavs.length != 3) {
|
||||
if (gavs.length < 3) {
|
||||
return null;
|
||||
}
|
||||
GAV ret = new GAV();
|
||||
ret.setG(gavs[0]);
|
||||
ret.setA(gavs[1]);
|
||||
ret.setV(gavs[2]);
|
||||
if (gavs.length > 3) {
|
||||
ret.setC(gavs[3]);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -184,19 +213,7 @@ public interface IDetectCVEService extends IService {
|
||||
}
|
||||
|
||||
String gav = mavenUri2GAV(mavenURI);
|
||||
if (StringUtils.isEmpty(gav)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String[] gavs = gav.split(":");
|
||||
if (gavs.length != 3) {
|
||||
return null;
|
||||
}
|
||||
GAV ret = new GAV();
|
||||
ret.setG(gavs[0]);
|
||||
ret.setA(gavs[1]);
|
||||
ret.setV(gavs[2]);
|
||||
return ret;
|
||||
return parseFromGAV(gav);
|
||||
}
|
||||
|
||||
public GAV clone() throws CloneNotSupportedException {
|
||||
@@ -224,6 +241,12 @@ public interface IDetectCVEService extends IService {
|
||||
sb.append(v);
|
||||
sb.append(",");
|
||||
}
|
||||
|
||||
if (!StringUtils.isEmpty(c)) {
|
||||
sb.append("c:");
|
||||
sb.append(c);
|
||||
sb.append(",");
|
||||
}
|
||||
|
||||
if (sb.lastIndexOf(",") > 0) {
|
||||
sb.deleteCharAt(sb.length() - 1);
|
||||
@@ -245,6 +268,9 @@ public interface IDetectCVEService extends IService {
|
||||
if (!StringUtils.isEmpty(v)) {
|
||||
hash += hash * 31 + v.hashCode();
|
||||
}
|
||||
if (!StringUtils.isEmpty(c)) {
|
||||
hash += hash * 31 + c.hashCode();
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
@@ -267,8 +293,12 @@ public interface IDetectCVEService extends IService {
|
||||
if (!StringUtils.equals(a, gav.getA())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!StringUtils.equals(v, gav.getV())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return StringUtils.equals(v, gav.getV());
|
||||
return StringUtils.equals(c, gav.getC());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ package org.talend.core.service;
|
||||
|
||||
import org.talend.commons.exception.LoginException;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IService;
|
||||
import org.talend.core.nexus.ArtifactRepositoryBean;
|
||||
import org.talend.utils.json.JSONException;
|
||||
@@ -38,4 +39,15 @@ public interface IRemoteService extends IService {
|
||||
boolean isTokenUsed(String adminUrl) throws Exception;
|
||||
|
||||
String getPendoKeyFromLicense() throws Exception;
|
||||
|
||||
public boolean isCloudConnection();
|
||||
|
||||
public static IRemoteService get() {
|
||||
GlobalServiceRegister gsr = GlobalServiceRegister.getDefault();
|
||||
if (gsr.isServiceRegistered(IRemoteService.class)) {
|
||||
return gsr.getService(IRemoteService.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -50,6 +50,10 @@ public interface IBrandingService extends IService {
|
||||
|
||||
public boolean isPoweredOnlyCamel();
|
||||
|
||||
/**
|
||||
* TP_All license also has the flag 'isCloud'
|
||||
* @return
|
||||
*/
|
||||
public default boolean isCloudLicense() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -581,3 +581,4 @@ I18nPreferencePage.restoreDefault=Restaurer les param\u00E8tres par d\u00E9faut
|
||||
I18nPreferencePage.wait_process=Le processus va prendre plusieurs minutes, patientez...
|
||||
MetadataPreferencePage.EnableBasic.name=Autorise l'en-t\u00EAte d'authentification basique
|
||||
MetadataPreferencePage.MessageDialog.Restart=Le Studio doit red\u00E9marrer pour que ce param\u00E8tre soit pris en compte.\nContinuer malgr\u00E9 tout ?
|
||||
TalendTabbedPropertyTitle.componentHelpTooltip=Ouvrir l'aide en ligne
|
||||
|
||||
@@ -581,3 +581,4 @@ I18nPreferencePage.restoreDefault=\u6062\u590D\u9ED8\u8BA4\u8BBE\u7F6E
|
||||
I18nPreferencePage.wait_process=\u8FD9\u4E2A\u8FC7\u7A0B\u5C06\u6301\u7EED\u51E0\u5206\u949F\u65F6\u95F4\uFF0C\u8BF7\u7A0D\u5019...
|
||||
MetadataPreferencePage.EnableBasic.name=\u542F\u7528\u57FA\u672C\u8EAB\u4EFD\u9A8C\u8BC1\u6807\u5934
|
||||
MetadataPreferencePage.MessageDialog.Restart=\u6B64\u8BBE\u7F6E\u5C06\u5728 Studio \u91CD\u542F\u540E\u751F\u6548\u3002\n\u662F\u5426\u786E\u5B9A\uFF1F
|
||||
TalendTabbedPropertyTitle.componentHelpTooltip=\u6253\u5F00\u5728\u7EBF\u5E2E\u52A9
|
||||
|
||||
@@ -144,7 +144,7 @@ public class ContextTreeTable {
|
||||
|
||||
private IContextModelManager manager;
|
||||
|
||||
private final static int fixedCheckBoxWidth = 30;
|
||||
private final static int fixedCheckBoxWidth = 90;
|
||||
|
||||
private final static int fixedTypeWidth = 90;
|
||||
|
||||
@@ -594,7 +594,7 @@ public class ContextTreeTable {
|
||||
// the columns after "type" will caculated by the contexts
|
||||
// 0=Name,1=Type,2=Comment.
|
||||
int j = 3;
|
||||
for (int i = 0; i < contexts.size(); i++) {
|
||||
for (IContext context : contexts) {
|
||||
columnLabelAccumulator.registerColumnOverrides(j++, new String[] { ContextTableConstants.COLUMN_CONTEXT_VALUE });
|
||||
columnLabelAccumulator.registerColumnOverrides(j++, new String[] { ContextTableConstants.COLUMN_CHECK_PROPERTY });
|
||||
columnLabelAccumulator.registerColumnOverrides(j++, new String[] { ContextTableConstants.COLUMN_PROMPT_PROPERTY });
|
||||
|
||||
@@ -23,9 +23,9 @@ public class ContextTableConstants {
|
||||
|
||||
public static final String COLUMN_COMMENT_PROPERTY = "Comment"; //$NON-NLS-1$
|
||||
|
||||
public static final String COLUMN_CHECK_PROPERTY = ""; //$NON-NLS-1$
|
||||
public static final String COLUMN_CHECK_PROPERTY = "Enable prompt"; //$NON-NLS-1$
|
||||
|
||||
public static final String COLUMN_PROMPT_PROPERTY = "Prompt"; //$NON-NLS-1$
|
||||
public static final String COLUMN_PROMPT_PROPERTY = "Prompt label"; //$NON-NLS-1$
|
||||
|
||||
public static final String COLUMN_CONTEXT_VALUE = "Value"; //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ package org.talend.core.ui.preference.collector;
|
||||
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.service.IRemoteService;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
import org.talend.core.ui.branding.IBrandingService;
|
||||
|
||||
/**
|
||||
* ggu class global comment. Detailled comment
|
||||
@@ -33,7 +33,7 @@ public class TalendDataCollectorPreferenceInitializer extends AbstractPreference
|
||||
IPreferenceStore preferenceStore = CoreUIPlugin.getDefault().getPreferenceStore();
|
||||
preferenceStore.setDefault(ITalendCorePrefConstants.DATA_COLLECTOR_ENABLED, true);
|
||||
preferenceStore.setDefault(ITalendCorePrefConstants.DATA_COLLECTOR_UPLOAD_PERIOD, 5);
|
||||
if(IBrandingService.get().isCloudLicense()) {
|
||||
if(IRemoteService.get().isCloudConnection()) {
|
||||
preferenceStore.setValue(ITalendCorePrefConstants.DATA_COLLECTOR_ENABLED, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.service.IRemoteService;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
import org.talend.core.ui.branding.IBrandingService;
|
||||
import org.talend.core.ui.i18n.Messages;
|
||||
import org.talend.core.ui.token.TokenCollectorFactory;
|
||||
|
||||
@@ -47,7 +47,7 @@ public class TalendDataCollectorPreferencePage extends FieldEditorPreferencePage
|
||||
|
||||
@Override
|
||||
protected void createFieldEditors() {
|
||||
if(!IBrandingService.get().isCloudLicense()) {
|
||||
if(!IRemoteService.get().isCloudConnection()) {
|
||||
addField(new BooleanFieldEditor(ITalendCorePrefConstants.DATA_COLLECTOR_ENABLED,
|
||||
Messages.getString("TalendDataCollectorPreferencePage_EnableCapture"), getFieldEditorParent())); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@@ -12,21 +12,10 @@
|
||||
// ============================================================================
|
||||
package org.talend.core;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
@@ -41,15 +30,12 @@ import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.LoginException;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.exception.SystemException;
|
||||
import org.talend.commons.runtime.xml.XmlUtil;
|
||||
import org.talend.commons.ui.runtime.image.OverlayImageProvider;
|
||||
import org.talend.commons.utils.generation.JavaUtils;
|
||||
import org.talend.commons.utils.workbench.resources.ResourceUtils;
|
||||
import org.talend.core.model.general.LibraryInfo;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.metadata.ColumnNameChanged;
|
||||
import org.talend.core.model.metadata.IMetadataTable;
|
||||
import org.talend.core.model.metadata.MetadataTalendType;
|
||||
import org.talend.core.model.metadata.MetadataToolHelper;
|
||||
import org.talend.core.model.metadata.QueryUtil;
|
||||
import org.talend.core.model.metadata.builder.ConvertionHelper;
|
||||
@@ -77,16 +63,9 @@ import org.talend.designer.codegen.ITalendSynchronizer;
|
||||
import org.talend.designer.core.IDesignerCoreService;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.designer.runprocess.ProcessorUtilities;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.RepositoryWorkUnit;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
import org.talend.utils.xml.XmlUtils;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* DOC Administrator class global comment. Detailled comment
|
||||
@@ -350,120 +329,15 @@ public class CoreService implements ICoreService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void synchronizeMapptingXML(ITalendProcessJavaProject talendJavaProject) {
|
||||
try {
|
||||
if (talendJavaProject == null) {
|
||||
return;
|
||||
}
|
||||
URL url = MetadataTalendType.getProjectForderURLOfMappingsFile();
|
||||
if (url != null) {
|
||||
// set the project mappings url
|
||||
System.setProperty(ProcessorUtilities.PROP_MAPPINGS_URL, url.toString()); // $NON-NLS-1$
|
||||
IFolder xmlMappingFolder = talendJavaProject.getResourceSubFolder(null, JavaUtils.JAVA_XML_MAPPING);
|
||||
|
||||
File mappingSource = new File(url.getPath());
|
||||
FilenameFilter filter = new FilenameFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
if (XmlUtil.isXMLFile(name)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
for (File file : mappingSource.listFiles(filter)) {
|
||||
String targetName = getTargetName(file);
|
||||
IFile targetFile = xmlMappingFolder.getFile(targetName);
|
||||
copyFile(file, targetFile);
|
||||
}
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
ExceptionHandler.process(e);
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
} catch (SystemException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void syncMappingsFileFromSystemToProject() {
|
||||
RepositoryWorkUnit workUnit = new RepositoryWorkUnit("Sync mapping files from system to project") { //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
protected void run() throws LoginException, PersistenceException {
|
||||
try {
|
||||
File sysMappingfolder = new File(MetadataTalendType.getSystemForderURLOfMappingsFile().getPath());
|
||||
IFolder projectMappingFolder = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject()).getFolder(MetadataTalendType.PROJECT_MAPPING_FOLDER);
|
||||
if (!projectMappingFolder.exists()) {
|
||||
projectMappingFolder.create(true, true, null);
|
||||
}
|
||||
for (File in : sysMappingfolder.listFiles()) {
|
||||
IFile out = projectMappingFolder.getFile(in.getName());
|
||||
copyFile(in, out);
|
||||
}
|
||||
} catch (SystemException | CoreException | IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
workUnit.setAvoidUnloadResources(true);
|
||||
ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(workUnit);
|
||||
}
|
||||
|
||||
public String getTargetName(File file) {
|
||||
String targetName = file.getName();
|
||||
try {
|
||||
DocumentBuilderFactory documentBuilderFactory = XmlUtils.getSecureDocumentBuilderFactory();
|
||||
DocumentBuilder analyser = documentBuilderFactory.newDocumentBuilder();
|
||||
Document document = analyser.parse(file);
|
||||
NodeList dbmsNodes = document.getElementsByTagName("dbms"); //$NON-NLS-1$
|
||||
String dbmsIdValue = "";
|
||||
for (int iDbms = 0; iDbms < dbmsNodes.getLength(); iDbms++) {
|
||||
Node dbmsNode = dbmsNodes.item(iDbms);
|
||||
NamedNodeMap dbmsAttributes = dbmsNode.getAttributes();
|
||||
dbmsIdValue = dbmsAttributes.getNamedItem("id").getNodeValue(); //$NON-NLS-1$
|
||||
|
||||
}
|
||||
if (dbmsIdValue != null && !"".equals(dbmsIdValue)) {
|
||||
final String[] fileNameSplit = targetName.split("_");
|
||||
String idA = "_id";
|
||||
String idB = "id_";
|
||||
final int indexA = dbmsIdValue.indexOf(idA);
|
||||
final int indexB = dbmsIdValue.indexOf(idB);
|
||||
String secondeName = "";
|
||||
if (indexA > 0) {
|
||||
secondeName = dbmsIdValue.substring(0, dbmsIdValue.length() - idA.length());
|
||||
} else if (indexB == 0) {
|
||||
secondeName = dbmsIdValue.substring(idB.length(), dbmsIdValue.length());
|
||||
} else if (indexA == -1 && indexB == -1) {
|
||||
secondeName = dbmsIdValue;
|
||||
}
|
||||
if (secondeName != null && !"".equals(secondeName)) {
|
||||
targetName = fileNameSplit[0] + "_" + secondeName.toLowerCase() + XmlUtil.FILE_XML_SUFFIX;
|
||||
}
|
||||
|
||||
}
|
||||
} catch (ParserConfigurationException e) {
|
||||
ExceptionHandler.process(e);
|
||||
} catch (SAXException e) {
|
||||
ExceptionHandler.process(e);
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return targetName;
|
||||
}
|
||||
|
||||
public void copyFile(File in, IFile out) throws CoreException, IOException {
|
||||
FileInputStream fis = new FileInputStream(in);
|
||||
if (out.exists()) {
|
||||
out.setContents(fis, true, false, null);
|
||||
} else {
|
||||
out.create(fis, true, null);
|
||||
}
|
||||
fis.close();
|
||||
//
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -59,7 +59,6 @@ import org.talend.commons.utils.generation.JavaUtils;
|
||||
import org.talend.commons.utils.time.TimeMeasure;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ICoreService;
|
||||
import org.talend.core.ITDQItemService;
|
||||
import org.talend.core.PluginChecker;
|
||||
import org.talend.core.context.Context;
|
||||
@@ -102,13 +101,11 @@ import org.talend.core.model.routines.CodesJarInfo;
|
||||
import org.talend.core.model.routines.RoutinesUtil;
|
||||
import org.talend.core.model.utils.JavaResourcesHelper;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.maven.MavenConstants;
|
||||
import org.talend.core.runtime.process.ITalendProcessJavaProject;
|
||||
import org.talend.core.runtime.process.LastGenerationInfo;
|
||||
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
|
||||
import org.talend.core.runtime.process.TalendProcessOptionConstants;
|
||||
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
|
||||
import org.talend.core.runtime.repository.build.BuildExportManager;
|
||||
import org.talend.core.runtime.services.IDesignerMavenService;
|
||||
import org.talend.core.service.IResourcesDependenciesService;
|
||||
@@ -139,8 +136,6 @@ public class ProcessorUtilities {
|
||||
|
||||
private static Logger log = Logger.getLogger(ProcessorUtilities.class);
|
||||
|
||||
public static final String PROP_MAPPINGS_URL = "talend.mappings.url"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* For generating code in CI without param -pl
|
||||
*/
|
||||
@@ -734,30 +729,10 @@ public class ProcessorUtilities {
|
||||
boolean hasDynamicMetadata = hasMetadataDynamic(currentProcess, jobInfo);
|
||||
LastGenerationInfo.getInstance().setUseDynamic(jobInfo.getJobId(), jobInfo.getJobVersion(), hasDynamicMetadata);
|
||||
if (hasDynamicMetadata) {
|
||||
try {
|
||||
URL url = MetadataTalendType.getProjectForderURLOfMappingsFile();
|
||||
if (url != null) {
|
||||
// set the project mappings url
|
||||
System.setProperty(ProcessorUtilities.PROP_MAPPINGS_URL, url.toString()); // $NON-NLS-1$
|
||||
|
||||
IFolder xmlMappingFolder = jobInfo.getProcessor().getTalendJavaProject().getResourceSubFolder(null,
|
||||
JavaUtils.JAVA_XML_MAPPING);
|
||||
ProjectPreferenceManager manager = CoreRuntimePlugin.getInstance().getProjectPreferenceManager();
|
||||
boolean updated = manager.getBoolean(MetadataTalendType.UPDATED_MAPPING_FILES);
|
||||
if ((xmlMappingFolder.members().length == 0 || updated)
|
||||
&& GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
|
||||
ICoreService coreService =
|
||||
GlobalServiceRegister.getDefault().getService(ICoreService.class);
|
||||
coreService.synchronizeMapptingXML(jobInfo.getProcessor().getTalendJavaProject());
|
||||
// reset
|
||||
if (updated) {
|
||||
manager.setValue(MetadataTalendType.UPDATED_MAPPING_FILES, false);
|
||||
manager.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
ITalendProcessJavaProject talendJavaProject = jobInfo.getProcessor().getTalendJavaProject();
|
||||
if (talendJavaProject != null) {
|
||||
IFolder xmlMappingFolder = talendJavaProject.getResourceSubFolder(null, JavaUtils.JAVA_XML_MAPPING);
|
||||
MetadataTalendType.syncMappingFiles(xmlMappingFolder.getLocation().toFile(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1953,12 +1928,6 @@ public class ProcessorUtilities {
|
||||
|
||||
private static void updateCodeSources() throws ProcessorException {
|
||||
if (isRemoteProject()) {
|
||||
// TESB-29071
|
||||
try {
|
||||
ProxyRepositoryFactory.getInstance().initialize();
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
RepositoryManager.syncRoutineAndJoblet(ERepositoryObjectType.ROUTINES);
|
||||
RepositoryManager.syncRoutineAndJoblet(ERepositoryObjectType.BEANS);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-compat</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.beanshell</groupId>
|
||||
<artifactId>bsh</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.12.0</version>
|
||||
<version>2.13.2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.12.0</version>
|
||||
<version>2.13.2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.thoughtworks.xstream</groupId>
|
||||
|
||||
@@ -155,6 +155,11 @@
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache-extras.beanshell</groupId>
|
||||
<artifactId>bsh</artifactId>
|
||||
<version>2.0b6</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -38,8 +38,58 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<version>3.0.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.shared</groupId>
|
||||
<artifactId>maven-shared-utils</artifactId>
|
||||
<version>3.3.3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.8.3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>30.0-jre</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
@@ -48,7 +98,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
<version>2.8.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
</parent>
|
||||
<artifactId>studio-tcompv1-dependencies</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
||||
<properties>
|
||||
<tcomp.version>1.45.2</tcomp.version>
|
||||
<tcomp.version>1.46.1</tcomp.version>
|
||||
<slf4j.version>1.7.32</slf4j.version>
|
||||
<reload4j.version>1.2.19</reload4j.version>
|
||||
</properties>
|
||||
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>talend_open</id>
|
||||
@@ -58,7 +58,7 @@
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@@ -70,7 +70,7 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.talend.sdk.component</groupId>
|
||||
@@ -119,7 +119,7 @@
|
||||
<version>${slf4j.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
<exclusion>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
@@ -87,7 +91,12 @@
|
||||
<configuration>
|
||||
<tasks>
|
||||
<echo message="Unzip old repository..." />
|
||||
<unzip src="${basedir}/../repository/maven_repository.zip" dest="${basedir}/../tmp/" />
|
||||
<unzip src="${basedir}/../repository/maven_repository.zip" dest="${basedir}/../tmp/">
|
||||
<patternset>
|
||||
<exclude name="repository/org/apache/maven/maven-artifact-manager/2.0.9/"/>
|
||||
<exclude name="repository/org/apache/maven/maven-artifact-manager/2.0.6/"/>
|
||||
</patternset>
|
||||
</unzip>
|
||||
</tasks>
|
||||
</configuration>
|
||||
<goals>
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
<version>2.8.2</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
|
||||
@@ -61,6 +61,7 @@ import org.eclipse.osgi.util.NLS;
|
||||
import org.talend.commons.CommonsPlugin;
|
||||
import org.talend.core.prefs.SecurityPreferenceConstants;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.service.IRemoteService;
|
||||
import org.talend.utils.security.StudioEncryption;
|
||||
|
||||
/**
|
||||
@@ -121,7 +122,7 @@ public class TalendMavenLaunchDelegate extends JavaLaunchDelegate implements Mav
|
||||
this.extensionsSupport = MavenLaunchExtensionsSupport.create(configuration, launch);
|
||||
|
||||
log.info("" + getWorkingDirectory(configuration)); //$NON-NLS-1$
|
||||
log.info(" mvn" + getProgramArguments(configuration, true)); //$NON-NLS-1$
|
||||
log.info(" mvn" + getProgramArguments(configuration, IRemoteService.get().isCloudConnection())); //$NON-NLS-1$
|
||||
this.programArguments = null;
|
||||
|
||||
extensionsSupport.configureSourceLookup(configuration, launch, monitor);
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.runtime.process.ITalendProcessJavaProject;
|
||||
import org.talend.designer.maven.utils.PomUtil;
|
||||
import org.talend.designer.runprocess.IProcessor;
|
||||
import org.talend.designer.runprocess.ProcessorUtilities;
|
||||
import org.talend.utils.io.FilesUtils;
|
||||
|
||||
/**
|
||||
@@ -123,6 +124,7 @@ public class MavenPomSynchronizer {
|
||||
if (!jProject.isOpen()) {
|
||||
jProject.open(monitor);
|
||||
}
|
||||
|
||||
// empty the src/main/java...
|
||||
IFolder srcFolder = codeProject.getSrcFolder();
|
||||
codeProject.cleanFolder(monitor, srcFolder);
|
||||
@@ -131,10 +133,12 @@ public class MavenPomSynchronizer {
|
||||
IFolder resourcesFolder = codeProject.getExternalResourcesFolder();
|
||||
codeProject.cleanFolder(monitor, resourcesFolder);
|
||||
|
||||
// empty the outputs, target
|
||||
IFolder targetFolder = codeProject.getTargetFolder();
|
||||
codeProject.cleanFolder(monitor, targetFolder);
|
||||
|
||||
// CI mode, need to depend on maven to clean target folder or not.
|
||||
if (!ProcessorUtilities.isCIMode()) {
|
||||
// empty the outputs, target
|
||||
IFolder targetFolder = codeProject.getTargetFolder();
|
||||
codeProject.cleanFolder(monitor, targetFolder);
|
||||
}
|
||||
// empty the src/test/java
|
||||
IFolder testSrcFolder = codeProject.getTestSrcFolder();
|
||||
codeProject.cleanFolder(monitor, testSrcFolder);
|
||||
|
||||
@@ -38,4 +38,5 @@
|
||||
required="true">
|
||||
</libraryNeeded>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
||||
@@ -2,6 +2,4 @@ source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
lib/advancedPersistentLookupLib-1.4.jar,\
|
||||
lib/advancedPersistentLookupLib-1.3.jar,\
|
||||
lib/advancedPersistentLookupLib-1.2.jar
|
||||
lib/advancedPersistentLookupLib-1.4.jar
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -187,7 +187,7 @@ public class JavaLibrariesService extends AbstractLibrariesService {
|
||||
final boolean isLocalRepository = !"global".equalsIgnoreCase(configSetting); //$NON-NLS-1$
|
||||
String currentRepType = isLocalRepository ? "local" : "global";
|
||||
if (!currentRepType.equals(lastRepType)) {
|
||||
repositoryBundleService.clearCache();
|
||||
repositoryBundleService.clearCache(false);
|
||||
}
|
||||
if (lastRepType == null || !currentRepType.equals(lastRepType)) {
|
||||
try {
|
||||
@@ -202,6 +202,9 @@ public class JavaLibrariesService extends AbstractLibrariesService {
|
||||
if (!repositoryBundleService.isInitialized()) {
|
||||
// 2. Components libraries and libraries from extension
|
||||
repositoryBundleService.createModulesIndexFromComponentAndExtension(monitorWrap);
|
||||
} else {
|
||||
//TUP-31721 & TUP-36231:Handle the custom components deployment when studio index is not re-generated.
|
||||
repositoryBundleService.deployLibsFromCustomComponents();
|
||||
}
|
||||
|
||||
repositoryBundleService.installModules(ModulesNeededProvider.getSystemRunningModules(), null);
|
||||
|
||||
@@ -377,6 +377,10 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
|
||||
.process(new Exception(getClass().getSimpleName() + " resolve " + module.getModuleName() + " failed !"));
|
||||
}
|
||||
try {
|
||||
// try maven uri first
|
||||
if (jarFile == null) {
|
||||
jarFile = getJarFile(module.getMavenUri());
|
||||
}
|
||||
// try the jar name if can't get jar with uri.
|
||||
if (jarFile == null) {
|
||||
jarFile = getJarFile(jarNeeded);
|
||||
@@ -388,7 +392,10 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
|
||||
ILibraryManagerUIService libUiService = GlobalServiceRegister.getDefault()
|
||||
.getService(ILibraryManagerUIService.class);
|
||||
|
||||
libUiService.installModules(new String[] { jarNeeded });
|
||||
// libUiService.installModules(new String[] { jarNeeded });
|
||||
List<ModuleNeeded> moduleList = new ArrayList<ModuleNeeded>();
|
||||
moduleList.add(module);
|
||||
libUiService.installModules(moduleList);
|
||||
}
|
||||
jarFile = retrieveJarFromLocal(module);
|
||||
if (jarFile == null) {
|
||||
@@ -832,13 +839,20 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCache() {
|
||||
public void clearCache(boolean cleanIndex) {
|
||||
if (isInitialized()) {
|
||||
LibrariesIndexManager.getInstance().clearAll();
|
||||
if (cleanIndex) {
|
||||
LibrariesIndexManager.getInstance().clearAll();
|
||||
}
|
||||
ModuleStatusProvider.reset();
|
||||
}
|
||||
jarList.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCache() {
|
||||
clearCache(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(String jarName) {
|
||||
@@ -1338,6 +1352,21 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
|
||||
}
|
||||
return mavenURIMap;
|
||||
}
|
||||
|
||||
public void deployLibsFromCustomComponents() {
|
||||
IComponentsService service = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IComponentsService.class)) {
|
||||
service = GlobalServiceRegister.getDefault().getService(IComponentsService.class);
|
||||
}
|
||||
if (service != null) {
|
||||
Map<String, String> platformURLMap = new HashMap<>();
|
||||
platformURLMap = LibrariesIndexManager.getInstance().getAllStudioLibsFromIndex();
|
||||
// Need to read components first, otherwise FiltUtils.getFilesFromFolderByName() returns empty for custom
|
||||
// component folder.
|
||||
service.getComponentsFactory().readComponents();
|
||||
deployLibsFromCustomComponents(service, platformURLMap);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -510,10 +510,12 @@ InegerCellEditorListener.NumeralMessage=Input value invalid
|
||||
MetadataTalendTypeEditor.button.edit=E&dit
|
||||
MetadataTalendTypeEditor.button.export=E&xport
|
||||
MetadataTalendTypeEditor.button.import=I&mport
|
||||
MetadataTalendTypeEditor.button.restore=R&estore
|
||||
MetadataTalendTypeEditor.column1.Name=Metadata Mapping File
|
||||
MetadataTalendTypeEditor.editMappingDialog.title=Edit Mapping File
|
||||
MetadataTalendTypeEditor.error.message=Error Message
|
||||
MetadataTalendTypeEditor.fileIsImported=This file has already been imported.
|
||||
MetadataTalendTypeEditor.fileOverwrite=This file already exists. Do you want to overwrite it?
|
||||
MetadataTalendTypeEditor.fileIsInvalid=The imported metadata file is not valid.
|
||||
MetadataTalendTypeEditor.fileNameStartRule=File name must start with 'mapping_'.
|
||||
ContextModeSelectPage.contextModes=Create a new context or reuse the existing one
|
||||
@@ -549,5 +551,5 @@ MetadataTalendTypeEditor.confirmMessage=Are you sure to replace current with def
|
||||
PromptDialog.title=Run Context {0} with parameters:
|
||||
PromptDialog.stringTip=The input text must be surrounded with single quote.
|
||||
PromptDialog.choose.title=Choose context
|
||||
PromptDialog.promptGroup.name=Prompt variables
|
||||
PromptDialog.variablePrompts.name=Variable prompts
|
||||
PromptDialog.context.environments.name=Context environments
|
||||
|
||||
@@ -229,7 +229,7 @@ public class PromptDialog extends SelectionDialog {
|
||||
|
||||
private void createContextArea(IContext currentContext, Composite parent) {
|
||||
Group promptGroup = new Group(parent, SWT.NONE);
|
||||
promptGroup.setText(Messages.getString("PromptDialog.promptGroup.name")); //$NON-NLS-1$
|
||||
promptGroup.setText(Messages.getString("PromptDialog.variablePrompts.name")); //$NON-NLS-1$
|
||||
promptGroup.setLayout(new GridLayout(1, false));
|
||||
promptGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
// Prompt for context values ?
|
||||
|
||||
@@ -12,16 +12,23 @@
|
||||
// ============================================================================
|
||||
package org.talend.metadata.managment.ui.editor;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.FileLocator;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
@@ -33,6 +40,7 @@ import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.preference.FieldEditor;
|
||||
import org.eclipse.jface.resource.JFaceResources;
|
||||
import org.eclipse.jface.text.Document;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
import org.eclipse.jface.viewers.ArrayContentProvider;
|
||||
import org.eclipse.jface.viewers.DoubleClickEvent;
|
||||
@@ -61,19 +69,16 @@ import org.eclipse.swt.widgets.Table;
|
||||
import org.eclipse.swt.widgets.TableColumn;
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.LoginException;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.exception.SystemException;
|
||||
import org.talend.commons.utils.io.FilesUtils;
|
||||
import org.talend.commons.utils.workbench.resources.ResourceUtils;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ICoreService;
|
||||
import org.talend.core.model.metadata.Dbms;
|
||||
import org.talend.core.model.metadata.MetadataTalendType;
|
||||
import org.talend.core.model.utils.ResourceModelHelper;
|
||||
import org.talend.core.model.utils.XSDValidater;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
|
||||
import org.talend.metadata.managment.ui.MetadataManagmentUiPlugin;
|
||||
import org.talend.metadata.managment.ui.dialog.MappingFileCheckViewerDialog;
|
||||
import org.talend.metadata.managment.ui.i18n.Messages;
|
||||
@@ -131,6 +136,16 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
|
||||
IDocument fileContent;
|
||||
|
||||
FileType type;
|
||||
|
||||
boolean isDeleted;
|
||||
|
||||
}
|
||||
|
||||
enum FileType {
|
||||
USER_DEFINED,
|
||||
SYSTEM_DEFAULT,
|
||||
USER_EXTERNAL,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,7 +156,7 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
*/
|
||||
class TmpFilesManager {
|
||||
|
||||
// store the editing tempertory files
|
||||
// store the editing temporary files
|
||||
private List<FileInfo> tmpFiles = new ArrayList<FileInfo>();
|
||||
|
||||
TmpFilesManager() {
|
||||
@@ -149,13 +164,30 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
}
|
||||
|
||||
private void init() {
|
||||
List<File> files = MetadataTalendType.getMetadataMappingFiles();
|
||||
tmpFiles.clear();
|
||||
for (File file : files) {
|
||||
FileInfo info = new FileInfo();
|
||||
info.file = file;
|
||||
info.fileName = file.getName();
|
||||
this.addFile(info);
|
||||
try {
|
||||
tmpFiles.clear();
|
||||
java.nio.file.Path systemMappingPath = new File(MetadataTalendType.getSystemFolderURLOfMappingsFile().getFile())
|
||||
.toPath();
|
||||
Map<String, File> systemFileMap = Stream
|
||||
.of(systemMappingPath.toFile()
|
||||
.listFiles(f -> f.getName().matches(MetadataTalendType.MAPPING_FILE_PATTERN)))
|
||||
.collect(Collectors.toMap(File::getName, Function.identity()));
|
||||
List<File> files = MetadataTalendType.getMetadataMappingFiles();
|
||||
for (File file : files) {
|
||||
FileInfo info = new FileInfo();
|
||||
info.file = file;
|
||||
info.fileName = file.getName();
|
||||
if (file.toPath().startsWith(systemMappingPath)) {
|
||||
info.type = FileType.SYSTEM_DEFAULT;
|
||||
} else if (systemFileMap.containsKey(file.getName())) {
|
||||
info.type = FileType.USER_DEFINED;
|
||||
} else {
|
||||
info.type = FileType.USER_EXTERNAL;
|
||||
}
|
||||
this.addFile(info);
|
||||
}
|
||||
} catch (SystemException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,8 +195,9 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
tmpFiles.add(file);
|
||||
}
|
||||
|
||||
List<FileInfo> getTempFiles() {
|
||||
return tmpFiles;
|
||||
List<FileInfo> getTempFiles(boolean includeDeleted) {
|
||||
return tmpFiles.stream().filter(f -> includeDeleted || !f.isDeleted || FileType.SYSTEM_DEFAULT == f.type)
|
||||
.sorted((f1, f2) -> f1.fileName.compareTo(f2.fileName)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
boolean contains(String fileName) {
|
||||
@@ -176,15 +209,6 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean contains(File file) {
|
||||
for (FileInfo info : tmpFiles) {
|
||||
if (info.file.equals(file)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void remove(FileInfo file) {
|
||||
tmpFiles.remove(file);
|
||||
}
|
||||
@@ -297,8 +321,29 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
sourceViewerDialog.setDocument(fileSelected.file);
|
||||
}
|
||||
if (sourceViewerDialog.open() == IDialogConstants.OK_ID) {
|
||||
System.out.println(sourceViewerDialog.getDocument().get());
|
||||
fileSelected.fileContent = sourceViewerDialog.getDocument();
|
||||
System.out.println(sourceViewerDialog.getResult());
|
||||
try {
|
||||
File systemFile = new File(MetadataTalendType.getSystemFolderURLOfMappingsFile().getFile(),
|
||||
fileSelected.fileName);
|
||||
if (systemFile.exists()) {
|
||||
String currentSha1 = MetadataTalendType.getSha1OfText(sourceViewerDialog.getDocument().get());
|
||||
String systemSha1 = MetadataTalendType.getSha1OfFile(systemFile);
|
||||
if (currentSha1 != null && currentSha1.equals(systemSha1)) {
|
||||
fileSelected.type = FileType.SYSTEM_DEFAULT;
|
||||
fileSelected.file = systemFile;
|
||||
setControlEnable(removeButton, false);
|
||||
} else {
|
||||
fileSelected.type = FileType.USER_DEFINED;
|
||||
fileSelected.file = new File(MetadataTalendType.getProjectFolderURLOfMappingsFile().getFile(),
|
||||
fileSelected.fileName);
|
||||
setControlEnable(removeButton, true);
|
||||
}
|
||||
}
|
||||
fileSelected.fileContent = sourceViewerDialog.getDocument();
|
||||
fileSelected.isDeleted = false;
|
||||
} catch (SystemException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,7 +427,16 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
*/
|
||||
protected void removeItem() {
|
||||
FileInfo info = getSelection();
|
||||
tmpFileManager.remove(info);
|
||||
info.isDeleted = true;
|
||||
if (FileType.USER_DEFINED == info.type) {
|
||||
try {
|
||||
info.type = FileType.SYSTEM_DEFAULT;
|
||||
info.file = new File(MetadataTalendType.getSystemFolderURLOfMappingsFile().getFile(), info.fileName);
|
||||
info.fileContent = null;
|
||||
} catch (SystemException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
refreshViewer();
|
||||
}
|
||||
|
||||
@@ -413,16 +467,21 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
}
|
||||
|
||||
private void exportItem() {
|
||||
File existing = getSelection().file;
|
||||
FileInfo selectedFileInfo = getSelection();
|
||||
FileDialog dia = new FileDialog(getShell(), SWT.SAVE);
|
||||
dia.setFileName(existing.getName());
|
||||
dia.setFileName(selectedFileInfo.fileName);
|
||||
dia.setFilterExtensions(new String[] { "*.xml" }); //$NON-NLS-1$
|
||||
String destination = dia.open();
|
||||
if (destination == null) {
|
||||
return;
|
||||
}
|
||||
File destinationFile = new File(destination);
|
||||
try {
|
||||
FilesUtils.copyFile(existing, new File(destination));
|
||||
if (selectedFileInfo.fileContent != null) {
|
||||
Files.write(destinationFile.toPath(), selectedFileInfo.fileContent.get().getBytes());
|
||||
} else {
|
||||
FilesUtils.copyFile(selectedFileInfo.file, destinationFile);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
@@ -472,17 +531,39 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
private void importItem() {
|
||||
setPresentsDefaultValue(false);
|
||||
File input = getNewInputObject();
|
||||
|
||||
if (input != null) {
|
||||
FileInfo fileInfo = new FileInfo();
|
||||
fileInfo.file = input;
|
||||
fileInfo.fileName = input.getName();
|
||||
tmpFileManager.addFile(fileInfo);
|
||||
Optional<FileInfo> optional = tmpFileManager.getTempFiles(true).stream()
|
||||
.filter(f -> f.fileName.equals(input.getName())).findAny();
|
||||
if (optional.isPresent()) {
|
||||
FileInfo tmpFileInfo = optional.get();
|
||||
try {
|
||||
String content = new String(Files.readAllBytes(input.toPath()));
|
||||
if (FileType.SYSTEM_DEFAULT == tmpFileInfo.type) {
|
||||
String systemSha1 = MetadataTalendType.getSha1OfSystemMappingFile(tmpFileInfo.fileName);
|
||||
String inputSha1 = MetadataTalendType.getSha1OfText(content);
|
||||
if (inputSha1.equals(systemSha1)) {
|
||||
return;
|
||||
}
|
||||
tmpFileInfo.type = FileType.USER_DEFINED;
|
||||
}
|
||||
tmpFileInfo.fileContent = new Document(content);
|
||||
tmpFileInfo.isDeleted = false;
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
} else {
|
||||
FileInfo fileInfo = new FileInfo();
|
||||
fileInfo.file = input;
|
||||
fileInfo.fileName = input.getName();
|
||||
fileInfo.type = FileType.USER_EXTERNAL;
|
||||
tmpFileManager.addFile(fileInfo);
|
||||
}
|
||||
refreshViewer();
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshViewer() {
|
||||
viewer.setInput(tmpFileManager.getTempFiles(false));
|
||||
viewer.refresh();
|
||||
selectionChanged();
|
||||
}
|
||||
@@ -497,11 +578,11 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
}
|
||||
File xmlFile = new File(fileName);
|
||||
if (tmpFileManager.contains(xmlFile.getName())) {
|
||||
MessageDialog
|
||||
.openWarning(
|
||||
boolean confirm = MessageDialog.openConfirm(
|
||||
shell,
|
||||
Messages.getString("MetadataTalendTypeEditor.error.message"), Messages.getString("MetadataTalendTypeEditor.fileIsImported")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return null;
|
||||
Messages.getString("MetadataTalendTypeEditor.confirmTitle"), //$NON-NLS-1$
|
||||
Messages.getString("MetadataTalendTypeEditor.fileOverwrite")); //$NON-NLS-1$
|
||||
return confirm ? xmlFile : null;
|
||||
}
|
||||
|
||||
if (!xmlFile.getName().startsWith("mapping_")) { //$NON-NLS-1$
|
||||
@@ -536,13 +617,21 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
boolean selected = !viewer.getSelection().isEmpty();
|
||||
setControlEnable(exportButton, selected);
|
||||
setControlEnable(editButton, selected);
|
||||
setControlEnable(removeButton, selected);
|
||||
|
||||
boolean removeEnable = selected;
|
||||
StructuredSelection select = (StructuredSelection) viewer.getSelection();
|
||||
|
||||
if (select != null) {
|
||||
FileInfo info = (FileInfo) select.getFirstElement();
|
||||
if (info != null) {
|
||||
String buttonText = null;
|
||||
if (FileType.USER_DEFINED == info.type || FileType.SYSTEM_DEFAULT == info.type) {
|
||||
buttonText = Messages.getString("MetadataTalendTypeEditor.button.restore"); //$NON-NLS-1$
|
||||
} else if (FileType.USER_EXTERNAL == info.type) {
|
||||
buttonText = JFaceResources.getString("ListEditor.remove"); //$NON-NLS-1$
|
||||
}
|
||||
removeButton.setText(buttonText);
|
||||
removeEnable = FileType.SYSTEM_DEFAULT != info.type;
|
||||
String id = null;
|
||||
String infoName = info.fileName;
|
||||
for (Dbms allDbm : allDbms) {
|
||||
@@ -553,6 +642,7 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
setSelectId(id);
|
||||
}
|
||||
}
|
||||
setControlEnable(removeButton, removeEnable);
|
||||
}
|
||||
|
||||
protected void setControlEnable(Control control, boolean enable) {
|
||||
@@ -569,13 +659,31 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
Messages.getString("MetadataTalendTypeEditor.confirmTitle"), //$NON-NLS-1$
|
||||
Messages.getString("MetadataTalendTypeEditor.confirmMessage")); //$NON-NLS-1$
|
||||
if (confirm) {
|
||||
ICoreService coreService = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
|
||||
coreService = GlobalServiceRegister.getDefault().getService(ICoreService.class);
|
||||
coreService.syncMappingsFileFromSystemToProject();
|
||||
tmpFileManager.reload();
|
||||
}
|
||||
RepositoryWorkUnit workUnit = new RepositoryWorkUnit("Restore mapping files") { //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
protected void run() throws LoginException, PersistenceException {
|
||||
try {
|
||||
File[] projectMappingFiles = new File(MetadataTalendType.getProjectFolderURLOfMappingsFile().getFile())
|
||||
.listFiles();
|
||||
if (projectMappingFiles != null) {
|
||||
Set<String> systemFileNames = Stream
|
||||
.of(new File(MetadataTalendType.getSystemFolderURLOfMappingsFile().getFile())
|
||||
.listFiles(f -> f.getName().matches(MetadataTalendType.MAPPING_FILE_PATTERN)))
|
||||
.map(File::getName).collect(Collectors.toSet());
|
||||
Stream.of(projectMappingFiles).filter(f -> systemFileNames.contains(f.getName()))
|
||||
.forEach(File::delete);
|
||||
}
|
||||
} catch (SystemException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
workUnit.setAvoidUnloadResources(true);
|
||||
ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(workUnit);
|
||||
tmpFileManager.reload();
|
||||
super.load();
|
||||
viewer.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,7 +694,7 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
*/
|
||||
@Override
|
||||
protected void doLoad() {
|
||||
viewer.setInput(tmpFileManager.getTempFiles());
|
||||
viewer.setInput(tmpFileManager.getTempFiles(false));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -595,7 +703,7 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
* DOC YeXiaowei Comment method "forceLoad".
|
||||
*/
|
||||
public void forceLoad() {
|
||||
viewer.setInput(tmpFileManager.getTempFiles());
|
||||
viewer.setInput(tmpFileManager.getTempFiles(false));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -635,98 +743,44 @@ public class MetadataTalendTypeEditor extends FieldEditor {
|
||||
}
|
||||
|
||||
boolean needReload = false;
|
||||
|
||||
List<FileInfo> tempFiles = tmpFileManager.getTempFiles();
|
||||
List<File> realFiles = MetadataTalendType.getMetadataMappingFiles();
|
||||
|
||||
// delete the removed files
|
||||
for (File file : realFiles) {
|
||||
if (!tmpFileManager.contains(file.getName())) {
|
||||
IFile iFile = mappingFolder.getFile(file.getName());
|
||||
List<FileInfo> tmpFiles = tmpFileManager.getTempFiles(true);
|
||||
for (FileInfo info : tmpFiles) {
|
||||
IFile file = mappingFolder.getFile(info.fileName);
|
||||
if (FileType.SYSTEM_DEFAULT == info.type || info.isDeleted) {
|
||||
try {
|
||||
iFile.delete(true, null);
|
||||
needReload = true;
|
||||
if (file.exists()) {
|
||||
file.delete(true, null);
|
||||
needReload = true;
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// add the new files;
|
||||
for (FileInfo newFile : tempFiles) {
|
||||
if (!realFiles.contains(newFile.file)) {
|
||||
if (FileType.USER_DEFINED == info.type || FileType.USER_EXTERNAL == info.type) {
|
||||
try {
|
||||
importFileIntoTalend(newFile.file);
|
||||
byte[] newContent = info.fileContent == null ? Files.readAllBytes(info.file.toPath())
|
||||
: info.fileContent.get().getBytes();
|
||||
InputStream inputStream = new ByteArrayInputStream(newContent);
|
||||
if (file.exists()) {
|
||||
file.setContents(inputStream, true, false, null);
|
||||
} else {
|
||||
if (!mappingFolder.exists()) {
|
||||
ResourceUtils.createFolder(mappingFolder);
|
||||
}
|
||||
file.create(inputStream, true, null);
|
||||
}
|
||||
needReload = true;
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// for editing files
|
||||
for (FileInfo tempFile : tempFiles) {
|
||||
for (File realFile : realFiles) {
|
||||
if (realFile.equals(tempFile.file)) {
|
||||
if (tempFile.fileContent != null) {
|
||||
try {
|
||||
updateFileContent(realFile, tempFile.fileContent.get());
|
||||
needReload = true;
|
||||
break;
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
mappingFolder.refreshLocal(IResource.DEPTH_ONE, null);
|
||||
} catch (CoreException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
if (needReload) {
|
||||
tmpFileManager.reload();
|
||||
ProjectPreferenceManager manager = CoreRuntimePlugin.getInstance().getProjectPreferenceManager();
|
||||
manager.setValue(MetadataTalendType.UPDATED_MAPPING_FILES, true);
|
||||
manager.save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* bqian Comment method "updateFileContent".
|
||||
*
|
||||
* @param realFile
|
||||
* @param string
|
||||
*/
|
||||
private void updateFileContent(File realFile, String string) throws Exception {
|
||||
FileWriter fw = null;
|
||||
try {
|
||||
fw = new FileWriter(realFile);
|
||||
fw.write(string);
|
||||
fw.flush();
|
||||
} finally {
|
||||
fw.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Import the selected file into talend.
|
||||
*
|
||||
* @param xmlFile
|
||||
* @throws SystemException
|
||||
*/
|
||||
private File importFileIntoTalend(File xmlFile) throws IOException, SystemException {
|
||||
String fileName = xmlFile.getName();
|
||||
|
||||
URL url = MetadataTalendType.getProjectForderURLOfMappingsFile();
|
||||
File targetFile = new File(url.getPath(), fileName);
|
||||
|
||||
FilesUtils.copyFile(xmlFile, targetFile);
|
||||
return targetFile;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc) Method declared on FieldEditor.
|
||||
*/
|
||||
|
||||
@@ -108,6 +108,8 @@ public class ExtendedNodeConnectionContextUtils {
|
||||
SynapseClientId,
|
||||
SynapseDirectoryId,
|
||||
SynapseSecretKey,
|
||||
UseSynapseCertificate,
|
||||
SynapseClientCertificate,
|
||||
SynapseDeployBlob,
|
||||
SynapseDriverMemory,
|
||||
SynapseDriverCores,
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// ============================================================================
|
||||
package org.talend.metadata.managment.connection.manager;
|
||||
|
||||
import java.security.PrivilegedExceptionAction;
|
||||
import java.sql.Connection;
|
||||
import java.sql.Driver;
|
||||
import java.sql.SQLException;
|
||||
@@ -26,6 +27,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.talend.commons.exception.CommonExceptionHandler;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.classloader.ClassLoaderFactory;
|
||||
import org.talend.core.classloader.DynamicClassLoader;
|
||||
@@ -58,37 +60,34 @@ public class ImpalaConnectionManager extends DataBaseConnectionManager {
|
||||
return manager;
|
||||
}
|
||||
|
||||
public void checkConnection(IMetadataConnection metadataConn) throws ClassNotFoundException, InstantiationException,
|
||||
IllegalAccessException, SQLException {
|
||||
public void checkConnection(IMetadataConnection metadataConn) throws ClassNotFoundException, InstantiationException, IllegalAccessException, SQLException {
|
||||
createConnection(metadataConn);
|
||||
}
|
||||
|
||||
public Connection createConnection(final IMetadataConnection metadataConn) throws ClassNotFoundException,
|
||||
InstantiationException, IllegalAccessException, SQLException {
|
||||
public Connection createConnection(final IMetadataConnection metadataConn) throws ClassNotFoundException, InstantiationException, IllegalAccessException, SQLException {
|
||||
FutureTask<Connection> futureTask = new FutureTask<Connection>(new Callable<Connection>() {
|
||||
|
||||
@Override
|
||||
public Connection call() throws Exception {
|
||||
Connection conn = null;
|
||||
|
||||
|
||||
if( !("".equals( metadataConn.getPassword() ) || "\"\"".equals( metadataConn.getPassword() )) ) {
|
||||
String url = metadataConn.getUrl().replace(";auth=noSasl", "");
|
||||
|
||||
|
||||
|
||||
if (url.startsWith("jdbc:hive2") && !url.contains(";user=")) {
|
||||
url = url + ";user=" + metadataConn.getUsername() + ";password=" + metadataConn.getPassword();
|
||||
} else if (!url.contains(";AuthMech=3;UID=")) {
|
||||
url = url + ";AuthMech=3;UID=" + metadataConn.getUsername() + ";PWD=" + metadataConn.getPassword();
|
||||
}
|
||||
|
||||
|
||||
metadataConn.setUrl(url);
|
||||
}
|
||||
|
||||
|
||||
|
||||
String connURL = metadataConn.getUrl();
|
||||
String username = metadataConn.getUsername();
|
||||
String password = metadataConn.getPassword();
|
||||
|
||||
String password = metadataConn.getPassword();
|
||||
|
||||
// 1. Get class loader.
|
||||
ClassLoader currClassLoader = Thread.currentThread().getContextClassLoader();
|
||||
ClassLoader impalaClassLoader = getClassLoader(metadataConn);
|
||||
@@ -98,35 +97,43 @@ public class ImpalaConnectionManager extends DataBaseConnectionManager {
|
||||
String driverClass = EDatabase4DriverClassName.IMPALA.getDriverClass();
|
||||
|
||||
Map<String, Object> otherParametersMap = metadataConn.getOtherParameters();
|
||||
Object userGroupInformation = null;
|
||||
boolean useKerberos = false;
|
||||
boolean useKeytab = false;
|
||||
if (otherParametersMap != null) {
|
||||
if (Boolean.valueOf((String) otherParametersMap.get(ConnParameterKeys.CONN_PARA_KEY_USE_KRB))) {
|
||||
if (Boolean.valueOf((String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_USEKEYTAB))) {
|
||||
|
||||
// driver
|
||||
Object driverObj = otherParametersMap.get(ConnParameterKeys.IMPALA_DRIVER);
|
||||
String driverType = null;
|
||||
if (driverObj != null) {
|
||||
driverType = String.valueOf(driverObj);
|
||||
}
|
||||
|
||||
useKerberos = Boolean.valueOf((String) otherParametersMap.get(ConnParameterKeys.CONN_PARA_KEY_USE_KRB));
|
||||
if (useKerberos) {
|
||||
// Set hadoop.security.authentication to Kerberos
|
||||
Object conf = Class.forName("org.apache.hadoop.conf.Configuration", true, impalaClassLoader) //$NON-NLS-1$
|
||||
.newInstance();
|
||||
EHadoopConfProperties.AUTHENTICATION.set(conf, "KERBEROS"); //$NON-NLS-1$
|
||||
ReflectionUtils.invokeStaticMethod("org.apache.hadoop.security.UserGroupInformation", //$NON-NLS-1$
|
||||
impalaClassLoader, "setConfiguration", new Object[] { conf }); //$NON-NLS-1$
|
||||
|
||||
useKeytab = Boolean.valueOf((String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_USEKEYTAB));
|
||||
if (useKeytab) {
|
||||
// Login user using keytab
|
||||
String principal = (String) metadataConn
|
||||
.getParameter(ConnParameterKeys.CONN_PARA_KEY_KEYTAB_PRINCIPAL);
|
||||
String keytabPath = (String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_KEYTAB);
|
||||
try {
|
||||
ReflectionUtils.invokeStaticMethod("org.apache.hadoop.security.UserGroupInformation", //$NON-NLS-1$
|
||||
impalaClassLoader, "loginUserFromKeytab", new String[] { principal, keytabPath });
|
||||
userGroupInformation = ReflectionUtils.invokeStaticMethod("org.apache.hadoop.security.UserGroupInformation", //$NON-NLS-1$
|
||||
impalaClassLoader, "loginUserFromKeytabAndReturnUGI", new String[] { principal, keytabPath }); //$NON-NLS-1$
|
||||
} catch (Exception e) {
|
||||
throw new SQLException(e);
|
||||
}
|
||||
} else {
|
||||
Object conf = Class.forName("org.apache.hadoop.conf.Configuration", true, impalaClassLoader) //$NON-NLS-1$
|
||||
.newInstance();
|
||||
EHadoopConfProperties.AUTHENTICATION.set(conf, "KERBEROS"); //$NON-NLS-1$
|
||||
ReflectionUtils.invokeStaticMethod("org.apache.hadoop.security.UserGroupInformation", //$NON-NLS-1$
|
||||
impalaClassLoader, "setConfiguration", new Object[] { conf }); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
IHadoopDistributionService hadoopService = getHadoopDistributionService();
|
||||
if ((hadoopService != null)) {
|
||||
// driver
|
||||
Object driverObj = otherParametersMap.get(ConnParameterKeys.IMPALA_DRIVER);
|
||||
String driverType = null;
|
||||
String impalaDriver = null;
|
||||
if (driverObj != null) {
|
||||
driverType = String.valueOf(driverObj);
|
||||
}
|
||||
// distribution
|
||||
Object distObj = otherParametersMap.get(ConnParameterKeys.CONN_PARA_KEY_IMPALA_DISTRIBUTION);
|
||||
String distribution = null;
|
||||
@@ -163,12 +170,25 @@ public class ImpalaConnectionManager extends DataBaseConnectionManager {
|
||||
Properties info = new Properties();
|
||||
username = username != null ? username : ""; //$NON-NLS-1$
|
||||
password = password != null ? password : "";//$NON-NLS-1$
|
||||
|
||||
|
||||
// info.setProperty("user", username);//$NON-NLS-1$
|
||||
// info.setProperty("password", password);//$NON-NLS-1$
|
||||
|
||||
conn = hiveDriver.connect(connURL, info);
|
||||
|
||||
if (!useKeytab) {
|
||||
conn = hiveDriver.connect(connURL, info);
|
||||
} else {
|
||||
PrivilegedExceptionAction<Object> privilegedExceptionAction = new java.security.PrivilegedExceptionAction<Object>() {
|
||||
@Override
|
||||
public Object run() {
|
||||
java.sql.Connection con = null;
|
||||
|
||||
try {
|
||||
con = hiveDriver.connect(connURL, info);
|
||||
} catch (java.sql.SQLException e) {
|
||||
CommonExceptionHandler.process(e);
|
||||
}
|
||||
return con;
|
||||
}
|
||||
};
|
||||
conn = (Connection) ReflectionUtils.invokeMethod(userGroupInformation, "doAs", new Object[] {privilegedExceptionAction}, PrivilegedExceptionAction.class ); //$NON-NLS-1$
|
||||
}
|
||||
} finally {
|
||||
Thread.currentThread().setContextClassLoader(currClassLoader);
|
||||
}
|
||||
@@ -240,7 +260,7 @@ public class ImpalaConnectionManager extends DataBaseConnectionManager {
|
||||
|
||||
private IHadoopDistributionService getHadoopDistributionService() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopDistributionService.class)) {
|
||||
return (IHadoopDistributionService) GlobalServiceRegister.getDefault().getService(IHadoopDistributionService.class);
|
||||
return GlobalServiceRegister.getDefault().getService(IHadoopDistributionService.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,197 +1,198 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
|
||||
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.talend.model/src/main/java" modelPluginID="org.talend.model"
|
||||
redirection="" modelName="TalendFile" importerID="org.eclipse.emf.importer.ecore">
|
||||
<foreignModel>TalendFile.ecore</foreignModel>
|
||||
<genPackages prefix="TalendFile" basePackage="org.talend.designer.core.model.utils.emf"
|
||||
resource="XML" disposableProviderFactory="true" ecorePackage="TalendFile.ecore#/">
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ColumnType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/comment"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/defaultValue"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/key"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/length"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/name"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/nullable"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/originalDbColumnName"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/pattern"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/precision"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/sourceType"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/type"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/relatedEntity"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/relationshipType"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/originalLength"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ColumnType/additionalField"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/usefulColumn"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ConnectionType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ConnectionType/elementParameter"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/connectorName"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/label"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/lineStyle"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/mergeOrder"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/metaname"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/offsetLabelX"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/offsetLabelY"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/outputId"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/source"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/target"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ContextParameterType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/comment"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/name"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/prompt"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/promptNeeded"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/repositoryContextId"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/type"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/value"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/internalId"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ContextType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ContextType/contextParameter"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextType/confirmationNeeded"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextType/name"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//DocumentRoot">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute TalendFile.ecore#//DocumentRoot/mixed"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/xMLNSPrefixMap"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/xSISchemaLocation"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/connection"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/context"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/elementParameter"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/node"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/note"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/parameters"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/process"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/required"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/subjob"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ElementParameterType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ElementParameterType/elementValue"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementParameterType/field"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementParameterType/name"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementParameterType/value"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementParameterType/contextMode"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementParameterType/show"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ElementValueType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementValueType/elementRef"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementValueType/value"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementValueType/type"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementValueType/hexValue"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//JobType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//JobType/context"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//JobType/name"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//LogsType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//LogsType/logToFile"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//LogsType/logToDatabase"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//LogsType/logToStdOut"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//LogToDatabaseType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToDatabaseType/database"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToDatabaseType/level"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToDatabaseType/selected"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//LogToFileType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToFileType/filename"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToFileType/level"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToFileType/selected"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//LogToStdOutType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToStdOutType/level"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToStdOutType/selected"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//MetadataType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//MetadataType/column"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//MetadataType/comment"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//MetadataType/connector"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//MetadataType/label"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//MetadataType/name"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//MetadataType/source"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//MetadataType/type"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//MetadataType/additionalProperties"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//NodeType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//NodeType/elementParameter"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//NodeType/metadata"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/binaryData"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/stringData"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/componentName"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/componentVersion"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/offsetLabelX"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/offsetLabelY"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/posX"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/posY"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/sizeX"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/sizeY"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/screenshot"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference TalendFile.ecore#//NodeType/nodeData"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//NodeType/nodeContainer"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//NoteType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NoteType/opaque"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NoteType/posX"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NoteType/posY"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NoteType/sizeHeight"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NoteType/sizeWidth"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NoteType/text"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference TalendFile.ecore#//NoteType/elementParameter"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ParametersType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ParametersType/elementParameter"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ParametersType/routinesParameter"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ProcessType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/description"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/required"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/context"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/parameters"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/node"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/connection"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/note"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/logs"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/author"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/comment"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/defaultContext"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/name"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/purpose"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/repositoryContextId"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/status"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/version"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/subjob"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/screenshot"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/screenshots"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/routinesDependencies"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/jobType"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/framework"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//RequiredType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//RequiredType/job"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//SubjobType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//SubjobType/elementParameter"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ItemInforType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ItemInforType/idOrName"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ItemInforType/system"/>
|
||||
</genClasses>
|
||||
<genClasses image="false" ecoreClass="TalendFile.ecore#//AbstractExternalData"/>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//RoutinesParameterType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//RoutinesParameterType/id"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//RoutinesParameterType/name"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//RoutinesParameterType/type"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//NodeContainerType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//NodeContainerType/elementParameter"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ScreenshotsMap">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ScreenshotsMap/key"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ScreenshotsMap/value"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//AdditionalFieldMap">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//AdditionalFieldMap/key"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//AdditionalFieldMap/value"/>
|
||||
</genClasses>
|
||||
</genPackages>
|
||||
</genmodel:GenModel>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
|
||||
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.talend.model/src/main/java" modelPluginID="org.talend.model"
|
||||
redirection="" modelName="TalendFile" importerID="org.eclipse.emf.importer.ecore">
|
||||
<foreignModel>TalendFile.ecore</foreignModel>
|
||||
<genPackages prefix="TalendFile" basePackage="org.talend.designer.core.model.utils.emf"
|
||||
resource="XML" disposableProviderFactory="true" ecorePackage="TalendFile.ecore#/">
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ColumnType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/comment"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/defaultValue"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/key"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/length"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/name"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/nullable"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/originalDbColumnName"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/pattern"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/precision"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/sourceType"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/type"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/relatedEntity"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/relationshipType"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/originalLength"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ColumnType/additionalField"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ColumnType/usefulColumn"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ConnectionType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ConnectionType/elementParameter"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/connectorName"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/label"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/lineStyle"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/mergeOrder"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/metaname"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/offsetLabelX"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/offsetLabelY"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/outputId"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/source"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ConnectionType/target"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ContextParameterType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/comment"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/name"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/prompt"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/promptNeeded"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/repositoryContextId"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/type"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/value"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextParameterType/internalId"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ContextType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ContextType/contextParameter"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextType/confirmationNeeded"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ContextType/name"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//DocumentRoot">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute TalendFile.ecore#//DocumentRoot/mixed"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/xMLNSPrefixMap"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/xSISchemaLocation"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/connection"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/context"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/elementParameter"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/node"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/note"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/parameters"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/process"/>
|
||||
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/required"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//DocumentRoot/subjob"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ElementParameterType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ElementParameterType/elementValue"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementParameterType/field"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementParameterType/name"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementParameterType/value"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementParameterType/contextMode"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementParameterType/show"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ElementValueType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementValueType/elementRef"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementValueType/value"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementValueType/type"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementValueType/hexValue"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ElementValueType/label"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//JobType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//JobType/context"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//JobType/name"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//LogsType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//LogsType/logToFile"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//LogsType/logToDatabase"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//LogsType/logToStdOut"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//LogToDatabaseType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToDatabaseType/database"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToDatabaseType/level"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToDatabaseType/selected"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//LogToFileType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToFileType/filename"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToFileType/level"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToFileType/selected"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//LogToStdOutType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToStdOutType/level"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//LogToStdOutType/selected"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//MetadataType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//MetadataType/column"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//MetadataType/comment"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//MetadataType/connector"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//MetadataType/label"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//MetadataType/name"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//MetadataType/source"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//MetadataType/type"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//MetadataType/additionalProperties"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//NodeType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//NodeType/elementParameter"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//NodeType/metadata"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/binaryData"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/stringData"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/componentName"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/componentVersion"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/offsetLabelX"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/offsetLabelY"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/posX"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/posY"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/sizeX"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/sizeY"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NodeType/screenshot"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference TalendFile.ecore#//NodeType/nodeData"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//NodeType/nodeContainer"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//NoteType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NoteType/opaque"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NoteType/posX"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NoteType/posY"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NoteType/sizeHeight"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NoteType/sizeWidth"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//NoteType/text"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference TalendFile.ecore#//NoteType/elementParameter"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ParametersType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ParametersType/elementParameter"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ParametersType/routinesParameter"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ProcessType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/description"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/required"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/context"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/parameters"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/node"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/connection"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/note"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/logs"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/author"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/comment"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/defaultContext"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/name"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/purpose"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/repositoryContextId"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/status"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/version"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/subjob"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/screenshot"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/screenshots"/>
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference TalendFile.ecore#//ProcessType/routinesDependencies"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/jobType"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ProcessType/framework"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//RequiredType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//RequiredType/job"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//SubjobType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//SubjobType/elementParameter"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ItemInforType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ItemInforType/idOrName"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ItemInforType/system"/>
|
||||
</genClasses>
|
||||
<genClasses image="false" ecoreClass="TalendFile.ecore#//AbstractExternalData"/>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//RoutinesParameterType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//RoutinesParameterType/id"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//RoutinesParameterType/name"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//RoutinesParameterType/type"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//NodeContainerType">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TalendFile.ecore#//NodeContainerType/elementParameter"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//ScreenshotsMap">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ScreenshotsMap/key"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//ScreenshotsMap/value"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TalendFile.ecore#//AdditionalFieldMap">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//AdditionalFieldMap/key"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TalendFile.ecore#//AdditionalFieldMap/value"/>
|
||||
</genClasses>
|
||||
</genPackages>
|
||||
</genmodel:GenModel>
|
||||
|
||||
@@ -143,4 +143,26 @@ public interface ElementValueType extends EObject {
|
||||
*/
|
||||
void setHexValue(boolean value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Label</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Label</em>' attribute.
|
||||
* @see #setLabel(String)
|
||||
* @see org.talend.designer.core.model.utils.emf.talendfile.TalendFilePackage#getElementValueType_Label()
|
||||
* @model dataType="org.eclipse.emf.ecore.xml.type.String"
|
||||
* @generated
|
||||
*/
|
||||
String getLabel();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.talend.designer.core.model.utils.emf.talendfile.ElementValueType#getLabel <em>Label</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Label</em>' attribute.
|
||||
* @see #getLabel()
|
||||
* @generated
|
||||
*/
|
||||
void setLabel(String value);
|
||||
|
||||
} // ElementValueType
|
||||
@@ -724,6 +724,15 @@ public interface TalendFilePackage extends EPackage {
|
||||
*/
|
||||
int ELEMENT_VALUE_TYPE__HEX_VALUE = 3;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Label</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int ELEMENT_VALUE_TYPE__LABEL = 4;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Element Value Type</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
@@ -731,7 +740,7 @@ public interface TalendFilePackage extends EPackage {
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int ELEMENT_VALUE_TYPE_FEATURE_COUNT = 4;
|
||||
int ELEMENT_VALUE_TYPE_FEATURE_COUNT = 5;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.talend.designer.core.model.utils.emf.talendfile.impl.JobTypeImpl <em>Job Type</em>}' class.
|
||||
@@ -2521,6 +2530,17 @@ public interface TalendFilePackage extends EPackage {
|
||||
*/
|
||||
EAttribute getElementValueType_HexValue();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.talend.designer.core.model.utils.emf.talendfile.ElementValueType#getLabel <em>Label</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute '<em>Label</em>'.
|
||||
* @see org.talend.designer.core.model.utils.emf.talendfile.ElementValueType#getLabel()
|
||||
* @see #getElementValueType()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getElementValueType_Label();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.talend.designer.core.model.utils.emf.talendfile.JobType <em>Job Type</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
@@ -4148,6 +4168,14 @@ public interface TalendFilePackage extends EPackage {
|
||||
*/
|
||||
EAttribute ELEMENT_VALUE_TYPE__HEX_VALUE = eINSTANCE.getElementValueType_HexValue();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Label</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute ELEMENT_VALUE_TYPE__LABEL = eINSTANCE.getElementValueType_Label();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.talend.designer.core.model.utils.emf.talendfile.impl.JobTypeImpl <em>Job Type</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
|
||||
@@ -110,6 +110,26 @@ public class ElementValueTypeImpl extends EObjectImpl implements ElementValueTyp
|
||||
*/
|
||||
protected boolean hexValue = HEX_VALUE_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getLabel() <em>Label</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getLabel()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String LABEL_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getLabel() <em>Label</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getLabel()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String label = LABEL_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc --> <!-- end-user-doc -->
|
||||
* @generated
|
||||
@@ -225,6 +245,27 @@ public class ElementValueTypeImpl extends EObjectImpl implements ElementValueTyp
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, TalendFilePackage.ELEMENT_VALUE_TYPE__HEX_VALUE, oldHexValue, hexValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setLabel(String newLabel) {
|
||||
String oldLabel = label;
|
||||
label = newLabel;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, TalendFilePackage.ELEMENT_VALUE_TYPE__LABEL, oldLabel, label));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc --> <!-- end-user-doc -->
|
||||
* @generated
|
||||
@@ -239,6 +280,8 @@ public class ElementValueTypeImpl extends EObjectImpl implements ElementValueTyp
|
||||
return getType();
|
||||
case TalendFilePackage.ELEMENT_VALUE_TYPE__HEX_VALUE:
|
||||
return isHexValue() ? Boolean.TRUE : Boolean.FALSE;
|
||||
case TalendFilePackage.ELEMENT_VALUE_TYPE__LABEL:
|
||||
return getLabel();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
@@ -261,6 +304,9 @@ public class ElementValueTypeImpl extends EObjectImpl implements ElementValueTyp
|
||||
case TalendFilePackage.ELEMENT_VALUE_TYPE__HEX_VALUE:
|
||||
setHexValue(((Boolean)newValue).booleanValue());
|
||||
return;
|
||||
case TalendFilePackage.ELEMENT_VALUE_TYPE__LABEL:
|
||||
setLabel((String)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
@@ -283,6 +329,9 @@ public class ElementValueTypeImpl extends EObjectImpl implements ElementValueTyp
|
||||
case TalendFilePackage.ELEMENT_VALUE_TYPE__HEX_VALUE:
|
||||
setHexValue(HEX_VALUE_EDEFAULT);
|
||||
return;
|
||||
case TalendFilePackage.ELEMENT_VALUE_TYPE__LABEL:
|
||||
setLabel(LABEL_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
@@ -301,6 +350,8 @@ public class ElementValueTypeImpl extends EObjectImpl implements ElementValueTyp
|
||||
return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
|
||||
case TalendFilePackage.ELEMENT_VALUE_TYPE__HEX_VALUE:
|
||||
return hexValue != HEX_VALUE_EDEFAULT;
|
||||
case TalendFilePackage.ELEMENT_VALUE_TYPE__LABEL:
|
||||
return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label);
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
@@ -321,6 +372,8 @@ public class ElementValueTypeImpl extends EObjectImpl implements ElementValueTyp
|
||||
result.append(type);
|
||||
result.append(", hexValue: ");
|
||||
result.append(hexValue);
|
||||
result.append(", label: ");
|
||||
result.append(label);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
@@ -802,6 +802,15 @@ public class TalendFilePackageImpl extends EPackageImpl implements TalendFilePac
|
||||
return (EAttribute)elementValueTypeEClass.getEStructuralFeatures().get(3);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getElementValueType_Label() {
|
||||
return (EAttribute)elementValueTypeEClass.getEStructuralFeatures().get(4);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc --> <!-- end-user-doc -->
|
||||
* @generated
|
||||
@@ -1692,6 +1701,7 @@ public class TalendFilePackageImpl extends EPackageImpl implements TalendFilePac
|
||||
createEAttribute(elementValueTypeEClass, ELEMENT_VALUE_TYPE__VALUE);
|
||||
createEAttribute(elementValueTypeEClass, ELEMENT_VALUE_TYPE__TYPE);
|
||||
createEAttribute(elementValueTypeEClass, ELEMENT_VALUE_TYPE__HEX_VALUE);
|
||||
createEAttribute(elementValueTypeEClass, ELEMENT_VALUE_TYPE__LABEL);
|
||||
|
||||
jobTypeEClass = createEClass(JOB_TYPE);
|
||||
createEAttribute(jobTypeEClass, JOB_TYPE__CONTEXT);
|
||||
@@ -1909,6 +1919,7 @@ public class TalendFilePackageImpl extends EPackageImpl implements TalendFilePac
|
||||
initEAttribute(getElementValueType_Value(), theXMLTypePackage.getString(), "value", null, 0, 1, ElementValueType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getElementValueType_Type(), theXMLTypePackage.getString(), "type", null, 0, 1, ElementValueType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getElementValueType_HexValue(), theXMLTypePackage.getBoolean(), "hexValue", "false", 0, 1, ElementValueType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getElementValueType_Label(), theXMLTypePackage.getString(), "label", null, 0, 1, ElementValueType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(jobTypeEClass, JobType.class, "JobType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getJobType_Context(), theXMLTypePackage.getString(), "context", null, 0, 1, JobType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
@@ -17,4 +17,8 @@ public interface ElementValueTypeValidator {
|
||||
boolean validateElementRef(String value);
|
||||
boolean validateValue(String value);
|
||||
boolean validateType(String value);
|
||||
|
||||
boolean validateHexValue(boolean value);
|
||||
|
||||
boolean validateLabel(String value);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.eclipse.ui.internal.intro.impl.model.loader.IntroContentParser;
|
||||
import org.eclipse.ui.intro.config.IIntroContentProviderSite;
|
||||
import org.eclipse.ui.intro.config.IIntroXHTMLContentProvider;
|
||||
import org.talend.commons.ui.html.TalendHtmlModelUtil;
|
||||
import org.talend.core.ui.branding.IBrandingService;
|
||||
import org.talend.core.service.IRemoteService;
|
||||
import org.talend.core.ui.branding.StartingConstants;
|
||||
import org.talend.registration.RegistrationPlugin;
|
||||
import org.talend.registration.i18n.Messages;
|
||||
@@ -67,10 +67,10 @@ public class TalendForgeRegistHelper {
|
||||
IntroContentParser parser = new IntroContentParser(result);
|
||||
Document dom = parser.getDocument();
|
||||
if (dom != null) {
|
||||
boolean cloudLicense = IBrandingService.get().isCloudLicense();
|
||||
boolean cloud = IRemoteService.get().isCloudConnection();
|
||||
Element ele = dom.createElement("licensetype");
|
||||
ele.setAttribute("id", "license_cloud");
|
||||
ele.setAttribute("isCloud",""+cloudLicense);
|
||||
ele.setAttribute("isCloud",""+cloud);
|
||||
dom.getDocumentElement().appendChild(ele);
|
||||
resolveInternationalization(dom);
|
||||
resolveDynamicContent(dom, null);
|
||||
|
||||
@@ -12,17 +12,17 @@
|
||||
// ============================================================================
|
||||
package org.talend.repository.items.importexport.handlers;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.runtime.FileLocator;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
@@ -115,10 +115,17 @@ public final class HandlerUtil {
|
||||
return;
|
||||
}
|
||||
// for migration task ,there is not .screeenshot file in preceding version - begin
|
||||
os = new FileOutputStream(fileURL.getFile());
|
||||
manager.getPaths().iterator().next();
|
||||
is = manager.getStream(screenshotNeeded, itemRecord);
|
||||
FileCopyUtils.copyStreams(is, os);
|
||||
String protocol = fileURL.getProtocol();
|
||||
String filePath = fileURL.toString();
|
||||
if(StringUtils.isNoneEmpty(protocol) && protocol.equalsIgnoreCase("file")) {
|
||||
filePath = filePath.replaceFirst("file://", "").replaceFirst("file:/", "").replaceFirst("file:", "");
|
||||
}
|
||||
if(new File(filePath).exists()) {
|
||||
os = new FileOutputStream(filePath);
|
||||
manager.getPaths().iterator().next();
|
||||
is = manager.getStream(screenshotNeeded, itemRecord);
|
||||
FileCopyUtils.copyStreams(is, os);
|
||||
}
|
||||
} finally {
|
||||
if (os != null) {
|
||||
os.close();
|
||||
|
||||
Binary file not shown.
@@ -1,19 +1,182 @@
|
||||
package org.talend.core.model.metadata;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.talend.commons.exception.SystemException;
|
||||
import org.talend.commons.utils.generation.JavaUtils;
|
||||
import org.talend.commons.utils.workbench.resources.ResourceUtils;
|
||||
import org.talend.core.runtime.process.ITalendProcessJavaProject;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
|
||||
public class MetadataTalendTypeTest {
|
||||
|
||||
private ITalendProcessJavaProject talendProcessJavaProject;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
if (IRunProcessService.get() != null) {
|
||||
IRunProcessService runProcessService = IRunProcessService.get();
|
||||
talendProcessJavaProject = runProcessService.getTempJavaProject();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetProjectForderURLOfMappingsFile() throws SystemException {
|
||||
URL url = MetadataTalendType.getProjectForderURLOfMappingsFile();
|
||||
URL url = MetadataTalendType.getProjectFolderURLOfMappingsFile();
|
||||
String projectLabel = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();
|
||||
assertTrue(url.getFile().endsWith(projectLabel + "/.settings/mappings/"));
|
||||
assertTrue(StringUtils.removeEnd(url.getFile(), "/").endsWith(projectLabel + "/.settings/mappings"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRestoreMappingFiles() throws Exception {
|
||||
IFolder projectMappingFolder = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject())
|
||||
.getFolder(MetadataTalendType.PROJECT_MAPPING_FOLDER);
|
||||
if (!projectMappingFolder.exists()) {
|
||||
projectMappingFolder.create(true, true, null);
|
||||
}
|
||||
|
||||
MetadataTalendType.restoreMappingFiles();
|
||||
IFile keep = null;
|
||||
IFile restore = null;
|
||||
IFile externalKeep = null;
|
||||
try {
|
||||
keep = projectMappingFolder.getFile("mapping_Access.xml");
|
||||
if (keep.exists()) {
|
||||
keep.delete(true, null);
|
||||
}
|
||||
keep.create(new ByteArrayInputStream("test1".getBytes()), true, null);
|
||||
String keepSha1_before = MetadataTalendType.getSha1OfFile(keep.getLocation().toFile());
|
||||
|
||||
restore = projectMappingFolder.getFile("mapping_Firebird.xml");
|
||||
if (restore.exists()) {
|
||||
restore.delete(true, null);
|
||||
}
|
||||
restore.create(new ByteArrayInputStream(Files.readAllBytes(
|
||||
new File(MetadataTalendType.getSystemFolderURLOfMappingsFile().getFile(), restore.getName()).toPath())), true,
|
||||
null);
|
||||
|
||||
externalKeep = projectMappingFolder.getFile("mapping_ExternalTest.xml");
|
||||
if (externalKeep.exists()) {
|
||||
externalKeep.delete(true, null);
|
||||
}
|
||||
externalKeep.create(new ByteArrayInputStream("test2".getBytes()), true, null);
|
||||
String externalKeepSha1_before = MetadataTalendType.getSha1OfFile(externalKeep.getLocation().toFile());
|
||||
|
||||
MetadataTalendType.restoreMappingFiles();
|
||||
|
||||
// kept
|
||||
assertTrue(keep.getLocation().toFile().exists());
|
||||
String keepSha1_after = MetadataTalendType.getSha1OfFile(keep.getLocation().toFile());
|
||||
assertEquals(keepSha1_before, keepSha1_after);
|
||||
|
||||
// restored(migration)
|
||||
assertFalse(restore.getLocation().toFile().exists());
|
||||
|
||||
// not impacted
|
||||
assertTrue(externalKeep.getLocation().toFile().exists());
|
||||
String externalKeepSha1_after = MetadataTalendType.getSha1OfFile(externalKeep.getLocation().toFile());
|
||||
assertEquals(externalKeepSha1_before, externalKeepSha1_after);
|
||||
} finally {
|
||||
if (keep != null && keep.getLocation().toFile().exists()) {
|
||||
keep.getLocation().toFile().delete();
|
||||
}
|
||||
if (restore != null && restore.getLocation().toFile().exists()) {
|
||||
restore.getLocation().toFile().delete();
|
||||
}
|
||||
if (externalKeep != null && externalKeep.getLocation().toFile().exists()) {
|
||||
externalKeep.getLocation().toFile().delete();
|
||||
}
|
||||
projectMappingFolder.refreshLocal(IResource.DEPTH_ONE, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSyncMappingFilesToTempMappingFolder() throws Exception {
|
||||
boolean renamed = false;
|
||||
List<File> workingMappingFiles = MetadataTalendType.getWorkingMappingFiles();
|
||||
IProject project = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject());
|
||||
IFolder tmpMappingFolder = ResourceUtils.getFolder(project,
|
||||
RepositoryConstants.TEMP_DIRECTORY + "/" + MetadataTalendType.INTERNAL_MAPPINGS_FOLDER, false);
|
||||
|
||||
MetadataTalendType.getProjectTempMappingFolder();
|
||||
|
||||
modifyTargetFolder(tmpMappingFolder, renamed);
|
||||
|
||||
MetadataTalendType.getProjectTempMappingFolder();
|
||||
|
||||
List<File> tmpMappingFiles = Arrays.asList(tmpMappingFolder.getLocation().toFile()
|
||||
.listFiles(f -> f.getName().matches(MetadataTalendType.MAPPING_FILE_PATTERN)));
|
||||
validateConsistence(workingMappingFiles, tmpMappingFiles, renamed);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSyncMappingFilesToJobProjectMappingFolder() throws Exception {
|
||||
boolean renamed = true;
|
||||
|
||||
List<File> workingMappingFiles = MetadataTalendType.getWorkingMappingFiles();
|
||||
IFolder jobProjectMappingFolder = talendProcessJavaProject.getResourceSubFolder(null, JavaUtils.JAVA_XML_MAPPING);
|
||||
|
||||
MetadataTalendType.syncMappingFiles(jobProjectMappingFolder.getLocation().toFile(), renamed);
|
||||
|
||||
modifyTargetFolder(jobProjectMappingFolder, renamed);
|
||||
|
||||
MetadataTalendType.syncMappingFiles(jobProjectMappingFolder.getLocation().toFile(), renamed);
|
||||
|
||||
List<File> jobMappingFiles = Arrays.asList(jobProjectMappingFolder.getLocation().toFile()
|
||||
.listFiles(f -> f.getName().matches(MetadataTalendType.MAPPING_FILE_PATTERN)));
|
||||
validateConsistence(workingMappingFiles, jobMappingFiles, renamed);
|
||||
}
|
||||
|
||||
private void modifyTargetFolder(IFolder folder, boolean renamed) throws CoreException {
|
||||
folder.refreshLocal(IResource.DEPTH_ONE, null);
|
||||
String fileName1 = "mapping_Access.xml";
|
||||
IFile file1 = folder.getFile(renamed ? fileName1.toLowerCase() : fileName1);
|
||||
assertTrue(file1.getLocation().toFile().exists());
|
||||
file1.delete(true, null);
|
||||
String fileName2 = "mapping_AS400.xml";
|
||||
IFile file2 = folder.getFile(renamed ? fileName2.toLowerCase() : fileName2);
|
||||
assertTrue(file2.getLocation().toFile().exists());
|
||||
String content = "test modification";
|
||||
InputStream in = new ByteArrayInputStream(content.getBytes());
|
||||
file2.setContents(in, true, false, null);
|
||||
}
|
||||
|
||||
private void validateConsistence(List<File> sources, List<File> targets, boolean renamed) throws IOException {
|
||||
assertEquals(sources.size(), targets.size());
|
||||
for (File source : sources) {
|
||||
boolean isFound = false;
|
||||
String sourceSha1 = MetadataTalendType.getSha1OfFile(source);
|
||||
String sourceFileName = MetadataTalendType.getTargetName(source, renamed);
|
||||
for (File target : targets) {
|
||||
if (target.getName().equals(sourceFileName)) {
|
||||
isFound = true;
|
||||
String targetSha1 = MetadataTalendType.getSha1OfFile(target);
|
||||
assertEquals(sourceSha1, targetSha1);
|
||||
}
|
||||
}
|
||||
assertTrue(isFound);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
package org.talend.core;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
@@ -15,38 +12,16 @@ import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.junit.Before;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Test;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.talend.commons.runtime.xml.XmlUtil;
|
||||
import org.talend.commons.utils.generation.JavaUtils;
|
||||
import org.talend.commons.utils.workbench.resources.ResourceUtils;
|
||||
import org.talend.core.model.metadata.MetadataTalendType;
|
||||
import org.talend.core.runtime.process.ITalendProcessJavaProject;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.utils.io.FilesUtils;
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class CoreServiceTest {
|
||||
|
||||
private boolean withFilter = false;
|
||||
|
||||
private CoreService service;
|
||||
|
||||
private ITalendProcessJavaProject talendProcessJavaProject;
|
||||
|
||||
private FilenameFilter filter = new FilenameFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
if (XmlUtil.isXMLFile(name)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
service = new CoreService();
|
||||
@@ -54,45 +29,11 @@ public class CoreServiceTest {
|
||||
IRunProcessService runProcessService = (IRunProcessService) GlobalServiceRegister.getDefault()
|
||||
.getService(IRunProcessService.class);
|
||||
talendProcessJavaProject = runProcessService.getTempJavaProject();
|
||||
//TODO create a temp job code project
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testASyncMappingsFileFromSystemToProject() throws Exception {
|
||||
withFilter = false;
|
||||
|
||||
String sysMappingFolder = MetadataTalendType.getSystemForderURLOfMappingsFile().getPath();
|
||||
IFolder projectMappingFolder = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject())
|
||||
.getFolder(MetadataTalendType.PROJECT_MAPPING_FOLDER);
|
||||
|
||||
service.syncMappingsFileFromSystemToProject();
|
||||
|
||||
modifyTargetFolder(projectMappingFolder);
|
||||
|
||||
service.syncMappingsFileFromSystemToProject();
|
||||
|
||||
validateConsistence(sysMappingFolder, projectMappingFolder.getLocation().toPortableString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBSynchronizeMapptingXML() throws Exception {
|
||||
withFilter = true;
|
||||
|
||||
IFolder resourceMappingFolder = talendProcessJavaProject.getResourceSubFolder(null, JavaUtils.JAVA_XML_MAPPING);
|
||||
String projectMappingFolder = MetadataTalendType.getProjectForderURLOfMappingsFile().getPath();
|
||||
|
||||
service.synchronizeMapptingXML(talendProcessJavaProject);
|
||||
|
||||
modifyTargetFolder(resourceMappingFolder);
|
||||
|
||||
service.synchronizeMapptingXML(talendProcessJavaProject);
|
||||
|
||||
validateConsistence(projectMappingFolder, resourceMappingFolder.getLocation().toPortableString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCSyncLog4jSettings() throws CoreException, IOException {
|
||||
public void testSyncLog4jSettings() throws CoreException, IOException {
|
||||
IRunProcessService runProcessService = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
runProcessService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
|
||||
@@ -144,38 +85,4 @@ public class CoreServiceTest {
|
||||
return log4jStrFromResouce;
|
||||
}
|
||||
|
||||
private void modifyTargetFolder(IFolder folder) throws CoreException {
|
||||
String fileName1 = "mapping_Access.xml";
|
||||
IFile file1 = folder.getFile(withFilter? fileName1.toLowerCase() : fileName1);
|
||||
assertTrue(file1.exists());
|
||||
file1.delete(true, null);
|
||||
String fileName2 = "mapping_AS400.xml";
|
||||
IFile file2 = folder.getFile(withFilter? fileName2.toLowerCase() : fileName2);
|
||||
assertTrue(file2.exists());
|
||||
String content = "test modification";
|
||||
InputStream in = new ByteArrayInputStream(content.getBytes());
|
||||
file2.setContents(in, true, false, null);
|
||||
}
|
||||
|
||||
private void validateConsistence(String folder1, String folder2) throws IOException {
|
||||
File dir1 = new File(folder1);
|
||||
File dir2 = new File(folder2);
|
||||
File[] subFiles1 = withFilter ? dir1.listFiles(filter) : dir1.listFiles();
|
||||
File[] subFiles2 = withFilter ? dir2.listFiles(filter) : dir2.listFiles();
|
||||
assertTrue(subFiles1.length == subFiles2.length);
|
||||
for (File subFile1 : subFiles1) {
|
||||
boolean isFound = false;
|
||||
long file1CRC = FilesUtils.getChecksumAlder32(subFile1);
|
||||
String subFile1Name = withFilter ? service.getTargetName(subFile1) : subFile1.getName();
|
||||
for (File subFile2 : subFiles2) {
|
||||
if (subFile2.getName().equals(subFile1Name)) {
|
||||
isFound = true;
|
||||
long file2CRC = FilesUtils.getChecksumAlder32(subFile2);
|
||||
assertEquals(file1CRC, file2CRC);
|
||||
}
|
||||
}
|
||||
assertTrue(isFound);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user