@Override protected Chunk doProcessChunk(final Chunk data, final Map<String, Serializable> context, final IProcessListener processListener, final ProcessingStats stats) throws Exception { final ComplexEditorStorageBatchHolder batchHolder = new ComplexEditorStorageBatchHolder(); for (final CatalogElement e : data.getItems()) { try { if (e.getElement() != null || e.getNonElement()!=null) { processElement(e, context, batchHolder); } } catch (final Exception ex) { if (processListener != null) { processListener.notifyEvent("licenceResolver.process", new String[]{e.getExtId()}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(ex)); } log.error("Exception processing licenses for element" + e.getExtId(), ex); throw ex; } } data.getCustomEditorOperations().addAll(batchHolder.getEditorBatchToRead()); data.getCustomStorageOperations().addAll(batchHolder.getStorageBatchToRead()); return data; }
batch.delete(Condition.eq(CategoryView.FIELD_EXTID, ce.getExtId())); } else if (ce.getNonElement() != null && ce.getNonElement() instanceof Category) { (Category) ce.getNonElement()); batch.addOrUpdate(Condition.eq(CategoryView.FIELD_EXTID, ce.getExtId()), tuple);
@Override protected Chunk doProcessChunk(final Chunk data, final Map<String, Serializable> context, final IProcessListener processListener, final ProcessingStats stats) throws Exception { final Batch batch = browserFacade.relation(TypeView.TYPE_VIEW_NAME).batch(); for (final CatalogElement ce : data.getItems()) { try { if (ce.isDeleted()) { batch.delete(Condition.eq(TypeView.FIELD_EXTID, ce.getId().getId())); } else if (ce.getElement() == null && ce.getNonElement() != null) { String extId = null; extId = ce.getNonElement().getExtId(); final Serializable[] tuple = TypeView.asTuple(ce.getNonElement()); batch.addOrUpdate(Condition.eq(TypeView.FIELD_EXTID, extId), tuple); } else if (ce.isDeleted()) { batch.delete(Condition.eq(TypeView.FIELD_EXTID, ce.getExtId())); } } catch (final Exception e) { log.error("Exception processing element " + ce.getExtId()); if (processListener != null) { processListener.notifyEvent("typeViewGenerator.process", new String[]{ce.getExtId()}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e)); } throw e; } } batch.run(); return data; }
if (e.getElement() == null && e.getNonElement() == null && !e.isDeleted()) { log.info("Element with id " + e.getExtId()
if (catalogElement.getElement() == null && catalogElement.getNonElement() == null && !catalogElement.isDeleted()) throw new YaddaException("Element contents not found");
if (e.getElement() == null && e.getNonElement() == null && !e.isDeleted()) throw new YaddaException("Element contents not found");