use of org.cristalise.kernel.entity.imports.ImportItem in project kernel by cristal-ise.
the class CreateNewItem method runActivityLogic.
@Override
protected String runActivityLogic(AgentPath agent, ItemPath item, int transitionID, String requestData, Object locker) throws InvalidDataException, ObjectCannotBeUpdated, ObjectNotFoundException, CannotManageException, ObjectAlreadyExistsException, InvalidCollectionModification {
try {
ImportItem newItem = (ImportItem) Gateway.getMarshaller().unmarshall(requestData);
newItem.create(agent, false);
return requestData;
} catch (MarshalException | ValidationException | IOException | MappingException e) {
Logger.error(e);
throw new InvalidDataException("CreateNewItem: Couldn't unmarshall new Item: " + requestData);
} catch (PersistencyException e) {
Logger.error(e);
throw new InvalidDataException("CreateNewItem: " + e.getMessage());
}
}
use of org.cristalise.kernel.entity.imports.ImportItem in project kernel by cristal-ise.
the class Module method importItems.
/**
* @param systemAgent
* @param reset
* @throws Exception
*/
private void importItems(AgentProxy systemAgent, boolean reset) throws Exception {
for (ImportItem thisItem : imports.getItems()) {
if (Bootstrap.shutdown)
return;
thisItem.setNamespace(ns);
addItemToContents(thisItem.create(systemAgent.getPath(), reset));
}
}
Aggregations