use of org.talend.core.model.properties.ProcessItem in project tesb-studio-se by Talend.
the class RouteInputProcessTypeController method refresh.
@Override
public void refresh(IElementParameter param, boolean check) {
IElementParameter processTypeParameter = param.getChildParameters().get(EParameterName.PROCESS_TYPE_PROCESS.getName());
if (processTypeParameter == null) {
super.refresh(processTypeParameter, check);
return;
}
Object processId = processTypeParameter.getValue();
if (processId == null) {
super.refresh(processTypeParameter, check);
return;
}
ProcessItem pi = ItemCacheManager.getProcessItem(processId.toString());
if (!CamelDesignerUtil.checkRouteInputExistInJob(pi)) {
clearAll(param, processTypeParameter);
} else {
super.refresh(param, check);
}
}
use of org.talend.core.model.properties.ProcessItem in project tesb-studio-se by Talend.
the class ConsumerFaultResponseMigrationTask method addMoreFaultResponseMessage.
private void addMoreFaultResponseMessage(Item item) throws PersistenceException {
if (item instanceof ProcessItem) {
ProcessType processType = ((ProcessItem) item).getProcess();
for (Object o : processType.getNode()) {
if (o instanceof NodeType) {
NodeType currentNode = (NodeType) o;
if ("tESBConsumer".equals(currentNode.getComponentName())) {
Iterator<?> iterator = currentNode.getMetadata().iterator();
while (iterator.hasNext()) {
MetadataType metadataType = (MetadataType) iterator.next();
if ("FAULT".equals(metadataType.getConnector())) {
EList<?> column = metadataType.getColumn();
addColumn(column, faultActor);
addColumn(column, faultCode);
addColumn(column, faultNode);
addColumn(column, faultRole);
}
}
}
}
}
FACTORY.save(item, true);
}
}
use of org.talend.core.model.properties.ProcessItem in project tesb-studio-se by Talend.
the class ExportServiceAction method addRequiredFeatures.
private void addRequiredFeatures(FeaturesModel features) {
// add correlation feature
ServiceConnection connection = (ServiceConnection) serviceItem.getConnection();
String useRegistry = connection.getAdditionalInfo().get(ServiceMetadataDialog.USE_SERVICE_REGISTRY);
if (!"true".equals(useRegistry)) {
String useCorrelation = connection.getAdditionalInfo().get(ServiceMetadataDialog.USE_BUSINESS_CORRELATION);
if ("true".equals(useCorrelation)) {
features.addFeature(new FeatureModel(FeaturesModel.CORRELATION_FEATURE_NAME));
}
}
// add talend-data-mapper feature
for (IRepositoryViewObject node : nodes) {
ProcessItem processItem = (ProcessItem) node.getProperty().getItem();
if (null != EmfModelUtils.getComponentByName(processItem, THMAP_COMPONENT_NAME)) {
features.addFeature(new FeatureModel(FeaturesModel.TALEND_DATA_MAPPER_FEATURE_NAME));
break;
}
}
}
use of org.talend.core.model.properties.ProcessItem in project tesb-studio-se by Talend.
the class ExportServiceAction method init.
private void init(String targetPath) throws InvocationTargetException {
serviceName = serviceItem.getProperty().getLabel();
serviceVersion = serviceItem.getProperty().getVersion();
serviceWsdl = WSDLUtils.getWsdlFile(serviceItem);
ServiceConnection serviceConnection = (ServiceConnection) serviceItem.getConnection();
additionalInfo = serviceConnection.getAdditionalInfo().map();
EList<ServicePort> listPort = serviceConnection.getServicePort();
List<IRepositoryViewObject> jobs;
try {
jobs = ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.PROCESS);
} catch (PersistenceException e) {
throw new InvocationTargetException(e);
}
for (ServicePort port : listPort) {
List<ServiceOperation> listOperation = port.getServiceOperation();
Map<String, String> operations = new HashMap<String, String>(listOperation.size());
for (ServiceOperation operation : listOperation) {
String jobId = operation.getReferenceJobId();
if (jobId != null && !jobId.equals("")) {
String operationName = operation.getName();
IRepositoryViewObject jobNode = null;
for (IRepositoryViewObject job : jobs) {
if (job.getId().equals(jobId)) {
jobNode = job;
break;
}
}
if (jobNode == null) {
continue;
}
String jobName = jobNode.getLabel();
operations.put(operationName, jobName);
nodes.add(jobNode);
contextValues.putAll(JobContextUtils.getContextsMap((ProcessItem) jobNode.getProperty().getItem()));
}
}
ports.put(port, operations);
}
if (this.serviceManager == null) {
this.serviceManager = new ServiceExportManager(exportChoiceMap);
}
serviceManager.setDestinationPath(targetPath);
tempFolder = getTmpFolderPath();
}
use of org.talend.core.model.properties.ProcessItem in project tdi-studio-se by Talend.
the class JobJavaScriptsWSManager method getExportResources.
/*
* (non-Javadoc)
*
* @see org.talend.repository.ui.wizards.exportjob.scriptsmanager.JobJavaScriptsManager#getExportResources
* (org.talend.repository.ui.wizards.exportjob.ExportFileResource[], java.util.Map, java.lang.String,
* java.lang.String, int, int, java.lang.String[])
*/
@Override
public List<ExportFileResource> getExportResources(ExportFileResource[] process, String... codeOptions) throws ProcessorException {
List<ExportFileResource> list = new ArrayList<ExportFileResource>();
boolean needJob = true;
boolean needSource = isOptionChoosed(ExportChoice.needSourceCode);
boolean needContext = isOptionChoosed(ExportChoice.needContext);
//$NON-NLS-1$
ExportFileResource libResource = new ExportFileResource(null, "WEB-INF/lib");
//$NON-NLS-1$
ExportFileResource contextResource = new ExportFileResource(null, "WEB-INF/classes");
//$NON-NLS-1$
ExportFileResource srcResource = new ExportFileResource(null, "WEB-INF");
if (needJob) {
list.add(libResource);
}
if (needContext) {
list.add(contextResource);
}
if (needSource) {
list.add(srcResource);
}
copyServerConfigFileToTempDir();
// set export config mode now only to be sure that the libraries will be setup for an export mode, and not
// editor mode.
//$NON-NLS-1$
ProcessorUtilities.setExportConfig("java", "", "");
for (ExportFileResource exportResource : process) {
ProcessItem processItem = (ProcessItem) exportResource.getItem();
String selectedJobVersion = processItem.getProperty().getVersion();
if (!isMultiNodes() && this.getSelectedJobVersion() != null) {
selectedJobVersion = this.getSelectedJobVersion();
}
if (!isOptionChoosed(ExportChoice.doNotCompileCode)) {
generateJobFiles(processItem, contextName, selectedJobVersion, statisticPort != IProcessor.NO_STATISTICS, tracePort != IProcessor.NO_TRACES, isOptionChoosed(ExportChoice.applyToChildren), progressMonitor);
}
}
// Gets talend libraries
List<URL> talendLibraries = getExternalLibraries(true, process);
libResource.addResources(talendLibraries);
// Add log4j files if needed
if (Log4jPrefsSettingManager.getInstance().isLog4jEnable()) {
addLog4jXmlToRes(contextResource);
}
for (ExportFileResource proces : process) {
ProcessItem processItem = (ProcessItem) proces.getItem();
String selectedJobVersion = processItem.getProperty().getVersion();
if (!isMultiNodes() && this.getSelectedJobVersion() != null) {
selectedJobVersion = this.getSelectedJobVersion();
}
ProcessorUtilities.setExportConfig(proces.getDirectoryName(), true);
// if (!isOptionChoosed(ExportChoice.doNotCompileCode)) {
// generateJobFiles(processItem, contextName, selectedJobVersion, statisticPort != IProcessor.NO_STATISTICS,
// tracePort != IProcessor.NO_TRACES, isOptionChoosed(ExportChoice.applyToChildren), progressMonitor);
// }
// generate the WSDL file
ExportFileResource wsdlFile = getWSDLFile(processItem, isOptionChoosed(ExportChoice.needWSDL), talendLibraries);
list.add(wsdlFile);
// edit the WSDD file
editWSDDFile(processItem);
// add children jobs
boolean needChildren = true;
addSubJobResources(process, processItem, needChildren, exportChoice, libResource, contextResource, srcResource, selectedJobVersion);
// generate the context file
getContextScripts(processItem, needContext, contextResource, selectedJobVersion);
// generate jar file for job
libResource.addResources(getJobScripts(processItem, selectedJobVersion, needJob));
// dynamic db xml mapping
addXmlMapping(proces, isOptionChoosed(ExportChoice.needSourceCode));
}
// generate Server Config file
ExportFileResource serverConfigFile = getServerConfigFile(isOptionChoosed(ExportChoice.needCONFIGFILE));
list.add(serverConfigFile);
// generate the WSDD file
ExportFileResource wsddFile = getWSDDFile(isOptionChoosed(ExportChoice.needWSDD));
list.add(wsddFile);
// generate the WEB-INFO folder
ExportFileResource webInfoFolder = getWebXMLFile(isOptionChoosed(ExportChoice.needWEBXML));
list.add(webInfoFolder);
// generate the META-INFO folder
ExportFileResource metaInfoFolder = genMetaInfoFolder(isOptionChoosed(ExportChoice.needMetaInfo));
list.add(metaInfoFolder);
// Gets system routines
List<URL> systemRoutineList = getSystemRoutine(process);
libResource.addResources(systemRoutineList);
// Gets user routines
List<URL> userRoutineList = getUserRoutine(process);
libResource.addResources(userRoutineList);
// Gets axis libraries
List<ModuleNeeded> newAxisLib = new ArrayList<ModuleNeeded>(axisLib);
for (URL libUrl : talendLibraries) {
if (libUrl.getFile() != null) {
newAxisLib.remove(new File(libUrl.getFile()).getName());
}
}
List<URL> axisLibList = getLib(newAxisLib, isOptionChoosed(ExportChoice.needAXISLIB));
libResource.addResources(axisLibList);
return list;
}
Aggregations