Search in sources :

Example 1 with JobInfo

use of com.amalto.workbench.utils.JobInfo in project tmdm-studio-se by Talend.

the class RepositoryJobInfoHolder method getExternalInfo.

@Override
public JobInfo[] getExternalInfo() {
    List<JobInfo> results = new LinkedList<JobInfo>();
    List<IRepositoryViewObject> viewObjs = RepositoryResourceUtil.findAllViewObjects(ERepositoryObjectType.PROCESS);
    for (IRepositoryViewObject viewObj : viewObjs) {
        Property prop = viewObj.getProperty();
        String path = null;
        if (prop != null) {
            Item item = prop.getItem();
            if (item != null) {
                path = item.getState().getPath();
            }
        }
        MDMServerDef serverDef = RepositoryResourceUtil.getLastServerDef(viewObj);
        String lastServerName = (serverDef != null) ? serverDef.getName() : null;
        // the suffix should be "war" or "zip", now use "" to replace
        // $NON-NLS-1$
        JobInfo jobInfo = new JobInfo(prop.getLabel(), prop.getVersion(), "", path, lastServerName);
        results.add(jobInfo);
    }
    return results.toArray(new JobInfo[0]);
}
Also used : Item(org.talend.core.model.properties.Item) JobInfo(com.amalto.workbench.utils.JobInfo) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) Property(org.talend.core.model.properties.Property) LinkedList(java.util.LinkedList) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)

Aggregations

JobInfo (com.amalto.workbench.utils.JobInfo)1 LinkedList (java.util.LinkedList)1 Item (org.talend.core.model.properties.Item)1 Property (org.talend.core.model.properties.Property)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 MDMServerDef (org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)1