use of org.talend.repository.documentation.ExportFileResource in project tdi-studio-se by Talend.
the class JobJavaScriptOSGIForESBManager method getCompiledLibExportFileResource.
@Override
protected ExportFileResource getCompiledLibExportFileResource(ExportFileResource[] processes) {
ExportFileResource libResource = new ExportFileResource(null, LIBRARY_FOLDER_NAME);
// Gets talend libraries
List<URL> talendLibraries = getExternalLibraries(true, processes, getCompiledModuleNames());
if (talendLibraries != null) {
libResource.addResources(talendLibraries);
}
addRoutinesResources(processes, libResource);
return libResource;
}
use of org.talend.repository.documentation.ExportFileResource in project tdi-studio-se by Talend.
the class PublishOnSpagoExportWizardPage method addTreeNode.
private void addTreeNode(RepositoryNode node, String path, List<ExportFileResource> list) {
if (node != null && node.getType() == ENodeType.REPOSITORY_ELEMENT) {
IRepositoryViewObject repositoryObject = node.getObject();
if (repositoryObject.getProperty().getItem() instanceof ProcessItem) {
ProcessItem processItem = (ProcessItem) repositoryObject.getProperty().getItem();
ExportFileResource resource = new ExportFileResource(processItem, path);
resource.setNode(node);
list.add(resource);
}
}
Object[] nodes = node.getChildren().toArray();
if (nodes.length <= 0) {
return;
}
for (int i = 0; i < nodes.length; i++) {
addTreeNode((RepositoryNode) nodes[i], //$NON-NLS-1$
path + "/" + ((RepositoryNode) nodes[i]).getProperties(EProperties.LABEL).toString(), list);
}
}
use of org.talend.repository.documentation.ExportFileResource in project tdi-studio-se by Talend.
the class PublishOnSpagoExportWizardPage method setTopFolder.
private void setTopFolder(List<ExportFileResource> resourcesToExport, String topFolder) {
for (ExportFileResource fileResource : resourcesToExport) {
String directory = fileResource.getDirectoryName();
//$NON-NLS-1$
fileResource.setDirectoryName(topFolder + "/" + directory);
}
}
use of org.talend.repository.documentation.ExportFileResource in project tdi-studio-se by Talend.
the class SpagicDeployWizardPage method addTreeNode.
private void addTreeNode(RepositoryNode node, String path, List<ExportFileResource> list) {
if (node != null && node.getType() == ENodeType.REPOSITORY_ELEMENT) {
IRepositoryViewObject repositoryObject = node.getObject();
if (repositoryObject.getProperty().getItem() instanceof ProcessItem) {
ProcessItem processItem = (ProcessItem) repositoryObject.getProperty().getItem();
ExportFileResource resource = new ExportFileResource(processItem, path);
resource.setNode(node);
list.add(resource);
}
}
Object[] nodes = node.getChildren().toArray();
if (nodes.length <= 0) {
return;
}
for (Object node2 : nodes) {
addTreeNode((RepositoryNode) node2, //$NON-NLS-1$
path + "/" + ((RepositoryNode) node2).getProperties(EProperties.LABEL).toString(), list);
}
}
use of org.talend.repository.documentation.ExportFileResource in project tdi-studio-se by Talend.
the class SpagicJavaDeployManager method getExportResources.
@Override
public List<ExportFileResource> getExportResources(ExportFileResource[] process, String... codeOptions) throws ProcessorException {
for (ExportFileResource proces : process) {
ProcessItem processItem = (ProcessItem) proces.getItem();
ProcessorUtilities.setExportConfig(proces.getDirectoryName(), true);
IProcess jobProcess = null;
if (!isOptionChoosed(ExportChoice.doNotCompileCode)) {
jobProcess = generateJobFiles(processItem, contextName, statisticPort != IProcessor.NO_STATISTICS, tracePort != IProcessor.NO_TRACES, isOptionChoosed(ExportChoice.applyToChildren));
}
List<URL> resources = new ArrayList<URL>();
resources.addAll(getLauncher(isOptionChoosed(ExportChoice.needLauncher), isOptionChoosed(ExportChoice.needParameterValues), isOptionChoosed(ExportChoice.needContext), jobProcess, processItem, escapeSpace(contextName), escapeSpace(launcher), statisticPort, tracePort, codeOptions));
addJobItem(process, processItem, isOptionChoosed(ExportChoice.needJobItem), proces);
resources.addAll(getJobScripts(processItem, isOptionChoosed(ExportChoice.needJobScript)));
// resources.addAll(getProperties(processItem, srcList));
resources.addAll(getProperties(processItem, contextName));
addContextScripts(proces, isOptionChoosed(ExportChoice.needContext));
// add children jobs
boolean needChildren = true;
List<URL> childrenList = addChildrenResources(process, processItem, needChildren, proces, exportChoice);
resources.addAll(childrenList);
proces.addResources(resources);
// Gets job designer resouce
// List<URL> srcList = getSource(processItem, exportChoice.get(ExportChoice.needSource));
// process[i].addResources(JOB_SOURCE_FOLDER_NAME, srcList);
}
// Exports the system libs
List<ExportFileResource> list = new ArrayList<ExportFileResource>(Arrays.asList(process));
// Add the java system libraries
ExportFileResource rootResource = new ExportFileResource(null, LIBRARY_FOLDER_NAME);
//$NON-NLS-1$
ExportFileResource spagicResource = new ExportFileResource(null, "");
list.add(rootResource);
list.add(spagicResource);
// Gets system routines
if (isOptionChoosed(ExportChoice.needSystemRoutine)) {
rootResource.addResources(getSystemRoutine(process));
}
// Gets user routines
if (isOptionChoosed(ExportChoice.needUserRoutine)) {
rootResource.addResources(getUserRoutine(process));
}
// Gets talend libraries
List<URL> talendLibraries = getExternalLibraries(isOptionChoosed(ExportChoice.needTalendLibraries), process);
rootResource.addResources(talendLibraries);
return list;
}
Aggregations