/** * Get a playload in JsonSimple format from the payload instance * * @param payload : Payload object * @return JsonSimple or null */ public JsonSimple getPayloadJsonSimple(Payload payload) { JsonSimple jsonSimple = null; if (payload == null) { return null; } try { jsonSimple = new JsonSimple(payload.open()); } catch (Exception e) { log.error("Failed to retrive payload. ID of payload: {}, more: {}", payload.getId(), e.getMessage()); } return jsonSimple; }
/** * Index a specific annotation * * @param object : The annotation's object * @param pid : The annotation payload * @throws IndexerException if there were errors during indexing */ private void annotate(DigitalObject object, Payload payload) throws IndexerException { String pid = payload.getId(); if (propertiesId.equals(pid)) { return; } try { Properties props = new Properties(); props.setProperty("metaPid", pid); String doc = index(object, payload, null, ANOTAR_RULES_OID, props); if (doc != null) { doc = "<add>" + doc + "</add>"; anotar.request(new DirectXmlRequest("/update", doc)); if (anotarAutoCommit) { anotar.commit(); } } } catch (Exception e) { log.error("Indexing failed!\n-----\n", e); } }
throws IndexerException { String oid = object.getId(); String pid = payload.getId();
log.info("payloadName is: " + payloadName); if (itemConfig.getBoolean(false, "transformSource")) { payloadName = sourcePayload.getId();
/** * Creates a copy of the specified payload * * @param payload payload to copy */ public GenericPayload(Payload payload) { if (payload != null) { setId(payload.getId()); setLabel(payload.getLabel()); setContentType(payload.getContentType()); setType(payload.getType()); try { setInputStream(payload.open()); } catch (StorageException e) { log.error( "Error accessing input stream during payload creation", e); } } metaChanged = false; }