Compare commits
111 Commits
release/5.
...
release/5.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4763277d7 | ||
|
|
4de1c3f2f1 | ||
|
|
3b47d7e0b8 | ||
|
|
33669a320f | ||
|
|
f3e1b92c26 | ||
|
|
f2b14b91ee | ||
|
|
7ff8f2d1ed | ||
|
|
5431fc5685 | ||
|
|
de25803f39 | ||
|
|
eda7ea395c | ||
|
|
9b21014eca | ||
|
|
27908d5685 | ||
|
|
51b9de0fca | ||
|
|
32832fe0ed | ||
|
|
32c82ea797 | ||
|
|
7e4161247e | ||
|
|
d6414e6816 | ||
|
|
9ab70dfd1c | ||
|
|
ce0f25a5c3 | ||
|
|
5b6cd862b9 | ||
|
|
a65bef85b2 | ||
|
|
99754af73d | ||
|
|
d04f128c1d | ||
|
|
fa43c38a63 | ||
|
|
bba4031ba4 | ||
|
|
a8ba04ae35 | ||
|
|
6183b67ea6 | ||
|
|
e459dd708b | ||
|
|
4c76085231 | ||
|
|
deab443470 | ||
|
|
4a3599b6cd | ||
|
|
b6b72ab915 | ||
|
|
fe72b97ed0 | ||
|
|
75a9c36f5f | ||
|
|
0c49bf0cfa | ||
|
|
1a3bd21da3 | ||
|
|
ee99532e84 | ||
|
|
04e416fd03 | ||
|
|
d479b623c6 | ||
|
|
9c8460622e | ||
|
|
a9c57c068a | ||
|
|
7692febcbf | ||
|
|
bc8286e2f5 | ||
|
|
454a515461 | ||
|
|
9e913fc3a1 | ||
|
|
cdfc86836f | ||
|
|
4889af4b70 | ||
|
|
14c1578a26 | ||
|
|
eb494f4a6c | ||
|
|
ff005fac79 | ||
|
|
3092006bde | ||
|
|
14934700f7 | ||
|
|
759891fc28 | ||
|
|
c096a24596 | ||
|
|
2fff4ac14d | ||
|
|
2d5437279d | ||
|
|
e5a1df7dd7 | ||
|
|
d3ddb570b4 | ||
|
|
6a2a9d9715 | ||
|
|
907b46c69a | ||
|
|
9a84aedf0f | ||
|
|
8952f82d36 | ||
|
|
425ed83de8 | ||
|
|
23ea0794d4 | ||
|
|
94a6c969b5 | ||
|
|
90ed6ec00d | ||
|
|
623b6d6e05 | ||
|
|
97d0d9cbd4 | ||
|
|
0b6469b904 | ||
|
|
4849d950de | ||
|
|
ff091a733b | ||
|
|
fca77eefc1 | ||
|
|
54f6028040 | ||
|
|
740c431e0b | ||
|
|
616b8465b5 | ||
|
|
a603f6a834 | ||
|
|
7dc8696442 | ||
|
|
1f17023c91 | ||
|
|
858c72b176 | ||
|
|
8ce5f93c77 | ||
|
|
347eb94837 | ||
|
|
ea977d32ec | ||
|
|
ce0825268d | ||
|
|
c882ed675c | ||
|
|
cf1d02131f | ||
|
|
4cda5da5d2 | ||
|
|
c55ff396ec | ||
|
|
a3028ef469 | ||
|
|
d743c0a742 | ||
|
|
e567bfa632 | ||
|
|
0cd3d1d0c5 | ||
|
|
47ac256be7 | ||
|
|
b8f2d97133 | ||
|
|
f7737490fb | ||
|
|
bcfe3cb951 | ||
|
|
8acdb1c05e | ||
|
|
fbf8ce3538 | ||
|
|
4d05b4714b | ||
|
|
541155c7df | ||
|
|
542c292570 | ||
|
|
a962ef98cc | ||
|
|
ee919ef45a | ||
|
|
db0f5b6051 | ||
|
|
b510800971 | ||
|
|
b959eba2fd | ||
|
|
953bdcb910 | ||
|
|
edaa839947 | ||
|
|
a4aaa545a8 | ||
|
|
609c0591d2 | ||
|
|
e2117d7a9b | ||
|
|
2579a20734 |
@@ -5,7 +5,7 @@ http://www.talend.com
|
||||

