use of org.talend.dataquality.properties.TDQJrxmlItem in project tdq-studio-se by Talend.
the class JrxmlFileDuplicateHandle method createJrxml.
/**
* create jrxml file.
*
* @param path
* @param label
* @param initFile
* @param extendtion
* @return
*/
public TDQJrxmlItem createJrxml(IPath path, String label, File initFile, String extendtion) {
Property property = PropertiesFactory.eINSTANCE.createProperty();
property.setVersion(VersionUtils.DEFAULT_VERSION);
property.setStatusCode(PluginConstant.EMPTY_STRING);
property.setLabel(label);
TDQJrxmlItem routineItem = org.talend.dataquality.properties.PropertiesFactory.eINSTANCE.createTDQJrxmlItem();
routineItem.setProperty(property);
routineItem.setExtension(extendtion);
routineItem.setName(label);
ByteArray byteArray = duplicateByteArray(initFile);
routineItem.setContent(byteArray);
IProxyRepositoryFactory repositoryFactory = ProxyRepositoryFactory.getInstance();
try {
property.setId(repositoryFactory.getNextId());
if (path != null) {
repositoryFactory.createParentFoldersRecursively(ERepositoryObjectType.getItemType(routineItem), path);
}
repositoryFactory.create(routineItem, path);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
return routineItem;
}
Aggregations