Compare commits

..

2 Commits

Author SHA1 Message Date
Zhiwei Xue
aeb31c0e57 feat(TUP-41073):Block the update if studio is not compatible (#6710) (#6728)
* feat(TUP-41073):Block the update if studio is not compatible

* feat(TUP-41073):fix feature adapt and block commandline
2024-01-15 16:28:53 +08:00
bhe-talendbj
9c5e56f757 fix(TUP-41511): throw exception (#6722) 2024-01-12 14:35:29 +08:00
39 changed files with 47 additions and 526 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -15,7 +15,7 @@ ColorStyledText.SelectAllItem.Text=\u3059\u3079\u3066\u9078\u629E
ContentProposalAdapterExtended.close=\u9589\u3058\u308B
ContentProposalAdapterExtended.closeFocusout=\u30D5\u30A9\u30FC\u30AB\u30B9\u30A2\u30A6\u30C8\u3092\u9589\u3058\u308B
ControlUtils.Unsupported1=\u3053\u306E\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB({0})\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5FC5\u8981\u3067\u3042\u308C\u3070\u3001\u30B1\u30FC\u30B9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044...
CopyPushButton.CopyButton.Tip=\u9078\u629E\u9805\u76EE\u3092\u30B3\u30D4\u30FC
CopyPushButton.CopyButton.Tip=\u9078\u629E\u3057\u305F\u30A2\u30A4\u30C6\u30E0\u3092\u30B3\u30D4\u30FC
Curve2D.MaxNum.Be0=maximumSegments\u306F\u6B63\u6570\u304B0\u306B\u3057\u3066\u304F\u3060\u3055\u3044
Curve2D.MinNum.Be0=minimumSegments\u306F\u6B63\u6570\u307E\u305F\u306F0\u306B\u3057\u3066\u304F\u3060\u3055\u3044
DateDialog.textContent=\u65E5\u6642\u3092\u9078\u629E

View File

@@ -15,7 +15,7 @@ ColorStyledText.SelectAllItem.Text=\u3059\u3079\u3066\u9078\u629E
ContentProposalAdapterExtended.close=\u9589\u3058\u308B
ContentProposalAdapterExtended.closeFocusout=\u30D5\u30A9\u30FC\u30AB\u30B9\u30A2\u30A6\u30C8\u3092\u9589\u3058\u308B
ControlUtils.Unsupported1=\u3053\u306E\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB({0})\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5FC5\u8981\u3067\u3042\u308C\u3070\u3001\u30B1\u30FC\u30B9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044...
CopyPushButton.CopyButton.Tip=\u9078\u629E\u9805\u76EE\u3092\u30B3\u30D4\u30FC
CopyPushButton.CopyButton.Tip=\u9078\u629E\u3057\u305F\u30A2\u30A4\u30C6\u30E0\u3092\u30B3\u30D4\u30FC
Curve2D.MaxNum.Be0=maximumSegments\u306F\u6B63\u6570\u304B0\u306B\u3057\u3066\u304F\u3060\u3055\u3044
Curve2D.MinNum.Be0=minimumSegments\u306F\u6B63\u307E\u305F\u306F0\u306B\u3057\u3066\u304F\u3060\u3055\u3044
DateDialog.textContent=\u65E5\u6642\u3092\u9078\u629E

View File

@@ -155,6 +155,7 @@ ProjectRepositoryNode.invalidItem=\u00C9l\u00E9ment invalide
ProjectRepositoryNode.columns=Colonnes
ProjectRepositoryNode.validationRules=R\u00E8gles de validation
ProjectRepositoryNode.cdcFoundation=Fondation CDC
ProjectRepositoryNode.cdcFoundation.deprecated=Fondation CDC (d\u00E9pr\u00E9ci\u00E9)
ProjectRepositoryNode.genericSchema=Sch\u00E9mas g\u00E9n\u00E9riques
ProjectRepositoryNode.queries=Requ\u00EAtes
ProjectRepositoryNode.synonymSchemas=Sch\u00E9mas synonymes

View File

@@ -155,6 +155,7 @@ ProjectRepositoryNode.invalidItem=\u65E0\u6548\u9879\u76EE
ProjectRepositoryNode.columns=\u5217
ProjectRepositoryNode.validationRules=\u9A8C\u8BC1\u89C4\u5219
ProjectRepositoryNode.cdcFoundation=CDC Foundation
ProjectRepositoryNode.cdcFoundation.deprecated=CDC Foundation (\u5DF2\u5F03\u7528)
ProjectRepositoryNode.genericSchema=\u901A\u7528 schema
ProjectRepositoryNode.queries=\u67E5\u8BE2
ProjectRepositoryNode.synonymSchemas=\u540C\u4E49\u5B57 schema

View File

@@ -856,13 +856,13 @@ public class XmiResourceManager {
URI orgPropertyResourceURI = EcoreUtil.getURI(originalItem.getProperty());
URI orgRelativePlateformDestUri = orgPropertyResourceURI.trimFileExtension().appendFileExtension(
FileConstants.SCREENSHOT_EXTENSION);
URL orgFileURL = FileLocator.resolve(new java.net.URL(
URL orgFileURL = FileLocator.toFileURL(new java.net.URL(
"platform:/resource" + orgRelativePlateformDestUri.toPlatformString(true))); //$NON-NLS-1$
URI newPropertyResourceURI = EcoreUtil.getURI(newItem.getProperty());
URI newRelativePlateformDestUri = newPropertyResourceURI.trimFileExtension().appendFileExtension(
FileConstants.SCREENSHOT_EXTENSION);
URL newFileURL = FileLocator.resolve(new java.net.URL(
URL newFileURL = FileLocator.toFileURL(new java.net.URL(
"platform:/resource" + newRelativePlateformDestUri.toPlatformString(true))); //$NON-NLS-1$
os = new FileOutputStream(newFileURL.getFile());

View File

@@ -55,7 +55,7 @@ public enum EDatabaseVersion4Drivers {
//
JAVADB_EMBEDED(new DbVersion4Drivers(EDatabaseTypeName.JAVADB_EMBEDED, "derby-10.14.2.0.jar")), //$NON-NLS-1$
SQLITE(new DbVersion4Drivers(EDatabaseTypeName.SQLITE, new String[] { "slf4j-api-1.7.34.jar", "sqlite-jdbc-3.44.1.0.jar" })), //$NON-NLS-1$
SQLITE(new DbVersion4Drivers(EDatabaseTypeName.SQLITE, "sqlite-jdbc-3.40.0.0.jar")), //$NON-NLS-1$
FIREBIRD(new DbVersion4Drivers(EDatabaseTypeName.FIREBIRD, "jaybird-2.1.1.jar")), //$NON-NLS-1$
TERADATA(new DbVersion4Drivers(EDatabaseTypeName.TERADATA,
new String[] { "terajdbc4-17.10.00.27.jar" })), //$NON-NLS-1$

View File

@@ -20,6 +20,7 @@ import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.pendo.PendoDataTrackFactory;
import org.talend.core.runtime.i18n.Messages;
import org.talend.core.service.ICloudSignOnService;
import org.talend.repository.model.RepositoryConstants;
@@ -253,13 +254,7 @@ public class ConnectionBean implements Cloneable {
String user = conDetails.getString(USER);
if (isToken()) {
String url = getDynamicFields().get(RepositoryConstants.REPOSITORY_URL);
if (ICloudSignOnService.get() != null) {
try {
user = ICloudSignOnService.get().getTokenUser(url, getPassword());
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
user = PendoDataTrackFactory.getInstance().getTmcUser(url, getPassword());
if (StringUtils.isNotBlank(user)) {
setUser(user);
}

View File

@@ -63,4 +63,11 @@ public class PendoDataTrackFactory {
}
}
public String getTmcUser(String url, String token) {
if (coreRuntimeService != null) {
return coreRuntimeService.getTmcUser(url, token);
}
return "";
}
}

View File

@@ -28,7 +28,7 @@ public interface ICloudSignOnService extends IService {
boolean hasValidToken() throws Exception;
String getTokenUser(String url, String token) throws Exception;
String getTokenUser(String url, TokenMode token) throws Exception;
void signonCloud(LoginEventListener listener) throws Exception;

View File

@@ -23,6 +23,8 @@ import org.talend.core.pendo.properties.IPendoDataProperties;
*/
public interface ICoreTisRuntimeService extends IService {
String getTmcUser(String url, String token);
AbstractPendoTrackManager getPendoProjectLoginManager();
AbstractPendoTrackManager getPendoGenericManager(TrackEvent event, IPendoDataProperties peoperties);

View File

@@ -36,7 +36,4 @@ public interface IReferenceProjectProvider {
public void initSettings() throws BusinessException, PersistenceException;
public boolean isHasConfigurationFile();
void resetReferenceProjectList();
}

View File

@@ -251,12 +251,6 @@ public class ReferenceProjectProvider implements IReferenceProjectProvider {
public static void removeTacReferenceList(String projectLabel) {
tacReferenceMap.remove(projectLabel);
}
@Override
public void resetReferenceProjectList() {
referenceProjectList = null;
}
}
class ReferenceProjectConfiguration {

View File

@@ -22,7 +22,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.CoreException;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProcessItem;
@@ -42,7 +41,6 @@ import org.talend.repository.model.IRepositoryNode;
*
*/
public class ExportFileResource {
private static Logger LOGGER = Logger.getLogger(ExportFileResource.class);
private Item item;
@@ -103,7 +101,7 @@ public class ExportFileResource {
String decodeStr = URLDecoder.decode(url.toString(), "UTF-8"); //$NON-NLS-1$
url = new URL(decodeStr);
} catch (Exception e) {
LOGGER.warn(e);
e.printStackTrace(); // only for debug.
}
return url;

View File

@@ -333,7 +333,7 @@ _UI_InformationsetModelWizard_description = Cr\u00E9er un mod\u00E8le Informatio
_UI_InformationsetEditor_label = \u00C9diteur de mod\u00E8le Informationset
_UI_InformationsetEditorFilenameDefaultBase = Mon
_UI_InformationsetEditorFilenameDefaultBase = INVISIBLE dans l'interface
_UI_InformationsetEditorFilenameExtension = informationset
_UI_InformationreportingModelWizard_label = Mod\u00E8le Informationreporting

View File

@@ -12,12 +12,6 @@
// ============================================================================
package org.talend.designer.maven.aether.util;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import org.eclipse.aether.repository.Authentication;
import org.eclipse.aether.repository.Proxy;
import org.eclipse.aether.repository.ProxySelector;
@@ -41,7 +35,6 @@ public class TalendAetherProxySelector implements ProxySelector {
@Override
public Proxy getProxy(RemoteRepository repository) {
/**
* Update each time in case the settings are changed
*/
@@ -60,37 +53,6 @@ public class TalendAetherProxySelector implements ProxySelector {
ExceptionHandler.process(e);
}
}
if (proxy == null) {
java.net.ProxySelector jreSelector = java.net.ProxySelector.getDefault();
try {
URI uri = new URI(repository.getUrl());
List<java.net.Proxy> proxies = jreSelector.select(uri);
if (proxies != null && !proxies.isEmpty() && proxies.get(0).type() == java.net.Proxy.Type.HTTP) {
SocketAddress addr = proxies.get(0).address();
if (addr instanceof InetSocketAddress) {
InetSocketAddress iaddr = (InetSocketAddress) addr;
proxy = new org.eclipse.aether.repository.Proxy(proxies.get(0).type().name().toLowerCase(), iaddr.getHostName(), iaddr.getPort(), null);
}
}
} catch (URISyntaxException e) {
ExceptionHandler.process(e);
}
}
if (isTalendDebug) {
try {
if (repository != null) {
String proxyStr = "";
if (proxy != null) {
proxyStr = proxy.getType() + " " + proxy.toString() + ", proxy user: "
+ (proxy.getAuthentication() != null ? "..." : "<empty>");
}
ExceptionHandler.log("Aether system proxy> host: " + repository.getHost() + ", proxy: " + proxyStr);
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
return proxy;
}

View File

@@ -8,4 +8,3 @@ ProjectSettingPage_ProjectPom=Projet
ProjectSettingPage_ProjectPomDesc=Param\u00E8tres des POM du projet
ProjectSettingPage_MavenCustomSetup=Configurer les scripts personnalis\u00E9s par dossier
ProjectSettingPage_MavenCustomSetupDesc=Configurer les scripts Maven personnalis\u00E9s par dossier
TalendMavenPreferencePage=Maven

View File

@@ -8,4 +8,3 @@ ProjectSettingPage_ProjectPom=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8
ProjectSettingPage_ProjectPomDesc=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8POM\u8A2D\u5B9A
ProjectSettingPage_MavenCustomSetup=\u30AB\u30B9\u30BF\u30E0\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u30D5\u30A9\u30EB\u30C0\u30FC\u3054\u3068\u306B\u8A2D\u5B9A
ProjectSettingPage_MavenCustomSetupDesc=\u30AB\u30B9\u30BF\u30E0Maven\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u30D5\u30A9\u30EB\u30C0\u30FC\u3054\u3068\u306B\u8A2D\u5B9A
TalendMavenPreferencePage=Maven

View File

@@ -8,4 +8,3 @@ ProjectSettingPage_ProjectPom=\u5DE5\u7A0B
ProjectSettingPage_ProjectPomDesc=\u5DE5\u7A0B POM \u8BBE\u7F6E
ProjectSettingPage_MavenCustomSetup=\u6309\u6587\u4EF6\u5939\u8BBE\u7F6E\u81EA\u5B9A\u4E49\u811A\u672C
ProjectSettingPage_MavenCustomSetupDesc=\u6309\u6587\u4EF6\u5939\u8BBE\u7F6E\u81EA\u5B9A\u4E49 Maven \u811A\u672C
TalendMavenPreferencePage=Maven

View File

@@ -23,5 +23,3 @@ MavenProjectSettingPage.syncAllPomsWarning=Cliquez sur Forcer la nouvelle synchr
MavenProjectSettingPage.skipFolders=Ignorer les dossiers
BuildProjectSettingPage.allowRecursiveJobsJoblets=Autorise les Jobs et Joblets r\u00E9cursifs (non support\u00E9 - pour des raisons de compatibilit\u00E9)
BuildProjectSettingPage.allowRecursiveJobs=Autoriser les Jobs r\u00E9cursifs (non recommand\u00E9)
TalendMavenPreferencePage.maven.offline=Hors ligne
TalendMavenPreferencePage.maven.warn=Le mode en ligne n'est pas recommand\u00E9 dans le Studio.

View File

@@ -23,5 +23,3 @@ MavenProjectSettingPage.syncAllPomsWarning=[\u5B8C\u5168\u306A\u518D\u540C\u671F
MavenProjectSettingPage.skipFolders=\u30D5\u30A9\u30EB\u30C0\u30FC\u3092\u30B9\u30AD\u30C3\u30D7
BuildProjectSettingPage.allowRecursiveJobsJoblets=\u518D\u5E30\u7684\u30B8\u30E7\u30D6\u3068\u30B8\u30E7\u30D6\u30EC\u30C3\u30C8\u3092\u8A31\u53EF(\u30B5\u30DD\u30FC\u30C8\u306A\u3057 - \u4E92\u63DB\u6027\u306E\u76EE\u7684\u306E\u307F)
BuildProjectSettingPage.allowRecursiveJobs=\u518D\u5E30\u7684\u30B8\u30E7\u30D6\u3092\u8A31\u53EF(\u975E\u63A8\u5968)
TalendMavenPreferencePage.maven.offline=\u30AA\u30D5\u30E9\u30A4\u30F3
TalendMavenPreferencePage.maven.warn=Studio\u5185\u90E8\u3067\u306E\u30AA\u30F3\u30E9\u30A4\u30F3\u30E2\u30FC\u30C9\u306F\u304A\u52E7\u3081\u3067\u304D\u307E\u305B\u3093\u3002

View File

@@ -23,5 +23,3 @@ MavenProjectSettingPage.syncAllPomsWarning=\u5355\u51FB \u201C\u5F3A\u5236\u5B8C
MavenProjectSettingPage.skipFolders=\u8DF3\u8FC7\u6587\u4EF6\u5939
BuildProjectSettingPage.allowRecursiveJobsJoblets=\u5141\u8BB8\u9012\u5F52\u4F5C\u4E1A\u548C\u5C0F\u4F5C\u4E1A (\u4E0D\u652F\u6301 - \u4EC5\u7528\u4E8E\u517C\u5BB9\u6027)
BuildProjectSettingPage.allowRecursiveJobs=\u5141\u8BB8\u9012\u5F52\u4F5C\u4E1A (\u4E0D\u63A8\u8350)
TalendMavenPreferencePage.maven.offline=\u79BB\u7EBF
TalendMavenPreferencePage.maven.warn=Studio \u5185\u4E0D\u5EFA\u8BAE\u4F7F\u7528\u5728\u7EBF\u6A21\u5F0F\u3002

View File

@@ -1,58 +0,0 @@
#Eclipse modern messages class
#Sat Apr 19 16:43:19 MSK 2014
ExecutePomAction_dialog_debug_message=S\u00E9lectionnez une configuration de d\u00E9marrage pour le d\u00E9bogage\u00A0:
ExecutePomAction_dialog_run_message=S\u00E9lectionnez une configuration de d\u00E9marrage pour l'ex\u00E9cution\u00A0:
ExecutePomAction_dialog_title=S\u00E9lectionner une configuration
ExecutePomAction_executing=Ex\u00E9cution de {0} dans {1}
MavenLaunchDelegate_error_cannot_create_conf=Impossible de cr\u00E9er m2.conf
MavenLaunchDelegate_job_name=Actualisation des ressources...
MavenLaunchDelegate_error_cannot_read_jvmConfig=Impossible de lire la configuration de la JVM depuis {0}
MavenLaunchExtensionsTab_lblExtensions=D\u00E9marrer les extensions Maven
MavenLaunchExtensionsTab_name=D\u00E9marrer les extensions
MavenLaunchMainTab_btnAfterClean=S\u00E9lec&tionner...
MavenLaunchMainTab_btnAutoBuild=&S\u00E9lectionner...
MavenLaunchMainTab_btnCleanBuild=S\u00E9&lectionner...
MavenLaunchMainTab_btnConfigure=Configurer...
MavenLaunchMainTab_btnDebugOutput=D\u00E9bo&guer la sortie
MavenLaunchMainTab_btnManualBuild=S&\u00E9lectionner...
MavenLaunchMainTab_btnNotRecursive=Non r\u00E9cursif
MavenLaunchMainTab_btnOffline=Hors ligne (&O)
MavenLaunchMainTab_btnResolveWorkspace=R\u00E9soudre les artefacts de l'espace de travail
MavenLaunchMainTab_btnSkipTests=Ignorer les tests (&k)
MavenLaunchMainTab_btnUpdateSnapshots=Mettre \u00E0 jour les Snapshots (&U)
MavenLaunchMainTab_lblAfterClean=Goals apr\u00E8s Clean (&f)\u00A0:
MavenLaunchMainTab_lblAutoBuildGoals=Goals &Build Auto\u00A0:
MavenLaunchMainTab_lblCleanBuild=Goals au cours d'un Clean (&D)\u00A0:
MavenLaunchMainTab_lblManualGoals=Goals du Build ma&nuel\u00A0:
MavenLaunchMainTab_lblRuntime=Runt&ime Maven\u00A0:
MavenLaunchMainTab_lblThreads=&Threads\u00A0:
MavenLaunchMainTab_lblEnableColorOutput=&Colorer la sortie\u00A0:
MavenLaunchMainTab_lblEnableColorOutput_Auto=Auto
MavenLaunchMainTab_lblEnableColorOutput_Always=Toujours
MavenLaunchMainTab_lblEnableColorOutput_Never=Jamais
MavenLaunchMainTab_lblUserSettings_text=Param\u00E8tres utilisateur\u00A0:
MavenLaunchMainTab_property_dialog_edit_title=Modifier le param\u00E8tre
MavenLaunchMainTab_property_dialog_title=Ajouter un param\u00E8tre
MavenJRETab_lblDefault=JRE d'ex\u00E9cution Maven par d\u00E9faut\u00A0: {0}
MavenJRETab_lblDefaultDetailsRequiredJavaVersion={0} (s\u00E9lection auto dans l'intervalle de versions Java requis {1})
MavenLaunchUtils_error_no_maven_install=L'installation de Maven est introuvable {0}
MavenLaynchDelegate_unsupported_source_locator=Locator de source inconnu on non support\u00E9 {0}
launchBrowseFs=Syst\u00E8&me de fichiers...
launchBrowseVariables=&Variables...
launchBrowseWorkspace=Espace de travail... (&W)
launchChoosePomDir=S\u00E9lectionner le r\u00E9pertoire de &Base
launchChooseSettingsFile=S\u00E9lectionner le fichier des param\u00E8tre&S
launchGoals=&S\u00E9lectionner...
launchGoalsLabel=&Goals\u00A0:
launchMainTabName=Main
launchPomDirectoryDoesntExist=Le r\u00E9pertoire de base n'existe pas ou ne peut \u00EAtre lu
launchErrorEvaluatingBaseDirectory=Le nom du r\u00E9pertoire de base ne peut \u00EAtre \u00E9valu\u00E9
launchPomDirectoryEmpty=Le r\u00E9pertoire de base doit \u00EAtre sp\u00E9cifi\u00E9
launchPomGroup=R\u00E9pertoire de base\u00A0:
launchProfilesLabel=&Profils\u00A0:
launchPropAddButton=&Ajouter...
launchPropEditButton=Mo&difier...
launchPropName=Nom du param\u00E8tre
launchPropRemoveButton=Supp&rimer
launchPropValue=Valeur
launchPropertyDialogBrowseVariables=Varia&bles...

View File

@@ -1,58 +0,0 @@
#Eclipse modern messages class
#Sat Apr 19 16:43:19 MSK 2014
ExecutePomAction_dialog_debug_message=\u30C7\u30D0\u30C3\u30B0\u3059\u308B\u8D77\u52D5\u8A2D\u5B9A\u3092\u9078\u629E:
ExecutePomAction_dialog_run_message=\u5B9F\u884C\u3059\u308B\u8D77\u52D5\u8A2D\u5B9A\u3092\u9078\u629E:
ExecutePomAction_dialog_title=\u8A2D\u5B9A\u3092\u9078\u629E
ExecutePomAction_executing={1}\u3067{0}\u3092\u5B9F\u884C
MavenLaunchDelegate_error_cannot_create_conf=m2.conf\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093
MavenLaunchDelegate_job_name=\u30EA\u30BD\u30FC\u30B9\u3092\u66F4\u65B0...
MavenLaunchDelegate_error_cannot_read_jvmConfig={0}\u304B\u3089JVM\u8A2D\u5B9A\u3092\u8AAD\u307F\u53D6\u308C\u307E\u305B\u3093
MavenLaunchExtensionsTab_lblExtensions=Maven\u8D77\u52D5\u62E1\u5F35\u6A5F\u80FD
MavenLaunchExtensionsTab_name=\u8D77\u52D5\u62E1\u5F35\u6A5F\u80FD
MavenLaunchMainTab_btnAfterClean=\u9078\u629E(&T)...
MavenLaunchMainTab_btnAutoBuild=\u9078\u629E(&S)...
MavenLaunchMainTab_btnCleanBuild=\u9078\u629E(&L)...
MavenLaunchMainTab_btnConfigure=\u8A2D\u5B9A...
MavenLaunchMainTab_btnDebugOutput=\u51FA\u529B\u3092\u30C7\u30D0\u30C3\u30B0(&G)
MavenLaunchMainTab_btnManualBuild=\u9078\u629E(&E)...
MavenLaunchMainTab_btnNotRecursive=\u975E\u518D\u5E30\u7684
MavenLaunchMainTab_btnOffline=\u30AA\u30D5\u30E9\u30A4\u30F3(&O)
MavenLaunchMainTab_btnResolveWorkspace=\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u30A2\u30FC\u30C6\u30A3\u30D5\u30A1\u30AF\u30C8\u3092\u89E3\u6C7A
MavenLaunchMainTab_btnSkipTests=\u30C6\u30B9\u30C8\u3092\u30B9\u30AD\u30C3\u30D7(&K)
MavenLaunchMainTab_btnUpdateSnapshots=\u30B9\u30CA\u30C3\u30D7\u30B7\u30E7\u30C3\u30C8\u3092\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8(&U)
MavenLaunchMainTab_lblAfterClean=\u30AF\u30EA\u30FC\u30F3\u76EE\u6A19\u5F8C(&F):
MavenLaunchMainTab_lblAutoBuildGoals=\u81EA\u52D5\u30D3\u30EB\u30C9\u76EE\u6A19(&B):
MavenLaunchMainTab_lblCleanBuild=\u30AF\u30EA\u30FC\u30F3\u76EE\u6A19\u4E2D(&D):
MavenLaunchMainTab_lblManualGoals=\u624B\u52D5\u30D3\u30EB\u30C9\u76EE\u6A19(&N):
MavenLaunchMainTab_lblRuntime=Maven\u30E9\u30F3\u30BF\u30A4\u30E0(&I):
MavenLaunchMainTab_lblThreads=\u30B9\u30EC\u30C3\u30C9(&T):
MavenLaunchMainTab_lblEnableColorOutput=\u8272\u306E\u51FA\u529B(&C):
MavenLaunchMainTab_lblEnableColorOutput_Auto=\u81EA\u52D5
MavenLaunchMainTab_lblEnableColorOutput_Always=\u5E38\u6642
MavenLaunchMainTab_lblEnableColorOutput_Never=\u3057\u306A\u3044
MavenLaunchMainTab_lblUserSettings_text=\u30E6\u30FC\u30B6\u30FC\u8A2D\u5B9A:
MavenLaunchMainTab_property_dialog_edit_title=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3092\u7DE8\u96C6
MavenLaunchMainTab_property_dialog_title=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3092\u8FFD\u52A0
MavenJRETab_lblDefault=\u30C7\u30D5\u30A9\u30EB\u30C8\u306EMaven\u5B9F\u884CJRE: {0}
MavenJRETab_lblDefaultDetailsRequiredJavaVersion={0} (\u5FC5\u8981\u306AJava\u30D0\u30FC\u30B8\u30E7\u30F3\u7BC4\u56F2{1}\u304B\u3089\u81EA\u52D5\u9078\u629E)
MavenLaunchUtils_error_no_maven_install=Maven\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
MavenLaynchDelegate_unsupported_source_locator=\u4E0D\u660E\u307E\u305F\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u30BD\u30FC\u30B9\u30ED\u30B1\u30FC\u30BF\u30FC{0}
launchBrowseFs=\u30D5\u30A1\u30A4\u30EB\u30B7\u30B9\u30C6\u30E0(&M)...
launchBrowseVariables=\u5909\u6570(&V)...
launchBrowseWorkspace=\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9(&W)...
launchChoosePomDir=\u30D9\u30FC\u30B9\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FC\u3092\u9078\u629E(&B)
launchChooseSettingsFile=\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E(&S)
launchGoals=\u9078\u629E(&S)...
launchGoalsLabel=\u76EE\u6A19(&G):
launchMainTabName=\u30E1\u30A4\u30F3
launchPomDirectoryDoesntExist=\u30D9\u30FC\u30B9\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FC\u304C\u5B58\u5728\u3057\u306A\u3044\u304B\u8AAD\u307F\u53D6\u308C\u307E\u305B\u3093
launchErrorEvaluatingBaseDirectory=\u30D9\u30FC\u30B9\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FC\u540D\u3092\u8A55\u4FA1\u3067\u304D\u307E\u305B\u3093
launchPomDirectoryEmpty=\u30D9\u30FC\u30B9\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FC\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
launchPomGroup=\u30D9\u30FC\u30B9\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FC
launchProfilesLabel=\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB(&P):
launchPropAddButton=\u8FFD\u52A0(&A)...
launchPropEditButton=\u7DE8\u96C6(&D)...
launchPropName=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u540D
launchPropRemoveButton=\u524A\u9664(&R)
launchPropValue=\u5024
launchPropertyDialogBrowseVariables=\u5909\u6570(&B)...

View File

@@ -1,58 +0,0 @@
#Eclipse modern messages class
#Sat Apr 19 16:43:19 MSK 2014
ExecutePomAction_dialog_debug_message=\u9009\u62E9\u8981\u8C03\u8BD5\u7684\u542F\u52A8\u914D\u7F6E\uFF1A
ExecutePomAction_dialog_run_message=\u9009\u62E9\u8981\u8FD0\u884C\u7684\u542F\u52A8\u914D\u7F6E\uFF1A
ExecutePomAction_dialog_title=\u9009\u62E9\u914D\u7F6E
ExecutePomAction_executing=\u5728 {1} \u4E2D\u6267\u884C {0}
MavenLaunchDelegate_error_cannot_create_conf=\u65E0\u6CD5\u521B\u5EFA m2.conf
MavenLaunchDelegate_job_name=\u6B63\u5728\u5237\u65B0\u8D44\u6E90...
MavenLaunchDelegate_error_cannot_read_jvmConfig=\u65E0\u6CD5\u4ECE {0} \u8BFB\u53D6 JVM \u914D\u7F6E
MavenLaunchExtensionsTab_lblExtensions=Maven \u542F\u52A8\u6269\u5C55
MavenLaunchExtensionsTab_name=\u542F\u52A8\u6269\u5C55
MavenLaunchMainTab_btnAfterClean=\u9009\u62E9(&T)...
MavenLaunchMainTab_btnAutoBuild=\u9009\u62E9(&S)...
MavenLaunchMainTab_btnCleanBuild=\u9009\u62E9(&L)...
MavenLaunchMainTab_btnConfigure=\u914D\u7F6E...
MavenLaunchMainTab_btnDebugOutput=\u8C03\u8BD5\u8F93\u51FA(&G)
MavenLaunchMainTab_btnManualBuild=\u9009\u62E9(&E)...
MavenLaunchMainTab_btnNotRecursive=\u975E\u9012\u5F52
MavenLaunchMainTab_btnOffline=\u79BB\u7EBF(&O)
MavenLaunchMainTab_btnResolveWorkspace=\u89E3\u51B3\u5DE5\u4F5C\u533A\u4F5C\u54C1
MavenLaunchMainTab_btnSkipTests=\u8DF3\u8FC7\u6D4B\u8BD5(&K)
MavenLaunchMainTab_btnUpdateSnapshots=\u66F4\u65B0\u5FEB\u7167(&U)
MavenLaunchMainTab_lblAfterClean=\u5728\u6E05\u7406\u76EE\u6807\u4E4B\u540E(&F)\uFF1A
MavenLaunchMainTab_lblAutoBuildGoals=\u81EA\u52A8\u6784\u5EFA\u76EE\u6807(&B)\uFF1A
MavenLaunchMainTab_lblCleanBuild=\u5728\u6E05\u7406\u76EE\u6807\u671F\u95F4(&D)\uFF1A
MavenLaunchMainTab_lblManualGoals=\u624B\u52A8\u6784\u5EFA\u76EE\u6807(&N)\uFF1A
MavenLaunchMainTab_lblRuntime=Maven \u8FD0\u884C\u65F6(&I)\uFF1A
MavenLaunchMainTab_lblThreads=\u7EBF\u7A0B(&T)\uFF1A
MavenLaunchMainTab_lblEnableColorOutput=\u989C\u8272\u8F93\u51FA(&C)\uFF1A
MavenLaunchMainTab_lblEnableColorOutput_Auto=\u81EA\u52A8
MavenLaunchMainTab_lblEnableColorOutput_Always=\u603B\u662F
MavenLaunchMainTab_lblEnableColorOutput_Never=\u4ECE\u4E0D
MavenLaunchMainTab_lblUserSettings_text=\u7528\u6237\u8BBE\u7F6E\uFF1A
MavenLaunchMainTab_property_dialog_edit_title=\u7F16\u8F91\u53C2\u6570
MavenLaunchMainTab_property_dialog_title=\u6DFB\u52A0\u53C2\u6570
MavenJRETab_lblDefault=\u9ED8\u8BA4 Maven Execution JRE\uFF1A {0}
MavenJRETab_lblDefaultDetailsRequiredJavaVersion={0} \uFF08\u4ECE\u6240\u9700\u7684 Java \u7248\u672C\u8303\u56F4 {1} \u4E2D\u81EA\u52A8\u9009\u62E9\uFF09
MavenLaunchUtils_error_no_maven_install=\u65E0\u6CD5\u627E\u5230 Maven \u5B89\u88C5 {0}
MavenLaynchDelegate_unsupported_source_locator=\u672A\u77E5\u6216\u4E0D\u652F\u6301\u7684\u6E90\u5B9A\u4F4D\u5668 {0}
launchBrowseFs=\u6587\u4EF6\u7CFB\u7EDF(&M)...
launchBrowseVariables=\u53D8\u91CF(&V)...
launchBrowseWorkspace=\u5DE5\u4F5C\u533A(&W)...
launchChoosePomDir=\u9009\u62E9\u57FA\u672C\u76EE\u5F55(&B)
launchChooseSettingsFile=\u9009\u62E9\u8BBE\u7F6E\u6587\u4EF6(&S)
launchGoals=\u9009\u62E9(&S)...
launchGoalsLabel=\u76EE\u6807(&G)\uFF1A
launchMainTabName=\u4E3B
launchPomDirectoryDoesntExist=\u57FA\u672C\u76EE\u5F55\u4E0D\u5B58\u5728\u6216\u65E0\u6CD5\u8BFB\u53D6
launchErrorEvaluatingBaseDirectory=\u65E0\u6CD5\u8BA1\u7B97\u57FA\u672C\u76EE\u5F55\u540D
launchPomDirectoryEmpty=\u5E94\u6307\u5B9A\u57FA\u672C\u76EE\u5F55
launchPomGroup=\u57FA\u672C\u76EE\u5F55\uFF1A
launchProfilesLabel=\u914D\u7F6E\u6587\u4EF6(&P)\uFF1A
launchPropAddButton=\u6DFB\u52A0(&A)...
launchPropEditButton=\u7F16\u8F91(&D)...
launchPropName=\u53C2\u6570\u540D\u79F0
launchPropRemoveButton=\u79FB\u9664(&R)
launchPropValue=\u503C
launchPropertyDialogBrowseVariables=\u53D8\u91CF(&B)...

View File

@@ -190,16 +190,8 @@
context="plugin:org.talend.metadata.managment"
language="java"
message="Needed for create sqlite connection"
mvn_uri="mvn:org.xerial/sqlite-jdbc/3.44.1.0"
name="sqlite-jdbc-3.44.1.0.jar"
required="true">
</libraryNeeded>
<libraryNeeded
context="plugin:org.talend.metadata.managment"
language="java"
message="Needed for create sqlite connection"
mvn_uri="mvn:org.slf4j/slf4j-api/1.7.34"
name="slf4j-api-1.7.34.jar"
mvn_uri="mvn:org.xerial/sqlite-jdbc/3.40.0.0"
name="sqlite-jdbc-3.40.0.0.jar"
required="true">
</libraryNeeded>
<libraryNeeded

View File

@@ -100,8 +100,6 @@ public class MigrationToolService implements IMigrationToolService {
private static final String PROPERTIES_REDO_ENCRYPTION_MIGRATION_TASKS = "talend.property.migration.redoEncryption"; //$NON-NLS-1$
private static final String RELATION_TASK = "org.talend.repository.model.migration.AutoUpdateRelationsMigrationTask"; //$NON-NLS-1$
private static final String TACOKIT_METADATA_UPGRADE_TASK = "org.talend.sdk.component.studio.metadata.migration.UpgradeTacokitMetadataMigrationTask";
private List<IProjectMigrationTask> doneThisSession;
@@ -248,7 +246,7 @@ public class MigrationToolService implements IMigrationToolService {
final List<MigrationTask> done = new ArrayList<MigrationTask>(storedMigrations);
boolean hasTaskToExecute = toExecute.stream()
.anyMatch(task -> !task.isDeprecated() && MigrationUtil.findMigrationTask(done, task) == null);
// force to redo the migration task for the relations only if user ask for "clean" or if relations is empty
// or if there is at least another migration to do.
if (!beforeLogon && (!RelationshipItemBuilder.INDEX_VERSION.equals(project.getEmfProject().getItemsRelationVersion())
@@ -522,7 +520,6 @@ public class MigrationToolService implements IMigrationToolService {
needSave = true;
}
if (needSave) {
MigrationUtil.removeMigrationTaskById(done, TACOKIT_METADATA_UPGRADE_TASK);
saveProjectMigrationTasksDone(project, done);
}
if (!RelationshipItemBuilder.INDEX_VERSION.equals(project.getEmfProject().getItemsRelationVersion())) {
@@ -599,7 +596,7 @@ public class MigrationToolService implements IMigrationToolService {
}
sortMigrationTasks(allMigrations);
for (IProjectMigrationTask task : allMigrations) {
if (RELATION_TASK.equals(task.getId()) || TACOKIT_METADATA_UPGRADE_TASK.equals(task.getId())) {
if (RELATION_TASK.equals(task.getId())) {
continue;
}
task.setStatus(ExecutionResult.NOTHING_TO_DO);

View File

@@ -115,4 +115,3 @@ WorkbenchMessages.ShowView_errorTitle=Probl\u00E8me lors de l'affichage de la vu
ComponentsManager.form.install.dialog.restart.title=Red\u00E9marrer le Studio
ComponentsManager.form.install.dialog.restart.message=Vous devez red\u00E9marrer le Studio pour terminer l'installation.\n\nSouhaitez-vous le red\u00E9marrer maintenant ?
JavaVersion.CheckError=Une mise \u00E0 niveau de Java est requise. La version minimale de Java est {0}, la version actuelle est {1}.
JavaVersion.CheckError.notSupported=La version Java maximale support\u00E9e par le Studio est {0}. Votre version actuelle est {1}.

View File

@@ -115,4 +115,3 @@ WorkbenchMessages.ShowView_errorTitle=\u95EE\u9898\u5217\u8868\u89C6\u56FE
ComponentsManager.form.install.dialog.restart.title=\u91CD\u65B0\u542F\u52A8 Studio
ComponentsManager.form.install.dialog.restart.message=\u6211\u4EEC\u9700\u8981\u91CD\u65B0\u542F\u52A8 Studio \u4EE5\u5B8C\u6210\u5B89\u88C5\u3002\n\n\u662F\u5426\u8981\u7ACB\u5373\u91CD\u65B0\u542F\u52A8 Studio\uFF1F
JavaVersion.CheckError=\u9700\u8981\u5347\u7EA7 Java\uFF0C\u8981\u6C42\u7684\u6700\u4F4E Java \u7248\u672C\u4E3A {0}\uFF0C\u5F53\u524D\u7248\u672C\u4E3A {1}\u3002
JavaVersion.CheckError.notSupported=Studio\u652F\u6301\u7684\u6700\u9AD8Java\u7248\u672C\u4E3A{0}\u3002\u60A8\u5F53\u4E0B\u7684\u7248\u672C\u662F{1}\u3002

View File

@@ -25,8 +25,7 @@ addJvmArgs(jvmArgs:\
--add-opens=java.base/sun.security.pkcs=ALL-UNNAMED|\
--add-opens=java.base/sun.security.x509=ALL-UNNAMED|\
--add-opens=java.base/sun.util.calendar=ALL-UNNAMED|\
--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED|\
--add-opens=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED);
--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED);
instructions.configure.import=\
org.talend.studiolite.p2.touchpoint.removeJvmArgs,\
org.talend.studiolite.p2.touchpoint.addJvmArgs

View File

@@ -97,7 +97,7 @@ public final class HandlerUtil {
URI propertyResourceURI = EcoreUtil.getURI(itemRecord.getItem().getProperty());
URI relativePlateformDestUri = propertyResourceURI.trimFileExtension().appendFileExtension(
FileConstants.SCREENSHOT_EXTENSION);
URL fileURL = FileLocator.resolve(new java.net.URL(
URL fileURL = FileLocator.toFileURL(new java.net.URL(
"platform:/resource" + relativePlateformDestUri.toPlatformString(true))); //$NON-NLS-1$
// for migration task ,there is not .screeenshot file in preceding version - begin
boolean hasScreenshotFile = false;

View File

@@ -1117,7 +1117,7 @@ public class ImportBasicHandler extends AbstractImportExecutableHandler {
haveRef = true;
URI relativePlateformDestUri = getReferenceFileURI(propertyResourceURI, refItem);
try {
URL fileURL = FileLocator.resolve(new java.net.URL(
URL fileURL = FileLocator.toFileURL(new java.net.URL(
"platform:/resource" + relativePlateformDestUri.toPlatformString(true))); //$NON-NLS-1$
os = new FileOutputStream(fileURL.getFile());
is = manager.getStream(getReferenceItemPath(selectedImportItem.getPath(), refItem), selectedImportItem);

View File

@@ -90,7 +90,7 @@ public class MetadataConnectionImportHandler extends ImportRepTypeHandler {
URI propertyResourceURI = EcoreUtil.getURI(((ConnectionItem) tmpItem).getProperty());
URI relativePlateformDestUri = propertyResourceURI.trimFileExtension().appendFileExtension(
FileConstants.ITEM_EXTENSION);
URL fileURL = FileLocator.resolve(new java.net.URL(
URL fileURL = FileLocator.toFileURL(new java.net.URL(
"platform:/resource" + relativePlateformDestUri.toPlatformString(true))); //$NON-NLS-1$
OutputStream os = new FileOutputStream(fileURL.getFile());
try {

View File

@@ -1913,7 +1913,6 @@ public class LocalRepositoryFactory extends AbstractEMFRepositoryFactory impleme
IPath parentPath = null;
Project project = getRepositoryContext().getProject();
IProject fsProject = ResourceUtils.getProject(project);
List<Resource> crossReferences = new ArrayList<Resource>();
List<IRepositoryViewObject> allRepositoryViewObject = new ArrayList<IRepositoryViewObject>();
for (IRepositoryViewObject objToMove : objToMoves) {
ERepositoryObjectType type = null;
@@ -1978,19 +1977,18 @@ public class LocalRepositoryFactory extends AbstractEMFRepositoryFactory impleme
resourceFolderMap.put(resource, folder);
}
}
Map<Resource, IPath> resourceAndPathMap = new HashMap<Resource, IPath>();
for (Resource resource : allResource) {
IFolder resfolder = resourceFolderMap.get(resource);
IPath path = resfolder.getFullPath().append(resource.getURI().lastSegment());
resourceAndPathMap.put(resource, path);
// Find cross references.
crossReferences.addAll(findCrossReference(resource));
moveResource(resource, path);
}
allResource.clear();
}
Map<Resource, IPath> resourceAndPathMap = new HashMap<Resource, IPath>();
List<Resource> crossReferences = new ArrayList<Resource>();
for (Resource resource : allResource) {
IFolder folder = resourceFolderMap.get(resource);
IPath path = folder.getFullPath().append(resource.getURI().lastSegment());
resourceAndPathMap.put(resource, path);
// Find cross references.
crossReferences.addAll(findCrossReference(resource));
moveResource(resource, path);
}
// Save cross references.
saveCrossReference(crossReferences);

View File

@@ -13,7 +13,6 @@
package org.talend.signon.util;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
@@ -69,7 +68,6 @@ public class TMCRepositoryUtil {
public static final Pattern DATA_CENTER_PATTERN = Pattern.compile("^http[s?]://tmc\\.(.*)(\\.cloud\\.talend\\.com.*)", Pattern.CASE_INSENSITIVE);
public static final String DEFAULT_DATA_CENTER = "us";
public static String getBaseLoginURL(String dataCenter) {
if (dataCenter == null) {
@@ -79,7 +77,7 @@ public class TMCRepositoryUtil {
}
public static String getDefaultDataCenter() {
String defaultDataCenter = DEFAULT_DATA_CENTER;
String defaultDataCenter = "us";
if (getRecentDataCenter() != null) {
defaultDataCenter = getRecentDataCenter();
}
@@ -165,16 +163,4 @@ public class TMCRepositoryUtil {
public static String getTokenIntrospectURL(String dataCenter) {
return String.format(TOKEN_INTROSPECT_URL, dataCenter);
}
public static String getDataCenterFromTmcUrl(String tmcUrl) {
String dataCenter = TMCRepositoryUtil.DEFAULT_DATA_CENTER;
Matcher m = DATA_CENTER_PATTERN.matcher(tmcUrl);
if (!m.matches()) {
// custom cloud
LOGGER.info("Use default data center, can not find data center area from tmcUrl: " + tmcUrl);
} else {
dataCenter = m.group(1);
}
return dataCenter;
}
}

View File

@@ -184,33 +184,27 @@ public class BaseRepositoryTest {
}
protected ProcessItem createTempProcessItem(LocalRepositoryFactory factory, String path) throws PersistenceException {
ProcessItem processItem = createTempProcessItem(factory, path, "myJob", "0.1", factory.getNextId());
return processItem;
}
protected ProcessItem createTempProcessItem(LocalRepositoryFactory factory, String path, String jobLabel, String jobVersion, String id) throws PersistenceException {
ProcessItem processItem = PropertiesFactory.eINSTANCE.createProcessItem();
Property myProperty = PropertiesFactory.eINSTANCE.createProperty();
ItemState itemState = PropertiesFactory.eINSTANCE.createItemState();
itemState.setPath(path);
processItem.setProperty(myProperty);
processItem.setState(itemState);
myProperty.setId(id);
myProperty.setLabel(jobLabel);
myProperty.setVersion(jobVersion);
myProperty.setId(factory.getNextId());
myProperty.setLabel("myJob");
myProperty.setVersion("0.1");
processItem.setProcess(TalendFileFactory.eINSTANCE.createProcessType());
processItem.getProcess().getNode().add(TalendFileFactory.eINSTANCE.createNodeType());
((NodeType) processItem.getProcess().getNode().get(0)).setComponentName("test");
((NodeType) processItem.getProcess().getNode().get(0)).setComponentVersion("0.1");
if (!"".equals(path)) {
factory.createFolder(sampleProject, ERepositoryObjectType.PROCESS, new Path(""), path);
}
factory.create(sampleProject, processItem, new Path(path), false);
return processItem;
}

View File

@@ -12,18 +12,13 @@
// ============================================================================
package org.talend.repository.localprovider.model;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.*;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
@@ -63,10 +58,6 @@ import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.designer.core.model.utils.emf.talendfile.TalendFileFactory;
import org.talend.repository.ProjectManager;
import org.talend.utils.xml.XmlUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
* DOC nrousseau class global comment. Detailled comment
@@ -1062,91 +1053,6 @@ public class LocalRepositoryFactoryTest extends BaseRepositoryTest {
assertTrue(fileProperty.exists());
}
/**
* Test method for
* {@link org.talend.repository.localprovider.model.LocalRepositoryFactory#moveObjectMulti(org.talend.core.model.repository.IRepositoryViewObject[], org.eclipse.core.runtime.IPath)}
* .
* take process for example, test move multi jobs, each job has multi versions
*
* @throws CoreException
* @throws PersistenceException
* @throws LoginException
* @throws IOException
* @throws ParserConfigurationException
*/
@Test
public void testmoveObjectMulti() throws LoginException, PersistenceException, IOException, CoreException, ParserConfigurationException {
repositoryFactory.logOnProject(sampleProject);
String version[] = {"0.1", "0.2", "0.3"};
// String version[] = {"0.1"};
String jobLabel = "job";
int nums = 3; // number of jobs, for test move as a group
List<IRepositoryViewObject> objects = new ArrayList<IRepositoryViewObject>();
ERepositoryObjectType type = ERepositoryObjectType.PROCESS;
for (int i = 0; i < nums; i++) {
String propId = repositoryFactory.getNextId();
ProcessItem processItem = createTempProcessItem(repositoryFactory, "", jobLabel + i, version[0], propId);
for (int j = 1; j < version.length; j++) {
String originalVersion = processItem.getProperty().getVersion();
processItem.getProperty().setVersion(version[j]);
ProxyRepositoryFactory.getInstance().save(processItem.getProperty(), processItem.getProperty().getLabel(), originalVersion);
}
String processId = processItem.getProperty().getId();
IRepositoryViewObject lastVersion = repositoryFactory.getLastVersion(sampleProject, processId, "", type);
assertNotNull(lastVersion);
objects.add(lastVersion);
}
String targetFolder = "moveMultiToThisFolder";
final Folder createFolder = repositoryFactory.createFolder(sampleProject, type, new Path(""), targetFolder);
assertNotNull(createFolder);
IPath ipath = new Path(createFolder.getLabel());
repositoryFactory.moveObjectMulti(objects.toArray(new IRepositoryViewObject[0]), ipath);
//verify in memory
FolderItem folderItem = repositoryFactory.getFolderItem(sampleProject, type, ipath);
assertEquals("after move multi jobs, the target folder has own children now in memory", nums * version.length, folderItem.getChildren().size());
//verify local files
IProject project = ResourceUtils.getProject(sampleProject);
for (int i = 0; i < nums; i++) {
ProcessItem processItem = null;
for (int j = 0; j < version.length; j++) {
checkMoveObjectFileExists(project, type, createFolder.getLabel(), jobLabel + i, version[j]);
checkAuthorPathInProperties(version[j], jobLabel + i, type, targetFolder, project);
}
}
//
repositoryFactory.batchDeleteObjectPhysical(sampleProject, objects, true, false);
}
private void checkAuthorPathInProperties(String version, String jobLabel, ERepositoryObjectType type, String targetFolder,
IProject project) {
// verify author path change in properties file: for example, <author
// href="../../talend.project#_UrUe4JXNEe6e9KueIEhr5Q"/>
try {
IFile fileProperty = project.getFile(new Path(ERepositoryObjectType.getFolderName(type) + "/" + targetFolder
+ "/" + jobLabel + "_" + version + ".properties"));
DocumentBuilder docBuilder = XmlUtils.getSecureDocumentBuilderFactory().newInstance().newDocumentBuilder();
Document doc = docBuilder.parse(fileProperty.getContents());
NodeList authorTag = doc.getElementsByTagName("author");
if (authorTag == null || authorTag.getLength() != 1) {
assertThat("author element not found");
}
Node hrefAttrItem = authorTag.item(0).getAttributes().getNamedItem("href");
String nodeValue = hrefAttrItem.getNodeValue();
assertTrue("relative href path for author: " + nodeValue, nodeValue.startsWith("../../"));
} catch (Exception e) {
}
}
/**
* Test method for