|
||||
|
||||
|
||||
> Contents
|
||||
## Contents
|
||||
|
||||
This repository contains the source files that are common across all Talend Open Studio products. These files must be used together with one or more of the following: [tdi-studio-se](https://github.com/Talend/tdi-studio-se), [tdq-studio-se](https://github.com/Talend/tdq-studio-se), [tmdm-studio-se](https://github.com/Talend/tmdm-studio-se), [tesb-studio-se](https://github.com/Talend/tesb-studio-se) or [tbd-studio-se](https://github.com/Talend/tbd-studio-se).
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ bin.includes = META-INF/,\
|
||||
.,\
|
||||
fakejdbc_driver.jar,\
|
||||
modes/,\
|
||||
talend.properties
|
||||
talend.properties,\
|
||||
dist/
|
||||
jars.compile.order = .,\
|
||||
dist/org.talend.commons.runtime.jar
|
||||
|
||||
@@ -46,8 +46,15 @@ public class PasswordEncryptUtil {
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC ggu Comment method "encryptPassword".
|
||||
*
|
||||
* TDI-30227, should only work for old migration task.
|
||||
*/
|
||||
@Deprecated
|
||||
public static String encryptPassword(String input) throws Exception {
|
||||
if (input == null || input.length() == 0) {
|
||||
if (input == null) {
|
||||
return input;
|
||||
}
|
||||
|
||||
@@ -59,6 +66,25 @@ public class PasswordEncryptUtil {
|
||||
return dec;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC ggu Comment method "encryptPassword".
|
||||
*
|
||||
* TDI-30227, should only work for old migration task.
|
||||
*/
|
||||
@Deprecated
|
||||
public static String decryptPassword(String input) throws Exception, BadPaddingException {
|
||||
if (input == null || input.length() == 0) {
|
||||
return input;
|
||||
}
|
||||
byte[] dec = Base64.decodeBase64(input.getBytes());
|
||||
SecretKey key = getSecretKey();
|
||||
Cipher c = Cipher.getInstance("DES"); //$NON-NLS-1$
|
||||
c.init(Cipher.DECRYPT_MODE, key, secureRandom);
|
||||
byte[] clearByte = c.doFinal(dec);
|
||||
return new String(clearByte);
|
||||
}
|
||||
|
||||
private static SecretKey passwordKey = null;
|
||||
|
||||
private static String CHARSET = "UTF-8";
|
||||
@@ -73,6 +99,11 @@ public class PasswordEncryptUtil {
|
||||
return passwordKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Work for codegen only. and must be same as the routine
|
||||
* "routines.system.PasswordEncryptUtil.encryptPassword(input)".
|
||||
*
|
||||
*/
|
||||
public static String encryptPasswordHex(String input) throws Exception {
|
||||
if (input == null) {
|
||||
return input;
|
||||
@@ -85,24 +116,48 @@ public class PasswordEncryptUtil {
|
||||
return dec;
|
||||
}
|
||||
|
||||
public static String decryptPassword(String input) throws Exception, BadPaddingException {
|
||||
if (input == null || input.length() == 0) {
|
||||
return input;
|
||||
}
|
||||
byte[] dec = Base64.decodeBase64(input.getBytes());
|
||||
SecretKey key = getSecretKey();
|
||||
Cipher c = Cipher.getInstance("DES"); //$NON-NLS-1$
|
||||
c.init(Cipher.DECRYPT_MODE, key, secureRandom);
|
||||
byte[] clearByte = c.doFinal(dec);
|
||||
return new String(clearByte);
|
||||
/**
|
||||
*
|
||||
* DOC ggu Comment method "isPasswordType".
|
||||
*
|
||||
* should match with JavaTypesManager.PASSWORD.getId()
|
||||
*
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public static boolean isPasswordType(String type) {
|
||||
return "Password".equals(type) || "id_Password".equals(type); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
public static boolean isPasswordType(String type) {
|
||||
// should match with JavaTypesManager.PASSWORD.getLabel() and
|
||||
// JavaTypesManager.PASSWORD.getId()
|
||||
if (type == null) {
|
||||
return false;
|
||||
}
|
||||
return type.equals("Password") || type.equals("id_Password"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
/**
|
||||
*
|
||||
* DOC ggu Comment method "isPasswordField".
|
||||
*
|
||||
* should match with the EParameterFieldType.PASSWORD
|
||||
*
|
||||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static boolean isPasswordField(String field) {
|
||||
return "PASSWORD".equals(field); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC ggu Comment method "getPasswordDisplay".
|
||||
*
|
||||
* will be * to dispaly always.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static String getPasswordDisplay(String value) {
|
||||
if (value == null || value.length() == 0) {
|
||||
// always display 4 start characters.
|
||||
return "****"; //$NON-NLS-1$
|
||||
} else {
|
||||
return value.replaceAll(".", "*"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,133 +1,133 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.utils.network;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* ggu class global comment. Detailled comment
|
||||
*/
|
||||
public class NetworkUtil {
|
||||
|
||||
private static final String[] windowsCommand = { "ipconfig", "/all" }; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
private static final String[] linuxCommand = { "/sbin/ifconfig", "-a" }; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
private static final Pattern macPattern = Pattern
|
||||
.compile(".*((:?[0-9a-f]{2}[-:]){5}[0-9a-f]{2}).*", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
|
||||
|
||||
private final static Set<String> getMacAddressList() throws IOException {
|
||||
final Set<String> macAddressList = new HashSet<String>();
|
||||
|
||||
final String os = System.getProperty("os.name"); //$NON-NLS-1$
|
||||
|
||||
final String[] command;
|
||||
if (os.startsWith("Windows")) { //$NON-NLS-1$
|
||||
command = windowsCommand;
|
||||
} else if (os.startsWith("Linux")) { //$NON-NLS-1$
|
||||
command = linuxCommand;
|
||||
} else {
|
||||
throw new IOException("Unknown operating system: " + os); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
final Process process = Runtime.getRuntime().exec(command);
|
||||
// Discard the stderr
|
||||
new Thread() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
InputStream errorStream = process.getErrorStream();
|
||||
while (errorStream.read() != -1) {
|
||||
}
|
||||
errorStream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
|
||||
// Extract the MAC addresses from stdout
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||
for (String line = null; (line = reader.readLine()) != null;) {
|
||||
Matcher matcher = macPattern.matcher(line);
|
||||
if (matcher.matches()) {
|
||||
// macAddressList.add(matcher.group(1));
|
||||
macAddressList.add(matcher.group(1).replaceAll("[-:]", "")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
reader.close();
|
||||
return macAddressList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: should rename as "getFullMacAddresses" later since it takes in fact the concatenation of all mac address.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getMacAddress() {
|
||||
try {
|
||||
Set<String> addressList = getMacAddressList();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
// remove empty mac address
|
||||
addressList.remove("0000000000E0"); //$NON-NLS-1$
|
||||
for (String curMacAddress : addressList) {
|
||||
sb.append(curMacAddress);
|
||||
}
|
||||
return sb.toString();
|
||||
} catch (IOException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isNetworkValid() {
|
||||
|
||||
try {
|
||||
URL url = new URL("http://www.talend.com"); //$NON-NLS-1$
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setConnectTimeout(2000);
|
||||
conn.setReadTimeout(2000);
|
||||
|
||||
conn.setRequestMethod("HEAD"); //$NON-NLS-1$
|
||||
String strMessage = conn.getResponseMessage();
|
||||
if (strMessage.compareTo("Not Found") == 0) { //$NON-NLS-1$
|
||||
return false;
|
||||
}
|
||||
if (strMessage.equals("OK")) { //$NON-NLS-1$
|
||||
return true;
|
||||
}
|
||||
conn.disconnect();
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public final static void main(String[] args) {
|
||||
try {
|
||||
System.out.println(" MAC Address: " + getMacAddress()); //$NON-NLS-1$
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.utils.network;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* ggu class global comment. Detailled comment
|
||||
*/
|
||||
public class NetworkUtil {
|
||||
|
||||
private static final String[] windowsCommand = { "ipconfig", "/all" }; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
private static final String[] linuxCommand = { "/sbin/ifconfig", "-a" }; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
private static final Pattern macPattern = Pattern
|
||||
.compile(".*((:?[0-9a-f]{2}[-:]){5}[0-9a-f]{2}).*", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
|
||||
|
||||
private final static Set<String> getMacAddressList() throws IOException {
|
||||
final Set<String> macAddressList = new HashSet<String>();
|
||||
|
||||
final String os = System.getProperty("os.name"); //$NON-NLS-1$
|
||||
|
||||
final String[] command;
|
||||
if (os.startsWith("Windows")) { //$NON-NLS-1$
|
||||
command = windowsCommand;
|
||||
} else if (os.startsWith("Linux")) { //$NON-NLS-1$
|
||||
command = linuxCommand;
|
||||
} else {
|
||||
throw new IOException("Unknown operating system: " + os); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
final Process process = Runtime.getRuntime().exec(command);
|
||||
// Discard the stderr
|
||||
new Thread() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
InputStream errorStream = process.getErrorStream();
|
||||
while (errorStream.read() != -1) {
|
||||
}
|
||||
errorStream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
|
||||
// Extract the MAC addresses from stdout
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||
for (String line = null; (line = reader.readLine()) != null;) {
|
||||
Matcher matcher = macPattern.matcher(line);
|
||||
if (matcher.matches()) {
|
||||
// macAddressList.add(matcher.group(1));
|
||||
macAddressList.add(matcher.group(1).replaceAll("[-:]", "")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
reader.close();
|
||||
return macAddressList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: should rename as "getFullMacAddresses" later since it takes in fact the concatenation of all mac address.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getMacAddress() {
|
||||
try {
|
||||
Set<String> addressList = getMacAddressList();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
// remove empty mac address
|
||||
addressList.remove("0000000000E0"); //$NON-NLS-1$
|
||||
for (String curMacAddress : addressList) {
|
||||
sb.append(curMacAddress);
|
||||
}
|
||||
return sb.toString();
|
||||
} catch (IOException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isNetworkValid() {
|
||||
|
||||
try {
|
||||
URL url = new URL("http://www.talend.com"); //$NON-NLS-1$
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setConnectTimeout(4000);
|
||||
conn.setReadTimeout(4000);
|
||||
|
||||
conn.setRequestMethod("HEAD"); //$NON-NLS-1$
|
||||
String strMessage = conn.getResponseMessage();
|
||||
if (strMessage.compareTo("Not Found") == 0) { //$NON-NLS-1$
|
||||
return false;
|
||||
}
|
||||
if (strMessage.equals("OK")) { //$NON-NLS-1$
|
||||
return true;
|
||||
}
|
||||
conn.disconnect();
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public final static void main(String[] args) {
|
||||
try {
|
||||
System.out.println(" MAC Address: " + getMacAddress()); //$NON-NLS-1$
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,9 +28,11 @@ public class ResourceUtil {
|
||||
|
||||
private static final String BUNDLERESOURCE = "bundleresource"; //$NON-NLS-1$
|
||||
|
||||
private static final String BUNDLEENTRY = "bundleentry"; //$NON-NLS-1$
|
||||
|
||||
public static File convertResourceToFile(URL resource) throws IOException, URISyntaxException {
|
||||
File fileDir = null;
|
||||
if (BUNDLERESOURCE.equals(resource.getProtocol())) {
|
||||
if (BUNDLERESOURCE.equals(resource.getProtocol()) || BUNDLEENTRY.equals(resource.getProtocol())) {
|
||||
URL unescapedURL = FileLocator.toFileURL(resource);
|
||||
URI escapedURI = new URI(unescapedURL.getProtocol(), unescapedURL.getPath(), unescapedURL.getQuery());
|
||||
fileDir = URIUtil.toFile(escapedURI);
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.commons.ui.utils.workbench.preferences;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.eclipse.jface.preference.IPreferenceNode;
|
||||
import org.eclipse.jface.preference.PreferenceManager;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
/**
|
||||
* created by ggu on Sep 25, 2014 Detailled comment
|
||||
*
|
||||
*/
|
||||
public class PreferencesHelper {
|
||||
|
||||
public static boolean removePage(String prefId) {
|
||||
return removePages(new String[] { prefId });
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Use the BFS(Breadth First Search) to remove the preferences ids.
|
||||
*/
|
||||
public static boolean removePages(String[] prefIds) {
|
||||
if (prefIds == null || prefIds.length == 0) {
|
||||
return false;
|
||||
}
|
||||
PreferenceManager preferenceManager = PlatformUI.getWorkbench().getPreferenceManager();
|
||||
|
||||
List<String> removedIds = new ArrayList<String>();
|
||||
IPreferenceNode[] rootSubNodes = preferenceManager.getRootSubNodes();
|
||||
for (IPreferenceNode node : rootSubNodes) {
|
||||
String id = node.getId();
|
||||
if (ArrayUtils.contains(prefIds, id)) {
|
||||
preferenceManager.remove(node);
|
||||
removedIds.add(id);
|
||||
}
|
||||
}
|
||||
// do for children
|
||||
for (IPreferenceNode node : rootSubNodes) {
|
||||
removePages(node, prefIds, removedIds);
|
||||
}
|
||||
//
|
||||
List<String> doList = new ArrayList<String>(Arrays.asList(prefIds));
|
||||
doList.removeAll(removedIds);
|
||||
|
||||
return doList.isEmpty(); // have done for all, so empty.
|
||||
}
|
||||
|
||||
private static void removePages(IPreferenceNode parentNode, String[] prefIds, List<String> removedIds) {
|
||||
|
||||
for (IPreferenceNode node : parentNode.getSubNodes()) {
|
||||
String id = node.getId();
|
||||
if (ArrayUtils.contains(prefIds, id)) {
|
||||
parentNode.remove(node);
|
||||
removedIds.add(id);
|
||||
}
|
||||
}
|
||||
// do for children
|
||||
for (IPreferenceNode node : parentNode.getSubNodes()) {
|
||||
removePages(node, prefIds, removedIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ source.dist/org.talend.core.repository.jar = src/main/java/
|
||||
output.dist/org.talend.core.repository.jar = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
plugin.xml
|
||||
plugin.xml,\
|
||||
dist/
|
||||
jars.compile.order = .,\
|
||||
dist/org.talend.core.repository.jar
|
||||
|
||||
@@ -25,6 +25,7 @@ ProxyRepositoryFactory.log.unlock=Unlock [{0}] by "{1}".
|
||||
ProxyRepositoryFactory.logonInProgress=Log on in progress...
|
||||
ProxyRepositoryFactory.MoveFolderContainsLockedItem=Cannot move a folder which contains locked items
|
||||
ProxyRepositoryFactory.projectIsNotCompatible=The project {0} had been opend by a more recent studio so cannot open it.
|
||||
ProxyRepositoryFactory.projectCanNotOpen=Cannot open the project.Error task is {0}.
|
||||
ProxyRepositoryFactory.RenameFolderContainsLockedItem=Cannot rename a folder which contains locked items
|
||||
ProxyRepositoryFactory.ReplaceJob=is already in use,do you want to replace it?
|
||||
ProxyRepositoryFactory.synch.repo.items=Synchronize repository items
|
||||
|
||||
@@ -284,7 +284,8 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
migrationToolService.updateMigrationSystem(project.getEmfProject(), false);
|
||||
boolean isProjectCompatibility = migrationToolService.checkMigrationTasks(project.getEmfProject());
|
||||
if (!isProjectCompatibility) {
|
||||
throw new LoginException(Messages.getString("ProxyRepositoryFactory.projectIsNotCompatible", project.getLabel())); //$NON-NLS-1$
|
||||
throw new LoginException(Messages.getString(
|
||||
"ProxyRepositoryFactory.projectCanNotOpen", migrationToolService.getTaskId())); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@ import org.eclipse.emf.common.util.BasicEList;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.emf.common.util.EMap;
|
||||
import org.talend.commons.bridge.ReponsitoryContextBridge;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.PasswordEncryptUtil;
|
||||
import org.talend.core.database.EDatabaseTypeName;
|
||||
import org.talend.core.database.conn.DatabaseConnStrUtil;
|
||||
import org.talend.core.model.metadata.Dbms;
|
||||
@@ -86,20 +84,7 @@ public class StandaloneConnectionContextUtils {
|
||||
cloneConn.setDatasourceName(datasource);
|
||||
cloneConn.setDBRootPath(dbRootPath);
|
||||
cloneConn.setFileFieldName(filePath);
|
||||
|
||||
// if use context
|
||||
if (dbConn.isContextMode()) {
|
||||
String encryptedPassword = null;
|
||||
try {
|
||||
encryptedPassword = PasswordEncryptUtil.encryptPassword(password);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
cloneConn.setPassword(encryptedPassword);
|
||||
} else {
|
||||
cloneConn.setPassword(password);
|
||||
}
|
||||
|
||||
cloneConn.setRawPassword(password); // the password is raw.
|
||||
cloneConn.setPort(port);
|
||||
cloneConn.setUiSchema(schemaOracle);
|
||||
cloneConn.setServerName(server);
|
||||
|
||||
@@ -1456,6 +1456,7 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
StableRepositoryNode tableContainer = new StableRepositoryNode(node,
|
||||
Messages.getString("ProjectRepositoryNode.sapTables"), ECoreImage.FOLDER_CLOSE_ICON); //$NON-NLS-1$
|
||||
tableContainer.setChildrenObjectType(ERepositoryObjectType.METADATA_CON_TABLE);
|
||||
tableContainer.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_SAP_TABLE);
|
||||
node.getChildren().add(tableContainer);
|
||||
|
||||
List<MetadataTable> tablesWithOrders = ConnectionHelper.getTablesWithOrders(metadataConnection);
|
||||
@@ -1502,6 +1503,7 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
|
||||
RepositoryNode inputNode = new StableRepositoryNode(tableNode,
|
||||
Messages.getString("ProjectRepositoryNode.sapFunctions.inputSchema"), ECoreImage.FOLDER_CLOSE_ICON); //$NON-NLS-1$
|
||||
inputNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_SAP_FUNCTION);
|
||||
tableNode.getChildren().add(inputNode);
|
||||
|
||||
createTables(recBin, inputNode, rebObj, unit.getInputTables(), ERepositoryObjectType.METADATA_CON_TABLE,
|
||||
@@ -1509,6 +1511,7 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
|
||||
RepositoryNode outputNode = new StableRepositoryNode(tableNode,
|
||||
Messages.getString("ProjectRepositoryNode.sapFunctions.outputSchema"), ECoreImage.FOLDER_CLOSE_ICON); //$NON-NLS-1$
|
||||
outputNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_SAP_FUNCTION);
|
||||
tableNode.getChildren().add(outputNode);
|
||||
|
||||
createTables(recBin, outputNode, rebObj, unit.getTables(), ERepositoryObjectType.METADATA_CON_TABLE, validationRules);
|
||||
@@ -1538,8 +1541,6 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
for (int i = 0; i < iDocs.size(); i++) {
|
||||
SAPIDocUnit unit = (SAPIDocUnit) iDocs.get(i);
|
||||
RepositoryNode tableNode = createSAPNode(rebObj, iDocNode, unit);
|
||||
|
||||
// createTables(recBin, tableNode, rebObj, unit.getTables(), ERepositoryObjectType.METADATA_CON_TABLE);
|
||||
if (SubItemHelper.isDeleted(unit)) {
|
||||
// recBin.getChildren().add(tableNode);
|
||||
} else {
|
||||
|
||||
@@ -54,7 +54,7 @@ public class DatabaseConnectionParameterUtil {
|
||||
if (obj instanceof ContextParameterType) {
|
||||
ContextParameterType type = (ContextParameterType) obj;
|
||||
if (type.getName().equals(paramValue)) {
|
||||
paramValue = type.getValue();
|
||||
paramValue = type.getRawValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -97,10 +97,11 @@ public class DatabaseConnectionParameterUtil {
|
||||
if (obj instanceof ContextParameterType) {
|
||||
ContextParameterType type = (ContextParameterType) obj;
|
||||
if (type.getName().equals(tempVlaue)) {
|
||||
if (type.getValue() == null) {
|
||||
String value = type.getRawValue();
|
||||
if (value == null) {
|
||||
paramValue = "";
|
||||
} else {
|
||||
paramValue = type.getValue();
|
||||
paramValue = value;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ bin.includes = META-INF/,\
|
||||
lib/,\
|
||||
talend_metadata_columns_schema.xsd,\
|
||||
talend_targetschema_columns_schema.xsd,\
|
||||
resources/
|
||||
resources/,\
|
||||
dist/
|
||||
src.includes = META-INF/,\
|
||||
mappingMetadataTypes.xml,\
|
||||
mappings/,\
|
||||
|
||||
120
main/plugins/org.talend.core.runtime/mappings/mapping_Impala.xml
Normal file
120
main/plugins/org.talend.core.runtime/mappings/mapping_Impala.xml
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0"?>
|
||||
<mapping>
|
||||
<dbms product="IMPALA" id="impala_id" label="Mapping Impala" default="true">
|
||||
<dbTypes>
|
||||
<dbType type="SMALLINT" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="FLOAT" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="DOUBLE" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="BIGINT" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="INT" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="TINYINT" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="STRING" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="BOOLEAN" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="STRUCT" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="MAP" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="ARRAY" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="true"/>
|
||||
</dbTypes>
|
||||
|
||||
<language name="java">
|
||||
<talendToDbTypes><!-- Adviced mappings -->
|
||||
<talendType type="id_List"/>
|
||||
<talendType type="id_Boolean">
|
||||
<dbType type="BOOLEAN"/>
|
||||
</talendType>
|
||||
<talendType type="id_Byte">
|
||||
<dbType type="TINYINT" default="true"/>
|
||||
<dbType type="BIGINT"/>
|
||||
<dbType type="INT"/>
|
||||
<dbType type="SMALLINT"/>
|
||||
</talendType>
|
||||
<talendType type="id_byte[]"/>
|
||||
<talendType type="id_Character">
|
||||
<dbType type="STRING"/>
|
||||
</talendType>
|
||||
<talendType type="id_Date">
|
||||
<dbType type="TIMESTAMP" default="true"/>
|
||||
</talendType>
|
||||
<talendType type="id_BigDecimal">
|
||||
<dbType type="BIGINT" default="true"/>
|
||||
<dbType type="FLOAT"/>
|
||||
<dbType type="DOUBLE"/>
|
||||
</talendType>
|
||||
<talendType type="id_Double">
|
||||
<dbType type="DOUBLE" default="true" />
|
||||
<dbType type="FLOAT"/>
|
||||
</talendType>
|
||||
<talendType type="id_Float">
|
||||
<dbType type="FLOAT" default="true" />
|
||||
<dbType type="DOUBLE"/>
|
||||
</talendType>
|
||||
<talendType type="id_Integer">
|
||||
<dbType type="INT" default="true" />
|
||||
<dbType type="BIGINT" />
|
||||
</talendType>
|
||||
<talendType type="id_Long">
|
||||
<dbType type="BIGINT" default="true" />
|
||||
</talendType>
|
||||
<talendType type="id_Object">
|
||||
<dbType type="STRUCT" default="true" />
|
||||
<dbType type="MAP" />
|
||||
<dbType type="ARRAY" />
|
||||
</talendType>
|
||||
<talendType type="id_Short">
|
||||
<dbType type="SMALLINT" default="true" />
|
||||
<dbType type="INT" />
|
||||
</talendType>
|
||||
<talendType type="id_String">
|
||||
<dbType type="STRING"/>
|
||||
</talendType>
|
||||
</talendToDbTypes>
|
||||
<dbToTalendTypes><!-- Adviced mappings -->
|
||||
<dbType type="STRING">
|
||||
<talendType type="id_String" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="BOOLEAN">
|
||||
<talendType type="id_Boolean" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="DOUBLE">
|
||||
<talendType type="id_Double" default="true"/>
|
||||
<talendType type="id_BigDecimal"/>
|
||||
<talendType type="id_Float"/>
|
||||
</dbType>
|
||||
<dbType type="BIGINT">
|
||||
<talendType type="id_BigDecimal" default="true"/>
|
||||
<talendType type="id_Byte"/>
|
||||
<talendType type="id_Integer"/>
|
||||
<talendType type="id_Long"/>
|
||||
</dbType>
|
||||
<dbType type="INT">
|
||||
<talendType type="id_Integer" default="true"/>
|
||||
<talendType type="id_Short"/>
|
||||
</dbType>
|
||||
<dbType type="SMALLINT">
|
||||
<talendType type="id_Short" default="true"/>
|
||||
<talendType type="id_Byte"/>
|
||||
</dbType>
|
||||
<dbType type="TINYINT">
|
||||
<talendType type="id_Byte" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="FLOAT">
|
||||
<talendType type="id_Float" default="true"/>
|
||||
<talendType type="id_Double"/>
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="STRUCT">
|
||||
<talendType type="id_Object" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="MAP">
|
||||
<talendType type="id_Object" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="ARRAY">
|
||||
<talendType type="id_Object" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="TIMESTAMP">
|
||||
<talendType type="id_Date" default="true"/>
|
||||
</dbType>
|
||||
</dbToTalendTypes>
|
||||
</language>
|
||||
</dbms>
|
||||
</mapping>
|
||||
@@ -1,178 +1,87 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- Similar as db system, but this mapping file is use for SAP -->
|
||||
<mapping>
|
||||
<dbms product="SAP" id="sap_id" label="Mapping SAP" default="true">
|
||||
<dbTypes>
|
||||
<dbType type="CHAR" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="DATE" ignorePre="true" />
|
||||
<dbType type="BYTE" defaultLength="1" ignorePre="true" />
|
||||
<dbType type="FLOAT" ignorePre="true" defaultPrecision="10" />
|
||||
<dbType type="INT" />
|
||||
<dbType type="INT1" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INT2" defaultLength="20" />
|
||||
<dbType type="TIME" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="NUM" ignorePre="true" />
|
||||
<dbType type="STRING" ignorePre="true" />
|
||||
<dbType type="XSTRING" defaultLength="20" />
|
||||
<dbType type="ITAB" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="ITEM" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BCD" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="STRUCTURE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TABLE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INVALID" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="EXCEPTION" ignoreLen="true" ignorePre="true" />
|
||||
|
||||
<!-- added by wchen -->
|
||||
<dbType type="BIG_DECIMAL" ignorePre="true" />
|
||||
<dbType type="BIG_INTEGER" ignorePre="true" />
|
||||
<dbType type="RAW" ignorePre="true" />
|
||||
<dbType type="DOUBLE" ignorePre="true" ignoreLen="true"/>
|
||||
<dbType type="INTEGER" ignorePre="true" ignoreLen="true"/>
|
||||
<dbType type="SHORT" ignorePre="true" ignoreLen="true"/>
|
||||
<!-- need to check -->
|
||||
<dbType type="LONG" ignorePre="true" ignoreLen="true"/>
|
||||
</dbTypes>
|
||||
<language name="java">
|
||||
<talendToDbTypes><!-- Adviced mappings -->
|
||||
<talendType type="id_List" />
|
||||
<talendType type="id_Boolean">
|
||||
</talendType>
|
||||
<talendType type="id_Byte">
|
||||
<dbType type="BYTE" default="true" />
|
||||
<dbType type="INT" />
|
||||
<dbType type="INT1" />
|
||||
<dbType type="INT2" />
|
||||
<dbType type="NUM" />
|
||||
</talendType>
|
||||
<talendType type="id_byte[]">
|
||||
<dbType type="RAW" />
|
||||
</talendType>
|
||||
<talendType type="id_Character">
|
||||
<dbType type="CHAR" default="true" />
|
||||
</talendType>
|
||||
<talendType type="id_Date">
|
||||
<dbType type="DATE" default="true" />
|
||||
<dbType type="TIME" />
|
||||
</talendType>
|
||||
<talendType type="id_BigDecimal">
|
||||
<dbType type="FLOAT" defautle="true" />
|
||||
<dbType type="BIG_DECIMAL" defautle="true" />
|
||||
</talendType>
|
||||
<talendType type="id_Double" >
|
||||
<dbType type="DOUBLE" default="true" />
|
||||
</talendType>
|
||||
<talendType type="id_Float">
|
||||
<dbType type="FLOAT" default="true" />
|
||||
</talendType>
|
||||
<talendType type="id_Integer">
|
||||
<dbType type="INT" default="true" />
|
||||
<dbType type="NUM" />
|
||||
<dbType type="INT1" />
|
||||
<dbType type="INT2" />
|
||||
<dbType type="BIG_INTEGER" />
|
||||
<dbType type="INTEGER" />
|
||||
</talendType>
|
||||
<talendType type="id_Long" >
|
||||
<dbType type="LONG" default ="true" />
|
||||
</talendType>
|
||||
<talendType type="id_Object">
|
||||
<dbType type="BCD" default="true" />
|
||||
<dbType type="ITAB" />
|
||||
<dbType type="ITEM" />
|
||||
<dbType type="STRUCTURE" />
|
||||
<dbType type="TABLE" />
|
||||
<dbType type="INVALID" />
|
||||
<dbType type="EXCEPTION" />
|
||||
</talendType>
|
||||
<talendType type="id_Short">
|
||||
<dbType type="SHORT" default="true" />
|
||||
<dbType type="INT" />
|
||||
</talendType>
|
||||
<talendType type="id_String">
|
||||
<dbType type="STRING" default="true" />
|
||||
<dbType type="XSTRING" />
|
||||
</talendType>
|
||||
</talendToDbTypes>
|
||||
<dbToTalendTypes>
|
||||
<dbType type="INT">
|
||||
<talendType type="id_Integer" default="true" />
|
||||
</dbType>
|
||||
<dbType type="CHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="DATE">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="FLOAT">
|
||||
<talendType type="id_Float" default="true" />
|
||||
<talendType type="id_BigDecimal" />
|
||||
</dbType>
|
||||
<dbType type="INT1">
|
||||
<talendType type="id_Integer" default="true" />
|
||||
</dbType>
|
||||
<dbType type="NUM">
|
||||
<talendType type="id_Integer" default="true" />
|
||||
</dbType>
|
||||
<dbType type="STRING">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="XSTRING">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="INT2">
|
||||
<talendType type="id_Integer" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BYTE">
|
||||
<talendType type="id_Byte" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TIME">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TABLE">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="ITEM">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="ITAB">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BCD">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="INVALID">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="EXCEPTION">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="STRUCTURE">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
|
||||
<!-- added by wchen -->
|
||||
<dbType type="BIG_DECIMAL" >
|
||||
<talendType type="id_BigDecimal" default="true" />
|
||||
</dbType>
|
||||
<dbms product="SAP" id="sap_id" label="Mapping SAP" default="true">
|
||||
<dbTypes>
|
||||
<dbType type="BIG_DECIMAL" ignorePre="true" />
|
||||
<dbType type="BIG_INTEGER" ignorePre="true" />
|
||||
<dbType type="BYTE" defaultLength="1" ignorePre="true" />
|
||||
<dbType type="DATE" ignorePre="true" />
|
||||
<dbType type="DOUBLE" ignorePre="true" ignoreLen="true"/>
|
||||
<dbType type="INTEGER" ignorePre="true" ignoreLen="true"/>
|
||||
<dbType type="RAW" ignorePre="true" />
|
||||
<dbType type="SHORT" ignorePre="true" ignoreLen="true"/>
|
||||
<dbType type="STRING" ignorePre="true" />
|
||||
<dbType type="TIME" ignoreLen="true" ignorePre="true" />
|
||||
</dbTypes>
|
||||
<language name="java">
|
||||
<talendToDbTypes><!-- Adviced mappings -->
|
||||
<talendType type="id_List"/>
|
||||
<talendType type="id_Boolean"/>
|
||||
<talendType type="id_Byte">
|
||||
<dbType type="BYTE"/>
|
||||
</talendType>
|
||||
<talendType type="id_byte[]">
|
||||
<dbType type="RAW"/>
|
||||
</talendType>
|
||||
<talendType type="id_Character"/>
|
||||
<talendType type="id_Date">
|
||||
<dbType type="DATE" default="true"/>
|
||||
<dbType type="TIME"/>
|
||||
</talendType>
|
||||
<talendType type="id_BigDecimal">
|
||||
<dbType type="BIG_DECIMAL"/>
|
||||
</talendType>
|
||||
<talendType type="id_Double">
|
||||
<dbType type="DOUBLE"/>
|
||||
</talendType>
|
||||
<talendType type="id_Float"/>
|
||||
<talendType type="id_Integer">
|
||||
<dbType type="INTEGER"/>
|
||||
</talendType>
|
||||
<talendType type="id_Long"/>
|
||||
<talendType type="id_Object">
|
||||
<dbType type="BIG_INTEGER"/>
|
||||
</talendType>
|
||||
<talendType type="id_Short">
|
||||
<dbType type="SHORT"/>
|
||||
</talendType>
|
||||
<talendType type="id_String">
|
||||
<dbType type="STRING"/>
|
||||
</talendType>
|
||||
</talendToDbTypes>
|
||||
<dbToTalendTypes>
|
||||
<dbType type="BIG_DECIMAL" >
|
||||
<talendType type="id_BigDecimal" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BIG_INTEGER" >
|
||||
<talendType type="id_Integer" default="true"/>
|
||||
<talendType type="id_Object" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="RAW" >
|
||||
<talendType type="id_byte[]" default="true" />
|
||||
</dbType>
|
||||
<dbType type="DOUBLE" >
|
||||
<dbType type="BYTE">
|
||||
<talendType type="id_Byte" default="true" />
|
||||
</dbType>
|
||||
<dbType type="DATE">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="DOUBLE">
|
||||
<talendType type="id_Double" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="INTEGER" >
|
||||
<dbType type="INTEGER">
|
||||
<talendType type="id_Integer" default="true" />
|
||||
</dbType>
|
||||
<dbType type="SHORT" >
|
||||
<dbType type="RAW">
|
||||
<talendType type="id_byte[]" default="true" />
|
||||
</dbType>
|
||||
<dbType type="SHORT">
|
||||
<talendType type="id_Short" default="true" />
|
||||
</dbType>
|
||||
<dbType type="LONG" >
|
||||
<talendType type="id_Long" default="true" />
|
||||
<dbType type="STRING">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
</dbToTalendTypes>
|
||||
</language>
|
||||
</dbms>
|
||||
</mapping>
|
||||
<dbType type="TIME">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
</dbToTalendTypes>
|
||||
</language>
|
||||
</dbms>
|
||||
</mapping>
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
"JOBTRACKER": "localhost:50300",
|
||||
"RESOURCE_MANAGER": "localhost:8050",
|
||||
"NAMENODE_PRINCIPAL": "nn/_HOST@EXAMPLE.COM",
|
||||
"JOBTRACKER_PRINCIPAL" : "mapred/_HOST@EXAMPLE.COM",
|
||||
"RESOURCE_MANAGER_PRINCIPAL" : "yarn/_HOST@EXAMPLE.COM",
|
||||
"HIVE": {
|
||||
"EMBEDDED": {
|
||||
"PORT": 9083
|
||||
@@ -22,7 +24,9 @@
|
||||
"NAMENODE_URI": "hdfs://localhost:8020",
|
||||
"JOBTRACKER": "localhost:8021",
|
||||
"RESOURCE_MANAGER": "localhost:8032",
|
||||
"NAMENODE_PRINCIPAL": "nn/_HOST@EXAMPLE.COM",
|
||||
"NAMENODE_PRINCIPAL": "hdfs/_HOST@EXAMPLE.COM",
|
||||
"JOBTRACKER_PRINCIPAL" : "mapred/_HOST@EXAMPLE.COM",
|
||||
"RESOURCE_MANAGER_PRINCIPAL" : "yarn/_HOST@EXAMPLE.COM",
|
||||
"HIVE": {
|
||||
"EMBEDDED": {
|
||||
"PORT": 9083
|
||||
@@ -59,6 +63,8 @@
|
||||
"NAMENODE_URI": "hdfs://localhost:9000",
|
||||
"JOBTRACKER": "localhost:9001",
|
||||
"NAMENODE_PRINCIPAL": "nn/_HOST@EXAMPLE.COM",
|
||||
"JOBTRACKER_PRINCIPAL" : "mapred/_HOST@EXAMPLE.COM",
|
||||
"RESOURCE_MANAGER_PRINCIPAL" : "yarn/_HOST@EXAMPLE.COM",
|
||||
"HIVE": {
|
||||
"EMBEDDED": {
|
||||
"PORT": 9083
|
||||
@@ -77,6 +83,9 @@
|
||||
"APACHE_2_4_0_EMR": {
|
||||
"NAMENODE_URI": "hdfs://localhost:9000",
|
||||
"RESOURCE_MANAGER": "localhost:9022",
|
||||
"HBASE": {
|
||||
"PORT": 2181
|
||||
}
|
||||
},
|
||||
"APACHE_1_0_3_EMR": {
|
||||
"NAMENODE_URI": "hdfs://localhost:9000",
|
||||
@@ -93,6 +102,8 @@
|
||||
}
|
||||
},
|
||||
"NAMENODE_PRINCIPAL": "nn/_HOST@EXAMPLE.COM",
|
||||
"JOBTRACKER_PRINCIPAL" : "mapred/_HOST@EXAMPLE.COM",
|
||||
"RESOURCE_MANAGER_PRINCIPAL" : "yarn/_HOST@EXAMPLE.COM",
|
||||
"HIVE": {
|
||||
"EMBEDDED": {
|
||||
"PORT": 9083
|
||||
@@ -108,6 +119,9 @@
|
||||
"NAMENODE_URI": "hdfs://localhost:8020",
|
||||
"JOBTRACKER": "localhost:8032",
|
||||
"RESOURCE_MANAGER": "localhost:8032",
|
||||
"NAMENODE_PRINCIPAL": "nn/_HOST@EXAMPLE.COM",
|
||||
"JOBTRACKER_PRINCIPAL" : "mapred/_HOST@EXAMPLE.COM",
|
||||
"RESOURCE_MANAGER_PRINCIPAL" : "yarn/_HOST@EXAMPLE.COM",
|
||||
"HIVE": {
|
||||
"EMBEDDED": {
|
||||
"PORT": 9083
|
||||
@@ -127,6 +141,8 @@
|
||||
"JOBTRACKER": "localhost:50300",
|
||||
"RESOURCE_MANAGER": "localhost:8050",
|
||||
"NAMENODE_PRINCIPAL": "nn/_HOST@EXAMPLE.COM",
|
||||
"JOBTRACKER_PRINCIPAL" : "mapred/_HOST@EXAMPLE.COM",
|
||||
"RESOURCE_MANAGER_PRINCIPAL" : "yarn/_HOST@EXAMPLE.COM",
|
||||
"HIVE": {
|
||||
"EMBEDDED": {
|
||||
"PORT": 9083
|
||||
|
||||
@@ -195,4 +195,6 @@ public interface ITDQRepositoryService extends IService {
|
||||
public void publishDynamicEvent(ModelElement indicator, Object value);
|
||||
|
||||
public Item createFile(String content, IPath path, String label, String extension);
|
||||
|
||||
public void changePerspectiveAction(String perspectiveId);
|
||||
}
|
||||
|
||||
@@ -113,8 +113,7 @@ public enum EDatabaseTypeName {
|
||||
REDSHIFT(
|
||||
"Redshift", "Redshift", Boolean.TRUE, "REDSHIFT", "REDSHIFT", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
|
||||
IMPALA(
|
||||
"IMPALA", "Impala", Boolean.TRUE, "CLOUDERA", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
IMPALA("IMPALA", "Impala", Boolean.TRUE, "IMPALA", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
HBASE(
|
||||
"HBase", "HBase", Boolean.FALSE, "HBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Column_Family, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
@@ -143,4 +143,12 @@ public class ConnParameterKeys {
|
||||
|
||||
public static final String CONN_PARA_KEY_HBASE_PROPERTIES = "CONN_PARA_KEY_HBASE_PROPERTIES"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Impala keys.
|
||||
*/
|
||||
public static final String CONN_PARA_KEY_IMPALA_DISTRIBUTION = "CONN_PARA_KEY_IMPALA_DISTRIBUTION";//$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_IMPALA_VERSION = "CONN_PARA_KEY_IMPALA_VERSION"; //$NON-NLS-1$
|
||||
|
||||
public static final String IMPALA_AUTHENTICATION_PRINCIPLA = "IMPALA_AUTHENTICATION_PRINCIPLA";//$NON-NLS-1$
|
||||
}
|
||||
|
||||
@@ -161,6 +161,21 @@ public class DatabaseConnStrUtil {
|
||||
return string;
|
||||
}
|
||||
|
||||
public static String getImpalaString(DatabaseConnection dbConn, String server, String port, String sidOrDatabase,
|
||||
String template) {
|
||||
boolean useKrb = Boolean.valueOf(dbConn.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_USE_KRB));
|
||||
String impalaPrincipal = null;
|
||||
if (useKrb) {
|
||||
impalaPrincipal = StringUtils.trimToNull(dbConn.getParameters()
|
||||
.get(ConnParameterKeys.IMPALA_AUTHENTICATION_PRINCIPLA));
|
||||
}
|
||||
String url = null;
|
||||
if (template.startsWith(DbConnStrForHive.URL_HIVE_2_TEMPLATE)) {
|
||||
url = getImpalaURLString(false, server, port, sidOrDatabase, impalaPrincipal);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
public static String getHiveURLString(DatabaseConnection dbConn, String server, String port, String sidOrDatabase,
|
||||
String template) {
|
||||
String hiveModel = dbConn.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE);
|
||||
@@ -220,6 +235,41 @@ public class DatabaseConnStrUtil {
|
||||
return s;
|
||||
}
|
||||
|
||||
private static String getImpalaURlString(String template, boolean supportContext, String server, String port, String sid) {
|
||||
String s = template;
|
||||
if (s != null) {
|
||||
if (supportContext) { // if context mode, should quote the original "connStr".
|
||||
s = TalendQuoteUtils.addQuotes(s);
|
||||
}
|
||||
s = getStringReplace(s, EDatabaseConnVar.HOST.getVariable(), server, supportContext);
|
||||
s = getStringReplace(s, EDatabaseConnVar.PORT.getVariable(), port, supportContext);
|
||||
s = getStringReplace(s, EDatabaseConnVar.SID.getVariable(), sid, supportContext);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
private static String getImpalaURLString(boolean supportContext, String server, String port, String sid, String Principal) {
|
||||
String s = EDatabaseConnTemplate.IMPALA.getUrlTemplate(EDatabaseVersion4Drivers.IMPALA_CDH5);
|
||||
String standardURlString = getImpalaURlString(s, supportContext, server, port, sid);
|
||||
String principalSuffix = "principal="; //$NON-NLS-1$
|
||||
boolean hasPrinc = false;
|
||||
String[] urlArray = standardURlString.split(SEMICOLON);
|
||||
if (urlArray[urlArray.length - 1].startsWith(principalSuffix)) {
|
||||
hasPrinc = true;
|
||||
}
|
||||
if (hasPrinc) {
|
||||
if (Principal == null) {
|
||||
standardURlString = standardURlString.substring(0, standardURlString.lastIndexOf(principalSuffix));
|
||||
}
|
||||
} else {
|
||||
if (Principal != null) {
|
||||
standardURlString = standardURlString.concat(SEMICOLON).concat(principalSuffix).concat(Principal);
|
||||
}
|
||||
}
|
||||
|
||||
return standardURlString;
|
||||
}
|
||||
|
||||
private static String getHive2StandaloneURLString(boolean supportContext, String server, String port, String sid,
|
||||
String hivePrincipal) {
|
||||
String s = EDatabaseConnTemplate.HIVE.getUrlTemplate(EDatabaseVersion4Drivers.HIVE_2_STANDALONE);
|
||||
@@ -255,7 +305,7 @@ public class DatabaseConnStrUtil {
|
||||
public static String getURLString(final boolean supportContext, final DatabaseConnection conn) {
|
||||
if (conn != null) {
|
||||
return getURLString(conn.getDatabaseType(), conn.getDbVersionString(), conn.getServerName(), conn.getUsername(),
|
||||
conn.getPassword(), conn.getPort(), conn.getSID(), conn.getFileFieldName(), conn.getDatasourceName(),
|
||||
conn.getRawPassword(), conn.getPort(), conn.getSID(), conn.getFileFieldName(), conn.getDatasourceName(),
|
||||
conn.getDBRootPath(), conn.getAdditionalParams());
|
||||
}
|
||||
return DatabaseConnConstants.EMPTY;
|
||||
|
||||
@@ -183,8 +183,8 @@ public enum EDatabaseConnTemplate {
|
||||
//
|
||||
// HIVE2_STANDALONE(new DbConnStr(EDatabaseTypeName.HIVE, "jdbc:hive2://<host>:<port>/<sid>")), //$NON-NLS-1$
|
||||
|
||||
IMPALA(new DbConnStr(EDatabaseTypeName.IMPALA, //
|
||||
"<host>")), //$NON-NLS-1$
|
||||
IMPALA(new DbConnStr(EDatabaseTypeName.IMPALA, "jdbc:hive2://<host>:<port>/<sid>;auth=noSasl", //
|
||||
"21050")), //$NON-NLS-1$
|
||||
|
||||
HBASE(new DbConnStr(EDatabaseTypeName.HBASE, "127.0.0.1", //$NON-NLS-1$
|
||||
"2181")); //$NON-NLS-1$
|
||||
@@ -323,7 +323,6 @@ public enum EDatabaseConnTemplate {
|
||||
case SAS:
|
||||
case SAPHana:
|
||||
case HBASE:
|
||||
case IMPALA:
|
||||
return true;
|
||||
default:
|
||||
}
|
||||
|
||||
@@ -36,10 +36,10 @@ public class DbVersion4DriversForOracle11 extends DbVersion4Drivers {
|
||||
String javaVersion = System.getProperty("java.version");//$NON-NLS-1$
|
||||
if (javaVersion != null) {
|
||||
org.talend.commons.utils.Version v = new org.talend.commons.utils.Version(javaVersion);
|
||||
if (v.getMajor() == 1 && v.getMinor() > 6) { // more than JDK 1.6
|
||||
drivers.add(DRIVER_1_6);
|
||||
} else {
|
||||
if (v.getMajor() == 1 && v.getMinor() == 5) {
|
||||
drivers.add(DRIVER_1_5);
|
||||
} else {
|
||||
drivers.add(DRIVER_1_6);
|
||||
}
|
||||
}
|
||||
return drivers;
|
||||
|
||||
@@ -145,9 +145,9 @@ public enum EDatabaseVersion4Drivers {
|
||||
"slf4j-log4j12-1.6.1.jar", "hive-exec-0.10.0-cdh4.4.0.jar" })),
|
||||
|
||||
IMPALA_CDH5(new DbVersion4Drivers(EDatabaseTypeName.IMPALA, "Cloudera 5", "CLOUDERA_5", new String[] {
|
||||
"commons-logging-1.1.1.jar", "hive-jdbc-0.12.0-cdh5.0.0.jar", "hive-metastore-0.12.0-cdh5.0.0.jar",
|
||||
"hive-service-0.12.0-cdh5.0.0.jar", "libfb303-0.9.0.jar", "log4j-1.2.16.jar", "slf4j-api-1.6.1.jar",
|
||||
"slf4j-log4j12-1.6.1.jar", "hive-exec-0.12.0-cdh5.0.0.jar", "httpcore-4.2.5.jar", "httpclient-4.2.5.jar",
|
||||
"commons-logging-1.1.1.jar", "hive-jdbc-0.12.0-cdh5.0.4.jar", "hive-metastore-0.12.0-cdh5.0.4.jar",
|
||||
"hive-service-0.12.0-cdh5.0.4.jar", "libfb303-0.9.0.jar", "log4j-1.2.16.jar", "slf4j-api-1.6.1.jar",
|
||||
"slf4j-log4j12-1.6.1.jar", "hive-exec-0.12.0-cdh5.0.4.jar", "httpcore-4.2.5.jar", "httpclient-4.2.5.jar",
|
||||
"hadoop-core-1.0.0.jar" })),
|
||||
|
||||
REDSHIFT(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT, "paraccel-jdbc.jar")); //$NON-NLS-1$
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 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.database.conn.version;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum EImpalaDistribution4Versions {
|
||||
|
||||
CLOUDERA_CDH5_1(EImpalaDistributions.CLOUDERA, "Cloudera CDH5.1", "Cloudera_CDH5_1"),
|
||||
|
||||
CUSTOM(EImpalaDistributions.CUSTOM, "", "");
|
||||
|
||||
private EImpalaDistributions distribution;
|
||||
|
||||
private String versionDisplayName;
|
||||
|
||||
private String versionValue;
|
||||
|
||||
EImpalaDistribution4Versions(EImpalaDistributions distribution, String versionDisplayName, String versionValue) {
|
||||
this.distribution = distribution;
|
||||
this.versionDisplayName = versionDisplayName;
|
||||
this.versionValue = versionValue;
|
||||
}
|
||||
|
||||
public static List<EImpalaDistribution4Versions> indexOfByDistribution(String distribution) {
|
||||
List<EImpalaDistribution4Versions> distribution4Versions = new ArrayList<EImpalaDistribution4Versions>();
|
||||
if (distribution != null) {
|
||||
for (EImpalaDistribution4Versions d4v : EImpalaDistribution4Versions.values()) {
|
||||
if (d4v.getDistribution().getName().equals(distribution)
|
||||
|| d4v.getDistribution().getDisplayName().equals(distribution)) {
|
||||
distribution4Versions.add(d4v);
|
||||
}
|
||||
}
|
||||
}
|
||||
return distribution4Versions;
|
||||
}
|
||||
|
||||
public static EImpalaDistribution4Versions indexOfByVersionDisplay(String displayName) {
|
||||
return indexOf(displayName, true);
|
||||
}
|
||||
|
||||
public static EImpalaDistribution4Versions indexOfByVersion(String value) {
|
||||
return indexOf(value, false);
|
||||
}
|
||||
|
||||
private static EImpalaDistribution4Versions indexOf(String name, boolean display) {
|
||||
if (name != null) {
|
||||
for (EImpalaDistribution4Versions version : EImpalaDistribution4Versions.values()) {
|
||||
if (display) {
|
||||
if (name.equalsIgnoreCase(version.getVersionDisplayName())) {
|
||||
return version;
|
||||
}
|
||||
} else {
|
||||
if (name.equalsIgnoreCase(version.getVersionValue())) {
|
||||
return version;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<String> getHadoopDistributionVersions(String distribution) {
|
||||
return getHadoopDistributionVersions(distribution, true);
|
||||
}
|
||||
|
||||
public static List<String> getHadoopDistributionVersions(String distribution, boolean display) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
List<EImpalaDistribution4Versions> d4vList = EImpalaDistribution4Versions.indexOfByDistribution(distribution);
|
||||
for (EImpalaDistribution4Versions d4v : d4vList) {
|
||||
if (display) {
|
||||
result.add(d4v.getVersionDisplayName());
|
||||
} else {
|
||||
result.add(d4v.getVersionValue());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public EImpalaDistributions getDistribution() {
|
||||
return this.distribution;
|
||||
}
|
||||
|
||||
public String getVersionDisplayName() {
|
||||
return this.versionDisplayName;
|
||||
}
|
||||
|
||||
public String getVersionValue() {
|
||||
return this.versionValue;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 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.database.conn.version;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum EImpalaDistributions {
|
||||
|
||||
CLOUDERA("Cloudera"),
|
||||
|
||||
CUSTOM("Custom - Unsupported");
|
||||
|
||||
private String displayName;
|
||||
|
||||
EImpalaDistributions(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name();
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return this.displayName;
|
||||
}
|
||||
|
||||
public static List<String> getAllDistributionDisplayNames() {
|
||||
return getAllDistributionNames(true);
|
||||
}
|
||||
|
||||
public static List<String> getAllDistributionNames(boolean display) {
|
||||
List<String> names = new ArrayList<String>();
|
||||
EImpalaDistributions[] values = values();
|
||||
for (EImpalaDistributions distribution : values) {
|
||||
if (display) {
|
||||
names.add(distribution.getDisplayName());
|
||||
} else {
|
||||
names.add(distribution.getName());
|
||||
}
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
public static EImpalaDistributions getDistributionByDisplayName(String name) {
|
||||
return getDistributionByName(name, true);
|
||||
}
|
||||
|
||||
public static EImpalaDistributions getDistributionByName(String name, boolean display) {
|
||||
if (name != null) {
|
||||
for (EImpalaDistributions distribution : values()) {
|
||||
if (display) {
|
||||
if (name.equalsIgnoreCase(distribution.getDisplayName())) {
|
||||
return distribution;
|
||||
}
|
||||
} else {
|
||||
if (name.equalsIgnoreCase(distribution.getName())) {
|
||||
return distribution;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -15,55 +15,107 @@ package org.talend.core.database.hbase.conn.version;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.talend.core.hadoop.version.EHadoopVersion4Drivers;
|
||||
|
||||
/**
|
||||
* DOC ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public enum EHBaseDistribution4Versions {
|
||||
HDP_2_1(EHBaseDistributions.HORTONWORKS, "Hortonworks Data Platform V2.1.0(Baikal)", "HDP_2_1"),
|
||||
HDP_2_1(EHBaseDistributions.HORTONWORKS, EHadoopVersion4Drivers.HDP_2_1.getVersionDisplay(), EHadoopVersion4Drivers.HDP_2_1
|
||||
.getVersionValue()),
|
||||
|
||||
HDP_2_0(EHBaseDistributions.HORTONWORKS, "Hortonworks Data Platform V2.0.0(BigWheel)", "HDP_2_0"),
|
||||
HDP_2_0(EHBaseDistributions.HORTONWORKS, EHadoopVersion4Drivers.HDP_2_0.getVersionDisplay(), EHadoopVersion4Drivers.HDP_2_0
|
||||
.getVersionValue()),
|
||||
|
||||
HDP_1_3(EHBaseDistributions.HORTONWORKS, "Hortonworks Data Platform V1.3.0(Condor)", "HDP_1_3"),
|
||||
HDP_1_3(EHBaseDistributions.HORTONWORKS, EHadoopVersion4Drivers.HDP_1_3.getVersionDisplay(), EHadoopVersion4Drivers.HDP_1_3
|
||||
.getVersionValue()),
|
||||
|
||||
HDP_1_2(EHBaseDistributions.HORTONWORKS, "Hortonworks Data Platform V1.2.0(Bimota)", "HDP_1_2"),
|
||||
HDP_1_2(EHBaseDistributions.HORTONWORKS, EHadoopVersion4Drivers.HDP_1_2.getVersionDisplay(), EHadoopVersion4Drivers.HDP_1_2
|
||||
.getVersionValue()),
|
||||
|
||||
HDP_1_0(EHBaseDistributions.HORTONWORKS, "Hortonworks Data Platform V1.0.0(deprecated)", "HDP_1_0"),
|
||||
HDP_1_0(EHBaseDistributions.HORTONWORKS, EHadoopVersion4Drivers.HDP_1_0.getVersionDisplay(), EHadoopVersion4Drivers.HDP_1_0
|
||||
.getVersionValue()),
|
||||
|
||||
APACHE_0_20_203(EHBaseDistributions.APACHE, "Apache 0.20.203", "APACHE_0_20_203"),
|
||||
APACHE_0_20_203(
|
||||
EHBaseDistributions.APACHE,
|
||||
EHadoopVersion4Drivers.APACHE_0_20_203.getVersionDisplay(),
|
||||
EHadoopVersion4Drivers.APACHE_0_20_203.getVersionValue()),
|
||||
|
||||
APACHE_2_4_0_EMR(EHBaseDistributions.AMAZON_EMR, "Apache 2.4.0(EMR)", "APACHE_2_4_0_EMR"),
|
||||
APACHE_2_4_0_EMR(
|
||||
EHBaseDistributions.AMAZON_EMR,
|
||||
EHadoopVersion4Drivers.APACHE_2_4_0_EMR.getVersionDisplay(),
|
||||
EHadoopVersion4Drivers.APACHE_2_4_0_EMR.getVersionValue()),
|
||||
|
||||
APACHE_1_0_3_EMR(EHBaseDistributions.AMAZON_EMR, "Apache 1.0.3(EMR)", "APACHE_1_0_3_EMR"),
|
||||
APACHE_1_0_3_EMR(
|
||||
EHBaseDistributions.AMAZON_EMR,
|
||||
EHadoopVersion4Drivers.APACHE_1_0_3_EMR.getVersionDisplay(),
|
||||
EHadoopVersion4Drivers.APACHE_1_0_3_EMR.getVersionValue()),
|
||||
|
||||
APACHE_1_0_0(EHBaseDistributions.APACHE, "Apache 1.0.0", "APACHE_1_0_0"),
|
||||
APACHE_1_0_0(
|
||||
EHBaseDistributions.APACHE,
|
||||
EHadoopVersion4Drivers.APACHE_1_0_0.getVersionDisplay(),
|
||||
EHadoopVersion4Drivers.APACHE_1_0_0.getVersionValue()),
|
||||
|
||||
CLOUDERA_CDH5_1(EHBaseDistributions.CLOUDERA, "Cloudera CDH5.1", "Cloudera_CDH5_1"),
|
||||
CLOUDERA_CDH5_1(
|
||||
EHBaseDistributions.CLOUDERA,
|
||||
EHadoopVersion4Drivers.CLOUDERA_CDH5_1.getVersionDisplay(),
|
||||
EHadoopVersion4Drivers.CLOUDERA_CDH5_1.getVersionValue()),
|
||||
|
||||
CLOUDERA_CDH5(EHBaseDistributions.CLOUDERA, "Cloudera CDH5", "Cloudera_CDH5"),
|
||||
CLOUDERA_CDH5_1_MR1(
|
||||
EHBaseDistributions.CLOUDERA,
|
||||
EHadoopVersion4Drivers.CLOUDERA_CDH5_1_MR1.getVersionDisplay(),
|
||||
EHadoopVersion4Drivers.CLOUDERA_CDH5_1_MR1.getVersionValue()),
|
||||
|
||||
CLOUDERA_CDH4_YARN(EHBaseDistributions.CLOUDERA, "Cloudera CDH4 YARN", "Cloudera_CDH4_YARN"),
|
||||
CLOUDERA_CDH5(
|
||||
EHBaseDistributions.CLOUDERA,
|
||||
EHadoopVersion4Drivers.CLOUDERA_CDH5.getVersionDisplay(),
|
||||
EHadoopVersion4Drivers.CLOUDERA_CDH5.getVersionValue()),
|
||||
|
||||
CLOUDERA_CDH4(EHBaseDistributions.CLOUDERA, "Cloudera CDH4", "Cloudera_CDH4"),
|
||||
CLOUDERA_CDH4_YARN(
|
||||
EHBaseDistributions.CLOUDERA,
|
||||
EHadoopVersion4Drivers.CLOUDERA_CDH4_YARN.getVersionDisplay(),
|
||||
EHadoopVersion4Drivers.CLOUDERA_CDH4_YARN.getVersionValue()),
|
||||
|
||||
CLOUDERA_CDH3(EHBaseDistributions.CLOUDERA, "Cloudera CDH3(deprecated)", "Cloudera_CDH3"),
|
||||
CLOUDERA_CDH4(
|
||||
EHBaseDistributions.CLOUDERA,
|
||||
EHadoopVersion4Drivers.CLOUDERA_CDH4.getVersionDisplay(),
|
||||
EHadoopVersion4Drivers.CLOUDERA_CDH4.getVersionValue()),
|
||||
|
||||
MAPR_4_0_1(EHBaseDistributions.MAPR, "MapR 4.0.1", "MAPR401"),
|
||||
CLOUDERA_CDH3(
|
||||
EHBaseDistributions.CLOUDERA,
|
||||
EHadoopVersion4Drivers.CLOUDERA_CDH3.getVersionDisplay(),
|
||||
EHadoopVersion4Drivers.CLOUDERA_CDH3.getVersionValue()),
|
||||
|
||||
MAPR_3_1_0(EHBaseDistributions.MAPR, "MapR 3.1.0", "MAPR310"),
|
||||
MAPR_4_0_1(EHBaseDistributions.MAPR, EHadoopVersion4Drivers.MAPR401.getVersionDisplay(), EHadoopVersion4Drivers.MAPR401
|
||||
.getVersionValue()),
|
||||
|
||||
MAPR_3_0_1(EHBaseDistributions.MAPR, "MapR 3.0.1", "MAPR301"),
|
||||
MAPR_3_1_0(EHBaseDistributions.MAPR, EHadoopVersion4Drivers.MAPR310.getVersionDisplay(), EHadoopVersion4Drivers.MAPR310
|
||||
.getVersionValue()),
|
||||
|
||||
MAPR_2_1_3(EHBaseDistributions.MAPR, "MapR 2.1.3", "MAPR213"),
|
||||
MAPR_3_0_1(EHBaseDistributions.MAPR, EHadoopVersion4Drivers.MAPR301.getVersionDisplay(), EHadoopVersion4Drivers.MAPR301
|
||||
.getVersionValue()),
|
||||
|
||||
MAPR_2_1_2(EHBaseDistributions.MAPR, "MapR 2.1.2", "MAPR212"),
|
||||
MAPR_2_1_3(EHBaseDistributions.MAPR, EHadoopVersion4Drivers.MAPR213.getVersionDisplay(), EHadoopVersion4Drivers.MAPR213
|
||||
.getVersionValue()),
|
||||
|
||||
MAPR(EHBaseDistributions.MAPR, "MapR 2.0.0", "MAPR2"),
|
||||
MAPR_2_1_2(EHBaseDistributions.MAPR, EHadoopVersion4Drivers.MAPR212.getVersionDisplay(), EHadoopVersion4Drivers.MAPR212
|
||||
.getVersionValue()),
|
||||
|
||||
PIVOTAL_HD_2_0(EHBaseDistributions.PIVOTAL_HD, "Pivotal HD 2.0", "PIVOTAL_HD_2_0"),
|
||||
MAPR(EHBaseDistributions.MAPR, EHadoopVersion4Drivers.MAPR2.getVersionDisplay(), EHadoopVersion4Drivers.MAPR2
|
||||
.getVersionValue()),
|
||||
|
||||
PIVOTAL_HD_1_0_1(EHBaseDistributions.PIVOTAL_HD, "Pivotal HD 1.0.1", "PIVOTAL_HD_1_0_1"),
|
||||
PIVOTAL_HD_2_0(
|
||||
EHBaseDistributions.PIVOTAL_HD,
|
||||
EHadoopVersion4Drivers.PIVOTAL_HD_2_0.getVersionDisplay(),
|
||||
EHadoopVersion4Drivers.PIVOTAL_HD_2_0.getVersionValue()),
|
||||
|
||||
CUSTOM(EHBaseDistributions.CUSTOM, "", "");
|
||||
PIVOTAL_HD_1_0_1(
|
||||
EHBaseDistributions.PIVOTAL_HD,
|
||||
EHadoopVersion4Drivers.PIVOTAL_HD_1_0_1.getVersionDisplay(),
|
||||
EHadoopVersion4Drivers.PIVOTAL_HD_1_0_1.getVersionValue()),
|
||||
|
||||
CUSTOM(EHBaseDistributions.CUSTOM, EHadoopVersion4Drivers.CUSTOM.getVersionDisplay(), EHadoopVersion4Drivers.CUSTOM
|
||||
.getVersionValue());
|
||||
|
||||
private EHBaseDistributions distribution;
|
||||
|
||||
|
||||
@@ -1,90 +1,92 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 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.database.hbase.conn.version;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* DOC ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public enum EHBaseDistributions {
|
||||
|
||||
HORTONWORKS("HortonWorks"),
|
||||
|
||||
CLOUDERA("Cloudera"),
|
||||
|
||||
MAPR("MapR"),
|
||||
|
||||
APACHE("Apache"),
|
||||
|
||||
AMAZON_EMR("AmazonEMR"),
|
||||
|
||||
PIVOTAL_HD("Pivotal HD"),
|
||||
|
||||
CUSTOM("Custom - Unsupported");
|
||||
|
||||
private String displayName;
|
||||
|
||||
EHBaseDistributions(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name();
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return this.displayName;
|
||||
}
|
||||
|
||||
public static List<String> getAllDistributionDisplayNames() {
|
||||
return getAllDistributionNames(true);
|
||||
}
|
||||
|
||||
public static List<String> getAllDistributionNames(boolean display) {
|
||||
List<String> names = new ArrayList<String>();
|
||||
EHBaseDistributions[] values = values();
|
||||
for (EHBaseDistributions distribution : values) {
|
||||
if (display) {
|
||||
names.add(distribution.getDisplayName());
|
||||
} else {
|
||||
names.add(distribution.getName());
|
||||
}
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
public static EHBaseDistributions getDistributionByDisplayName(String name) {
|
||||
return getDistributionByName(name, true);
|
||||
}
|
||||
|
||||
public static EHBaseDistributions getDistributionByName(String name, boolean display) {
|
||||
if (name != null) {
|
||||
for (EHBaseDistributions distribution : values()) {
|
||||
if (display) {
|
||||
if (name.equalsIgnoreCase(distribution.getDisplayName())) {
|
||||
return distribution;
|
||||
}
|
||||
} else {
|
||||
if (name.equalsIgnoreCase(distribution.getName())) {
|
||||
return distribution;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 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.database.hbase.conn.version;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.talend.core.hadoop.version.EHadoopDistributions;
|
||||
|
||||
/**
|
||||
* DOC ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public enum EHBaseDistributions {
|
||||
|
||||
HORTONWORKS(EHadoopDistributions.HORTONWORKS.getDisplayName()),
|
||||
|
||||
CLOUDERA(EHadoopDistributions.CLOUDERA.getDisplayName()),
|
||||
|
||||
MAPR(EHadoopDistributions.MAPR.getDisplayName()),
|
||||
|
||||
APACHE(EHadoopDistributions.APACHE.getDisplayName()),
|
||||
|
||||
AMAZON_EMR(EHadoopDistributions.AMAZON_EMR.getDisplayName()),
|
||||
|
||||
PIVOTAL_HD(EHadoopDistributions.PIVOTAL_HD.getDisplayName()),
|
||||
|
||||
CUSTOM(EHadoopDistributions.CUSTOM.getDisplayName());
|
||||
|
||||
private String displayName;
|
||||
|
||||
EHBaseDistributions(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name();
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return this.displayName;
|
||||
}
|
||||
|
||||
public static List<String> getAllDistributionDisplayNames() {
|
||||
return getAllDistributionNames(true);
|
||||
}
|
||||
|
||||
public static List<String> getAllDistributionNames(boolean display) {
|
||||
List<String> names = new ArrayList<String>();
|
||||
EHBaseDistributions[] values = values();
|
||||
for (EHBaseDistributions distribution : values) {
|
||||
if (display) {
|
||||
names.add(distribution.getDisplayName());
|
||||
} else {
|
||||
names.add(distribution.getName());
|
||||
}
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
public static EHBaseDistributions getDistributionByDisplayName(String name) {
|
||||
return getDistributionByName(name, true);
|
||||
}
|
||||
|
||||
public static EHBaseDistributions getDistributionByName(String name, boolean display) {
|
||||
if (name != null) {
|
||||
for (EHBaseDistributions distribution : values()) {
|
||||
if (display) {
|
||||
if (name.equalsIgnoreCase(distribution.getDisplayName())) {
|
||||
return distribution;
|
||||
}
|
||||
} else {
|
||||
if (name.equalsIgnoreCase(distribution.getName())) {
|
||||
return distribution;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class BaseConnectionContextHelper {
|
||||
*
|
||||
* if value is context mode, return original value.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")//$NON-NLS-1$
|
||||
@SuppressWarnings("unchecked")
|
||||
public static String getOriginalValue(ContextType contextType, final String value) {
|
||||
if (value == null) {
|
||||
return EMPTY;
|
||||
@@ -72,7 +72,7 @@ public class BaseConnectionContextHelper {
|
||||
}
|
||||
}
|
||||
if (param != null) {
|
||||
String value2 = param.getValue();
|
||||
String value2 = param.getRawValue();
|
||||
if (value2 != null) {
|
||||
// return TalendTextUtils.removeQuotes(value2); //some value can't be removed for quote
|
||||
return value2;
|
||||
|
||||
@@ -1,41 +1,45 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 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.hadoop.conf;
|
||||
|
||||
/**
|
||||
* created by ycbai on Jul 31, 2014 Detailled comment
|
||||
*
|
||||
*/
|
||||
public enum EHadoopProperties {
|
||||
|
||||
NAMENODE_URI,
|
||||
|
||||
JOBTRACKER,
|
||||
|
||||
RESOURCE_MANAGER,
|
||||
|
||||
NAMENODE_PRINCIPAL,
|
||||
|
||||
HIVE_PRINCIPAL,
|
||||
|
||||
DATABASE,
|
||||
|
||||
PORT,
|
||||
|
||||
;
|
||||
|
||||
public String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
}
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 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.hadoop.conf;
|
||||
|
||||
/**
|
||||
* created by ycbai on Jul 31, 2014 Detailled comment
|
||||
*
|
||||
*/
|
||||
public enum EHadoopProperties {
|
||||
|
||||
NAMENODE_URI,
|
||||
|
||||
JOBTRACKER,
|
||||
|
||||
RESOURCE_MANAGER,
|
||||
|
||||
NAMENODE_PRINCIPAL,
|
||||
|
||||
JOBTRACKER_PRINCIPAL,
|
||||
|
||||
RESOURCE_MANAGER_PRINCIPAL,
|
||||
|
||||
HIVE_PRINCIPAL,
|
||||
|
||||
DATABASE,
|
||||
|
||||
PORT,
|
||||
|
||||
;
|
||||
|
||||
public String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,115 +21,104 @@ import org.apache.commons.lang.ArrayUtils;
|
||||
* DOC ycbai class global comment. Detailled comment
|
||||
*/
|
||||
public enum EHadoopVersion4Drivers {
|
||||
HDP_2_1(
|
||||
EHadoopDistributions.HORTONWORKS,
|
||||
"Hortonworks Data Platform V2.1.0(Baikal)",
|
||||
"HDP_2_1",
|
||||
|
||||
HDP_2_1(EHadoopDistributions.HORTONWORKS, "Hortonworks Data Platform V2.1.0(Baikal)", //$NON-NLS-1$
|
||||
"HDP_2_1", //$NON-NLS-1$
|
||||
true,
|
||||
false,
|
||||
new EMRVersion[] { EMRVersion.YARN }),
|
||||
|
||||
HDP_2_0(
|
||||
EHadoopDistributions.HORTONWORKS,
|
||||
"Hortonworks Data Platform V2.0.0(BigWheel)",
|
||||
"HDP_2_0",
|
||||
HDP_2_0(EHadoopDistributions.HORTONWORKS, "Hortonworks Data Platform V2.0.0(BigWheel)", //$NON-NLS-1$
|
||||
"HDP_2_0", //$NON-NLS-1$
|
||||
true,
|
||||
false,
|
||||
new EMRVersion[] { EMRVersion.YARN }),
|
||||
|
||||
HDP_1_3(EHadoopDistributions.HORTONWORKS, "Hortonworks Data Platform V1.3.0(Condor)", "HDP_1_3", true, false),
|
||||
HDP_1_3(EHadoopDistributions.HORTONWORKS, "Hortonworks Data Platform V1.3.0(Condor)", "HDP_1_3", true, false), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
HDP_1_2(EHadoopDistributions.HORTONWORKS, "Hortonworks Data Platform V1.2.0(Bimota)", "HDP_1_2", true, false),
|
||||
HDP_1_2(EHadoopDistributions.HORTONWORKS, "Hortonworks Data Platform V1.2.0(Bimota)", "HDP_1_2", true, false), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
HDP_1_0(EHadoopDistributions.HORTONWORKS, "Hortonworks Data Platform V1.0.0(deprecated)", "HDP_1_0", true, false),
|
||||
HDP_1_0(EHadoopDistributions.HORTONWORKS, "Hortonworks Data Platform V1.0.0(deprecated)", "HDP_1_0", true, false), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
APACHE_1_0_0(EHadoopDistributions.APACHE, "Apache 1.0.0", "APACHE_1_0_0", true, false),
|
||||
APACHE_1_0_0(EHadoopDistributions.APACHE, "Apache 1.0.0", "APACHE_1_0_0", true, false), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
APACHE_0_20_204(EHadoopDistributions.APACHE, "Apache 0.20.204", "APACHE_0_20_204", false, false),
|
||||
APACHE_0_20_204(EHadoopDistributions.APACHE, "Apache 0.20.204", "APACHE_0_20_204", false, false), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
APACHE_0_20_203(EHadoopDistributions.APACHE, "Apache 0.20.203", "APACHE_0_20_203", false, false),
|
||||
APACHE_0_20_203(EHadoopDistributions.APACHE, "Apache 0.20.203", "APACHE_0_20_203", false, false), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
APACHE_0_20_2(EHadoopDistributions.APACHE, "Apache 0.20.2", "APACHE_0_20_2", false, true),
|
||||
APACHE_0_20_2(EHadoopDistributions.APACHE, "Apache 0.20.2", "APACHE_0_20_2", false, true), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
CLOUDERA_CDH5_1(
|
||||
EHadoopDistributions.CLOUDERA,
|
||||
"Cloudera CDH5.1",
|
||||
"Cloudera_CDH5_1",
|
||||
CLOUDERA_CDH5_1(EHadoopDistributions.CLOUDERA, "Cloudera CDH5.1(YARN mode)", //$NON-NLS-1$
|
||||
"Cloudera_CDH5_1", //$NON-NLS-1$
|
||||
true,
|
||||
false,
|
||||
new EMRVersion[] { EMRVersion.YARN }),
|
||||
|
||||
CLOUDERA_CDH5(
|
||||
EHadoopDistributions.CLOUDERA,
|
||||
"Cloudera CDH5",
|
||||
"Cloudera_CDH5",
|
||||
CLOUDERA_CDH5_1_MR1(EHadoopDistributions.CLOUDERA, "Cloudera CDH5.1(MR 1 mode)", //$NON-NLS-1$
|
||||
"Cloudera_CDH5_1_MR1", //$NON-NLS-1$
|
||||
true,
|
||||
false,
|
||||
new EMRVersion[] { EMRVersion.MR1 }),
|
||||
|
||||
CLOUDERA_CDH5(EHadoopDistributions.CLOUDERA, "Cloudera CDH5", //$NON-NLS-1$
|
||||
"Cloudera_CDH5", //$NON-NLS-1$
|
||||
true,
|
||||
false,
|
||||
new EMRVersion[] { EMRVersion.YARN }),
|
||||
|
||||
CLOUDERA_CDH4_YARN(
|
||||
EHadoopDistributions.CLOUDERA,
|
||||
"Cloudera CDH4 YARN",
|
||||
"Cloudera_CDH4_YARN",
|
||||
CLOUDERA_CDH4_YARN(EHadoopDistributions.CLOUDERA, "Cloudera CDH4 YARN", //$NON-NLS-1$
|
||||
"Cloudera_CDH4_YARN", //$NON-NLS-1$
|
||||
true,
|
||||
false,
|
||||
new EMRVersion[] { EMRVersion.YARN }),
|
||||
|
||||
CLOUDERA_CDH4(EHadoopDistributions.CLOUDERA, "Cloudera CDH4", "Cloudera_CDH4", true, false),
|
||||
CLOUDERA_CDH4(EHadoopDistributions.CLOUDERA, "Cloudera CDH4", "Cloudera_CDH4", true, false), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
CLOUDERA_CDH3(EHadoopDistributions.CLOUDERA, "Cloudera CDH3(deprecated)", "Cloudera_CDH3", false, false),
|
||||
CLOUDERA_CDH3(EHadoopDistributions.CLOUDERA, "Cloudera CDH3(deprecated)", "Cloudera_CDH3", false, false), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
MAPR401(EHadoopDistributions.MAPR, "MapR 4.0.1", "MAPR401", false, true, new EMRVersion[] { EMRVersion.YARN }),
|
||||
MAPR401(EHadoopDistributions.MAPR, "MapR 4.0.1", "MAPR401", false, true, new EMRVersion[] { EMRVersion.YARN }), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
MAPR310(EHadoopDistributions.MAPR, "MapR 3.1.0", "MAPR310", false, true),
|
||||
MAPR310(EHadoopDistributions.MAPR, "MapR 3.1.0", "MAPR310", false, true), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
MAPR301(EHadoopDistributions.MAPR, "MapR 3.0.1", "MAPR301", false, true),
|
||||
MAPR301(EHadoopDistributions.MAPR, "MapR 3.0.1", "MAPR301", false, true), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
MAPR213(EHadoopDistributions.MAPR, "MapR 2.1.3", "MAPR213", false, true),
|
||||
MAPR213(EHadoopDistributions.MAPR, "MapR 2.1.3", "MAPR213", false, true), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
MAPR212(EHadoopDistributions.MAPR, "MapR 2.1.2", "MAPR212", false, true),
|
||||
MAPR212(EHadoopDistributions.MAPR, "MapR 2.1.2", "MAPR212", false, true), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
MAPR2(EHadoopDistributions.MAPR, "MapR 2.0.0", "MAPR2", false, true),
|
||||
MAPR2(EHadoopDistributions.MAPR, "MapR 2.0.0", "MAPR2", false, true), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
MAPR1(EHadoopDistributions.MAPR, "MapR 1.2.0", "MAPR1", false, true),
|
||||
MAPR1(EHadoopDistributions.MAPR, "MapR 1.2.0", "MAPR1", false, true), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
APACHE_2_4_0_EMR(
|
||||
EHadoopDistributions.AMAZON_EMR,
|
||||
"Apache 2.4.0",
|
||||
"APACHE_2_4_0_EMR",
|
||||
APACHE_2_4_0_EMR(EHadoopDistributions.AMAZON_EMR, "Apache 2.4.0", //$NON-NLS-1$
|
||||
"APACHE_2_4_0_EMR", //$NON-NLS-1$
|
||||
false,
|
||||
false,
|
||||
new EMRVersion[] { EMRVersion.YARN }),
|
||||
|
||||
APACHE_1_0_3_EMR(EHadoopDistributions.AMAZON_EMR, "Apache 1.0.3", "APACHE_1_0_3_EMR", true, false),
|
||||
APACHE_1_0_3_EMR(EHadoopDistributions.AMAZON_EMR, "Apache 1.0.3", "APACHE_1_0_3_EMR", true, false), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
MAPR_EMR(EHadoopDistributions.AMAZON_EMR, "MapR 1.2.8(deprecated)", "MapR_EMR", false, true),
|
||||
MAPR_EMR(EHadoopDistributions.AMAZON_EMR, "MapR 1.2.8(deprecated)", "MapR_EMR", false, true), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
PIVOTAL_HD_2_0(
|
||||
EHadoopDistributions.PIVOTAL_HD,
|
||||
"Pivotal HD 2.0",
|
||||
"PIVOTAL_HD_2_0",
|
||||
PIVOTAL_HD_2_0(EHadoopDistributions.PIVOTAL_HD, "Pivotal HD 2.0", //$NON-NLS-1$
|
||||
"PIVOTAL_HD_2_0", //$NON-NLS-1$
|
||||
true,
|
||||
false,
|
||||
new EMRVersion[] { EMRVersion.YARN }),
|
||||
|
||||
PIVOTAL_HD_1_0_1(
|
||||
EHadoopDistributions.PIVOTAL_HD,
|
||||
"Pivotal HD 1.0.1",
|
||||
"PIVOTAL_HD_1_0_1",
|
||||
PIVOTAL_HD_1_0_1(EHadoopDistributions.PIVOTAL_HD, "Pivotal HD 1.0.1", //$NON-NLS-1$
|
||||
"PIVOTAL_HD_1_0_1", //$NON-NLS-1$
|
||||
false,
|
||||
false,
|
||||
new EMRVersion[] { EMRVersion.YARN }),
|
||||
|
||||
MICROSOFT_HD_INSIGHT_3_1(
|
||||
EHadoopDistributions.MICROSOFT_HD_INSIGHT,
|
||||
"Microsoft HD Insight 3.1",
|
||||
"MICROSOFT_HD_INSIGHT_3_1",
|
||||
MICROSOFT_HD_INSIGHT_3_1(EHadoopDistributions.MICROSOFT_HD_INSIGHT, "Microsoft HD Insight 3.1", //$NON-NLS-1$
|
||||
"MICROSOFT_HD_INSIGHT_3_1", //$NON-NLS-1$
|
||||
true,
|
||||
false,
|
||||
new EMRVersion[] { EMRVersion.YARN }),
|
||||
|
||||
CUSTOM(EHadoopDistributions.CUSTOM, "", "", false, false, new EMRVersion[] { EMRVersion.MR1, EMRVersion.YARN });
|
||||
CUSTOM(EHadoopDistributions.CUSTOM, "", "", false, false, new EMRVersion[] { EMRVersion.MR1, EMRVersion.YARN }); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
private EHadoopDistributions distribution;
|
||||
|
||||
@@ -196,7 +185,7 @@ public enum EHadoopVersion4Drivers {
|
||||
}
|
||||
}
|
||||
}
|
||||
return EHadoopVersion4Drivers.CUSTOM;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<EHadoopVersion4Drivers> indexOfByDistribution(EHadoopDistributions distribution) {
|
||||
|
||||
@@ -85,7 +85,7 @@ public class ContextUtils {
|
||||
contextParam.setPrompt(parameterType.getPrompt());
|
||||
contextParam.setPromptNeeded(parameterType.isPromptNeeded());
|
||||
contextParam.setType(parameterType.getType());
|
||||
contextParam.setValue(parameterType.getValue());
|
||||
contextParam.setValue(parameterType.getRawValue());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -395,7 +395,7 @@ public class ContextUtils {
|
||||
} else {
|
||||
targetParam.setType(MetadataTalendType.getDefaultTalendType());
|
||||
}
|
||||
targetParam.setValue(sourceParam.getValue());
|
||||
targetParam.setValue(sourceParam.getRawValue());
|
||||
targetParam.setPromptNeeded(sourceParam.isPromptNeeded());
|
||||
targetParam.setComment(sourceParam.getComment());
|
||||
|
||||
@@ -497,7 +497,8 @@ public class ContextUtils {
|
||||
if (sourceParam.isPromptNeeded() != targetParamType.isPromptNeeded()) {
|
||||
return false;
|
||||
}
|
||||
if (!sourceParam.getValue().equals(targetParamType.getValue())) {
|
||||
// need check the raw value, because in sourceParam, it's raw
|
||||
if (!sourceParam.getValue().equals(targetParamType.getRawValue())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -631,30 +632,20 @@ public class ContextUtils {
|
||||
|
||||
contextParam.setName(contextParamType.getName());
|
||||
contextParam.setPrompt(contextParamType.getPrompt());
|
||||
boolean exists = false;
|
||||
ECodeLanguage curLanguage = LanguageManager.getCurrentLanguage();
|
||||
if (curLanguage == ECodeLanguage.JAVA) {
|
||||
exists = true;
|
||||
try {
|
||||
ContextParameterJavaTypeManager.getJavaTypeFromId(contextParamType.getType());
|
||||
} catch (IllegalArgumentException e) {
|
||||
exists = false;
|
||||
}
|
||||
} else {
|
||||
String[] existingTypes;
|
||||
existingTypes = ContextParameterJavaTypeManager.getPerlTypesLabels();
|
||||
for (String existingType : existingTypes) {
|
||||
if (existingType.equals(contextParamType.getType())) {
|
||||
exists = true;
|
||||
}
|
||||
}
|
||||
boolean exists = true;
|
||||
try {
|
||||
ContextParameterJavaTypeManager.getJavaTypeFromId(contextParamType.getType());
|
||||
} catch (IllegalArgumentException e) {
|
||||
exists = false;
|
||||
}
|
||||
if (exists) {
|
||||
contextParam.setType(contextParamType.getType());
|
||||
} else {
|
||||
contextParam.setType(MetadataTalendType.getDefaultTalendType());
|
||||
}
|
||||
contextParam.setValue(contextParamType.getValue());
|
||||
// specially for Password type to get raw value.
|
||||
contextParam.setValue(contextParamType.getRawValue());
|
||||
|
||||
contextParam.setPromptNeeded(contextParamType.isPromptNeeded());
|
||||
contextParam.setComment(contextParamType.getComment());
|
||||
contextParam.setSource(contextItem.getProperty().getId());
|
||||
|
||||
@@ -18,13 +18,8 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.PasswordEncryptUtil;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
import org.talend.core.model.metadata.MetadataTalendType;
|
||||
import org.talend.core.model.metadata.types.ContextParameterJavaTypeManager;
|
||||
import org.talend.core.model.process.IContext;
|
||||
@@ -33,10 +28,10 @@ import org.talend.core.model.process.IContextManager;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.utils.ContextParameterUtils;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.TalendFileFactory;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
|
||||
/**
|
||||
* DOC nrousseau class global comment. Detailled comment <br/>
|
||||
@@ -234,13 +229,7 @@ public class JobContextManager implements IContextManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA) {
|
||||
// for java, the var name not be named with java keywords.
|
||||
if (ContextUtils.isJavaKeyWords(newContextName)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return Pattern.matches(RepositoryConstants.CONTEXT_AND_VARIABLE_PATTERN, newContextName);
|
||||
return ContextParameterUtils.isValidParameterName(newContextName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -278,19 +267,7 @@ public class JobContextManager implements IContextManager {
|
||||
contextParamType.setName(contextParam.getName());
|
||||
contextParamType.setPrompt(contextParam.getPrompt());
|
||||
contextParamType.setType(contextParam.getType());
|
||||
if (PasswordEncryptUtil.isPasswordType(contextParamType.getType())) {
|
||||
// see 0000949: Encryption of DB passwords in XMI
|
||||
// repository files
|
||||
try {
|
||||
String password = PasswordEncryptUtil.encryptPassword(contextParam.getValue());
|
||||
contextParamType.setValue(password);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
} else {
|
||||
contextParamType.setValue(contextParam.getValue());
|
||||
}
|
||||
contextParamType.setRawValue(contextParam.getValue());
|
||||
contextParamType.setPromptNeeded(contextParam.isPromptNeeded());
|
||||
contextParamType.setComment(contextParam.getComment());
|
||||
if (!contextParam.isBuiltIn()) {
|
||||
@@ -347,30 +324,19 @@ public class JobContextManager implements IContextManager {
|
||||
contextParam.setName(contextParamType.getName());
|
||||
contextParam.setPrompt(contextParamType.getPrompt());
|
||||
originalParamerters.add(contextParam.getName());
|
||||
boolean exists = false;
|
||||
ECodeLanguage curLanguage = LanguageManager.getCurrentLanguage();
|
||||
if (curLanguage == ECodeLanguage.JAVA) {
|
||||
exists = true;
|
||||
try {
|
||||
ContextParameterJavaTypeManager.getJavaTypeFromId(contextParamType.getType());
|
||||
} catch (IllegalArgumentException e) {
|
||||
exists = false;
|
||||
}
|
||||
} else {
|
||||
String[] existingTypes;
|
||||
existingTypes = ContextParameterJavaTypeManager.getPerlTypesLabels();
|
||||
for (String existingType : existingTypes) {
|
||||
if (existingType.equals(contextParamType.getType())) {
|
||||
exists = true;
|
||||
}
|
||||
}
|
||||
boolean exists = true;
|
||||
try {
|
||||
ContextParameterJavaTypeManager.getJavaTypeFromId(contextParamType.getType());
|
||||
} catch (IllegalArgumentException e) {
|
||||
exists = false;
|
||||
}
|
||||
if (exists) {
|
||||
contextParam.setType(contextParamType.getType());
|
||||
} else {
|
||||
contextParam.setType(MetadataTalendType.getDefaultTalendType());
|
||||
}
|
||||
contextParam.setValue(contextParamType.getValue());
|
||||
contextParam.setValue(contextParamType.getRawValue());
|
||||
|
||||
contextParam.setPromptNeeded(contextParamType.isPromptNeeded());
|
||||
contextParam.setComment(contextParamType.getComment());
|
||||
|
||||
|
||||
@@ -12,12 +12,10 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.model.context;
|
||||
|
||||
import org.talend.core.context.RepositoryContext;
|
||||
import org.talend.core.model.metadata.MetadataToolHelper;
|
||||
import org.talend.core.model.process.IContext;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.utils.ContextParameterUtils;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
|
||||
/**
|
||||
* Parameter in a context. <br/>
|
||||
@@ -267,12 +265,7 @@ public class JobContextParameter implements IContextParameter, Cloneable {
|
||||
@Override
|
||||
public String getScriptCode() {
|
||||
if (this.scriptCode == null) {
|
||||
scriptCode = ContextParameterUtils
|
||||
.getScriptCode(
|
||||
this,
|
||||
((RepositoryContext) CoreRuntimePlugin.getInstance().getContext()
|
||||
.getProperty(org.talend.core.context.Context.REPOSITORY_CONTEXT_KEY)).getProject()
|
||||
.getLanguage());
|
||||
scriptCode = ContextParameterUtils.getScriptCode(this);
|
||||
}
|
||||
return this.scriptCode;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public final class UpdateContextVariablesHelper {
|
||||
return false;
|
||||
}
|
||||
// get old syntax map of the context variables.
|
||||
Map<String, String> replacedScriptCodeMap = retrieveReplacedScriptCodeMap((List<ContextType>) processType.getContext(),
|
||||
Map<String, String> replacedScriptCodeMap = retrieveReplacedScriptCodeMap(processType.getContext(),
|
||||
processType.getDefaultContext());
|
||||
if (replacedScriptCodeMap.isEmpty()) {
|
||||
return false;
|
||||
@@ -138,13 +138,11 @@ public final class UpdateContextVariablesHelper {
|
||||
|
||||
boolean changed = false;
|
||||
// update process parameter
|
||||
changed = updateElementParameter((List<ElementParameterType>) processType.getParameters().getElementParameter(),
|
||||
varScriptCodeMap, oldSyntax);
|
||||
changed = updateElementParameter(processType.getParameters().getElementParameter(), varScriptCodeMap, oldSyntax);
|
||||
// update nodes parameter
|
||||
for (NodeType node : (List<NodeType>) processType.getNode()) {
|
||||
// update parameter
|
||||
changed |= updateElementParameter((List<ElementParameterType>) node.getElementParameter(), varScriptCodeMap,
|
||||
oldSyntax);
|
||||
changed |= updateElementParameter(node.getElementParameter(), varScriptCodeMap, oldSyntax);
|
||||
|
||||
// update extend node data
|
||||
String strdata = node.getStringData();
|
||||
@@ -159,8 +157,7 @@ public final class UpdateContextVariablesHelper {
|
||||
// update links parameters(bug 3993)
|
||||
for (ConnectionType conn : (List<ConnectionType>) processType.getConnection()) {
|
||||
// update parameter
|
||||
changed |= updateElementParameter((List<ElementParameterType>) conn.getElementParameter(), varScriptCodeMap,
|
||||
oldSyntax);
|
||||
changed |= updateElementParameter(conn.getElementParameter(), varScriptCodeMap, oldSyntax);
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
@@ -171,7 +168,7 @@ public final class UpdateContextVariablesHelper {
|
||||
return false;
|
||||
}
|
||||
boolean changed = false;
|
||||
for (ElementParameterType eleParameterType : (List<ElementParameterType>) eleParameterList) {
|
||||
for (ElementParameterType eleParameterType : eleParameterList) {
|
||||
String oldValue = eleParameterType.getValue();
|
||||
if (oldValue != null) {
|
||||
String newValue = hasAndReplaceValue(oldValue, varScriptCodeMap, oldSyntax);
|
||||
@@ -319,7 +316,7 @@ public final class UpdateContextVariablesHelper {
|
||||
ECodeLanguage language = LanguageManager.getCurrentLanguage();
|
||||
|
||||
for (ContextParameterType parameter : (List<ContextParameterType>) contextType.getContextParameter()) {
|
||||
String oldCode = ContextParameterUtils.getScriptCode(parameter, language);
|
||||
String oldCode = ContextParameterUtils.getScriptCode(parameter);
|
||||
String newCode = ContextParameterUtils.getNewScriptCode(parameter.getName(), language);
|
||||
varsScriptCodeMap.put(oldCode, newCode);
|
||||
}
|
||||
|
||||
@@ -404,8 +404,8 @@ public final class MetadataTalendType {
|
||||
return dbms;
|
||||
}
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException(Messages.getString("MetadataTalendType.dbIdNotFound", dbmsId)); //$NON-NLS-1$
|
||||
ExceptionHandler.log(Messages.getString("MetadataTalendType.dbIdNotFound", dbmsId));
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -199,7 +199,7 @@ public final class ConvertionHelper {
|
||||
result.setId(connection.getId());
|
||||
result.setLabel(connection.getLabel());
|
||||
result.setNullChar(connection.getNullChar());
|
||||
result.setPassword(connection.getPassword());
|
||||
result.setPassword(connection.getRawPassword());
|
||||
result.setPort(connection.getPort());
|
||||
result.setServerName(connection.getServerName());
|
||||
result.setSqlSyntax(connection.getSqlSynthax());
|
||||
@@ -277,7 +277,7 @@ public final class ConvertionHelper {
|
||||
result.setId(connection.getId());
|
||||
result.setLabel(connection.getLabel());
|
||||
|
||||
result.setPassword(connection.getPassword());
|
||||
result.setPassword(connection.getValue(connection.getPassword(), false));
|
||||
result.setPort(connection.getPort());
|
||||
result.setServerName(connection.getServer());
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.model.metadata.connection.hive;
|
||||
|
||||
import org.talend.core.hadoop.version.EHadoopDistributions;
|
||||
import org.talend.core.hadoop.version.EHadoopVersion4Drivers;
|
||||
|
||||
/**
|
||||
* This class provides the info for Hive. There are 3 levels as follows:
|
||||
*
|
||||
@@ -29,67 +32,165 @@ package org.talend.core.model.metadata.connection.hive;
|
||||
*/
|
||||
public enum HiveConnVersionInfo {
|
||||
|
||||
HORTONWORKS(0, "HORTONWORKS", "HortonWorks", true), //$NON-NLS-1$//$NON-NLS-2$
|
||||
HORTONWORKS(0, EHadoopDistributions.HORTONWORKS.getName(), EHadoopDistributions.HORTONWORKS.getDisplayName(), true),
|
||||
|
||||
APACHE(0, "APACHE", "Apache", false), //$NON-NLS-1$//$NON-NLS-2$
|
||||
APACHE(0, EHadoopDistributions.APACHE.getName(), EHadoopDistributions.APACHE.getDisplayName(), false),
|
||||
|
||||
CLOUDERA(0, "CLOUDERA", "Cloudera", false), //$NON-NLS-1$//$NON-NLS-2$
|
||||
CLOUDERA(0, EHadoopDistributions.CLOUDERA.getName(), EHadoopDistributions.CLOUDERA.getDisplayName(), false),
|
||||
|
||||
MAPR(0, "MAPR", "MapR", false), //$NON-NLS-1$//$NON-NLS-2$
|
||||
MAPR(0, EHadoopDistributions.MAPR.getName(), EHadoopDistributions.MAPR.getDisplayName(), false),
|
||||
|
||||
AMAZON_EMR(0, "AMAZON_EMR", "Amazon EMR", false), //$NON-NLS-1$//$NON-NLS-2$
|
||||
AMAZON_EMR(0, EHadoopDistributions.AMAZON_EMR.getName(), EHadoopDistributions.AMAZON_EMR.getDisplayName(), false),
|
||||
|
||||
PIVOTAL_HD(0, "PIVOTAL_HD", "Pivotal HD", false), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
PIVOTAL_HD(0, EHadoopDistributions.PIVOTAL_HD.getName(), EHadoopDistributions.PIVOTAL_HD.getDisplayName(), false),
|
||||
|
||||
DISTRO_CUSTOM(0, "CUSTOM", "Custom - Unsupported", false), //$NON-NLS-1$//$NON-NLS-2$
|
||||
DISTRO_CUSTOM(0, EHadoopDistributions.CUSTOM.getName(), EHadoopDistributions.CUSTOM.getDisplayName(), false),
|
||||
|
||||
HDP_2_1(1, "HDP_2_1", "Hortonworks Data Platform V2.1.0(Baikal)", true, false, true, true, HiveConnVersionInfo.HORTONWORKS), //$NON-NLS-1$//$NON-NLS-2$
|
||||
HDP_2_1(
|
||||
1,
|
||||
EHadoopVersion4Drivers.HDP_2_1.getVersionValue(),
|
||||
EHadoopVersion4Drivers.HDP_2_1.getVersionDisplay(),
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
HiveConnVersionInfo.HORTONWORKS),
|
||||
|
||||
HDP_2_0(1, "HDP_2_0", "Hortonworks Data Platform V2.0.0(BigWheel)", true, false, true, true, HiveConnVersionInfo.HORTONWORKS), //$NON-NLS-1$//$NON-NLS-2$
|
||||
HDP_2_0(
|
||||
1,
|
||||
EHadoopVersion4Drivers.HDP_2_0.getVersionValue(),
|
||||
EHadoopVersion4Drivers.HDP_2_0.getVersionDisplay(),
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
HiveConnVersionInfo.HORTONWORKS),
|
||||
|
||||
HDP_1_3(1, "HDP_1_3", "Hortonworks Data Platform V1.3.0(Condor)", true, true, HiveConnVersionInfo.HORTONWORKS), //$NON-NLS-1$//$NON-NLS-2$
|
||||
HDP_1_3(
|
||||
1,
|
||||
EHadoopVersion4Drivers.HDP_1_3.getVersionValue(),
|
||||
EHadoopVersion4Drivers.HDP_1_3.getVersionDisplay(),
|
||||
true,
|
||||
true,
|
||||
HiveConnVersionInfo.HORTONWORKS),
|
||||
|
||||
HDP_1_2(1, "HDP_1_2", "Hortonworks Data Platform V1.2.0(Bimota)", true, true, HiveConnVersionInfo.HORTONWORKS), //$NON-NLS-1$//$NON-NLS-2$
|
||||
HDP_1_2(
|
||||
1,
|
||||
EHadoopVersion4Drivers.HDP_1_2.getVersionValue(),
|
||||
EHadoopVersion4Drivers.HDP_1_2.getVersionDisplay(),
|
||||
true,
|
||||
true,
|
||||
HiveConnVersionInfo.HORTONWORKS),
|
||||
|
||||
HDP_1_0(1, "HDP_1_0", "Hortonworks Data Platform V1.0.0(deprecated)", true, HiveConnVersionInfo.HORTONWORKS), //$NON-NLS-1$//$NON-NLS-2$
|
||||
HDP_1_0(
|
||||
1,
|
||||
EHadoopVersion4Drivers.HDP_1_0.getVersionValue(),
|
||||
EHadoopVersion4Drivers.HDP_1_0.getVersionDisplay(),
|
||||
true,
|
||||
HiveConnVersionInfo.HORTONWORKS),
|
||||
|
||||
APACHE_1_0_0(1, "APACHE_1_0_0", "Apache 1.0.0 (Hive 0.9.0)", false, HiveConnVersionInfo.APACHE), //$NON-NLS-1$//$NON-NLS-2$
|
||||
APACHE_1_0_0(1, EHadoopVersion4Drivers.APACHE_1_0_0.getVersionValue(), EHadoopVersion4Drivers.APACHE_1_0_0
|
||||
.getVersionDisplay(), false, HiveConnVersionInfo.APACHE),
|
||||
|
||||
APACHE_0_20_203(1, "APACHE_0_20_203", "Apache 0.20.203 (Hive 0.7.1)", false, HiveConnVersionInfo.APACHE), //$NON-NLS-1$//$NON-NLS-2$
|
||||
APACHE_0_20_203(1, EHadoopVersion4Drivers.APACHE_0_20_203.getVersionValue(), EHadoopVersion4Drivers.APACHE_0_20_203
|
||||
.getVersionDisplay(), false, HiveConnVersionInfo.APACHE),
|
||||
|
||||
Cloudera_CDH5_1(1, "Cloudera_CDH5_1", "Cloudera CDH5.1", true, false, true, true, HiveConnVersionInfo.CLOUDERA), //$NON-NLS-1$//$NON-NLS-2$
|
||||
Cloudera_CDH5_1(1, EHadoopVersion4Drivers.CLOUDERA_CDH5_1.getVersionValue(), EHadoopVersion4Drivers.CLOUDERA_CDH5_1
|
||||
.getVersionDisplay(), true, false, true, true, HiveConnVersionInfo.CLOUDERA),
|
||||
|
||||
Cloudera_CDH5(1, "Cloudera_CDH5", "Cloudera CDH5", true, false, true, true, HiveConnVersionInfo.CLOUDERA), //$NON-NLS-1$//$NON-NLS-2$
|
||||
Cloudera_CDH5_1_MR1(
|
||||
1,
|
||||
EHadoopVersion4Drivers.CLOUDERA_CDH5_1_MR1.getVersionValue(),
|
||||
EHadoopVersion4Drivers.CLOUDERA_CDH5_1_MR1.getVersionDisplay(),
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
HiveConnVersionInfo.CLOUDERA),
|
||||
|
||||
Cloudera_CDH4_YARN(1, "Cloudera_CDH4_YARN", "Cloudera CDH4 YARN", true, false, true, false, HiveConnVersionInfo.CLOUDERA), //$NON-NLS-1$//$NON-NLS-2$
|
||||
Cloudera_CDH5(1, EHadoopVersion4Drivers.CLOUDERA_CDH5.getVersionValue(), EHadoopVersion4Drivers.CLOUDERA_CDH5
|
||||
.getVersionDisplay(), true, false, true, true, HiveConnVersionInfo.CLOUDERA),
|
||||
|
||||
Cloudera_CDH4(1, "Cloudera_CDH4", "Cloudera CDH4", true, true, HiveConnVersionInfo.CLOUDERA), //$NON-NLS-1$//$NON-NLS-2$
|
||||
Cloudera_CDH4_YARN(1, EHadoopVersion4Drivers.CLOUDERA_CDH4_YARN.getVersionValue(), EHadoopVersion4Drivers.CLOUDERA_CDH4_YARN
|
||||
.getVersionDisplay(), true, false, true, false, HiveConnVersionInfo.CLOUDERA),
|
||||
|
||||
Cloudera_CDH3(1, "Cloudera_CDH3", "Cloudera CDH3(deprecated)", false, HiveConnVersionInfo.CLOUDERA), //$NON-NLS-1$//$NON-NLS-2$
|
||||
Cloudera_CDH4(1, EHadoopVersion4Drivers.CLOUDERA_CDH4.getVersionValue(), EHadoopVersion4Drivers.CLOUDERA_CDH4
|
||||
.getVersionDisplay(), true, true, HiveConnVersionInfo.CLOUDERA),
|
||||
|
||||
MAPR4_0_1(1, "MAPR401", "MapR 4.0.1", true, false, HiveConnVersionInfo.MAPR), //$NON-NLS-1$//$NON-NLS-2$
|
||||
Cloudera_CDH3(1, EHadoopVersion4Drivers.CLOUDERA_CDH3.getVersionValue(), EHadoopVersion4Drivers.CLOUDERA_CDH3
|
||||
.getVersionDisplay(), false, HiveConnVersionInfo.CLOUDERA),
|
||||
|
||||
MAPR3_1_0(1, "MAPR310", "MapR 3.1.0", true, false, HiveConnVersionInfo.MAPR), //$NON-NLS-1$//$NON-NLS-2$
|
||||
MAPR4_0_1(
|
||||
1,
|
||||
EHadoopVersion4Drivers.MAPR401.getVersionValue(),
|
||||
EHadoopVersion4Drivers.MAPR401.getVersionDisplay(),
|
||||
true,
|
||||
false,
|
||||
HiveConnVersionInfo.MAPR),
|
||||
|
||||
MAPR3_0_1(1, "MAPR301", "MapR 3.0.1", true, false, HiveConnVersionInfo.MAPR), //$NON-NLS-1$//$NON-NLS-2$
|
||||
MAPR3_1_0(
|
||||
1,
|
||||
EHadoopVersion4Drivers.MAPR310.getVersionValue(),
|
||||
EHadoopVersion4Drivers.MAPR310.getVersionDisplay(),
|
||||
true,
|
||||
false,
|
||||
HiveConnVersionInfo.MAPR),
|
||||
|
||||
MAPR2_1_3(1, "MAPR213", "MapR 2.1.3", true, false, HiveConnVersionInfo.MAPR), //$NON-NLS-1$//$NON-NLS-2$
|
||||
MAPR3_0_1(
|
||||
1,
|
||||
EHadoopVersion4Drivers.MAPR301.getVersionValue(),
|
||||
EHadoopVersion4Drivers.MAPR301.getVersionDisplay(),
|
||||
true,
|
||||
false,
|
||||
HiveConnVersionInfo.MAPR),
|
||||
|
||||
MAPR2_1_2(1, "MAPR212", "MapR 2.1.2", false, HiveConnVersionInfo.MAPR), //$NON-NLS-1$//$NON-NLS-2$
|
||||
MAPR2_1_3(
|
||||
1,
|
||||
EHadoopVersion4Drivers.MAPR213.getVersionValue(),
|
||||
EHadoopVersion4Drivers.MAPR213.getVersionDisplay(),
|
||||
true,
|
||||
false,
|
||||
HiveConnVersionInfo.MAPR),
|
||||
|
||||
MAPR2(1, "MAPR2", "MapR 2.0.0", false, HiveConnVersionInfo.MAPR), //$NON-NLS-1$//$NON-NLS-2$
|
||||
MAPR2_1_2(
|
||||
1,
|
||||
EHadoopVersion4Drivers.MAPR212.getVersionValue(),
|
||||
EHadoopVersion4Drivers.MAPR212.getVersionDisplay(),
|
||||
false,
|
||||
HiveConnVersionInfo.MAPR),
|
||||
|
||||
MAPR1(1, "MAPR1", "MapR 1.2.0", false, HiveConnVersionInfo.MAPR), //$NON-NLS-1$//$NON-NLS-2$
|
||||
MAPR2(
|
||||
1,
|
||||
EHadoopVersion4Drivers.MAPR2.getVersionValue(),
|
||||
EHadoopVersion4Drivers.MAPR2.getVersionDisplay(),
|
||||
false,
|
||||
HiveConnVersionInfo.MAPR),
|
||||
|
||||
APACHE_2_4_0_EMR(1, "APACHE_2_4_0_EMR", "Apache 2.4.0 (Hive 0.11.0)", true, HiveConnVersionInfo.AMAZON_EMR), //$NON-NLS-1$//$NON-NLS-2$
|
||||
MAPR1(
|
||||
1,
|
||||
EHadoopVersion4Drivers.MAPR1.getVersionValue(),
|
||||
EHadoopVersion4Drivers.MAPR1.getVersionDisplay(),
|
||||
false,
|
||||
HiveConnVersionInfo.MAPR),
|
||||
|
||||
APACHE_1_0_3_EMR(1, "APACHE_1_0_3_EMR", "Apache 1.0.3 (Hive 0.8.1)", false, HiveConnVersionInfo.AMAZON_EMR), //$NON-NLS-1$//$NON-NLS-2$
|
||||
APACHE_2_4_0_EMR(1, EHadoopVersion4Drivers.APACHE_2_4_0_EMR.getVersionValue(), EHadoopVersion4Drivers.APACHE_2_4_0_EMR
|
||||
.getVersionDisplay(), true, HiveConnVersionInfo.AMAZON_EMR),
|
||||
|
||||
MapR_EMR(1, "MapR_EMR", "MapR 1.2.8(deprecated)", false, HiveConnVersionInfo.AMAZON_EMR), //$NON-NLS-1$//$NON-NLS-2$
|
||||
APACHE_1_0_3_EMR(1, EHadoopVersion4Drivers.APACHE_1_0_3_EMR.getVersionValue(), EHadoopVersion4Drivers.APACHE_1_0_3_EMR
|
||||
.getVersionDisplay(), false, HiveConnVersionInfo.AMAZON_EMR),
|
||||
|
||||
PIVOTAL_HD_2_0(1, "PIVOTAL_HD_2_0", "Pivotal HD 2.0", true, false, true, true, HiveConnVersionInfo.PIVOTAL_HD), //$NON-NLS-1$//$NON-NLS-2$
|
||||
MapR_EMR(
|
||||
1,
|
||||
EHadoopVersion4Drivers.MAPR_EMR.getVersionValue(),
|
||||
EHadoopVersion4Drivers.MAPR_EMR.getVersionDisplay(),
|
||||
false,
|
||||
HiveConnVersionInfo.AMAZON_EMR),
|
||||
|
||||
PIVOTAL_HD_1_0_1(1, "PIVOTAL_HD_1_0_1", "Pivotal HD 1.0.1", false, false, true, false, HiveConnVersionInfo.PIVOTAL_HD), //$NON-NLS-1$//$NON-NLS-2$
|
||||
PIVOTAL_HD_2_0(1, EHadoopVersion4Drivers.PIVOTAL_HD_2_0.getVersionValue(), EHadoopVersion4Drivers.PIVOTAL_HD_2_0
|
||||
.getVersionDisplay(), true, false, true, true, HiveConnVersionInfo.PIVOTAL_HD),
|
||||
|
||||
PIVOTAL_HD_1_0_1(1, EHadoopVersion4Drivers.PIVOTAL_HD_1_0_1.getVersionValue(), EHadoopVersion4Drivers.PIVOTAL_HD_1_0_1
|
||||
.getVersionDisplay(), false, false, true, false, HiveConnVersionInfo.PIVOTAL_HD),
|
||||
|
||||
DISTRO_VERSION_CUSTOM(1, "DISTRO_VERSION_CUSTOM", "Customized Version", true, true, HiveConnVersionInfo.DISTRO_CUSTOM), //$NON-NLS-1$//$NON-NLS-2$
|
||||
|
||||
@@ -106,6 +207,7 @@ public enum HiveConnVersionInfo {
|
||||
HiveConnVersionInfo.Cloudera_CDH4_YARN,
|
||||
HiveConnVersionInfo.Cloudera_CDH5,
|
||||
HiveConnVersionInfo.Cloudera_CDH5_1,
|
||||
HiveConnVersionInfo.Cloudera_CDH5_1_MR1,
|
||||
HiveConnVersionInfo.MAPR2,
|
||||
HiveConnVersionInfo.MAPR2_1_2,
|
||||
HiveConnVersionInfo.MAPR2_1_3,
|
||||
@@ -132,6 +234,7 @@ public enum HiveConnVersionInfo {
|
||||
HiveConnVersionInfo.Cloudera_CDH4_YARN,
|
||||
HiveConnVersionInfo.Cloudera_CDH5,
|
||||
HiveConnVersionInfo.Cloudera_CDH5_1,
|
||||
HiveConnVersionInfo.Cloudera_CDH5_1_MR1,
|
||||
HiveConnVersionInfo.MAPR1,
|
||||
HiveConnVersionInfo.MAPR2,
|
||||
HiveConnVersionInfo.MAPR2_1_2,
|
||||
@@ -163,7 +266,8 @@ public enum HiveConnVersionInfo {
|
||||
private boolean supportSecurity;
|
||||
|
||||
private static HiveConnVersionInfo[] hiveVersions = new HiveConnVersionInfo[] { HiveConnVersionInfo.Cloudera_CDH5,
|
||||
HiveConnVersionInfo.HDP_2_1, HiveConnVersionInfo.HDP_2_0, HiveConnVersionInfo.PIVOTAL_HD_2_0 };
|
||||
HiveConnVersionInfo.Cloudera_CDH5_1, HiveConnVersionInfo.Cloudera_CDH5_1_MR1, HiveConnVersionInfo.HDP_2_1,
|
||||
HiveConnVersionInfo.HDP_2_0, HiveConnVersionInfo.PIVOTAL_HD_2_0 };
|
||||
|
||||
private HiveConnVersionInfo(int level, String key, String displayName, boolean supportSecurity,
|
||||
HiveConnVersionInfo... follows) {
|
||||
|
||||
@@ -22,8 +22,6 @@ import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.PasswordEncryptUtil;
|
||||
import org.talend.core.database.EDatabase4DriverClassName;
|
||||
import org.talend.core.database.EDatabaseTypeName;
|
||||
import org.talend.core.database.conn.DatabaseConnStrUtil;
|
||||
@@ -36,6 +34,7 @@ import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.DelimitedFileConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.EbcdicConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.Escape;
|
||||
import org.talend.core.model.metadata.builder.connection.FieldSeparator;
|
||||
import org.talend.core.model.metadata.builder.connection.FileExcelConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.HL7Connection;
|
||||
import org.talend.core.model.metadata.builder.connection.LDAPSchemaConnection;
|
||||
@@ -43,6 +42,7 @@ import org.talend.core.model.metadata.builder.connection.LdifFileConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.MDMConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.PositionalFileConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.RegexpFileConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.RowSeparator;
|
||||
import org.talend.core.model.metadata.builder.connection.SAPConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.SalesforceSchemaConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.SchemaTarget;
|
||||
@@ -525,13 +525,8 @@ public class ComponentToRepositoryProperty {
|
||||
if ("PASSWORD".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
// see bug in feature 5998,encrypt the password.
|
||||
try {
|
||||
String pwd = TalendQuoteUtils.checkAndRemoveBackslashes(value);
|
||||
connection.setPassword(PasswordEncryptUtil.encryptPassword(TalendQuoteUtils.removeQuotes(pwd)));
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
String pwd = TalendQuoteUtils.checkAndRemoveBackslashes(value);
|
||||
connection.setRawPassword(TalendQuoteUtils.removeQuotes(pwd));
|
||||
}
|
||||
}
|
||||
if ("SERVER_NAME".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
@@ -871,7 +866,7 @@ public class ComponentToRepositoryProperty {
|
||||
if ("PASSWORD".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
String value = (getParameterValue(connection, node, param)).replaceAll("\\\\\\\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
if (value != null) {
|
||||
connection.setBindPassword(value);
|
||||
connection.setBindPassword(connection.getValue(value, true));
|
||||
}
|
||||
}
|
||||
if ("FILTER".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
@@ -934,7 +929,7 @@ public class ComponentToRepositoryProperty {
|
||||
if ("AUTH_PASSWORD".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.setPassword(value);
|
||||
connection.setPassword(connection.getValue(value, true));
|
||||
}
|
||||
}
|
||||
if ("UES_PROXY".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
@@ -964,7 +959,7 @@ public class ComponentToRepositoryProperty {
|
||||
if ("PROXY_PASSWORD".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.setProxyPassword(value);
|
||||
connection.setProxyPassword(connection.getValue(value, true));
|
||||
}
|
||||
}
|
||||
if ("METHOD".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
@@ -1229,14 +1224,47 @@ public class ComponentToRepositoryProperty {
|
||||
}
|
||||
}
|
||||
if ("ROW_SEPARATOR".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.setRowSeparatorValue(value);
|
||||
if (param.isShow(node.getElementParameters())) {
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
// set the type
|
||||
RowSeparator rowSeparator = null;
|
||||
if ("\\n".equals(value)) { //$NON-NLS-1$
|
||||
rowSeparator = RowSeparator.STANDART_EOL_LITERAL;
|
||||
} else {
|
||||
rowSeparator = RowSeparator.CUSTOM_STRING_LITERAL;
|
||||
value = getParameterOriginalValue(connection, node, param);
|
||||
}
|
||||
connection.setRowSeparatorType(rowSeparator);
|
||||
|
||||
// set the value
|
||||
connection.setRowSeparatorValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("FIELD_SEPARATOR".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
// set the type
|
||||
FieldSeparator separatorType = null;
|
||||
if (";".equals(value)) { //$NON-NLS-1$
|
||||
separatorType = FieldSeparator.SEMICOLON_LITERAL;
|
||||
} else if (",".equals(value)) { //$NON-NLS-1$
|
||||
separatorType = FieldSeparator.COMMA_LITERAL;
|
||||
} else if ("\\t".equals(value)) { //$NON-NLS-1$
|
||||
separatorType = FieldSeparator.TABULATION_LITERAL;
|
||||
} else if (" ".equals(value)) { //$NON-NLS-1$
|
||||
separatorType = FieldSeparator.SPACE_LITERAL;
|
||||
} else if ("''".equals(value)) { //$NON-NLS-1$
|
||||
separatorType = FieldSeparator.ALT_65_LITERAL;
|
||||
} else {
|
||||
separatorType = FieldSeparator.CUSTOM_UTF8_LITERAL;
|
||||
// custom string, need to reserve the quota
|
||||
value = getParameterOriginalValue(connection, node, param);
|
||||
}
|
||||
connection.setFieldSeparatorType(separatorType);
|
||||
|
||||
// set the value
|
||||
connection.setFieldSeparatorValue(value);
|
||||
}
|
||||
}
|
||||
@@ -1252,14 +1280,24 @@ public class ComponentToRepositoryProperty {
|
||||
}
|
||||
}
|
||||
if ("ESCAPE_CHAR".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
String value = getParameterValue(connection, node, param);
|
||||
String value = getParameterOriginalValue(connection, node, param);
|
||||
if (value != null) {
|
||||
// the tFileInputDelimited, the default value of Escape char is ["""] rather than ["\""]
|
||||
// so... need some format..
|
||||
if ("\"\"\"".equals(value)) { //$NON-NLS-1$
|
||||
value = "\"\\\"\""; //$NON-NLS-1$
|
||||
}
|
||||
connection.setEscapeChar(value);
|
||||
}
|
||||
}
|
||||
if ("TEXT_ENCLOSURE".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
String value = getParameterValue(connection, node, param);
|
||||
String value = getParameterOriginalValue(connection, node, param);
|
||||
if (value != null) {
|
||||
// the tFileInputDelimited, the default value of text enclosure is ["""] rather than ["\""]
|
||||
// so... need some format..
|
||||
if ("\"\"\"".equals(value)) { //$NON-NLS-1$
|
||||
value = "\"\\\"\""; //$NON-NLS-1$
|
||||
}
|
||||
connection.setTextEnclosure(value);
|
||||
}
|
||||
}
|
||||
@@ -1428,7 +1466,7 @@ public class ComponentToRepositoryProperty {
|
||||
if ("PASSWORD".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.setPassword(value);
|
||||
connection.setPassword(connection.getValue(value, true));
|
||||
}
|
||||
}
|
||||
if ("LANGUAGE".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
@@ -1482,7 +1520,7 @@ public class ComponentToRepositoryProperty {
|
||||
if ("PASSWORD".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.setPassword(value);
|
||||
connection.setPassword(connection.getValue(value, true));
|
||||
}
|
||||
}
|
||||
if ("MODULENAME".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
@@ -1531,7 +1569,7 @@ public class ComponentToRepositoryProperty {
|
||||
if ("PROXY_PASSWORD".equals(param.getRepositoryValue())) { //$NON-NLS-1$
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.setProxyPassword(value);
|
||||
connection.setProxyPassword(connection.getValue(value, true));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.utils.PathUtils;
|
||||
import org.talend.commons.utils.PasswordEncryptUtil;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.database.EDatabaseTypeName;
|
||||
import org.talend.core.database.conn.ConnParameterKeys;
|
||||
@@ -362,7 +361,7 @@ public class RepositoryToComponentProperty {
|
||||
if (isContextMode(connection, connection.getPassword())) {
|
||||
return connection.getPassword();
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getPassword());
|
||||
return TalendQuoteUtils.addQuotes(connection.getValue(connection.getPassword(), false));
|
||||
}
|
||||
} else if ("LANGUAGE".equals(value)) { //$NON-NLS-1$
|
||||
if (isContextMode(connection, connection.getLanguage())) {
|
||||
@@ -399,8 +398,8 @@ public class RepositoryToComponentProperty {
|
||||
for (AdditionalConnectionProperty property : additionalProperties) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
if (property.getPropertyName() != null && !"".equals(property.getPropertyName())) {
|
||||
map.put("PROPERTY", property.getPropertyName());//$NON-NLS-1$
|
||||
map.put("VALUE", property.getValue());//$NON-NLS-1$
|
||||
map.put("PROPERTY", TalendQuoteUtils.addQuotes(property.getPropertyName()));//$NON-NLS-1$
|
||||
map.put("VALUE", TalendQuoteUtils.addQuotes(property.getValue()));//$NON-NLS-1$
|
||||
values.add(map);
|
||||
}
|
||||
}
|
||||
@@ -473,7 +472,7 @@ public class RepositoryToComponentProperty {
|
||||
if (isContextMode(connection, connection.getPassword())) {
|
||||
return connection.getPassword();
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getPassword());
|
||||
return TalendQuoteUtils.addQuotes(connection.getValue(connection.getPassword(), false));
|
||||
}
|
||||
}
|
||||
// for bug TDI-8662 . should be careful that connection.getModuleName() will always get the latest name of the
|
||||
@@ -530,7 +529,7 @@ public class RepositoryToComponentProperty {
|
||||
if (isContextMode(connection, connection.getProxyPassword())) {
|
||||
return connection.getProxyPassword();
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getProxyPassword());
|
||||
return TalendQuoteUtils.addQuotes(connection.getValue(connection.getProxyPassword(), false));
|
||||
}
|
||||
} else if ("TIMEOUT".equals(value)) { //$NON-NLS-1$
|
||||
if (isContextMode(connection, connection.getTimeOut())) {
|
||||
@@ -554,7 +553,7 @@ public class RepositoryToComponentProperty {
|
||||
if (isContextMode(connection, connection.getConsumeSecret())) {
|
||||
return connection.getConsumeSecret();
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getConsumeSecret());
|
||||
return TalendQuoteUtils.addQuotes(connection.getValue(connection.getConsumeSecret(), false));
|
||||
}
|
||||
} else if ("OAUTH_CALLBACK_HOST".equals(value)) {
|
||||
if (isContextMode(connection, connection.getCallbackHost())) {
|
||||
@@ -611,7 +610,7 @@ public class RepositoryToComponentProperty {
|
||||
if (isContextMode(connection, connection.getPassword())) {
|
||||
return connection.getPassword();
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getPassword());
|
||||
return TalendQuoteUtils.addQuotes(connection.getValue(connection.getPassword(), false));
|
||||
}
|
||||
} else if ("UES_PROXY".equals(value)) { //$NON-NLS-1$
|
||||
return new Boolean(connection.isUseProxy());
|
||||
@@ -637,7 +636,7 @@ public class RepositoryToComponentProperty {
|
||||
if (isContextMode(connection, connection.getProxyPassword())) {
|
||||
return connection.getProxyPassword();
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getProxyPassword());
|
||||
return TalendQuoteUtils.addQuotes(connection.getValue(connection.getProxyPassword(), false));
|
||||
}
|
||||
} else if ("METHOD".equals(value)) { //$NON-NLS-1$
|
||||
if (!connection.isIsInputModel()) {
|
||||
@@ -729,7 +728,7 @@ public class RepositoryToComponentProperty {
|
||||
if (isContextMode(connection, connection.getPassword())) {
|
||||
return connection.getPassword();
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getPassword());
|
||||
return TalendQuoteUtils.addQuotes(connection.getValue(connection.getPassword(), false));
|
||||
}
|
||||
} else if ("UNIVERSE".equals(value)) { //$NON-NLS-1$
|
||||
if (isContextMode(connection, connection.getUniverse())) {
|
||||
@@ -930,7 +929,7 @@ public class RepositoryToComponentProperty {
|
||||
if (isContextMode(connection, connection.getPassword())) {
|
||||
return connection.getPassword();
|
||||
} else {
|
||||
String pwd = TalendQuoteUtils.checkAndAddBackslashes(connection.getPassword());
|
||||
String pwd = TalendQuoteUtils.checkAndAddBackslashes(connection.getRawPassword());
|
||||
return TalendQuoteUtils.addQuotes(pwd);
|
||||
}
|
||||
}
|
||||
@@ -1385,6 +1384,10 @@ public class RepositoryToComponentProperty {
|
||||
return TalendQuoteUtils.addQuotes(connection.getParameters().get(ConnParameterKeys.HIVE_AUTHENTICATION_KEYTAB));
|
||||
}
|
||||
|
||||
if (value.equals("IMPALA_PRINCIPAL")) {
|
||||
return TalendQuoteUtils.addQuotes(connection.getParameters().get(ConnParameterKeys.IMPALA_AUTHENTICATION_PRINCIPLA));
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -2153,7 +2156,8 @@ public class RepositoryToComponentProperty {
|
||||
if (isContextMode(connection, connection.getBindPassword())) {
|
||||
return connection.getBindPassword();
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getBindPassword()).replaceAll("\\\\", "\\\\\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return TalendQuoteUtils.addQuotes(connection.getValue(connection.getBindPassword(), false)).replaceAll(
|
||||
"\\\\", "\\\\\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
if (value.equals("FILTER")) { //$NON-NLS-1$
|
||||
@@ -2344,12 +2348,7 @@ public class RepositoryToComponentProperty {
|
||||
if (isContextMode(connection, connection.getPassword())) {
|
||||
return connection.getPassword();
|
||||
} else {
|
||||
try {
|
||||
return TalendQuoteUtils.addQuotes(PasswordEncryptUtil.decryptPassword(connection.getPassword()));
|
||||
} catch (Exception e) {
|
||||
String pwd = ConnectionHelper.getDecryptPassword(connection.getPassword());
|
||||
return pwd == null ? TalendQuoteUtils.addQuotes(connection.getPassword()) : TalendQuoteUtils.addQuotes(pwd);
|
||||
}
|
||||
return TalendQuoteUtils.addQuotes(connection.getValue(connection.getPassword(), false));
|
||||
}
|
||||
}
|
||||
if (value.equals("KEYSTORE_FILE")) {
|
||||
@@ -2364,13 +2363,7 @@ public class RepositoryToComponentProperty {
|
||||
if (isContextMode(connection, connection.getKeystorePassword())) {
|
||||
return connection.getKeystorePassword();
|
||||
} else {
|
||||
try {
|
||||
return TalendQuoteUtils.addQuotes(PasswordEncryptUtil.decryptPassword(connection.getKeystorePassword()));
|
||||
} catch (Exception e) {
|
||||
String pwd = ConnectionHelper.getDecryptPassword(connection.getKeystorePassword());
|
||||
return pwd == null ? TalendQuoteUtils.addQuotes(connection.getKeystorePassword()) : TalendQuoteUtils
|
||||
.addQuotes(pwd);
|
||||
}
|
||||
return TalendQuoteUtils.addQuotes(connection.getValue(connection.getKeystorePassword(), false));
|
||||
}
|
||||
}
|
||||
if (value.equals("PRIVATEKEY")) {
|
||||
@@ -2385,12 +2378,7 @@ public class RepositoryToComponentProperty {
|
||||
if (isContextMode(connection, connection.getPassphrase())) {
|
||||
return connection.getPassphrase();
|
||||
} else {
|
||||
try {
|
||||
return TalendQuoteUtils.addQuotes(PasswordEncryptUtil.decryptPassword(connection.getPassphrase()));
|
||||
} catch (Exception e) {
|
||||
String pwd = ConnectionHelper.getDecryptPassword(connection.getPassphrase());
|
||||
return pwd == null ? TalendQuoteUtils.addQuotes(connection.getPassphrase()) : TalendQuoteUtils.addQuotes(pwd);
|
||||
}
|
||||
return TalendQuoteUtils.addQuotes(connection.getValue(connection.getPassphrase(), false));
|
||||
}
|
||||
}
|
||||
if (value.equals("AUTH_METHOD")) {
|
||||
@@ -2457,13 +2445,7 @@ public class RepositoryToComponentProperty {
|
||||
if (isContextMode(connection, connection.getProxypassword())) {
|
||||
return connection.getProxypassword();
|
||||
} else {
|
||||
try {
|
||||
return TalendQuoteUtils.addQuotes(PasswordEncryptUtil.decryptPassword(connection.getProxypassword()));
|
||||
} catch (Exception e) {
|
||||
String pwd = ConnectionHelper.getDecryptPassword(connection.getProxypassword());
|
||||
return pwd == null ? TalendQuoteUtils.addQuotes(connection.getProxypassword()) : TalendQuoteUtils
|
||||
.addQuotes(pwd);
|
||||
}
|
||||
return TalendQuoteUtils.addQuotes(connection.getValue(connection.getProxypassword(), false));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -66,4 +66,6 @@ public interface IMigrationToolService extends IService {
|
||||
*/
|
||||
public void updateMigrationSystem(org.talend.core.model.properties.Project project, boolean persistence);
|
||||
|
||||
public String getTaskId();
|
||||
|
||||
}
|
||||
|
||||
@@ -729,6 +729,9 @@ public abstract class AbstractNode implements INode {
|
||||
|
||||
@Override
|
||||
public List<? extends IElementParameter> getElementParametersWithChildrens() {
|
||||
if (this.elementParameters == null) {
|
||||
return new ArrayList<IElementParameter>();
|
||||
}
|
||||
List<IElementParameter> fullListParam = new ArrayList<IElementParameter>(this.elementParameters);
|
||||
|
||||
for (IElementParameter curParam : elementParameters) {
|
||||
|
||||
@@ -341,6 +341,9 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
public final static ERepositoryObjectType SYSTEM_INDICATORS_FRAUDDETECTION = new ERepositoryObjectType(
|
||||
"repository.systemIndicators.fraudDetection", "TDQ_Libraries/Indicators/System Indicators/Fraud Detection", "SYSTEM_INDICATORS_FRAUDDETECTION", 103, true, "repository.systemIndicators.fraudDetectionStatistics.alias", new String[] { PROD_DQ }, new String[] {}, false); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
public final static ERepositoryObjectType METADATA_SAP_TABLE = new ERepositoryObjectType(
|
||||
"repository.SAPTable", "METADATA_SAP_TABLE", 104, true, true, new String[] { PROD_DI }, new String[] {}, false); //$NON-NLS-1$
|
||||
|
||||
private String label;
|
||||
|
||||
private String alias;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package org.talend.core.model.repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.jface.viewers.ViewerFilter;
|
||||
import org.talend.core.model.process.IElement;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
import org.talend.repository.model.nodes.IProjectRepositoryNode;
|
||||
|
||||
/**
|
||||
* created by ycbai on 2013-3-4 Detailled comment
|
||||
@@ -17,12 +17,12 @@ public interface IRepositoryTypeProcessor {
|
||||
|
||||
public boolean isSelectionValid(RepositoryNode node);
|
||||
|
||||
public IRepositoryNode getInputRoot(IProjectRepositoryNode projectRepoNode);
|
||||
|
||||
public ViewerFilter makeFilter();
|
||||
|
||||
public String getDialogTitle();
|
||||
|
||||
public ILabelProvider getLabelProvider(IElement elem);
|
||||
|
||||
public List<ERepositoryObjectType> getShowRootTypes();
|
||||
|
||||
}
|
||||
|
||||
@@ -867,19 +867,21 @@ public abstract class RepositoryUpdateManager {
|
||||
}
|
||||
if (citem == contextItem) {
|
||||
if (conn instanceof SalesforceSchemaConnection) {
|
||||
SalesforceSchemaConnection dbConn = (SalesforceSchemaConnection) conn;
|
||||
if (dbConn.getWebServiceUrl() != null && dbConn.getWebServiceUrl().equals(oldValue)) {
|
||||
dbConn.setWebServiceUrl(newValue);
|
||||
} else if (dbConn.getPassword() != null && dbConn.getPassword().equals(oldValue)) {
|
||||
dbConn.setPassword(newValue);
|
||||
} else if (dbConn.getUserName() != null && dbConn.getUserName().equals(oldValue)) {
|
||||
dbConn.setUserName(newValue);
|
||||
} else if (dbConn.getTimeOut() != null && dbConn.getTimeOut().equals(oldValue)) {
|
||||
dbConn.setTimeOut(newValue);
|
||||
} else if (dbConn.getBatchSize() != null && dbConn.getBatchSize().equals(oldValue)) {
|
||||
dbConn.setBatchSize(newValue);
|
||||
} else if (dbConn.getQueryCondition() != null && dbConn.getQueryCondition().equals(oldValue)) {
|
||||
dbConn.setQueryCondition(newValue);
|
||||
SalesforceSchemaConnection ssConn = (SalesforceSchemaConnection) conn;
|
||||
if (ssConn.getWebServiceUrl() != null && ssConn.getWebServiceUrl().equals(oldValue)) {
|
||||
ssConn.setWebServiceUrl(newValue);
|
||||
} else if (ssConn.getPassword() != null && ssConn.getPassword().equals(oldValue)) {
|
||||
// in fact, because in context mode. can setPassword directly.
|
||||
// ssConn.setPassword(ssConn.getValue(newValue,true));
|
||||
ssConn.setPassword(newValue);
|
||||
} else if (ssConn.getUserName() != null && ssConn.getUserName().equals(oldValue)) {
|
||||
ssConn.setUserName(newValue);
|
||||
} else if (ssConn.getTimeOut() != null && ssConn.getTimeOut().equals(oldValue)) {
|
||||
ssConn.setTimeOut(newValue);
|
||||
} else if (ssConn.getBatchSize() != null && ssConn.getBatchSize().equals(oldValue)) {
|
||||
ssConn.setBatchSize(newValue);
|
||||
} else if (ssConn.getQueryCondition() != null && ssConn.getQueryCondition().equals(oldValue)) {
|
||||
ssConn.setQueryCondition(newValue);
|
||||
}
|
||||
factory.save(item);
|
||||
}
|
||||
|
||||
@@ -18,27 +18,26 @@ import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.oro.text.regex.MalformedPatternException;
|
||||
import org.apache.oro.text.regex.PatternCompiler;
|
||||
import org.apache.oro.text.regex.Perl5Compiler;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
import org.apache.oro.text.regex.Perl5Substitution;
|
||||
import org.apache.oro.text.regex.Util;
|
||||
import org.talend.core.context.Context;
|
||||
import org.talend.core.context.RepositoryContext;
|
||||
import org.talend.commons.utils.PasswordEncryptUtil;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
import org.talend.core.model.context.ContextUtils;
|
||||
import org.talend.core.model.context.UpdateContextVariablesHelper;
|
||||
import org.talend.core.model.metadata.types.ContextParameterJavaTypeManager;
|
||||
import org.talend.core.model.metadata.types.JavaType;
|
||||
import org.talend.core.model.metadata.types.JavaTypesManager;
|
||||
import org.talend.core.model.process.IContext;
|
||||
import org.talend.core.model.process.IContextManager;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
|
||||
/**
|
||||
* Utilities to work with IContextParamet objects. <br/>
|
||||
@@ -73,62 +72,53 @@ public final class ContextParameterUtils {
|
||||
* @param language Language of the script.
|
||||
* @return Script code invoquing the context parameter.
|
||||
*/
|
||||
public static String getScriptCode(IContextParameter parameter, ECodeLanguage language) {
|
||||
if (parameter == null || language == null) {
|
||||
public static String getScriptCode(IContextParameter parameter) {
|
||||
if (parameter == null) {
|
||||
return null;
|
||||
}
|
||||
String code = getScriptCode(parameter.getName(), parameter.getType(), language);
|
||||
String code = getScriptCode(parameter.getName(), parameter.getType());
|
||||
if (code == null) {
|
||||
return parameter.getName();
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
public static String getScriptCode(ContextParameterType parameter, ECodeLanguage language) {
|
||||
if (parameter == null || language == null) {
|
||||
public static String getScriptCode(ContextParameterType parameter) {
|
||||
if (parameter == null) {
|
||||
return null;
|
||||
}
|
||||
String code = getScriptCode(parameter.getName(), parameter.getType(), language);
|
||||
String code = getScriptCode(parameter.getName(), parameter.getType());
|
||||
if (code == null) {
|
||||
return parameter.getName();
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
private static String getScriptCode(final String name, final String type, ECodeLanguage language) {
|
||||
private static String getScriptCode(final String name, final String type) {
|
||||
if (name == null || type == null) {
|
||||
return null;
|
||||
}
|
||||
String code;
|
||||
|
||||
final String string = JAVA_STARTWITH + name + JAVA_ENDWITH;
|
||||
switch (language) {
|
||||
case PERL:
|
||||
code = PERL_STARTWITH + name + PERL_ENDWITH;
|
||||
break;
|
||||
case JAVA:
|
||||
JavaType javaType = ContextParameterJavaTypeManager.getJavaTypeFromId(type);
|
||||
String typeToGenerate = ContextParameterJavaTypeManager.getTypeToGenerate(type, true);
|
||||
if (javaType.isPrimitive()) {
|
||||
if (typeToGenerate.compareTo("String") == 0) { //$NON-NLS-1$
|
||||
code = string;
|
||||
} else if (typeToGenerate.compareTo("Integer") == 0) { //$NON-NLS-1$
|
||||
code = "Integer.parseInt(" + string + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} else {
|
||||
code = typeToGenerate + ".parse" + typeToGenerate + "(" + string + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
}
|
||||
} else if (typeToGenerate.compareTo("java.util.Date") == 0) { //$NON-NLS-1$
|
||||
|
||||
code = "(" + typeToGenerate + ")" + "(new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\")" + ".parse" + "(" + string //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
|
||||
+ "))"; //$NON-NLS-1$
|
||||
} else if (typeToGenerate.compareTo("java.lang.Object") == 0) { //$NON-NLS-1$
|
||||
code = "(" + typeToGenerate + ")" + string; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
JavaType javaType = ContextParameterJavaTypeManager.getJavaTypeFromId(type);
|
||||
String typeToGenerate = ContextParameterJavaTypeManager.getTypeToGenerate(type, true);
|
||||
if (javaType.isPrimitive()) {
|
||||
if (typeToGenerate.compareTo("String") == 0) { //$NON-NLS-1$
|
||||
code = string;
|
||||
} else if (typeToGenerate.compareTo("Integer") == 0) { //$NON-NLS-1$
|
||||
code = "Integer.parseInt(" + string + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} else {
|
||||
code = "(" + typeToGenerate + ")" + string; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
code = typeToGenerate + ".parse" + typeToGenerate + "(" + string + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
}
|
||||
break;
|
||||
default:
|
||||
code = name;
|
||||
} else if (typeToGenerate.compareTo("java.util.Date") == 0) { //$NON-NLS-1$
|
||||
|
||||
code = "(" + typeToGenerate + ")" + "(new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\")" + ".parse" + "(" + string //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
|
||||
+ "))"; //$NON-NLS-1$
|
||||
} else if (typeToGenerate.compareTo("java.lang.Object") == 0) { //$NON-NLS-1$
|
||||
code = "(" + typeToGenerate + ")" + string; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} else {
|
||||
code = "(" + typeToGenerate + ")" + string; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
return code;
|
||||
}
|
||||
@@ -171,12 +161,10 @@ public final class ContextParameterUtils {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
final ECodeLanguage language = ((RepositoryContext) CoreRuntimePlugin.getInstance().getContext()
|
||||
.getProperty(Context.REPOSITORY_CONTEXT_KEY)).getProject().getLanguage();
|
||||
if (!isContainContextParam(code)) {
|
||||
return code;
|
||||
} else {
|
||||
String paraName = getContextString(code, language);
|
||||
String paraName = getContextString(code);
|
||||
IContextParameter param = context.getContextParameter(paraName);
|
||||
if (param != null) {
|
||||
return parseScriptContextCode(param.getValue(), context);// Multi-layer
|
||||
@@ -189,21 +177,17 @@ public final class ContextParameterUtils {
|
||||
}
|
||||
}
|
||||
|
||||
private static String getContextString(String code, ECodeLanguage language) {
|
||||
switch (language) {
|
||||
case PERL:
|
||||
if (containOldContext(code)) {
|
||||
return code.substring(code.indexOf(PERL_STARTWITH) + PERL_STARTWITH.length(), code.indexOf(PERL_ENDWITH));
|
||||
}
|
||||
case JAVA:
|
||||
private static String getContextString(String code) {
|
||||
if (code != null) {
|
||||
if (containOldContext(code)) {
|
||||
return code.substring(code.indexOf(JAVA_STARTWITH) + JAVA_STARTWITH.length(), code.indexOf(JAVA_ENDWITH));
|
||||
} else if (containNewContext(code)) {
|
||||
return trimContextPrefix(code);
|
||||
if (code.startsWith(JAVA_NEW_CONTEXT_PREFIX)) {
|
||||
return code.substring(JAVA_NEW_CONTEXT_PREFIX.length());
|
||||
}
|
||||
}
|
||||
default:
|
||||
return code;
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
public static boolean isContainContextParam(String code) {
|
||||
@@ -217,16 +201,8 @@ public final class ContextParameterUtils {
|
||||
* @return
|
||||
*/
|
||||
private static boolean containOldContext(String code) {
|
||||
final ECodeLanguage language = ((RepositoryContext) CoreRuntimePlugin.getInstance().getContext()
|
||||
.getProperty(Context.REPOSITORY_CONTEXT_KEY)).getProject().getLanguage();
|
||||
switch (language) {
|
||||
case PERL:
|
||||
return (code.contains(PERL_STARTWITH) && code.contains(PERL_ENDWITH));
|
||||
case JAVA:
|
||||
return (code.contains(JAVA_STARTWITH.substring(0, JAVA_STARTWITH.length() - 1)) && code.contains(JAVA_ENDWITH));
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return code != null
|
||||
&& (code.contains(JAVA_STARTWITH.substring(0, JAVA_STARTWITH.length() - 1)) && code.contains(JAVA_ENDWITH));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -239,51 +215,8 @@ public final class ContextParameterUtils {
|
||||
return containContextVariables(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells if a context parameter is a valid name.
|
||||
*
|
||||
* @param name Context parameter name tested.
|
||||
* @param language Language where the context parameter is used.
|
||||
* @return true if the name is valid, false otherwise.
|
||||
*
|
||||
* @deprecated should be tested in by the context manager of a process
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean isValidName(String name, ECodeLanguage language) {
|
||||
boolean valid;
|
||||
switch (language) {
|
||||
case PERL:
|
||||
String perlPattern = "[a-zA-Z0-9_]+"; //$NON-NLS-1$
|
||||
Pattern p = Pattern.compile(perlPattern);
|
||||
Matcher m = p.matcher(name);
|
||||
valid = m.matches();
|
||||
break;
|
||||
default:
|
||||
valid = true;
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
|
||||
private static boolean containContextPrefix(String code) {
|
||||
if (code == null) {
|
||||
return false;
|
||||
}
|
||||
return code.startsWith(JAVA_NEW_CONTEXT_PREFIX);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC yexiaowei Comment method "trimContextPrefix".
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public static String trimContextPrefix(String code) {
|
||||
if (containContextPrefix(code)) {
|
||||
return code.substring(JAVA_NEW_CONTEXT_PREFIX.length());
|
||||
} else {
|
||||
return code;
|
||||
}
|
||||
public static String getNewScriptCode(final String name) {
|
||||
return getNewScriptCode(name, ECodeLanguage.JAVA);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -296,19 +229,7 @@ public final class ContextParameterUtils {
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
String code = null;
|
||||
|
||||
switch (language) {
|
||||
case PERL:
|
||||
code = PERL_STARTWITH + name + PERL_ENDWITH;
|
||||
break;
|
||||
case JAVA:
|
||||
code = JAVA_NEW_CONTEXT_PREFIX + name;
|
||||
break;
|
||||
default:
|
||||
code = name;
|
||||
}
|
||||
return code;
|
||||
return JAVA_NEW_CONTEXT_PREFIX + name;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -324,22 +245,15 @@ public final class ContextParameterUtils {
|
||||
// if (isContainContextParam(code)) {
|
||||
String pattern = null;
|
||||
String varPattern = "(.+?)"; //$NON-NLS-1$
|
||||
switch (LanguageManager.getCurrentLanguage()) {
|
||||
case JAVA:
|
||||
String wordPattern = "\\b"; //$NON-NLS-1$
|
||||
pattern = wordPattern + replaceCharForRegex(JAVA_NEW_CONTEXT_PREFIX) + varPattern + wordPattern;
|
||||
break;
|
||||
case PERL:
|
||||
default:
|
||||
pattern = replaceCharForRegex(PERL_STARTWITH) + varPattern + replaceCharForRegex(PERL_ENDWITH);
|
||||
}
|
||||
String wordPattern = "\\b"; //$NON-NLS-1$
|
||||
pattern = wordPattern + replaceCharForRegex(JAVA_NEW_CONTEXT_PREFIX) + varPattern + wordPattern;
|
||||
if (pattern != null) {
|
||||
Pattern regex = Pattern.compile(pattern, Pattern.CANON_EQ);
|
||||
Matcher regexMatcher = regex.matcher(code);
|
||||
if (regexMatcher.find()) {
|
||||
try {
|
||||
String var = regexMatcher.group(1);
|
||||
if (var != null) {
|
||||
if (var != null && ContextParameterUtils.isValidParameterName(var)) {
|
||||
return var;
|
||||
}
|
||||
} catch (RuntimeException re) {
|
||||
@@ -400,15 +314,10 @@ public final class ContextParameterUtils {
|
||||
return null;
|
||||
}
|
||||
|
||||
final String displayValue = parameter.getDisplayValue();
|
||||
if (isPasswordType(parameter)) {
|
||||
if ("".equals(displayValue)) { //$NON-NLS-1$
|
||||
return "****"; //$NON-NLS-1$
|
||||
} else {
|
||||
return displayValue.replaceAll(".", "*"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
if (PasswordEncryptUtil.isPasswordType(parameter.getType())) {
|
||||
return PasswordEncryptUtil.getPasswordDisplay(parameter.getValue());
|
||||
} else {
|
||||
return displayValue;
|
||||
return parameter.getDisplayValue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -422,15 +331,7 @@ public final class ContextParameterUtils {
|
||||
if (parameter == null) {
|
||||
return false;
|
||||
}
|
||||
return isPasswordType(parameter.getType());
|
||||
}
|
||||
|
||||
public static boolean isPasswordType(String type) {
|
||||
String passwordType = JavaTypesManager.PASSWORD.getLabel(); // perl
|
||||
if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA) {
|
||||
passwordType = JavaTypesManager.PASSWORD.getId();
|
||||
}
|
||||
return passwordType.equals(type);
|
||||
return PasswordEncryptUtil.isPasswordType(parameter.getType());
|
||||
}
|
||||
|
||||
public static String updateValue(final String value, final String oldName, final String newName) {
|
||||
@@ -477,7 +378,7 @@ public final class ContextParameterUtils {
|
||||
}
|
||||
}
|
||||
if (param != null) {
|
||||
String value2 = param.getValue();
|
||||
String value2 = param.getRawValue();
|
||||
if (value2 != null) {
|
||||
// return TalendTextUtils.removeQuotes(value2); //some value can't be removed for quote
|
||||
return value2;
|
||||
@@ -488,4 +389,19 @@ public final class ContextParameterUtils {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public static boolean isValidParameterName(String name) {
|
||||
if (name != null) {
|
||||
// for java, the var name not be named with java keywords.
|
||||
if (ContextUtils.isJavaKeyWords(name)) {
|
||||
return false;
|
||||
}
|
||||
return Pattern.matches(RepositoryConstants.CONTEXT_AND_VARIABLE_PATTERN, name);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isEmptyParameter(String source) {
|
||||
return source.equals(StringUtils.EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -813,7 +813,9 @@ public class NodeUtil {
|
||||
List<IElementParameter> reps = new ArrayList<IElementParameter>();
|
||||
// should ignore Parallelize?
|
||||
List<String> ignorePs = Arrays.asList("CONNECTION_FORMAT", "INFORMATION", "COMMENT", "VALIDATION_RULES", "LABEL", "HINT",
|
||||
"ACTIVATE", "TSTATCATCHER_STATS", "PARALLELIZE", "PROPERTY");
|
||||
"ACTIVATE", "TSTATCATCHER_STATS", "PARALLELIZE", "PROPERTY", "SQLPATTERN_VALUE", "ROWS_BUFFER_SIZE",
|
||||
"TEMPORARY_DATA_DIRECTORY");
|
||||
// Exclude SQLPATTERN_VALUE.
|
||||
for (IElementParameter ep : eps) {
|
||||
if (ep.isShow(eps)) {
|
||||
if (!ignorePs.contains(ep.getName())) {
|
||||
@@ -824,12 +826,24 @@ public class NodeUtil {
|
||||
return reps;
|
||||
}
|
||||
|
||||
public static String getNormalizeParameterValue(INode node, String elementName) {
|
||||
List<? extends IElementParameter> eps = node.getElementParameters();
|
||||
for (IElementParameter ep : eps) {
|
||||
if (elementName.equals(ep.getName())) {
|
||||
return getNormalizeParameterValue(node, ep);
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
public static String getNormalizeParameterValue(INode node, IElementParameter ep) {
|
||||
if (EParameterFieldType.TABLE.equals(ep.getFieldType())) {
|
||||
Map<String, IElementParameter> types = new HashMap<String, IElementParameter>();
|
||||
for (Object o : ep.getListItemsValue()) {
|
||||
IElementParameter cep = (IElementParameter) o;
|
||||
types.put(cep.getName(), cep);
|
||||
if (cep.isShow(node.getElementParameters())) {
|
||||
types.put(cep.getName(), cep);
|
||||
}
|
||||
}
|
||||
List<Map<String, String>> lines = (List<Map<String, String>>) ElementParameterParser.getObjectValue(node,
|
||||
"__" + ep.getName() + "__");
|
||||
@@ -843,23 +857,33 @@ public class NodeUtil {
|
||||
for (;;) {
|
||||
Map<String, String> columns = linesIter.next();
|
||||
Iterator<Entry<String, String>> columnsIter = columns.entrySet().iterator();
|
||||
if (!columnsIter.hasNext()) {
|
||||
value.append("{}");
|
||||
}
|
||||
|
||||
value.append("{");
|
||||
for (;;) {
|
||||
Entry<String, String> column = columnsIter.next();
|
||||
Entry<String, String> column = null;
|
||||
boolean printedColumnExist = false;
|
||||
while (columnsIter.hasNext()) {
|
||||
column = columnsIter.next();
|
||||
if (types.get(column.getKey()) == null) {
|
||||
continue;
|
||||
}
|
||||
printedColumnExist = true;
|
||||
|
||||
value.append(column.getKey());
|
||||
value.append("=\"+");
|
||||
value.append("=\"+(");
|
||||
|
||||
value.append(getNormalizeParameterValue(column.getValue(), types.get(column.getKey()), true));
|
||||
|
||||
if (!columnsIter.hasNext()) {
|
||||
value.append("+\"}").toString();
|
||||
break;
|
||||
value.append(")+\"");
|
||||
|
||||
if (columnsIter.hasNext()) {
|
||||
value.append(", ");
|
||||
}
|
||||
value.append("+\",").append(" ");
|
||||
}
|
||||
if (printedColumnExist && column != null && (types.get(column.getKey()) == null)) {
|
||||
value.setLength(value.length() - 2);
|
||||
}
|
||||
value.append("}");
|
||||
|
||||
if (!linesIter.hasNext()) {
|
||||
return value.append("]\"").toString();
|
||||
}
|
||||
@@ -876,11 +900,14 @@ public class NodeUtil {
|
||||
}
|
||||
|
||||
private static String getNormalizeParameterValue(String value, IElementParameter ep, boolean itemFromTable) {
|
||||
List<EParameterFieldType> escapeQuotation = Arrays.asList(EParameterFieldType.MEMO_JAVA,
|
||||
EParameterFieldType.SCHEMA_XPATH_QUERYS);
|
||||
if (escapeQuotation.contains(ep.getFieldType()) && ep.isRaw()) {
|
||||
value = value.replaceAll("\\\"", "\\\\\\\"");
|
||||
}
|
||||
// !!!no need these code because we treat it when ep.isRaw()
|
||||
// List<EParameterFieldType> escapeQuotation = Arrays.asList(EParameterFieldType.MEMO_JAVA,
|
||||
// EParameterFieldType.SCHEMA_XPATH_QUERYS);// TODO: no need for SCHEMA_XPATH_QUERYS, and remove the
|
||||
// // RAW="true" on component xml
|
||||
// if (escapeQuotation.contains(ep.getFieldType()) && ep.isRaw()) {
|
||||
// value = value.replaceAll("\\\\", "\\\\\\\\");
|
||||
// value = value.replaceAll("\\\"", "\\\\\\\"");
|
||||
// }
|
||||
List<EParameterFieldType> needRemoveCRLFList = Arrays.asList(EParameterFieldType.MEMO, EParameterFieldType.MEMO_JAVA,
|
||||
EParameterFieldType.MEMO_SQL, EParameterFieldType.MEMO_IMPORT, EParameterFieldType.MEMO_MESSAGE);
|
||||
if (needRemoveCRLFList.contains(ep.getFieldType())) {
|
||||
@@ -892,14 +919,26 @@ public class NodeUtil {
|
||||
EParameterFieldType.CONTEXT_PARAM_NAME_LIST, EParameterFieldType.PROCESS_TYPE, EParameterFieldType.COLOR,
|
||||
EParameterFieldType.TABLE_BY_ROW, EParameterFieldType.HADOOP_JARS_DIALOG);
|
||||
List<EParameterFieldType> needQuoteListForItem = itemFromTable ? Arrays.asList(EParameterFieldType.SCHEMA_TYPE,
|
||||
EParameterFieldType.MODULE_LIST) : new ArrayList<EParameterFieldType>();
|
||||
EParameterFieldType.SAP_SCHEMA_TYPE, EParameterFieldType.MODULE_LIST) : new ArrayList<EParameterFieldType>();
|
||||
// TODO: add RAW attribute when SCHEMA_COLUMN generated by BASED_ON_SCHEMA
|
||||
List<String> needQuoteListByName = Arrays.asList("SCHEMA_COLUMN");// SCHEMA_COLUMN for BASED_ON_SCHEMA="true"
|
||||
|
||||
if (needQuoteList.contains(ep.getFieldType()) || needQuoteListForItem.contains(ep.getFieldType())
|
||||
|| needQuoteListByName.contains(ep.getName()) || ep.isRaw()) {
|
||||
value = value.replaceAll("\\\\", "\\\\\\\\");
|
||||
value = value.replaceAll("\\\"", "\\\\\\\"");
|
||||
value = "\"" + value + "\"";
|
||||
}
|
||||
|
||||
if (itemFromTable) {
|
||||
if ("*".equals(value)) {
|
||||
value = "\"" + value + "\"";
|
||||
}
|
||||
if (value != null && value.endsWith(";")) {
|
||||
value = value.substring(0, value.length() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
// copied it from Log4jFileUtil.javajet but need more comment for this script
|
||||
if (value == null || "".equals(value.trim())) {// for the value which empty
|
||||
value = "\"\"";
|
||||
@@ -915,6 +954,14 @@ public class NodeUtil {
|
||||
} else if ("\"\"\\n\"\"".equals(value)) {
|
||||
value = "\"\\\\n\"";
|
||||
}
|
||||
// ftom 20141008 - patch to fix javajet compilation errors due to hard-coded studio TableEditor mechanism
|
||||
// linked to BUILDIN properties checks, this item is a boolean set to TRUE or FALSE
|
||||
// fix is just transforming into true or false to make logging OK
|
||||
else if ("BUILDIN".equals(ep.getName())) {
|
||||
value = value.toLowerCase();
|
||||
} else if (value.endsWith("*")) {
|
||||
value = value.substring(0, value.length() - 1) + "\"*\"";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,18 +31,26 @@ import org.apache.oro.text.regex.Substitution;
|
||||
import org.apache.oro.text.regex.Util;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.talend.commons.utils.PasswordEncryptUtil;
|
||||
import org.talend.core.model.context.UpdateContextVariablesHelper;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.process.EParameterFieldType;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ElementValueType;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.utils.security.CryptoHelper;
|
||||
|
||||
/**
|
||||
* cli class global comment. Detailled comment
|
||||
*/
|
||||
public final class ParameterValueUtil {
|
||||
|
||||
public static final String EMPTY = ""; //$NON-NLS-1$
|
||||
|
||||
private ParameterValueUtil() {
|
||||
}
|
||||
|
||||
@@ -51,15 +59,16 @@ public final class ParameterValueUtil {
|
||||
if (param == null || oldName == null || newName == null) {
|
||||
return;
|
||||
}
|
||||
boolean flag = true;
|
||||
if (param.getFieldType() == EParameterFieldType.MEMO_SQL) {
|
||||
flag = false;
|
||||
}
|
||||
// boolean flag = true;
|
||||
// if (param.getFieldType() == EParameterFieldType.MEMO_SQL) {
|
||||
// flag = false;
|
||||
// }
|
||||
if (param.getValue() instanceof String) { // for TEXT / MEMO etc..
|
||||
String value = (String) param.getValue();
|
||||
if (value.contains(oldName)) {
|
||||
// param.setValue(value.replaceAll(oldName, newName));
|
||||
String newValue = renameValues(value, oldName, newName, flag);
|
||||
// String newValue = renameValues(value, oldName, newName, flag);
|
||||
String newValue = splitQueryData(oldName, newName, value);
|
||||
if (!value.equals(newValue)) {
|
||||
param.setValue(newValue);
|
||||
}
|
||||
@@ -76,7 +85,8 @@ public final class ParameterValueUtil {
|
||||
if (value.contains(oldName)) {
|
||||
// line.put(key, value.replaceAll(oldName,
|
||||
// newName));
|
||||
String newValue = renameValues(value, oldName, newName, flag);
|
||||
// String newValue = renameValues(value, oldName, newName, flag);
|
||||
String newValue = splitQueryData(oldName, newName, value);
|
||||
if (!value.equals(newValue)) {
|
||||
line.put(key, newValue);
|
||||
}
|
||||
@@ -105,7 +115,7 @@ public final class ParameterValueUtil {
|
||||
|
||||
if (matcher.contains(value, pattern)) {
|
||||
// replace
|
||||
String returnValue = "";
|
||||
String returnValue = EMPTY;
|
||||
if (value.contains(TalendQuoteUtils.getQuoteChar()) && !flag) {
|
||||
// returnValue = splitQueryData(matcher, pattern, substitution, value, Util.SUBSTITUTE_ALL);
|
||||
returnValue = splitQueryData(oldName, newName, value);
|
||||
@@ -124,7 +134,7 @@ public final class ParameterValueUtil {
|
||||
public static String splitQueryData(PatternMatcher matcher, Pattern pattern, Substitution sub, String value, int numSubs) {
|
||||
String[] split = value.split("\"");
|
||||
int i = 0;
|
||||
String replace = "";
|
||||
String replace = EMPTY;
|
||||
for (String s : split) {
|
||||
if (i % 2 == 0) {
|
||||
replace = s;
|
||||
@@ -137,7 +147,7 @@ public final class ParameterValueUtil {
|
||||
}
|
||||
i++;
|
||||
}
|
||||
String returnValue = "";
|
||||
String returnValue = EMPTY;
|
||||
for (int t = 1; t < split.length; t++) {
|
||||
if (t % 2 == 0) {
|
||||
returnValue += split[t];
|
||||
@@ -494,4 +504,110 @@ public final class ParameterValueUtil {
|
||||
return prefix + UpdateContextVariablesHelper.replaceSpecialChar(toTest) + suffix;
|
||||
|
||||
}
|
||||
|
||||
public static String getValue4Doc(ContextParameterType contextParam) {
|
||||
if (contextParam != null) {
|
||||
String docValue = contextParam.getValue();
|
||||
if (docValue != null) {
|
||||
if (isHidePassword() && PasswordEncryptUtil.isPasswordType(contextParam.getType())) {
|
||||
// use the raw value to display.
|
||||
docValue = PasswordEncryptUtil.getPasswordDisplay(contextParam.getRawValue());
|
||||
}
|
||||
return docValue;
|
||||
}
|
||||
}
|
||||
return EMPTY;
|
||||
}
|
||||
|
||||
public static String getValue4Doc(IContextParameter contextParam) {
|
||||
if (contextParam != null) {
|
||||
String docValue = contextParam.getValue();
|
||||
if (docValue != null) {
|
||||
if (PasswordEncryptUtil.isPasswordType(contextParam.getType())) {
|
||||
if (isHidePassword()) { // if hide will display the *
|
||||
docValue = PasswordEncryptUtil.getPasswordDisplay(docValue.toString());
|
||||
} else { // the value has been raw, so need encrypt it like the ContextParameterType.
|
||||
String encryptValue = getEncryptValue(contextParam);
|
||||
if (encryptValue != null) {
|
||||
docValue = encryptValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return docValue;
|
||||
}
|
||||
}
|
||||
return EMPTY;
|
||||
}
|
||||
|
||||
public static String getEncryptValue(IContextParameter contextParam) {
|
||||
if (contextParam != null) {
|
||||
String docValue = contextParam.getValue();
|
||||
if (docValue != null) {
|
||||
String encryptValue = CryptoHelper.DEFAULT.encrypt(docValue);
|
||||
if (encryptValue != null) {
|
||||
return encryptValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Object getValue4Doc(IElementParameter param) {
|
||||
if (param != null) {
|
||||
Object docValue = param.getValue();
|
||||
if (docValue != null) {
|
||||
if ((param.getRepositoryValue() != null && param.getRepositoryValue().toUpperCase().contains("PASSWORD") //$NON-NLS-1$
|
||||
|| EParameterFieldType.PASSWORD.equals(param.getFieldType()))//
|
||||
&& !ContextParameterUtils.containContextVariables((String) docValue)) {
|
||||
|
||||
if (isHidePassword()) { // if hide will display the *
|
||||
docValue = PasswordEncryptUtil.getPasswordDisplay(docValue.toString());
|
||||
} else { // the value has been raw, so need encrypt it like the ElementParameterType.
|
||||
String encryptValue = getEncryptValue(param);
|
||||
if (encryptValue != null) {
|
||||
docValue = encryptValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return docValue;
|
||||
}
|
||||
}
|
||||
return EMPTY;
|
||||
}
|
||||
|
||||
public static String getEncryptValue(IElementParameter param) {
|
||||
if (param != null) {
|
||||
Object docValue = param.getValue();
|
||||
if (docValue != null && docValue instanceof String) {
|
||||
String encryptValue = CryptoHelper.DEFAULT.encrypt(docValue.toString());
|
||||
if (encryptValue != null) {
|
||||
return encryptValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getValue4Doc(ElementParameterType param) {
|
||||
if (param != null) {
|
||||
String docValue = param.getValue();
|
||||
if (docValue != null) {
|
||||
if (EParameterFieldType.PASSWORD.getName().equals(param.getField()) && isHidePassword()
|
||||
&& !ContextParameterUtils.containContextVariables(docValue)) {
|
||||
// the value has been raw, so just get dispaly value.
|
||||
docValue = PasswordEncryptUtil.getPasswordDisplay(param.getRawValue());
|
||||
}
|
||||
return docValue;
|
||||
}
|
||||
}
|
||||
return EMPTY;
|
||||
}
|
||||
|
||||
public static boolean isHidePassword() {
|
||||
Project currentProject = ProjectManager.getInstance().getCurrentProject();
|
||||
if (currentProject != null) {
|
||||
return currentProject.getEmfProject().isHidePassword();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +77,17 @@ public final class RepositoryManagerHelper {
|
||||
}
|
||||
|
||||
public static IRepositoryView getRepositoryView() {
|
||||
return getDIRepositoryView(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* get the RepoViewCommonNavigator from UI.
|
||||
*
|
||||
* @param flag if it is true return RepoViewCommonNavigator even if the current perspective is DQ, if is is false
|
||||
* return null when the current perspective is DQ
|
||||
* @return
|
||||
*/
|
||||
public static IRepositoryView getDIRepositoryView(boolean flag) {
|
||||
if (CommonsPlugin.isHeadless()) {
|
||||
return null;
|
||||
}
|
||||
@@ -91,7 +102,7 @@ public final class RepositoryManagerHelper {
|
||||
try {
|
||||
if (IBrandingConfiguration.PERSPECTIVE_DI_ID.equals(page.getPerspective().getId())) {
|
||||
part = page.showView(IRepositoryView.VIEW_ID);
|
||||
} else if (IBrandingConfiguration.PERSPECTIVE_DQ_ID.equals(page.getPerspective().getId())) {
|
||||
} else if (flag && IBrandingConfiguration.PERSPECTIVE_DQ_ID.equals(page.getPerspective().getId())) {
|
||||
part = page.showView(IRepositoryView.VIEW_ID, null, IWorkbenchPage.VIEW_CREATE);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -451,6 +451,7 @@ repository.systemIndicators.textStatistics=Text Statistics
|
||||
repository.tdqExchange=Exchange
|
||||
repository.systemIndicators.phoneNumberStatistics=Phone Number Statistics
|
||||
repository.systemIndicators.fraudDetection=Fraud Detection
|
||||
repository.metadataSalesforceModule=SalesforceModule(AccountHistory)
|
||||
EUpdateItemType.Property=Property
|
||||
EUpdateItemType.MapReduce=Map Reduce
|
||||
EUpdateItemType.Schema=Schema
|
||||
|
||||
@@ -44,4 +44,6 @@ public interface IMRProcessService extends IService {
|
||||
public List<IRepositoryViewObject> getMapReduceProcesses(Project project);
|
||||
|
||||
public void generateMRInfosParameter(IProcess2 process);
|
||||
|
||||
public boolean isProgressBarNeeded(IProcess2 process);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class TalendCWMService {
|
||||
}
|
||||
}
|
||||
if (param != null) {
|
||||
String value2 = param.getValue();
|
||||
String value2 = param.getRawValue();
|
||||
if (value2 != null) {
|
||||
return value2;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ public final class TalendQuoteUtils {
|
||||
if (!text.startsWith(quote)) {
|
||||
text = quote + text;
|
||||
}
|
||||
if (!text.endsWith(quote)) {
|
||||
if (!text.endsWith(quote) || (quote != null && quote.equals(text))) {
|
||||
text = text + quote;
|
||||
}
|
||||
return text;
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
|
||||
import org.talend.core.model.process.IContextManager;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.properties.RulesItem;
|
||||
import org.talend.core.model.properties.SQLPatternItem;
|
||||
@@ -103,8 +104,8 @@ public interface IRepositoryService extends IService {
|
||||
|
||||
public IRepositoryNode getRepositoryNode(String id, boolean expanded);
|
||||
|
||||
public void openRepositoryReviewDialog(ERepositoryObjectType type, String repositoryType, List<IContextParameter> params,
|
||||
IContextManager contextManager);
|
||||
public ContextItem openRepositoryReviewDialog(ERepositoryObjectType type, String repositoryType,
|
||||
List<IContextParameter> params, IContextManager contextManager);
|
||||
|
||||
public IRepositoryNode getRootRepositoryNode(ERepositoryObjectType type);
|
||||
|
||||
|
||||
@@ -568,10 +568,10 @@ NodeReturnProposal.Type=Type: {3}\n
|
||||
NodeReturnProposal.Availability=Availability: {4}\n
|
||||
NodeReturnProposal.VariableName=Variable Name: {5}\n
|
||||
ContextParameterProposal.NoCommentAvaiable=No Comment Available
|
||||
ContextParameterProposal.Description=Description: {0}\n\n
|
||||
ContextParameterProposal.ContextVariable=Context Variable: {1}\n
|
||||
ContextParameterProposal.Type=Type: {2}\n
|
||||
ContextParameterProposal.VariableName=Variable Name: {3}\n
|
||||
ContextParameterProposal.Description=Description: {0}
|
||||
ContextParameterProposal.ContextVariable=Context Variable: {1}
|
||||
ContextParameterProposal.Type=Type: {2}
|
||||
ContextParameterProposal.VariableName=Variable Name: {3}
|
||||
ArchiveFileExportOperationFullPath.cannotCreateDir=unable to create directory '{0}'
|
||||
WorkingSetConfigurationDialog_new_label=&New...
|
||||
WorkingSetConfigurationDialog_edit_label=&Edit...
|
||||
|
||||
@@ -229,7 +229,7 @@ public abstract class ContextComposite extends Composite implements IContextMode
|
||||
switchSettingsView(oldName, newName);
|
||||
}
|
||||
|
||||
protected void switchSettingsView(String oldName, String newName) {
|
||||
public void switchSettingsView(String oldName, String newName) {
|
||||
// sub-class implement this method.
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import org.talend.commons.ui.swt.composites.MessagesWithActionComposite;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ILibraryManagerUIService;
|
||||
import org.talend.core.ui.i18n.Messages;
|
||||
import org.talend.designer.core.ui.views.contexts.Contexts;
|
||||
|
||||
/**
|
||||
* created by ldong on Aug 18, 2014 Detailled comment
|
||||
@@ -117,15 +116,19 @@ public class ContextMissSettingComposite extends Composite {
|
||||
for (String jarName : missModulesNeeded) {
|
||||
libUiService.installModules(new String[] { jarName });
|
||||
}
|
||||
Contexts.forceRefreshContextsView();
|
||||
// after install the jar,need to refresh again the parent composite
|
||||
refreshContextView();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshContextView() {
|
||||
((ContextNebulaGridComposite) this.getParent()).refresh();
|
||||
}
|
||||
|
||||
protected void disposeChildren() {
|
||||
if (messagesComp != null && !messagesComp.isDisposed()) {
|
||||
// Empty the composite before use (kinda refresh) :
|
||||
|
||||
@@ -91,6 +91,8 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
|
||||
private Button moveDownButton;
|
||||
|
||||
private Button selectContextVariablesButton;
|
||||
|
||||
private Composite contextTableComp;
|
||||
|
||||
private Composite availableLabelComp;
|
||||
@@ -218,7 +220,7 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
}
|
||||
|
||||
if ((modelManager instanceof ContextComposite) && !((ContextComposite) modelManager).isRepositoryContext()) {
|
||||
Button selectContextVariablesButton = createSelectContextVariablesPushButton(buttonsComp);
|
||||
selectContextVariablesButton = createSelectContextVariablesPushButton(buttonsComp);
|
||||
buttonList.add(selectContextVariablesButton);
|
||||
}
|
||||
// move the context group from the top to the bottom
|
||||
@@ -418,6 +420,9 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
if (this.moveDownButton != null) {
|
||||
this.moveDownButton.setEnabled(enableState);
|
||||
}
|
||||
if (this.selectContextVariablesButton != null) {
|
||||
this.selectContextVariablesButton.setEnabled(enableState);
|
||||
}
|
||||
if (contextConfigButton != null) {
|
||||
this.contextConfigButton.setEnabled(enableState);
|
||||
}
|
||||
|
||||
@@ -258,18 +258,15 @@ public class ContextTreeTable {
|
||||
bodyDataLayer.setConfigLabelAccumulator(labelAccumulator);
|
||||
registerColumnLabels(labelAccumulator, ContextRowDataListFixture.getContexts(manager.getContextManager()));
|
||||
|
||||
ISelectionProvider selectionProvider = new RowSelectionProvider<ContextTreeNode>(selectionLayer, bodyDataProvider,
|
||||
false);
|
||||
|
||||
natTable = new NatTable(parent, NatTable.DEFAULT_STYLE_OPTIONS | SWT.BORDER, gridLayer, false);
|
||||
natTable.setConfigRegistry(configRegistry);
|
||||
|
||||
addCustomStylingBehaviour(parent.getFont(), bodyDataProvider, columnGroupModel, manager.getContextManager());
|
||||
|
||||
boolean isRepositoryContext = (manager instanceof ContextComposite)
|
||||
&& ((ContextComposite) manager).isRepositoryContext();
|
||||
|
||||
if (!isRepositoryContext) {
|
||||
|
||||
addCustomContextMenuBehavior(manager, bodyDataProvider);
|
||||
}
|
||||
addCustomContextMenuBehavior(manager, bodyDataProvider, selectionProvider);
|
||||
|
||||
natTable.addConfiguration(new DefaultTreeLayerConfiguration(treeLayer));
|
||||
|
||||
@@ -294,9 +291,9 @@ public class ContextTreeTable {
|
||||
|
||||
natTable.configure();
|
||||
|
||||
ISelectionProvider selectionProvider = new RowSelectionProvider<ContextTreeNode>(selectionLayer, bodyDataProvider,
|
||||
false);
|
||||
GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
|
||||
|
||||
// add selection listener for the context NatTable
|
||||
addNatTableListener(bodyDataProvider, selectionProvider);
|
||||
|
||||
GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
|
||||
@@ -324,20 +321,18 @@ public class ContextTreeTable {
|
||||
}
|
||||
|
||||
private void contructContextTrees(List<ContextTableTabParentModel> listOfData) {
|
||||
if (listOfData.size() > 0) {
|
||||
for (ContextTableTabParentModel contextModel : listOfData) {
|
||||
if (contextModel.hasChildren()) {
|
||||
createContextTreeNode(contextModel.getOrder(), manager, contextModel, TREE_CONTEXT_ROOT,
|
||||
contextModel.getSourceName());
|
||||
List<ContextTabChildModel> childModels = contextModel.getChildren();
|
||||
for (ContextTabChildModel childModel : childModels) {
|
||||
createContextTreeNode(contextModel.getOrder(), manager, childModel, contextModel.getSourceName(),
|
||||
childModel.getContextParameter().getName());
|
||||
}
|
||||
} else {
|
||||
createContextTreeNode(contextModel.getOrder(), manager, contextModel, TREE_CONTEXT_ROOT, contextModel
|
||||
for (ContextTableTabParentModel contextModel : listOfData) {
|
||||
if (contextModel.hasChildren()) {
|
||||
createContextTreeNode(contextModel.getOrder(), manager, contextModel, TREE_CONTEXT_ROOT,
|
||||
contextModel.getSourceName());
|
||||
List<ContextTabChildModel> childModels = contextModel.getChildren();
|
||||
for (ContextTabChildModel childModel : childModels) {
|
||||
createContextTreeNode(contextModel.getOrder(), manager, childModel, contextModel.getSourceName(), childModel
|
||||
.getContextParameter().getName());
|
||||
}
|
||||
} else {
|
||||
createContextTreeNode(contextModel.getOrder(), manager, contextModel, TREE_CONTEXT_ROOT, contextModel
|
||||
.getContextParameter().getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -355,8 +350,8 @@ public class ContextTreeTable {
|
||||
@Override
|
||||
public void mouseDoubleClick(MouseEvent e) {
|
||||
int rowPos = natTable.getRowPositionByY(e.y);
|
||||
if (rowPos == 0) {
|
||||
// in case click the column header
|
||||
if (rowPos == 0 || rowPos == -1) {
|
||||
// in case click the column header or the empty space
|
||||
return;
|
||||
}
|
||||
int rowIndex = natTable.getRowIndexByPosition(rowPos);
|
||||
@@ -518,8 +513,8 @@ public class ContextTreeTable {
|
||||
}
|
||||
|
||||
private void addCustomContextMenuBehavior(final IContextModelManager modelManager,
|
||||
final GlazedListsDataProvider<ContextTreeNode> bodyDataProvider) {
|
||||
natTable.addConfiguration(new ContextParaModeChangeMenuConfiguration(natTable, bodyDataProvider));
|
||||
final GlazedListsDataProvider<ContextTreeNode> bodyDataProvider, final ISelectionProvider selection) {
|
||||
natTable.addConfiguration(new ContextParaModeChangeMenuConfiguration(natTable, bodyDataProvider, selection));
|
||||
}
|
||||
|
||||
private void addContextColumnGroupsBehaviour(ColumnGroupHeaderLayer columnHeaderLayer, List<IContext> contexts) {
|
||||
|
||||
@@ -21,9 +21,12 @@ import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.nebula.widgets.nattable.NatTable;
|
||||
import org.talend.core.model.process.IContextManager;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.ui.context.ContextTreeTable.ContextTreeNode;
|
||||
import org.talend.core.ui.context.IContextModelManager;
|
||||
import org.talend.core.ui.context.cmd.ContextBuiltinToRepositoryCommand;
|
||||
import org.talend.core.ui.context.model.table.ContextTableTabChildModel;
|
||||
import org.talend.core.ui.context.model.table.ContextTableTabParentModel;
|
||||
import org.talend.core.ui.context.model.template.ContextVariableTabChildModel;
|
||||
@@ -63,8 +66,13 @@ public class ContextBuiltinToRepositoryAction extends AContextualAction {
|
||||
@Override
|
||||
protected void doRun() {
|
||||
if (contextManager != null) {
|
||||
CoreRuntimePlugin.getInstance().getRepositoryService()
|
||||
ContextItem item = CoreRuntimePlugin.getInstance().getRepositoryService()
|
||||
.openRepositoryReviewDialog(ERepositoryObjectType.CONTEXT, null, params, contextManager);
|
||||
if (modelManager.getCommandStack() != null) {
|
||||
modelManager.getCommandStack().execute(new ContextBuiltinToRepositoryCommand(params, contextManager, item));
|
||||
} else {
|
||||
new ContextBuiltinToRepositoryCommand(params, contextManager, item).execute();
|
||||
}
|
||||
modelManager.refresh();
|
||||
}
|
||||
}
|
||||
@@ -113,30 +121,32 @@ public class ContextBuiltinToRepositoryAction extends AContextualAction {
|
||||
setEnabled(canWork);
|
||||
}
|
||||
|
||||
public void init(NatTable table, Object rowData) {
|
||||
public void init(NatTable table, Object[] rowNodes) {
|
||||
this.table = table;
|
||||
this.contextManager = modelManager.getContextManager();
|
||||
boolean canWork = table != null && rowData != null;
|
||||
boolean canWork = table != null && rowNodes != null;
|
||||
if (canWork) {
|
||||
if (rowData instanceof ContextTableTabParentModel) {
|
||||
ContextTableTabParentModel param = (ContextTableTabParentModel) rowData;
|
||||
if (!IContextParameter.BUILT_IN.equals(param.getSourceId())) {
|
||||
setEnabled(false);
|
||||
return;
|
||||
} else {
|
||||
params.add(param.getContextParameter());
|
||||
}
|
||||
} else if (rowData instanceof ContextTableTabChildModel) {
|
||||
ContextTableTabChildModel param = (ContextTableTabChildModel) rowData;
|
||||
if (!IContextParameter.BUILT_IN.equals(param.getContextParameter().getSource())) {
|
||||
setEnabled(false);
|
||||
return;
|
||||
} else {
|
||||
params.add(param.getContextParameter());
|
||||
for (Object rowNode : rowNodes) {
|
||||
Object rowData = ((ContextTreeNode) rowNode).getTreeData();
|
||||
if (rowData instanceof ContextTableTabParentModel) {
|
||||
ContextTableTabParentModel param = (ContextTableTabParentModel) rowData;
|
||||
if (!IContextParameter.BUILT_IN.equals(param.getSourceId())) {
|
||||
setEnabled(false);
|
||||
return;
|
||||
} else {
|
||||
params.add(param.getContextParameter());
|
||||
}
|
||||
} else if (rowData instanceof ContextTableTabChildModel) {
|
||||
ContextTableTabChildModel param = (ContextTableTabChildModel) rowData;
|
||||
if (!IContextParameter.BUILT_IN.equals(param.getContextParameter().getSource())) {
|
||||
setEnabled(false);
|
||||
return;
|
||||
} else {
|
||||
params.add(param.getContextParameter());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
setEnabled(canWork);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.context.cmd;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.talend.core.model.context.JobContextManager;
|
||||
import org.talend.core.model.process.IContext;
|
||||
import org.talend.core.model.process.IContextManager;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.properties.Item;
|
||||
|
||||
/**
|
||||
* created by ldong on Sep 12, 2014 Detailled comment
|
||||
*
|
||||
*/
|
||||
public class AddContextGroupRelationCommand extends Command {
|
||||
|
||||
private IContextParameter param;
|
||||
|
||||
private IContextManager contextManager;
|
||||
|
||||
private Item sourceItem;
|
||||
|
||||
private IContextParameter originaParam;
|
||||
|
||||
public AddContextGroupRelationCommand(IContextManager contextManager, IContextParameter param, Item sourceItem) {
|
||||
super();
|
||||
this.contextManager = contextManager;
|
||||
this.param = param;
|
||||
this.sourceItem = sourceItem;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.gef.commands.Command#execute()
|
||||
*/
|
||||
@Override
|
||||
public void execute() {
|
||||
boolean isChange = false;
|
||||
String sourceId = sourceItem.getProperty().getId();
|
||||
originaParam = param;
|
||||
if (contextManager != null) {
|
||||
List<IContext> contexts = contextManager.getListContext();
|
||||
for (IContext envContext : contexts) {
|
||||
List<IContextParameter> list = envContext.getContextParameterList();
|
||||
if (list != null && list.size() > 0) {
|
||||
for (IContextParameter contextPara : list) {
|
||||
String tempContextParaName = contextPara.getName();
|
||||
if (tempContextParaName.equals(param.getName())) {
|
||||
contextPara.setSource(sourceId);
|
||||
isChange = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isChange) {
|
||||
updateRelation();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.gef.commands.Command#undo()
|
||||
*/
|
||||
@Override
|
||||
public void undo() {
|
||||
String sourceId = originaParam.getSource();
|
||||
if (contextManager != null) {
|
||||
List<IContext> contexts = contextManager.getListContext();
|
||||
for (IContext envContext : contexts) {
|
||||
List<IContextParameter> list = envContext.getContextParameterList();
|
||||
if (list != null && list.size() > 0) {
|
||||
for (IContextParameter contextPara : list) {
|
||||
String tempContextParaName = contextPara.getName();
|
||||
if (tempContextParaName.equals(originaParam.getName())) {
|
||||
contextPara.setSource(sourceId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateRelation() {
|
||||
if (param != null) {
|
||||
if (contextManager != null && contextManager instanceof JobContextManager) {
|
||||
JobContextManager jobContextManager = (JobContextManager) contextManager;
|
||||
if (jobContextManager.isOriginalParameter(param.getName())) {
|
||||
jobContextManager.setModified(true);
|
||||
contextManager.fireContextsChangedEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.context.cmd;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.core.model.context.JobContextManager;
|
||||
import org.talend.core.model.process.IContext;
|
||||
import org.talend.core.model.process.IContextManager;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.ui.context.ContextManagerHelper;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.TalendFileFactory;
|
||||
import org.talend.designer.core.ui.editor.cmd.ContextRemoveParameterCommand;
|
||||
|
||||
/**
|
||||
* created by ldong on Sep 12, 2014 Detailled comment
|
||||
*
|
||||
*/
|
||||
public class ContextBuiltinToRepositoryCommand extends Command {
|
||||
|
||||
private List<IContextParameter> params = new ArrayList<IContextParameter>();
|
||||
|
||||
private IContextManager contextManager;
|
||||
|
||||
private ContextItem item;
|
||||
|
||||
private ContextManagerHelper helper;
|
||||
|
||||
/**
|
||||
* DOC ldong ContextBuiltinToRepositoryCommand constructor comment.
|
||||
*
|
||||
* @param params
|
||||
* @param contextManager
|
||||
* @param item
|
||||
*/
|
||||
public ContextBuiltinToRepositoryCommand(List<IContextParameter> params, IContextManager contextManager, ContextItem item) {
|
||||
super();
|
||||
this.params = params;
|
||||
this.contextManager = contextManager;
|
||||
this.item = item;
|
||||
this.helper = new ContextManagerHelper(contextManager);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.gef.commands.Command#execute()
|
||||
*/
|
||||
@Override
|
||||
public void execute() {
|
||||
IContext jobDefaultContext = contextManager.getDefaultContext(); // get default context from job
|
||||
List<IContext> jobContextlist = contextManager.getListContext(); // get all context from job
|
||||
List<String> jobContextNames = getJobContextGroupNames(jobContextlist);
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
EList contextList = item.getContext();
|
||||
|
||||
boolean conflictflag = false;
|
||||
|
||||
JobContextManager itemManager = new JobContextManager();
|
||||
itemManager.loadFromEmf(contextList, item.getDefaultContext());
|
||||
// this loop is used to get all context groups
|
||||
for (int i = 0, n = contextList.size(); i < n; i++) {
|
||||
ContextType type = (ContextType) contextList.get(i);
|
||||
if (type == null) {
|
||||
return;
|
||||
}
|
||||
EList contextParameters = type.getContextParameter(); // parameters from current contextType
|
||||
List<IContextParameter> allParameters = getAllExistContextParameters(contextParameters, params);
|
||||
// find one same context group,this group will get the
|
||||
// values from the same group of designer
|
||||
if (jobContextNames.contains(type.getName())) {
|
||||
int index = jobContextNames.indexOf(type.getName());
|
||||
IContext currentContext = jobContextlist.get(index);
|
||||
for (IContextParameter param : params) {
|
||||
IContextParameter selectedParam = currentContext.getContextParameter(param.getName());
|
||||
if (!allParameters.contains(param)) {
|
||||
ContextParameterType parameter = TalendFileFactory.eINSTANCE.createContextParameterType();
|
||||
copyContextParameter(item, contextParameters, parameter, selectedParam);
|
||||
} else {
|
||||
for (int k = 0; k < contextParameters.size(); k++) {
|
||||
ContextParameterType parameter = (ContextParameterType) contextParameters.get(k);
|
||||
if (parameter.getName().equals(param.getName())) {
|
||||
conflictflag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (conflictflag) {
|
||||
// now if add the build-in param into repository context group,if already exist same
|
||||
// one,just update the relation
|
||||
addRelationForContextParameter(item, contextParameters, selectedParam);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// this group will get the vaules from default group of designer
|
||||
} else if (!jobContextNames.contains(type.getName()) && type.getName() != null) {
|
||||
for (IContextParameter param : params) {
|
||||
IContextParameter selectedParam = jobDefaultContext.getContextParameter(param.getName());
|
||||
if (!allParameters.contains(param)) {
|
||||
ContextParameterType parameter = TalendFileFactory.eINSTANCE.createContextParameterType();
|
||||
copyContextParameter(item, contextParameters, parameter, selectedParam);
|
||||
} else {
|
||||
for (int k = 0; k < contextParameters.size(); k++) {
|
||||
ContextParameterType parameter = (ContextParameterType) contextParameters.get(k);
|
||||
if (parameter.getName().equals(param.getName())) {
|
||||
conflictflag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (conflictflag) {
|
||||
addRelationForContextParameter(item, contextParameters, selectedParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
ProxyRepositoryFactory.getInstance().save(item, false);
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
private List<IContextParameter> getAllExistContextParameters(EList contextParameters, List<IContextParameter> params) {
|
||||
List<IContextParameter> allParameters = new ArrayList<IContextParameter>();
|
||||
for (int i = 0; i < contextParameters.size(); i++) {
|
||||
ContextParameterType parameter = (ContextParameterType) contextParameters.get(i);
|
||||
for (IContextParameter param : params) {
|
||||
if (parameter.getName().equals(param.getName())) {
|
||||
allParameters.add(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
return allParameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC xye Comment method "copyContextParameter".
|
||||
*
|
||||
* @param context
|
||||
* @param item
|
||||
* @param contextParameters
|
||||
* @param parameter
|
||||
* @param param
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private void copyContextParameter(ContextItem item, EList contextParameters, ContextParameterType parameter,
|
||||
IContextParameter selectedParam) {
|
||||
parameter.setName(selectedParam.getName());
|
||||
parameter.setComment(selectedParam.getComment());
|
||||
parameter.setPrompt(selectedParam.getPrompt());
|
||||
parameter.setPromptNeeded(selectedParam.isPromptNeeded());
|
||||
parameter.setType(selectedParam.getType());
|
||||
parameter.setValue(selectedParam.getValue());
|
||||
contextParameters.add(parameter);
|
||||
selectedParam.setSource(item.getProperty().getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC ldong Comment method "addRelationForContextParameter".
|
||||
*
|
||||
* @param contextItem
|
||||
* @param parameterList
|
||||
* @param existParam
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private void addRelationForContextParameter(ContextItem contextItem, EList parameterList, IContextParameter existParam) {
|
||||
Iterator contextParamItor = parameterList.iterator();
|
||||
while (contextParamItor.hasNext()) {
|
||||
ContextParameterType defaultContextParamType = (ContextParameterType) contextParamItor.next();
|
||||
|
||||
if (defaultContextParamType.getName().equals(existParam.getName())) {
|
||||
// existed.then create the relation and remove from job context parameters and update from the emf new
|
||||
// one
|
||||
new AddContextGroupRelationCommand(contextManager, existParam, contextItem).execute();
|
||||
|
||||
new ContextRemoveParameterCommand(contextManager, defaultContextParamType.getName(), existParam.getSource())
|
||||
.execute();
|
||||
helper.addContextParameterType(defaultContextParamType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC hyWang Comment method "getJobContextGroupNames".
|
||||
*/
|
||||
private List<String> getJobContextGroupNames(List<IContext> jobContextlist) {
|
||||
List<String> jobContextNames = new ArrayList<String>();
|
||||
// parameters from designer of default context
|
||||
for (int k = 0; k < jobContextlist.size(); k++) {
|
||||
jobContextNames.add(k, jobContextlist.get(k).getName());
|
||||
}
|
||||
return jobContextNames;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.context.nattableTree;
|
||||
|
||||
import org.eclipse.nebula.widgets.nattable.NatTable;
|
||||
import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.ui.menu.HeaderMenuConfiguration;
|
||||
import org.eclipse.nebula.widgets.nattable.ui.menu.PopupMenuBuilder;
|
||||
import org.eclipse.swt.events.DisposeEvent;
|
||||
import org.eclipse.swt.events.DisposeListener;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
|
||||
/**
|
||||
* created by ldong on Jul 21, 2014 Detailled comment
|
||||
*
|
||||
*/
|
||||
public class ContextHeaderMenuConfiguration extends HeaderMenuConfiguration {
|
||||
|
||||
private final Menu modeMenu;
|
||||
|
||||
private final ContextPopMenuBuilder contextMenuBuilder;
|
||||
|
||||
/**
|
||||
* DOC Talend ContextHeaderMenuConfiguration constructor comment.
|
||||
*
|
||||
* @param natTable
|
||||
*/
|
||||
public ContextHeaderMenuConfiguration(NatTable natTable, IDataProvider dataProvider) {
|
||||
super(natTable);
|
||||
contextMenuBuilder = new ContextPopMenuBuilder(natTable);
|
||||
modeMenu = contextMenuBuilder.withChangeModeMenuItem(dataProvider).build();
|
||||
|
||||
natTable.addDisposeListener(new DisposeListener() {
|
||||
|
||||
@Override
|
||||
public void widgetDisposed(DisposeEvent e) {
|
||||
modeMenu.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.nebula.widgets.nattable.ui.menu.HeaderMenuConfiguration#createColumnHeaderMenu(org.eclipse.nebula
|
||||
* .widgets.nattable.NatTable)
|
||||
*/
|
||||
@Override
|
||||
protected PopupMenuBuilder createRowHeaderMenu(NatTable natTable) {
|
||||
return contextMenuBuilder;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,6 +13,8 @@
|
||||
package org.talend.core.ui.context.nattableTree;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.nebula.widgets.nattable.NatTable;
|
||||
import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsDataProvider;
|
||||
@@ -29,7 +31,6 @@ import org.talend.core.ui.context.ContextTreeTable.ContextTreeNode;
|
||||
import org.talend.core.ui.context.IContextModelManager;
|
||||
import org.talend.core.ui.context.action.ContextBuiltinToRepositoryAction;
|
||||
import org.talend.core.ui.context.model.table.ContextTableTabChildModel;
|
||||
import org.talend.core.ui.context.model.table.ContextTableTabParentModel;
|
||||
import org.talend.core.ui.i18n.Messages;
|
||||
|
||||
/**
|
||||
@@ -39,7 +40,8 @@ import org.talend.core.ui.i18n.Messages;
|
||||
public class ContextMenuItemProviders extends MenuItemProviders {
|
||||
|
||||
// the item of change the context parameter's mode such as from repositroy to build-in
|
||||
public static IMenuItemProvider changeModeMenuItemProvider(final IDataProvider dataProvider) {
|
||||
public static IMenuItemProvider changeModeMenuItemProvider(final IDataProvider dataProvider,
|
||||
final ISelectionProvider selection) {
|
||||
return new IMenuItemProvider() {
|
||||
|
||||
@Override
|
||||
@@ -52,27 +54,18 @@ public class ContextMenuItemProviders extends MenuItemProviders {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
NatEventData natEventData = getNatEventData(e);
|
||||
NatTable nt = natEventData.getNatTable();
|
||||
int rowPosition = natEventData.getRowPosition();
|
||||
int rowIndex = nt.getRowIndexByPosition(rowPosition);
|
||||
@SuppressWarnings("unchecked")
|
||||
ContextTreeNode treeNode = ((GlazedListsDataProvider<ContextTreeNode>) dataProvider)
|
||||
.getRowObject(rowIndex);
|
||||
IContextModelManager manager = treeNode.getManager();
|
||||
if (treeNode.getTreeData() instanceof ContextTableTabChildModel) {
|
||||
ContextTableTabChildModel childModel = (ContextTableTabChildModel) treeNode.getTreeData();
|
||||
String sourceId = childModel.getSourceId();
|
||||
if (manager.getContextManager() != null) {
|
||||
if (!sourceId.equals(IContextParameter.BUILT_IN)) {
|
||||
Command cmd = new ContextParaChangeModeCommand(manager, treeNode, childModel
|
||||
.getContextParameter());
|
||||
if (manager.getCommandStack() == null) {
|
||||
cmd.execute();
|
||||
} else {
|
||||
manager.getCommandStack().execute(cmd);
|
||||
}
|
||||
IStructuredSelection selectRows = (IStructuredSelection) selection.getSelection();
|
||||
if (selectRows.isEmpty()) {
|
||||
ContextTreeNode treeNode = getTreeNodeByRightClickPostion(dataProvider, e);
|
||||
handleRepositoryToBuiltIn(treeNode);
|
||||
} else {
|
||||
Object[] obj = getTreeNodesByMultipleSelection(selectRows);
|
||||
for (Object object : obj) {
|
||||
if (object == null) {
|
||||
return;
|
||||
}
|
||||
ContextTreeNode treeNode = (ContextTreeNode) object;
|
||||
handleRepositoryToBuiltIn(treeNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,26 +79,67 @@ public class ContextMenuItemProviders extends MenuItemProviders {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
NatEventData natEventData = getNatEventData(e);
|
||||
NatTable nt = natEventData.getNatTable();
|
||||
int rowPosition = natEventData.getRowPosition();
|
||||
int rowIndex = nt.getRowIndexByPosition(rowPosition);
|
||||
@SuppressWarnings("unchecked")
|
||||
ContextTreeNode treeNode = ((GlazedListsDataProvider<ContextTreeNode>) dataProvider)
|
||||
.getRowObject(rowIndex);
|
||||
IContextModelManager manager = treeNode.getManager();
|
||||
if (treeNode.getTreeData() instanceof ContextTableTabParentModel) {
|
||||
ContextTableTabParentModel paraModel = (ContextTableTabParentModel) treeNode.getTreeData();
|
||||
String sourceId = paraModel.getSourceId();
|
||||
if (sourceId.equals(IContextParameter.BUILT_IN)) {
|
||||
ContextBuiltinToRepositoryAction action = new ContextBuiltinToRepositoryAction(manager);
|
||||
action.init(natTable, treeNode.getTreeData());
|
||||
action.run();
|
||||
}
|
||||
IStructuredSelection selectRows = (IStructuredSelection) selection.getSelection();
|
||||
if (selectRows.isEmpty()) {
|
||||
ContextTreeNode treeNode = getTreeNodeByRightClickPostion(dataProvider, e);
|
||||
Object[] obj = new Object[1];
|
||||
obj[0] = treeNode;
|
||||
handleBuiltInToRepository(natTable, obj);
|
||||
} else {
|
||||
Object[] obj = getTreeNodesByMultipleSelection(selectRows);
|
||||
handleBuiltInToRepository(natTable, obj);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static void handleBuiltInToRepository(final NatTable natTable, Object[] realTreeNodes) {
|
||||
IContextModelManager modelManager = ((ContextTreeNode) realTreeNodes[0]).getManager();
|
||||
ContextBuiltinToRepositoryAction action = new ContextBuiltinToRepositoryAction(modelManager);
|
||||
action.init(natTable, realTreeNodes);
|
||||
action.run();
|
||||
}
|
||||
|
||||
private static void handleRepositoryToBuiltIn(ContextTreeNode treeNode) {
|
||||
IContextModelManager manager = treeNode.getManager();
|
||||
Object rowData = treeNode.getTreeData();
|
||||
if (rowData instanceof ContextTableTabChildModel) {
|
||||
ContextTableTabChildModel childModel = (ContextTableTabChildModel) rowData;
|
||||
String sourceId = childModel.getSourceId();
|
||||
if (manager.getContextManager() != null) {
|
||||
if (!sourceId.equals(IContextParameter.BUILT_IN)) {
|
||||
Command cmd = new ContextParaChangeModeCommand(manager, treeNode, childModel.getContextParameter());
|
||||
if (manager.getCommandStack() == null) {
|
||||
cmd.execute();
|
||||
} else {
|
||||
manager.getCommandStack().execute(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static ContextTreeNode getTreeNodeByRightClickPostion(final IDataProvider dataProvider, SelectionEvent e) {
|
||||
NatEventData natEventData = getNatEventData(e);
|
||||
NatTable nt = natEventData.getNatTable();
|
||||
int rowPosition = natEventData.getRowPosition();
|
||||
int rowIndex = nt.getRowIndexByPosition(rowPosition);
|
||||
@SuppressWarnings("unchecked")
|
||||
ContextTreeNode treeNode = ((GlazedListsDataProvider<ContextTreeNode>) dataProvider).getRowObject(rowIndex);
|
||||
return treeNode;
|
||||
}
|
||||
|
||||
private static Object[] getTreeNodesByMultipleSelection(IStructuredSelection sels) {
|
||||
Object[] obj = new Object[sels.toList().size()];
|
||||
int i = 0;
|
||||
for (Object node : sels.toList().toArray()) {
|
||||
if (node instanceof ContextTreeNode) {
|
||||
obj[i++] = node;
|
||||
}
|
||||
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,330 +1,330 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.context.nattableTree;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration;
|
||||
import org.eclipse.nebula.widgets.nattable.config.CellConfigAttributes;
|
||||
import org.eclipse.nebula.widgets.nattable.config.EditableRule;
|
||||
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
|
||||
import org.eclipse.nebula.widgets.nattable.config.IEditableRule;
|
||||
import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.data.convert.DefaultBooleanDisplayConverter;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.EditConfigAttributes;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.config.DialogErrorHandling;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.editor.CheckBoxCellEditor;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.editor.ComboBoxCellEditor;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.editor.TextCellEditor;
|
||||
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsDataProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel;
|
||||
import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
|
||||
import org.eclipse.nebula.widgets.nattable.painter.cell.CheckBoxPainter;
|
||||
import org.eclipse.nebula.widgets.nattable.painter.cell.ComboBoxPainter;
|
||||
import org.eclipse.nebula.widgets.nattable.painter.cell.ImagePainter;
|
||||
import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes;
|
||||
import org.eclipse.nebula.widgets.nattable.style.CellStyleUtil;
|
||||
import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
|
||||
import org.eclipse.nebula.widgets.nattable.style.Style;
|
||||
import org.eclipse.nebula.widgets.nattable.ui.util.CellEdgeEnum;
|
||||
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
import org.talend.core.model.metadata.types.ContextParameterJavaTypeManager;
|
||||
import org.talend.core.model.process.IContextManager;
|
||||
import org.talend.core.ui.context.ContextTreeTable.ContextTreeNode;
|
||||
import org.talend.core.ui.context.model.ContextTabChildModel;
|
||||
import org.talend.core.ui.context.model.table.ContextTableConstants;
|
||||
|
||||
/**
|
||||
* this one for the main configuration of context NatTable such as the color,editTable,custom control,etc.
|
||||
*/
|
||||
public class ContextNatTableConfiguration extends AbstractRegistryConfiguration {
|
||||
|
||||
private IDataProvider dataProvider;
|
||||
|
||||
private ColumnGroupModel columnGroupModel;
|
||||
|
||||
private IContextManager manager;
|
||||
|
||||
/**
|
||||
* DOC ldong ContextNatTableConfiguration constructor comment.
|
||||
*
|
||||
* @param dataProvider
|
||||
*/
|
||||
public ContextNatTableConfiguration(IDataProvider dataProvider, ColumnGroupModel columnGroupModel, IContextManager manager) {
|
||||
super();
|
||||
this.dataProvider = dataProvider;
|
||||
this.columnGroupModel = columnGroupModel;
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.nebula.widgets.nattable.config.IConfiguration#configureRegistry(org.eclipse.nebula.widgets.nattable
|
||||
* .config.IConfigRegistry)
|
||||
*/
|
||||
@Override
|
||||
public void configureRegistry(IConfigRegistry configRegistry) {
|
||||
registerEditableRules(configRegistry);
|
||||
registerEditors(configRegistry);
|
||||
registerStyleRules(configRegistry);
|
||||
registerValidateRules(configRegistry);
|
||||
registerErrorHandlingStrategies(configRegistry);
|
||||
}
|
||||
|
||||
private void registerEditableRules(IConfigRegistry configRegistry) {
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, IEditableRule.ALWAYS_EDITABLE);
|
||||
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, getEditRule(), DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_NAME_PROPERTY);
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, getEditRule(), DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_TYPE_PROPERTY);
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, getEditRule(), DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_CHECK_PROPERTY);
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, getEditRule(), DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_PROMPT_PROPERTY);
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, getEditRule(), DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_CONTEXT_VALUE);
|
||||
}
|
||||
|
||||
private void registerStyleRules(IConfigRegistry configRegistry) {
|
||||
// register the default cell fg/bg colour for the natTable
|
||||
Style cellStyleDefault = new Style();
|
||||
cellStyleDefault.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_WHITE);
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleDefault, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_TYPE_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleDefault, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_NAME_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleDefault, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_CHECK_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleDefault, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_PROMPT_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleDefault, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_CONTEXT_VALUE);
|
||||
|
||||
Style cellStyleSelect = new Style();
|
||||
cellStyleSelect.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_TITLE_INACTIVE_BACKGROUND);
|
||||
cellStyleSelect.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, GUIHelper.COLOR_RED);
|
||||
cellStyleSelect.setAttributeValue(CellStyleAttributes.FONT, GUIHelper.DEFAULT_FONT);
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleSelect, DisplayMode.SELECT,
|
||||
ContextTableConstants.COLUMN_TYPE_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleSelect, DisplayMode.SELECT,
|
||||
ContextTableConstants.COLUMN_NAME_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleSelect, DisplayMode.SELECT,
|
||||
ContextTableConstants.COLUMN_CHECK_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleSelect, DisplayMode.SELECT,
|
||||
ContextTableConstants.COLUMN_PROMPT_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleSelect, DisplayMode.SELECT,
|
||||
ContextTableConstants.COLUMN_CONTEXT_VALUE);
|
||||
}
|
||||
|
||||
private void registerValidateRules(IConfigRegistry configRegistry) {
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.DATA_VALIDATOR,
|
||||
new EventDataValidator(dataProvider, manager), DisplayMode.EDIT, ContextTableConstants.COLUMN_NAME_PROPERTY);
|
||||
}
|
||||
|
||||
private void registerErrorHandlingStrategies(IConfigRegistry configRegistry) {
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.VALIDATION_ERROR_HANDLER, new DialogErrorHandling(),
|
||||
DisplayMode.EDIT, ContextTableConstants.COLUMN_NAME_PROPERTY);
|
||||
}
|
||||
|
||||
private IEditableRule getEditRule() {
|
||||
EditableRule rule = new EditableRule() {
|
||||
|
||||
@Override
|
||||
public boolean isEditable(int columnIndex, int rowIndex) {
|
||||
ContextTreeNode rowNode = ((GlazedListsDataProvider<ContextTreeNode>) dataProvider).getRowObject(rowIndex);
|
||||
if (ContextNatTableUtils.isEmptyTreeNode(rowNode.getTreeData())) {
|
||||
return false;
|
||||
} else {
|
||||
if (rowNode.getTreeData() instanceof ContextTabChildModel || rowNode.getChildren().size() > 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
return rule;
|
||||
}
|
||||
|
||||
private void registerEditors(IConfigRegistry configRegistry) {
|
||||
registerColumnFirstTextEditor(configRegistry);
|
||||
registerColumnTwoComboxEditor(configRegistry);
|
||||
registerColumnThreeCheckBoxEditor(configRegistry);
|
||||
registerColumnFourTextEditor(configRegistry);
|
||||
registerColumnFiveTextEditor(configRegistry);
|
||||
}
|
||||
|
||||
private void registerColumnFirstTextEditor(IConfigRegistry configRegistry) {
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new TextCellEditor(true, true),
|
||||
DisplayMode.EDIT, ContextTableConstants.COLUMN_NAME_PROPERTY);
|
||||
}
|
||||
|
||||
private void registerColumnTwoComboxEditor(IConfigRegistry configRegistry) {
|
||||
List<String> originalTypes = Arrays.asList(ContextParameterJavaTypeManager.getJavaTypesLabels());
|
||||
List<String> finalTypes = new ArrayList<String>();
|
||||
for (String type : originalTypes) {
|
||||
String newType = type;
|
||||
if (type.contains("|")) {
|
||||
int index = type.indexOf("|");
|
||||
newType = type.substring(index + 1).trim();
|
||||
finalTypes.add(newType);
|
||||
} else {
|
||||
finalTypes.add(type);
|
||||
}
|
||||
}
|
||||
ComboBoxCellEditor comboBoxCellEditor = new ComboBoxCellEditor(finalTypes);
|
||||
comboBoxCellEditor.setFreeEdit(true);
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor, DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_TYPE_PROPERTY);
|
||||
|
||||
ComboBoxPainter customPainter = new ComboBoxPainter() {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper#paintCell(org.eclipse.nebula.widgets
|
||||
* .nattable.layer.cell.ILayerCell, org.eclipse.swt.graphics.GC, org.eclipse.swt.graphics.Rectangle,
|
||||
* org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)
|
||||
*/
|
||||
@Override
|
||||
public void paintCell(ILayerCell cell, GC gc, Rectangle adjustedCellBounds, IConfigRegistry configRegistry) {
|
||||
ContextTreeNode rowNode = ((GlazedListsDataProvider<ContextTreeNode>) dataProvider).getRowObject(cell
|
||||
.getRowIndex());
|
||||
if (rowNode.getChildren().size() > 0) {
|
||||
// do nothing just set back the color,no need paint control here
|
||||
Color backgroundColor = CellStyleUtil.getCellStyle(cell, configRegistry).getAttributeValue(
|
||||
CellStyleAttributes.BACKGROUND_COLOR);
|
||||
if (backgroundColor != null) {
|
||||
Color originalBackground = gc.getBackground();
|
||||
|
||||
gc.setBackground(backgroundColor);
|
||||
gc.fillRectangle(adjustedCellBounds);
|
||||
|
||||
gc.setBackground(originalBackground);
|
||||
}
|
||||
|
||||
} else if (rowNode.getTreeData() instanceof ContextTabChildModel) {
|
||||
((ContextCellPainterDecorator) getWrappedPainter()).setChangeBackgroundColor(true);
|
||||
super.paintCell(cell, gc, adjustedCellBounds, configRegistry);
|
||||
} else {
|
||||
((ContextCellPainterDecorator) getWrappedPainter()).setChangeBackgroundColor(false);
|
||||
super.paintCell(cell, gc, adjustedCellBounds, configRegistry);
|
||||
}
|
||||
}
|
||||
};
|
||||
customPainter.setWrappedPainter(new ContextCellPainterDecorator(new ContextTextPainter(false, false, false),
|
||||
CellEdgeEnum.RIGHT, new ImagePainter(GUIHelper.getImage("down_2"))));
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, customPainter, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_TYPE_PROPERTY);
|
||||
}
|
||||
|
||||
private void registerColumnThreeCheckBoxEditor(IConfigRegistry configRegistry) {
|
||||
CheckBoxCellEditor checkCellEditor = new CheckBoxCellEditor();
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, checkCellEditor, DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_CHECK_PROPERTY);
|
||||
CheckBoxPainter customPainter = new CheckBoxPainter() {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.nebula.widgets.nattable.painter.cell.ImagePainter#paintCell(org.eclipse.nebula.widgets.nattable
|
||||
* .layer.cell.ILayerCell, org.eclipse.swt.graphics.GC, org.eclipse.swt.graphics.Rectangle,
|
||||
* org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)
|
||||
*/
|
||||
@Override
|
||||
public void paintCell(ILayerCell cell, GC gc, Rectangle bounds, IConfigRegistry configRegistry) {
|
||||
ContextTreeNode rowNode = ((GlazedListsDataProvider<ContextTreeNode>) dataProvider).getRowObject(cell
|
||||
.getRowIndex());
|
||||
if (rowNode.getChildren().size() > 0) {
|
||||
Color backgroundColor = CellStyleUtil.getCellStyle(cell, configRegistry).getAttributeValue(
|
||||
CellStyleAttributes.BACKGROUND_COLOR);
|
||||
if (backgroundColor != null) {
|
||||
Color originalBackground = gc.getBackground();
|
||||
|
||||
gc.setBackground(backgroundColor);
|
||||
gc.fillRectangle(bounds);
|
||||
|
||||
gc.setBackground(originalBackground);
|
||||
}
|
||||
} else {
|
||||
super.paintCell(cell, gc, bounds, configRegistry);
|
||||
}
|
||||
}
|
||||
};
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, customPainter, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_CHECK_PROPERTY);
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new ContextCheckDisplayConverter(),
|
||||
DisplayMode.NORMAL, ContextTableConstants.COLUMN_CHECK_PROPERTY);
|
||||
}
|
||||
|
||||
private void registerColumnFourTextEditor(IConfigRegistry configRegistry) {
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new TextCellEditor(true, true),
|
||||
DisplayMode.NORMAL, ContextTableConstants.COLUMN_PROMPT_PROPERTY);
|
||||
}
|
||||
|
||||
private void registerColumnFiveTextEditor(IConfigRegistry configRegistry) {
|
||||
ProxyDynamicCellEditor cutomCellEditor = new ProxyDynamicCellEditor(dataProvider, columnGroupModel, manager);
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, cutomCellEditor, DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_CONTEXT_VALUE);
|
||||
}
|
||||
|
||||
public class ContextCheckDisplayConverter extends DefaultBooleanDisplayConverter {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.nebula.widgets.nattable.data.convert.DefaultBooleanDisplayConverter#displayToCanonicalValue(java
|
||||
* .lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object displayToCanonicalValue(Object displayValue) {
|
||||
return super.displayToCanonicalValue(displayValue);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.nebula.widgets.nattable.data.convert.DefaultBooleanDisplayConverter#canonicalToDisplayValue(java
|
||||
* .lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object canonicalToDisplayValue(Object canonicalValue) {
|
||||
if (canonicalValue.equals("")) {
|
||||
return null;
|
||||
}
|
||||
return super.canonicalToDisplayValue(canonicalValue);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.context.nattableTree;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration;
|
||||
import org.eclipse.nebula.widgets.nattable.config.CellConfigAttributes;
|
||||
import org.eclipse.nebula.widgets.nattable.config.EditableRule;
|
||||
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
|
||||
import org.eclipse.nebula.widgets.nattable.config.IEditableRule;
|
||||
import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.data.convert.DefaultBooleanDisplayConverter;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.EditConfigAttributes;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.config.DialogErrorHandling;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.editor.CheckBoxCellEditor;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.editor.ComboBoxCellEditor;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.editor.TextCellEditor;
|
||||
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsDataProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel;
|
||||
import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
|
||||
import org.eclipse.nebula.widgets.nattable.painter.cell.CheckBoxPainter;
|
||||
import org.eclipse.nebula.widgets.nattable.painter.cell.ComboBoxPainter;
|
||||
import org.eclipse.nebula.widgets.nattable.painter.cell.ImagePainter;
|
||||
import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes;
|
||||
import org.eclipse.nebula.widgets.nattable.style.CellStyleUtil;
|
||||
import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
|
||||
import org.eclipse.nebula.widgets.nattable.style.Style;
|
||||
import org.eclipse.nebula.widgets.nattable.ui.util.CellEdgeEnum;
|
||||
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
import org.talend.core.model.metadata.types.ContextParameterJavaTypeManager;
|
||||
import org.talend.core.model.process.IContextManager;
|
||||
import org.talend.core.ui.context.ContextTreeTable.ContextTreeNode;
|
||||
import org.talend.core.ui.context.model.ContextTabChildModel;
|
||||
import org.talend.core.ui.context.model.table.ContextTableConstants;
|
||||
|
||||
/**
|
||||
* this one for the main configuration of context NatTable such as the color,editTable,custom control,etc.
|
||||
*/
|
||||
public class ContextNatTableConfiguration extends AbstractRegistryConfiguration {
|
||||
|
||||
private IDataProvider dataProvider;
|
||||
|
||||
private ColumnGroupModel columnGroupModel;
|
||||
|
||||
private IContextManager manager;
|
||||
|
||||
/**
|
||||
* DOC ldong ContextNatTableConfiguration constructor comment.
|
||||
*
|
||||
* @param dataProvider
|
||||
*/
|
||||
public ContextNatTableConfiguration(IDataProvider dataProvider, ColumnGroupModel columnGroupModel, IContextManager manager) {
|
||||
super();
|
||||
this.dataProvider = dataProvider;
|
||||
this.columnGroupModel = columnGroupModel;
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.nebula.widgets.nattable.config.IConfiguration#configureRegistry(org.eclipse.nebula.widgets.nattable
|
||||
* .config.IConfigRegistry)
|
||||
*/
|
||||
@Override
|
||||
public void configureRegistry(IConfigRegistry configRegistry) {
|
||||
registerEditableRules(configRegistry);
|
||||
registerEditors(configRegistry);
|
||||
registerStyleRules(configRegistry);
|
||||
registerValidateRules(configRegistry);
|
||||
registerErrorHandlingStrategies(configRegistry);
|
||||
}
|
||||
|
||||
private void registerEditableRules(IConfigRegistry configRegistry) {
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, IEditableRule.ALWAYS_EDITABLE);
|
||||
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, getEditRule(), DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_NAME_PROPERTY);
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, getEditRule(), DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_TYPE_PROPERTY);
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, getEditRule(), DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_CHECK_PROPERTY);
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, getEditRule(), DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_PROMPT_PROPERTY);
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, getEditRule(), DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_CONTEXT_VALUE);
|
||||
}
|
||||
|
||||
private void registerStyleRules(IConfigRegistry configRegistry) {
|
||||
// register the default cell fg/bg colour for the natTable
|
||||
Style cellStyleDefault = new Style();
|
||||
cellStyleDefault.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_WHITE);
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleDefault, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_TYPE_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleDefault, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_NAME_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleDefault, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_CHECK_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleDefault, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_PROMPT_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleDefault, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_CONTEXT_VALUE);
|
||||
|
||||
Style cellStyleSelect = new Style();
|
||||
cellStyleSelect.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_TITLE_INACTIVE_BACKGROUND);
|
||||
cellStyleSelect.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, GUIHelper.COLOR_RED);
|
||||
cellStyleSelect.setAttributeValue(CellStyleAttributes.FONT, GUIHelper.DEFAULT_FONT);
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleSelect, DisplayMode.SELECT,
|
||||
ContextTableConstants.COLUMN_TYPE_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleSelect, DisplayMode.SELECT,
|
||||
ContextTableConstants.COLUMN_NAME_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleSelect, DisplayMode.SELECT,
|
||||
ContextTableConstants.COLUMN_CHECK_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleSelect, DisplayMode.SELECT,
|
||||
ContextTableConstants.COLUMN_PROMPT_PROPERTY);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleSelect, DisplayMode.SELECT,
|
||||
ContextTableConstants.COLUMN_CONTEXT_VALUE);
|
||||
}
|
||||
|
||||
private void registerValidateRules(IConfigRegistry configRegistry) {
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.DATA_VALIDATOR,
|
||||
new EventDataValidator(dataProvider, manager), DisplayMode.EDIT, ContextTableConstants.COLUMN_NAME_PROPERTY);
|
||||
}
|
||||
|
||||
private void registerErrorHandlingStrategies(IConfigRegistry configRegistry) {
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.VALIDATION_ERROR_HANDLER, new DialogErrorHandling(),
|
||||
DisplayMode.EDIT, ContextTableConstants.COLUMN_NAME_PROPERTY);
|
||||
}
|
||||
|
||||
private IEditableRule getEditRule() {
|
||||
EditableRule rule = new EditableRule() {
|
||||
|
||||
@Override
|
||||
public boolean isEditable(int columnIndex, int rowIndex) {
|
||||
ContextTreeNode rowNode = ((GlazedListsDataProvider<ContextTreeNode>) dataProvider).getRowObject(rowIndex);
|
||||
if (ContextNatTableUtils.isEmptyTreeNode(rowNode.getTreeData())) {
|
||||
return false;
|
||||
} else {
|
||||
if (rowNode.getTreeData() instanceof ContextTabChildModel || rowNode.getChildren().size() > 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
return rule;
|
||||
}
|
||||
|
||||
private void registerEditors(IConfigRegistry configRegistry) {
|
||||
registerColumnFirstTextEditor(configRegistry);
|
||||
registerColumnTwoComboxEditor(configRegistry);
|
||||
registerColumnThreeCheckBoxEditor(configRegistry);
|
||||
registerColumnFourTextEditor(configRegistry);
|
||||
registerColumnFiveTextEditor(configRegistry);
|
||||
}
|
||||
|
||||
private void registerColumnFirstTextEditor(IConfigRegistry configRegistry) {
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new TextCellEditor(true, true),
|
||||
DisplayMode.EDIT, ContextTableConstants.COLUMN_NAME_PROPERTY);
|
||||
}
|
||||
|
||||
private void registerColumnTwoComboxEditor(IConfigRegistry configRegistry) {
|
||||
List<String> originalTypes = Arrays.asList(ContextParameterJavaTypeManager.getJavaTypesLabels());
|
||||
List<String> finalTypes = new ArrayList<String>();
|
||||
for (String type : originalTypes) {
|
||||
String newType = type;
|
||||
if (type.contains("|")) {
|
||||
int index = type.indexOf("|");
|
||||
newType = type.substring(index + 1).trim();
|
||||
finalTypes.add(newType);
|
||||
} else {
|
||||
finalTypes.add(type);
|
||||
}
|
||||
}
|
||||
ComboBoxCellEditor comboBoxCellEditor = new ComboBoxCellEditor(finalTypes);
|
||||
comboBoxCellEditor.setFreeEdit(true);
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor, DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_TYPE_PROPERTY);
|
||||
|
||||
ComboBoxPainter customPainter = new ComboBoxPainter() {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.nebula.widgets.nattable.painter.cell.CellPainterWrapper#paintCell(org.eclipse.nebula.widgets
|
||||
* .nattable.layer.cell.ILayerCell, org.eclipse.swt.graphics.GC, org.eclipse.swt.graphics.Rectangle,
|
||||
* org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)
|
||||
*/
|
||||
@Override
|
||||
public void paintCell(ILayerCell cell, GC gc, Rectangle adjustedCellBounds, IConfigRegistry configRegistry) {
|
||||
ContextTreeNode rowNode = ((GlazedListsDataProvider<ContextTreeNode>) dataProvider).getRowObject(cell
|
||||
.getRowIndex());
|
||||
if (rowNode.getChildren().size() > 0) {
|
||||
// do nothing just set back the color,no need paint control here
|
||||
Color backgroundColor = CellStyleUtil.getCellStyle(cell, configRegistry).getAttributeValue(
|
||||
CellStyleAttributes.BACKGROUND_COLOR);
|
||||
if (backgroundColor != null) {
|
||||
Color originalBackground = gc.getBackground();
|
||||
|
||||
gc.setBackground(backgroundColor);
|
||||
gc.fillRectangle(adjustedCellBounds);
|
||||
|
||||
gc.setBackground(originalBackground);
|
||||
}
|
||||
|
||||
} else if (rowNode.getTreeData() instanceof ContextTabChildModel) {
|
||||
((ContextCellPainterDecorator) getWrappedPainter()).setChangeBackgroundColor(true);
|
||||
super.paintCell(cell, gc, adjustedCellBounds, configRegistry);
|
||||
} else {
|
||||
((ContextCellPainterDecorator) getWrappedPainter()).setChangeBackgroundColor(false);
|
||||
super.paintCell(cell, gc, adjustedCellBounds, configRegistry);
|
||||
}
|
||||
}
|
||||
};
|
||||
customPainter.setWrappedPainter(new ContextCellPainterDecorator(new ContextTextPainter(false, false, false),
|
||||
CellEdgeEnum.RIGHT, new ImagePainter(GUIHelper.getImage("down_2"))));
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, customPainter, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_TYPE_PROPERTY);
|
||||
}
|
||||
|
||||
private void registerColumnThreeCheckBoxEditor(IConfigRegistry configRegistry) {
|
||||
CheckBoxCellEditor checkCellEditor = new CheckBoxCellEditor();
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, checkCellEditor, DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_CHECK_PROPERTY);
|
||||
CheckBoxPainter customPainter = new CheckBoxPainter() {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.nebula.widgets.nattable.painter.cell.ImagePainter#paintCell(org.eclipse.nebula.widgets.nattable
|
||||
* .layer.cell.ILayerCell, org.eclipse.swt.graphics.GC, org.eclipse.swt.graphics.Rectangle,
|
||||
* org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)
|
||||
*/
|
||||
@Override
|
||||
public void paintCell(ILayerCell cell, GC gc, Rectangle bounds, IConfigRegistry configRegistry) {
|
||||
ContextTreeNode rowNode = ((GlazedListsDataProvider<ContextTreeNode>) dataProvider).getRowObject(cell
|
||||
.getRowIndex());
|
||||
if (rowNode.getChildren().size() > 0) {
|
||||
Color backgroundColor = CellStyleUtil.getCellStyle(cell, configRegistry).getAttributeValue(
|
||||
CellStyleAttributes.BACKGROUND_COLOR);
|
||||
if (backgroundColor != null) {
|
||||
Color originalBackground = gc.getBackground();
|
||||
|
||||
gc.setBackground(backgroundColor);
|
||||
gc.fillRectangle(bounds);
|
||||
|
||||
gc.setBackground(originalBackground);
|
||||
}
|
||||
} else {
|
||||
super.paintCell(cell, gc, bounds, configRegistry);
|
||||
}
|
||||
}
|
||||
};
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, customPainter, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_CHECK_PROPERTY);
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new ContextCheckDisplayConverter(),
|
||||
DisplayMode.NORMAL, ContextTableConstants.COLUMN_CHECK_PROPERTY);
|
||||
}
|
||||
|
||||
private void registerColumnFourTextEditor(IConfigRegistry configRegistry) {
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new TextCellEditor(true, true),
|
||||
DisplayMode.NORMAL, ContextTableConstants.COLUMN_PROMPT_PROPERTY);
|
||||
}
|
||||
|
||||
private void registerColumnFiveTextEditor(IConfigRegistry configRegistry) {
|
||||
ProxyDynamicCellEditor cutomCellEditor = new ProxyDynamicCellEditor(dataProvider, columnGroupModel, manager);
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, cutomCellEditor, DisplayMode.EDIT,
|
||||
ContextTableConstants.COLUMN_CONTEXT_VALUE);
|
||||
}
|
||||
|
||||
public class ContextCheckDisplayConverter extends DefaultBooleanDisplayConverter {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.nebula.widgets.nattable.data.convert.DefaultBooleanDisplayConverter#displayToCanonicalValue(java
|
||||
* .lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object displayToCanonicalValue(Object displayValue) {
|
||||
return super.displayToCanonicalValue(displayValue);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.nebula.widgets.nattable.data.convert.DefaultBooleanDisplayConverter#canonicalToDisplayValue(java
|
||||
* .lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object canonicalToDisplayValue(Object canonicalValue) {
|
||||
if (canonicalValue.equals("")) {
|
||||
return null;
|
||||
}
|
||||
return super.canonicalToDisplayValue(canonicalValue);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.context.nattableTree;
|
||||
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.NatTable;
|
||||
import org.eclipse.nebula.widgets.nattable.config.AbstractUiBindingConfiguration;
|
||||
import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
|
||||
@@ -39,8 +40,9 @@ public class ContextParaModeChangeMenuConfiguration extends AbstractUiBindingCon
|
||||
|
||||
private final Menu modeMenu;
|
||||
|
||||
public ContextParaModeChangeMenuConfiguration(final NatTable natTable, final IDataProvider dataProvider) {
|
||||
modeMenu = new ContextPopMenuBuilder(natTable).withChangeModeMenuItem(dataProvider).build();
|
||||
public ContextParaModeChangeMenuConfiguration(final NatTable natTable, final IDataProvider dataProvider,
|
||||
final ISelectionProvider selection) {
|
||||
modeMenu = new ContextPopMenuBuilder(natTable).withChangeModeMenuItem(dataProvider, selection).build();
|
||||
|
||||
modeMenu.addMenuListener(new MenuListener() {
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.context.nattableTree;
|
||||
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.NatTable;
|
||||
import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.ui.menu.PopupMenuBuilder;
|
||||
@@ -31,8 +32,8 @@ public class ContextPopMenuBuilder extends PopupMenuBuilder {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
public PopupMenuBuilder withChangeModeMenuItem(IDataProvider dataProvider) {
|
||||
return withMenuItemProvider(ContextMenuItemProviders.changeModeMenuItemProvider(dataProvider));
|
||||
public PopupMenuBuilder withChangeModeMenuItem(IDataProvider dataProvider, ISelectionProvider selection) {
|
||||
return withMenuItemProvider(ContextMenuItemProviders.changeModeMenuItemProvider(dataProvider, selection));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,25 +12,25 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.context.nattableTree;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes;
|
||||
import org.eclipse.nebula.widgets.nattable.style.HorizontalAlignmentEnum;
|
||||
import org.eclipse.nebula.widgets.nattable.style.IStyle;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.FocusAdapter;
|
||||
import org.eclipse.swt.events.FocusEvent;
|
||||
import org.eclipse.swt.events.FocusListener;
|
||||
import org.eclipse.swt.events.KeyListener;
|
||||
import org.eclipse.swt.events.MouseAdapter;
|
||||
import org.eclipse.swt.events.MouseEvent;
|
||||
import org.eclipse.swt.events.MouseListener;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.events.ShellListener;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.layout.FillLayout;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
@@ -61,9 +61,11 @@ public class ContextValuesNatText extends Composite {
|
||||
private NatTableCellEditorFactory cellFactory;
|
||||
|
||||
/**
|
||||
* Flag to determine whether the button was hidden on focus lost.
|
||||
* Flag to determine whether the text is on focus or lost.
|
||||
*/
|
||||
private boolean hideByFocusLost = false;
|
||||
private boolean focusLostActive = false;
|
||||
|
||||
private List<FocusListener> focusListener = new ArrayList<FocusListener>();
|
||||
|
||||
public ContextValuesNatText(Composite parent, IStyle cellStyle, IContextParameter realPara, int style) {
|
||||
this(parent, cellStyle, style, realPara);
|
||||
@@ -112,6 +114,7 @@ public class ContextValuesNatText extends Composite {
|
||||
|
||||
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
text.setLayoutData(gridData);
|
||||
// text.addFocusListener(new FocusListenerWrapper());
|
||||
|
||||
if (cellFactory.isSpecialType(realPara)) {
|
||||
button = new Button(this, widgetStyle);
|
||||
@@ -134,7 +137,7 @@ public class ContextValuesNatText extends Composite {
|
||||
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
hideButtonCanvaControl(true);
|
||||
hideButtonControl(true);
|
||||
if (freeEdit) {
|
||||
text.forceFocus();
|
||||
}
|
||||
@@ -143,25 +146,17 @@ public class ContextValuesNatText extends Composite {
|
||||
}
|
||||
}
|
||||
|
||||
protected void createButtonControl(int style) {
|
||||
buttonShell = new Shell(getShell(), SWT.MODELESS);
|
||||
buttonShell.setLayout(new FillLayout());
|
||||
|
||||
int buttonStyle = SWT.NULL;
|
||||
}
|
||||
|
||||
protected void updateTextControl(boolean focusOnText) {
|
||||
text.setText(getTransformedTextForDialog(focusOnText));
|
||||
// realPara.setValue(getValue());
|
||||
if (focusOnText) {
|
||||
hideButtonCanvaControl(true);
|
||||
hideButtonControl(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide the buttonCanva of cell
|
||||
*/
|
||||
public void hideButtonCanvaControl(boolean visible) {
|
||||
public void hideButtonControl(boolean visible) {
|
||||
button.setVisible(visible);
|
||||
}
|
||||
|
||||
@@ -193,17 +188,38 @@ public class ContextValuesNatText extends Composite {
|
||||
public void addMouseListener(MouseListener listener) {
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.swt.widgets.Control#addFocusListener(org.eclipse.swt.events.FocusListener)
|
||||
*/
|
||||
@Override
|
||||
public void notifyListeners(int eventType, Event event) {
|
||||
// this.button.notifyListeners(eventType, event);
|
||||
public void addFocusListener(FocusListener listener) {
|
||||
this.text.addFocusListener(listener);
|
||||
}
|
||||
|
||||
public void addSelectionListener(SelectionListener listener) {
|
||||
// this.button.addSelectionListener(listener);
|
||||
}
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.swt.widgets.Control#removeFocusListener(org.eclipse.swt.events.FocusListener)
|
||||
*/
|
||||
@Override
|
||||
public void removeFocusListener(final FocusListener listener) {
|
||||
if (focusLostActive) {
|
||||
try {
|
||||
new Thread() {
|
||||
|
||||
public void addShellListener(ShellListener listener) {
|
||||
this.buttonShell.addShellListener(listener);
|
||||
@Override
|
||||
public void run() {
|
||||
focusListener.remove(listener);
|
||||
};
|
||||
}.join();
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
focusListener.remove(listener);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -232,5 +248,4 @@ public class ContextValuesNatText extends Composite {
|
||||
result = getTransformedSelection(focusOnText);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.eclipse.swt.graphics.Cursor;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.talend.commons.utils.PasswordEncryptUtil;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
|
||||
/**
|
||||
@@ -50,6 +51,11 @@ public class CustomTextCellEditor extends AbstractCellEditor {
|
||||
*/
|
||||
private ContextValuesNatText buttonText;
|
||||
|
||||
/**
|
||||
* if password, the value will be * always. should find out the real value.
|
||||
*/
|
||||
private Object recordOriginalCanonicalValue;
|
||||
|
||||
public CustomTextCellEditor(IContextParameter realPara, IStyle cellStyle, boolean commitOnUpDown, boolean moveSelectionOnEnter) {
|
||||
this.realPara = realPara;
|
||||
this.cellStyle = cellStyle;
|
||||
@@ -65,12 +71,12 @@ public class CustomTextCellEditor extends AbstractCellEditor {
|
||||
* )
|
||||
*/
|
||||
@Override
|
||||
public Control createEditorControl(Composite parent) {
|
||||
public Control createEditorControl(Composite parentComp) {
|
||||
int style = this.editMode == EditModeEnum.INLINE ? SWT.NONE : SWT.BORDER;
|
||||
if (!this.freeEdit) {
|
||||
style |= SWT.READ_ONLY;
|
||||
}
|
||||
final ContextValuesNatText text = new ContextValuesNatText(parent, cellStyle, realPara, style);
|
||||
final ContextValuesNatText text = new ContextValuesNatText(parentComp, cellStyle, realPara, style);
|
||||
|
||||
text.setCursor(new Cursor(Display.getDefault(), SWT.CURSOR_IBEAM));
|
||||
|
||||
@@ -144,7 +150,7 @@ public class CustomTextCellEditor extends AbstractCellEditor {
|
||||
*/
|
||||
@Override
|
||||
public void setEditorValue(Object value) {
|
||||
this.buttonText.setValue(value != null && value.toString().length() > 0 ? value.toString() : "");
|
||||
this.buttonText.setValue(value != null && value.toString().length() > 0 ? value.toString() : ""); //$NON-NLS-1$
|
||||
|
||||
}
|
||||
|
||||
@@ -156,10 +162,15 @@ public class CustomTextCellEditor extends AbstractCellEditor {
|
||||
* , java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Control activateCell(Composite parent, Object originalCanonicalValue) {
|
||||
this.buttonText = (ContextValuesNatText) createEditorControl(parent);
|
||||
public Control activateCell(Composite parentComp, Object originalCanonicalValue) {
|
||||
this.recordOriginalCanonicalValue = originalCanonicalValue;
|
||||
if (PasswordEncryptUtil.isPasswordType(realPara.getType())) { // if pasword, get the real one.
|
||||
this.recordOriginalCanonicalValue = realPara.getValue(); // correct the value.
|
||||
}
|
||||
|
||||
setCanonicalValue(originalCanonicalValue);
|
||||
this.buttonText = (ContextValuesNatText) createEditorControl(parentComp);
|
||||
// use the real value.
|
||||
setCanonicalValue(this.recordOriginalCanonicalValue);
|
||||
|
||||
return this.buttonText;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.emf.common.util.EMap;
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.talend.core.model.metadata.IMetadataTable;
|
||||
import org.talend.core.model.metadata.ISAPConstant;
|
||||
@@ -47,6 +48,10 @@ public class RepositoryChangeMetadataForSAPBapi extends Command {
|
||||
|
||||
private SAPFunctionUnit functionUnit;
|
||||
|
||||
private final String ISINPUT = "isinput"; //$NON-NLS-1$
|
||||
|
||||
private final String TRUE = "true"; //$NON-NLS-1$
|
||||
|
||||
public RepositoryChangeMetadataForSAPBapi(INode node, SAPFunctionUnit functionUnit, IMetadataTable newMetadatTable,
|
||||
IMetadataTable oldMetadataTable) {
|
||||
super();
|
||||
@@ -99,12 +104,20 @@ public class RepositoryChangeMetadataForSAPBapi extends Command {
|
||||
inputTableParam.setValue(paramValues);
|
||||
}
|
||||
if (newMetadatTable != null) {
|
||||
Map<String, String> properties = newMetadatTable.getAdditionalProperties();
|
||||
if (properties != null) {
|
||||
properties.put(ISINPUT, TRUE);
|
||||
}
|
||||
// create new line
|
||||
createNewSchema(paramValues, newMetadatTable, MetadataSchemaType.INPUT.name());
|
||||
} else {
|
||||
if (functionUnit != null) {
|
||||
EList<MetadataTable> tables = functionUnit.getInputTables();
|
||||
for (MetadataTable table : tables) {
|
||||
EMap<String, String> properties = table.getAdditionalProperties();
|
||||
if (properties != null) {
|
||||
properties.put(ISINPUT, TRUE);
|
||||
}
|
||||
createNewSchema(paramValues, ConvertionHelper.convert(table), MetadataSchemaType.INPUT.name());
|
||||
}
|
||||
}
|
||||
@@ -129,22 +142,23 @@ public class RepositoryChangeMetadataForSAPBapi extends Command {
|
||||
if (found) {
|
||||
return;
|
||||
}
|
||||
Boolean isInput = MetadataSchemaType.INPUT.name().equals(tableType);
|
||||
HashMap valueMap = new HashMap<String, Object>();
|
||||
paramValues.add(valueMap);
|
||||
|
||||
String uinqueTableName = node.getProcess().generateUniqueConnectionName(
|
||||
MultiSchemasUtil.getConnectionBaseName(newMetadatTable.getLabel()));
|
||||
String paramType = getParamType(newMetadatTable);
|
||||
String paramType = getParamType(newMetadatTable, isInput);
|
||||
if (paramType == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
valueMap.put(ISAPConstant.NAME, uinqueTableName);
|
||||
valueMap.put(ISAPConstant.NAME, TalendQuoteUtils.addQuotes(newMetadatTable.getLabel()));
|
||||
valueMap.put(ISAPConstant.TYPE, paramType);
|
||||
valueMap.put(ISAPConstant.FIELD_SCHEMA, uinqueTableName);
|
||||
if (MetadataSchemaType.INPUT.name().equals(tableType)) {
|
||||
valueMap.put(ISAPConstant.PARENT_ROW, "");
|
||||
if (isInput) {
|
||||
valueMap.put(ISAPConstant.PARENT_ROW, ""); //$NON-NLS-1$
|
||||
}
|
||||
paramValues.add(valueMap);
|
||||
|
||||
if (oldMetadataTable != null) {
|
||||
CoreUIPlugin.getDefault().getDesignerCoreService().removeConnection(node, oldMetadataTable.getTableName());
|
||||
@@ -152,12 +166,13 @@ public class RepositoryChangeMetadataForSAPBapi extends Command {
|
||||
}
|
||||
|
||||
newMetadatTable.setTableName(uinqueTableName);
|
||||
newMetadatTable.setLabel(uinqueTableName);
|
||||
node.getProcess().addUniqueConnectionName(uinqueTableName);
|
||||
node.getMetadataList().add(newMetadatTable);
|
||||
}
|
||||
}
|
||||
|
||||
private String getParamType(IMetadataTable table) {
|
||||
private String getParamType(IMetadataTable table, boolean isInput) {
|
||||
if (functionUnit == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -166,8 +181,14 @@ public class RepositoryChangeMetadataForSAPBapi extends Command {
|
||||
return null;
|
||||
}
|
||||
|
||||
// SCHEMAS is output param
|
||||
for (SAPFunctionParameter parameter : paramData.getOutputRoot().getChildren()) {
|
||||
EList<SAPFunctionParameter> parameterChildrenList = null;
|
||||
if (isInput) {
|
||||
parameterChildrenList = paramData.getInputRoot().getChildren();
|
||||
} else {
|
||||
parameterChildrenList = paramData.getOutputRoot().getChildren();
|
||||
}
|
||||
|
||||
for (SAPFunctionParameter parameter : parameterChildrenList) {
|
||||
if (parameter.getName().equals(table.getTableName())) {
|
||||
if (parameter.getType().equals(ISAPConstant.PARAM_STRUCTURE)) {
|
||||
return ISAPConstant.PARAM_STRUCTURE.toUpperCase();
|
||||
@@ -177,7 +198,11 @@ public class RepositoryChangeMetadataForSAPBapi extends Command {
|
||||
return ISAPConstant.PARAM_SINGLE.toUpperCase();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// if there is no parameter named "SINGLE_PARAM_TABLE_NAME" in the paramData, then means this param is added by
|
||||
// Studio
|
||||
if (ISAPConstant.SINGLE_PARAM_TABLE_NAME.equals(table.getTableName())) {
|
||||
return ISAPConstant.PARAM_TABLE.toUpperCase();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -76,16 +76,23 @@ public class ContextParameterProposal implements IContentProposal {
|
||||
} else {
|
||||
desc = Messages.getString("ContextParameterProposal.NoCommentAvaiable"); //$NON-NLS-1$
|
||||
}
|
||||
// TDI-30683:fix the NPE pb and another description match pb(need move "\n" from message.propreties to code).
|
||||
MessageFormat format = new MessageFormat(getDescriptionMessagePattern());
|
||||
if (contextParameter.getContext() != null) {
|
||||
Object[] replaceArgs = new Object[] { desc, contextParameter.getContext().getName(), contextParameter.getType(),
|
||||
contextParameter.getName() };
|
||||
return format.format(replaceArgs);
|
||||
}
|
||||
return desc;
|
||||
|
||||
String message = Messages.getString("ContextParameterProposal.Description"); //$NON-NLS-1$
|
||||
message += Messages.getString("ContextParameterProposal.ContextVariable"); //$NON-NLS-1$
|
||||
message += Messages.getString("ContextParameterProposal.Type"); //$NON-NLS-1$
|
||||
message += Messages.getString("ContextParameterProposal.VariableName"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
MessageFormat format = new MessageFormat(message);
|
||||
// Object[] args = new Object[] { desc, contextParameter.getType(), getContent() };
|
||||
Object[] args = new Object[] { desc, contextParameter.getContext().getName(), contextParameter.getType(), contextParameter.getName() };
|
||||
return format.format(args);
|
||||
private String getDescriptionMessagePattern() {
|
||||
String message = Messages.getString("ContextParameterProposal.Description") + "\n\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
message += Messages.getString("ContextParameterProposal.ContextVariable") + "\n\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
message += Messages.getString("ContextParameterProposal.Type") + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
message += Messages.getString("ContextParameterProposal.VariableName") + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return message;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -27,9 +27,8 @@ import org.talend.core.model.process.IComponentDocumentation;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.utils.ContextParameterUtils;
|
||||
import org.talend.core.model.utils.ParameterValueUtil;
|
||||
import org.talend.designer.core.IDesignerCoreService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
|
||||
/**
|
||||
* This class is external node component handler for generating HTML.
|
||||
@@ -224,12 +223,10 @@ public class ExternalNodeComponentHandler extends AbstractComponentHandler {
|
||||
// value = checkString(type.getListItemsDisplayName()[index]);
|
||||
// }
|
||||
|
||||
else if ((elemparameter.getRepositoryValue() != null
|
||||
else if (elemparameter.getRepositoryValue() != null
|
||||
&& elemparameter.getRepositoryValue().toUpperCase().contains("PASSWORD") //$NON-NLS-1$
|
||||
|| elemparameter.getFieldType() == EParameterFieldType.PASSWORD)
|
||||
&& ProjectManager.getInstance().getCurrentProject().getEmfProject().isHidePassword()
|
||||
&& !ContextParameterUtils.containContextVariables((String) elemparameter.getValue())) {
|
||||
value = "******"; //$NON-NLS-1$
|
||||
|| elemparameter.getFieldType() == EParameterFieldType.PASSWORD) {
|
||||
value = ParameterValueUtil.getValue4Doc(elemparameter).toString();
|
||||
}
|
||||
Element columnElement = parametersElement.addElement("column"); //$NON-NLS-1$
|
||||
columnElement.addAttribute("name", HTMLDocUtils.checkString(elemparameter.getDisplayName())); //$NON-NLS-1$
|
||||
|
||||
@@ -23,10 +23,9 @@ import org.talend.core.model.process.EParameterFieldType;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.utils.ContextParameterUtils;
|
||||
import org.talend.core.model.utils.ParameterValueUtil;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.designer.core.IDesignerCoreService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
|
||||
/**
|
||||
* This class is internal node component handler for generating HTML. <br/>
|
||||
@@ -175,12 +174,10 @@ public class InternalNodeComponentHandler extends AbstractComponentHandler {
|
||||
// int index = type.getIndexOfItemFromList(type.getDisplayName());
|
||||
// value = checkString(type.getListItemsDisplayName()[index]);
|
||||
// }
|
||||
else if ((elemparameter.getRepositoryValue() != null
|
||||
else if (elemparameter.getRepositoryValue() != null
|
||||
&& elemparameter.getRepositoryValue().toUpperCase().contains("PASSWORD") //$NON-NLS-1$
|
||||
|| elemparameter.getFieldType() == EParameterFieldType.PASSWORD)
|
||||
&& ProjectManager.getInstance().getCurrentProject().getEmfProject().isHidePassword()
|
||||
&& !ContextParameterUtils.containContextVariables((String) elemparameter.getValue())) {
|
||||
value = "******"; //$NON-NLS-1$
|
||||
|| elemparameter.getFieldType() == EParameterFieldType.PASSWORD) {
|
||||
value = ParameterValueUtil.getValue4Doc(elemparameter).toString();
|
||||
}
|
||||
Element columnElement = parametersElement.addElement("column"); //$NON-NLS-1$
|
||||
columnElement.addAttribute("name", HTMLDocUtils.checkString(elemparameter.getDisplayName())); //$NON-NLS-1$
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.talend.core.CorePlugin;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ITDQItemService;
|
||||
import org.talend.core.PluginChecker;
|
||||
import org.talend.core.hadoop.IHadoopClusterService;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.JobletProcessItem;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
@@ -59,6 +60,14 @@ public final class ProcessUtils {
|
||||
|
||||
private static List<IProcess> fakeProcesses = new ArrayList<IProcess>();
|
||||
|
||||
private static IHadoopClusterService hadoopClusterService = null;
|
||||
static {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopClusterService.class)) {
|
||||
hadoopClusterService = (IHadoopClusterService) GlobalServiceRegister.getDefault().getService(
|
||||
IHadoopClusterService.class);
|
||||
}
|
||||
}
|
||||
|
||||
public static void clearFakeProcesses() {
|
||||
for (IProcess p : fakeProcesses) {
|
||||
if (p instanceof IProcess2) {
|
||||
@@ -189,10 +198,10 @@ public final class ProcessUtils {
|
||||
obj = factory.getLastVersion(relation.getId());
|
||||
}
|
||||
if (obj != null) {
|
||||
if (!repositoryObjects.contains(obj)) {
|
||||
repositoryObjects.add(obj);
|
||||
checkAllVerSionLatest(repositoryObjects, obj);
|
||||
checkItemDependencies(obj.getProperty().getItem(), repositoryObjects);
|
||||
updateRepositoryObjects(repositoryObjects, obj);
|
||||
IRepositoryViewObject clusterObj = getHadoopClusterConnectionIfNeeded(obj, factory);
|
||||
if (clusterObj != null) {
|
||||
updateRepositoryObjects(repositoryObjects, clusterObj);
|
||||
}
|
||||
}
|
||||
} catch (PersistenceException et) {
|
||||
@@ -201,6 +210,60 @@ public final class ProcessUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC cmeng Comment method "updateRepositoryObjects".
|
||||
*
|
||||
* @param repositoryObjects
|
||||
* @param obj
|
||||
*/
|
||||
private static void updateRepositoryObjects(List<IRepositoryViewObject> repositoryObjects, IRepositoryViewObject obj) {
|
||||
if (!repositoryObjects.contains(obj)) {
|
||||
repositoryObjects.add(obj);
|
||||
checkAllVerSionLatest(repositoryObjects, obj);
|
||||
checkItemDependencies(obj.getProperty().getItem(), repositoryObjects);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To check the obj, if the obj is a subItem of a Hadoop Cluster Metadata, then need to get the Cluster connection
|
||||
* item too.
|
||||
*
|
||||
* @param obj
|
||||
* @param factory
|
||||
* @return
|
||||
*/
|
||||
private static IRepositoryViewObject getHadoopClusterConnectionIfNeeded(IRepositoryViewObject obj,
|
||||
IProxyRepositoryFactory factory) {
|
||||
if (hadoopClusterService == null || obj == null) {
|
||||
return null;
|
||||
}
|
||||
Property property = obj.getProperty();
|
||||
if (property == null) {
|
||||
return null;
|
||||
}
|
||||
Item subItem = property.getItem();
|
||||
if (subItem == null) {
|
||||
return null;
|
||||
}
|
||||
if (!hadoopClusterService.isHadoopSubItem(subItem)) {
|
||||
return null;
|
||||
}
|
||||
Item clusterItem = hadoopClusterService.getHadoopClusterBySubitemId(property.getId());
|
||||
if (clusterItem == null) {
|
||||
return null;
|
||||
}
|
||||
Property clusterProperty = clusterItem.getProperty();
|
||||
if (clusterProperty == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return factory.getLastVersion(clusterProperty.getId());
|
||||
} catch (PersistenceException et) {
|
||||
ExceptionHandler.process(et);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void checkAllVerSionLatest(List<IRepositoryViewObject> repositoryObjects, IRepositoryViewObject object) {
|
||||
IProxyRepositoryFactory factory = CorePlugin.getDefault().getProxyRepositoryFactory();
|
||||
RelationshipItemBuilder builder = RelationshipItemBuilder.getInstance();
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.talend.core.model.context.ContextUtils;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
|
||||
@@ -43,7 +44,7 @@ public class ContextOrderProperties extends Properties {
|
||||
|
||||
List<IContextParameter> parameterList = new ArrayList<IContextParameter>();
|
||||
|
||||
private final static String BUILD_IN_COMMENT = "Build-in context variables";
|
||||
private final static String BUILT_IN_COMMENT = "Build-in context variables";
|
||||
|
||||
private final static String REPOSITORY_COMMENT = "Context variables from repository context ";
|
||||
|
||||
@@ -107,47 +108,55 @@ public class ContextOrderProperties extends Properties {
|
||||
|
||||
private void initContextProperties() {
|
||||
// group the context and set the comment
|
||||
for (IContextParameter parameter : parameterList) {
|
||||
// for the temp parameter in expression builder,its source is empty,need to filter from sort
|
||||
if (!parameter.getSource().equals("")) {
|
||||
int currentIndex = parameterList.indexOf(parameter);
|
||||
if (currentIndex == 0) {
|
||||
if (parameter.getSource().equals(IContextParameter.BUILT_IN)) {
|
||||
this.setProperty(parameter.getName(), TalendTextUtils.trimParameter(parameter.getValue()),
|
||||
BUILD_IN_COMMENT);
|
||||
} else {
|
||||
String contextName = ContextUtils.getRepositoryContextItemById(parameter.getSource()).getProperty()
|
||||
.getLabel();
|
||||
this.setProperty(parameter.getName(), TalendTextUtils.trimParameter(parameter.getValue()),
|
||||
REPOSITORY_COMMENT + contextName);
|
||||
}
|
||||
for (IContextParameter currentParameter : parameterList) {
|
||||
int currentIndex = parameterList.indexOf(currentParameter);
|
||||
if (currentIndex == 0) {
|
||||
initFirstContextParameter(currentParameter);
|
||||
} else {
|
||||
IContextParameter previousParameter = parameterList.get(currentIndex - 1);
|
||||
initOtherContextParameters(currentParameter, previousParameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initFirstContextParameter(IContextParameter firstParameter) {
|
||||
if (firstParameter.isBuiltIn()) {
|
||||
this.setProperty(firstParameter.getName(), TalendTextUtils.trimParameter(firstParameter.getValue()), BUILT_IN_COMMENT);
|
||||
} else if (ContextParameterUtils.isEmptyParameter(firstParameter.getSource())) {
|
||||
this.setProperty(firstParameter.getName(), TalendTextUtils.trimParameter(firstParameter.getValue()));
|
||||
} else {
|
||||
this.setProperty(firstParameter.getName(), TalendTextUtils.trimParameter(firstParameter.getValue()),
|
||||
REPOSITORY_COMMENT
|
||||
+ ContextUtils.getRepositoryContextItemById(firstParameter.getSource()).getProperty().getLabel());
|
||||
}
|
||||
}
|
||||
|
||||
private void initOtherContextParameters(IContextParameter currentParameter, IContextParameter previousParameter) {
|
||||
if (currentParameter.isBuiltIn()) {
|
||||
if (previousParameter.isBuiltIn()) {
|
||||
// same neighbor built-in in one group,no need to comment since the previous added comment
|
||||
this.setProperty(currentParameter.getName(), TalendTextUtils.trimParameter(currentParameter.getValue()),
|
||||
StringUtils.EMPTY);
|
||||
} else {
|
||||
this.setProperty(currentParameter.getName(), TalendTextUtils.trimParameter(currentParameter.getValue()),
|
||||
BUILT_IN_COMMENT);
|
||||
}
|
||||
} else if (ContextParameterUtils.isEmptyParameter(currentParameter.getSource())) {
|
||||
this.setProperty(currentParameter.getName(), TalendTextUtils.trimParameter(currentParameter.getValue()));
|
||||
} else {
|
||||
String repositryContextName = ContextUtils.getRepositoryContextItemById(currentParameter.getSource()).getProperty()
|
||||
.getLabel();
|
||||
if (previousParameter.isBuiltIn()) {
|
||||
this.setProperty(currentParameter.getName(), TalendTextUtils.trimParameter(currentParameter.getValue()),
|
||||
REPOSITORY_COMMENT + repositryContextName);
|
||||
} else {
|
||||
// need to check if the same repository's context
|
||||
if (previousParameter.getSource().equals(currentParameter.getSource())) {
|
||||
this.setProperty(currentParameter.getName(), TalendTextUtils.trimParameter(currentParameter.getValue()),
|
||||
StringUtils.EMPTY);
|
||||
} else {
|
||||
int previousIndex = currentIndex - 1;
|
||||
if (parameter.getSource().equals(IContextParameter.BUILT_IN)) {
|
||||
if (parameterList.get(previousIndex).getSource().equals(IContextParameter.BUILT_IN)) {
|
||||
// same neighbor build-in,so should be in one group,no need to add comment since the
|
||||
// previous has added comment
|
||||
this.setProperty(parameter.getName(), TalendTextUtils.trimParameter(parameter.getValue()), "");
|
||||
} else {
|
||||
this.setProperty(parameter.getName(), TalendTextUtils.trimParameter(parameter.getValue()),
|
||||
BUILD_IN_COMMENT);
|
||||
}
|
||||
} else {
|
||||
String contextName = ContextUtils.getRepositoryContextItemById(parameter.getSource()).getProperty()
|
||||
.getLabel();
|
||||
if (parameterList.get(previousIndex).getSource().equals(IContextParameter.BUILT_IN)) {
|
||||
this.setProperty(parameter.getName(), TalendTextUtils.trimParameter(parameter.getValue()),
|
||||
REPOSITORY_COMMENT + contextName);
|
||||
} else {
|
||||
// need to check if the same repository's context
|
||||
if (parameterList.get(previousIndex).getSource().equals(parameter.getSource())) {
|
||||
this.setProperty(parameter.getName(), TalendTextUtils.trimParameter(parameter.getValue()), "");
|
||||
} else {
|
||||
this.setProperty(parameter.getName(), TalendTextUtils.trimParameter(parameter.getValue()),
|
||||
REPOSITORY_COMMENT + contextName);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setProperty(currentParameter.getName(), TalendTextUtils.trimParameter(currentParameter.getValue()),
|
||||
REPOSITORY_COMMENT + repositryContextName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ Bundle-ClassPath: .
|
||||
Bundle-Activator: orgomg.cwm.objectmodel.core.provider.Cwm_mipEditPlugin$Implementation
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Export-Package: orgomg.cwm.analysis.businessnomenclature.provider,
|
||||
orgomg.cwm.analysis.datamining.provider,
|
||||
orgomg.cwm.analysis.informationvisualization.provider,
|
||||
|
||||
@@ -7,7 +7,6 @@ Bundle-ClassPath: .
|
||||
Bundle-Activator: orgomg.cwm.objectmodel.core.presentation.Cwm_mipEditorPlugin$Implementation
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Export-Package: orgomg.cwm.analysis.businessnomenclature.presentation,
|
||||
orgomg.cwm.analysis.datamining.presentation,
|
||||
orgomg.cwm.analysis.informationvisualization.presentation,
|
||||
|
||||
@@ -6,7 +6,6 @@ Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-ClassPath: .
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Export-Package: orgomg.cwm.analysis.businessnomenclature,
|
||||
orgomg.cwm.analysis.businessnomenclature.impl,
|
||||
orgomg.cwm.analysis.businessnomenclature.util,
|
||||
|
||||
@@ -10,7 +10,8 @@ bin.includes = .,\
|
||||
META-INF/,\
|
||||
plugin.xml,\
|
||||
plugin.properties,\
|
||||
model/
|
||||
model/,\
|
||||
dist/
|
||||
jars.compile.order = .,\
|
||||
dist/org.talend.cwm.mip.jar
|
||||
source.dist/org.talend.cwm.mip.jar = src/
|
||||
|
||||
@@ -10,7 +10,6 @@ Require-Bundle: org.eclipse.core.runtime,
|
||||
org.apache.commons.logging,
|
||||
javax.mail;bundle-version="1.4.0",
|
||||
javax.activation;bundle-version="1.1.0"
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Bundle-ClassPath: lib/activation-1.1.jar,
|
||||
lib/axiom-api-1.2.13.jar,
|
||||
lib/axiom-impl-1.2.13.jar,
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,6 @@ Bundle-Name: Lucene plug-in
|
||||
Bundle-SymbolicName: org.talend.libraries.apache.lucene
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Vendor: .Talend SA.
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Bundle-ClassPath: lib/lucene-core-3.0.1.jar,
|
||||
.
|
||||
Export-Package: org.apache.lucene,
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -14,13 +14,9 @@ Bundle-ClassPath: .,
|
||||
lib/asm.jar,
|
||||
lib/hibernate-3.2-patched1.7.jar
|
||||
Require-Bundle: org.apache.log4j,
|
||||
org.talend.libraries.jdbc.jtds;resolution:=optional;visibility:=reexport,
|
||||
org.talend.libraries.jdbc.mysql;visibility:=reexport,
|
||||
org.talend.libraries.jdbc.oracle;resolution:=optional;visibility:=reexport,
|
||||
org.talend.libraries.jdbc.hsql;resolution:=optional,
|
||||
org.apache.xerces,
|
||||
org.talend.libraries.dom4j-jaxen;visibility:=reexport,
|
||||
org.talend.libraries.jdbc.postgresql;resolution:=optional;visibility:=reexport,
|
||||
org.apache.commons.collections
|
||||
Export-Package: antlr,
|
||||
antlr.ASdebug,
|
||||
|
||||
@@ -304,6 +304,5 @@ Require-Bundle: org.talend.libraries.hibernate,
|
||||
org.talend.libraries.jdtcompiler;resolution:=optional
|
||||
Eclipse-BuddyPolicy: registered
|
||||
Eclipse-RegisterBuddy: org.apache.log4j
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Bundle-ActivationPolicy: lazy
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ Bundle-Name: Javacsv Plug-in
|
||||
Bundle-SymbolicName: org.talend.libraries.javacsv;singleton:=true
|
||||
Bundle-Version: 2.2.0.qualifier
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Bundle-ClassPath: .,
|
||||
lib/javacsv.jar
|
||||
Export-Package: com.csvreader
|
||||
|
||||
@@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
|
||||
Bundle-Name: As400 Plug-in
|
||||
Bundle-SymbolicName: org.talend.libraries.jdbc.as400;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Export-Package: com.ibm.as400.access,
|
||||
com.ibm.as400.access.list,
|
||||
com.ibm.as400.data,
|
||||
|
||||
@@ -17,5 +17,4 @@ Export-Package:
|
||||
org.hsqldb.scriptio,
|
||||
org.hsqldb.types,
|
||||
org.hsqldb.util
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Bundle-ActivationPolicy: lazy
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user