@Override protected Chunk doProcessChunk(Chunk data, Map<String, Serializable> context, IProcessListener processListener, ProcessingStats stats) throws Exception { final Batch batch = browserFacade.relation(ElementPublisherView.ELEMENT_PUBLISHER_VIEW_NAME).batch(); for (final CatalogElement catalogElement : data.getItems()) { try { batch.delete(Condition.eq(ElementPublisherView.FIELD_PUBLISHED_ELEMENT_EXTID, catalogElement.getExtId())); if (!catalogElement.isDeleted() && catalogElement.getElement() != null && hasRelatedPublisher(catalogElement)) { final List<Serializable[]> tuples = ElementPublisherView.asTuples(catalogElement, contributorInfoBuilder, bwmetaSource); for (final Serializable[] tuple : tuples) { batch.add(tuple); } } } catch (final Exception e) { if (context.containsKey(Constants.PARAM_DISABLE_AGGREGATIONS_DURING_REBUILD)) { browserFacade.relation(ElementPublisherView.ELEMENT_PUBLISHER_VIEW_NAME).setAggregatingEnabled(false, false); } if (processListener != null) { processListener.notifyEvent("elementPublisherViewGenerator.process", new String[]{catalogElement.getExtId()}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e)); } log.error("Exception processing element " + catalogElement.getExtId()); throw e; } } batch.run(); return data; }
@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(ContributorView.CONTRIBUTOR_VIEW_NAME).batch(); for (final CatalogElement ce : data.getItems()) { try { batch.delete(Condition.eq(ContributorView.FIELD_ELEMENT_ID, ce.getExtId())); if (!ce.isDeleted() && ce.getElement() != null) { final Serializable[][] tuples=ContributorView.asTuples(ce.getElement(), contributorInfoBuilder); for (final Serializable[] tuple : tuples) { batch.add(tuple); } } } catch (final Exception e) { if (context.containsKey(Constants.PARAM_DISABLE_AGGREGATIONS_DURING_REBUILD)) { browserFacade.relation(ContributorView.CONTRIBUTOR_VIEW_NAME).setAggregatingEnabled(false, false); } if (processListener != null) { processListener.notifyEvent("contributorViewGenerator.process", new String[]{ce.getExtId()}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e)); } log.error("Exception processing element " + ce.getExtId()); throw e; } } batch.run(); return data; }
@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(SubscriberView.VIEW_NAME).batch(); for (final CatalogElement ce : data.getItems()) { try { batch.delete(Condition.eq(SubscriberView.FIELD_ELEMENT_ID, ce.getExtId())); if (!ce.isDeleted() && ce.getElement() != null) { final Serializable[][] tuples=SubscriberView.asTuples(ce); for (final Serializable[] tuple : tuples) { batch.add(tuple); } } } catch (final Exception e) { if (processListener != null) { processListener.notifyEvent("subscriberViewGenerator.process", new String[]{ce.getExtId()}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e)); } log.error("Exception processing element " + ce.getExtId()); throw e; } } batch.run(); return data; }
throws Exception { final Batch elementViewBath = browserFacade.relation(ElementView.ELEMENT_VIEW_NAME).batch(); final Batch journalViewBatch = browserFacade.relation(JournalView.JOURNAL_VIEW_NAME).batch(); final Batch publisherViewBatch = browserFacade.relation(PublisherView.PUBLISHER_VIEW_NAME).batch(); final Batch bookPublisherViewBatch = browserFacade.relation(BookPublisherView.PUBLISHER_VIEW_NAME).batch(); final Batch institutionEntityViewBatch = browserFacade.relation(InstitutionEntityView.VIEW_NAME).batch();
browserFacade.relation(CategoryView.CATEGORY_VIEW_NAME).batch();
final IProcessListener processListener, final ProcessingStats stats) throws Exception { final Batch batch = browser.relation(ContentView.NAME).batch();
@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; }