@Override public NativeDocument process(NativeDocument item) throws Exception { if (item != null) { item.addTagByKey(tagKey, tagValue); } return item; }
@Override public NativeDocument process(NativeDocument document) throws Exception { document.addTagByKey(RepositoryStoreConstants.TAG_NAME_OBJECT_CLASS, BWMetaImporterConstants.SOURCE_FORMAT); return document; }
@Override public NativeDocument process(NativeDocument nativeDocument) throws Exception { nativeDocument.addTagByKey(RepositoryStoreConstants.TAG_NAME_CREATION_TIMESTAMP, ""+System.currentTimeMillis()); if (processIdHolder != null) { nativeDocument.addTagByKey(RepositoryStoreConstants.TAG_NAME_IMPORT, processIdHolder.getProcessId()); } if (StringUtils.isNotBlank(definitionId)) { nativeDocument.addTagByKey(RepositoryStoreConstants.TAG_NAME_IMPORT_DATA_SOURCE_DEFINITIONS, definitionId); } return nativeDocument; } }
@Override public NativeDocument process(SourceImportDocument item) { NativeDocument document = documentFactory.getDocument(item.getContent()); document.addTagByKey(RepositoryStoreConstants.TAG_NAME_OBJECT_CLASS, BWMetaImporterConstants.SOURCE_FORMAT); return document; }
document.addTagByKey(RepositoryStoreConstants.TAG_NAME_CREATED_BY_USER_TIMESTAMP, "" + timestamp); document.addTagByKey(RepositoryStoreConstants.TAG_NAME_CONTENT_LAST_MODIFICATION_USER, userId); document.addTagByKey(RepositoryStoreConstants.TAG_NAME_CONTENT_LAST_MODIFICATION_TIMESTAMP, "" + timestamp); document.addTagByKey(RepositoryStoreConstants.TAG_NAME_DATASET, datasetId); document.addTagByKey(RepositoryStoreConstants.TAG_NAME_OBJECT_VISIBILITY, ResourceVisibility.PRIVATE.getyVisibilityValue()); document.addTagByKey(RepositoryStoreConstants.TAG_NAME_LICENSING_POLICY, ResourceVisibility.PRIVATE.getyVisibilityValue());
@Override public String publishElement(DataSet resource) { YElement yElement = prepareYElement(resource); String id = yElement.getId().replaceAll(DATA_SET_YELEMENT_ID_PREFIX, ""); resource.setId(id); final boolean isElementExists = repositoryFacade.checkElementExists(id); if (!isElementExists) { NativeDocument document = createDocument(id); document = processMetadata(document, yElement); document.addTagByKey(TAG_NAME_OBJECT_CLASS , TAG_VALUE_DATASET ); repository.storeDocument(document, null); } else { NativeDocument document = repository.fetchDocument(id); document = processMetadata(document, yElement); document.addTagByKey(TAG_NAME_OBJECT_CLASS , TAG_VALUE_DATASET ); repository.replaceDocument(document, null); } logger.debug("Published data set with id {}", id); return resource.getId(); }
logger.debug("Publish with id {}", id); document = createDocument(id); document.addTagByKey(RepositoryStoreConstants.TAG_NAME_CREATED_BY_USER_TIMESTAMP, timestamp + ""); } else { document = repository.fetchDocument(id); if (contentStored) { final String userId = this.userBusinessService.getCurrentUserId(); document.addTagByKey(RepositoryStoreConstants.TAG_NAME_CONTENT_LAST_MODIFICATION_USER, userId); document.addTagByKey(RepositoryStoreConstants.TAG_NAME_CONTENT_LAST_MODIFICATION_TIMESTAMP, "" + timestamp); document.addTagByKey(RepositoryStoreConstants.TAG_NAME_OBJECT_CLASS, "publication"); document.addTagByKey(RepositoryStoreConstants.TAG_NAME_OBJECT_SUB_CLASS, "article"); document.addTagByKey(RepositoryStoreConstants.TAG_NAME_OBJECT_VISIBILITY, visibility.getyVisibilityValue()); document.addTagByKey(RepositoryStoreConstants.TAG_NAME_LICENSING_POLICY, visibility.getyVisibilityValue()); document.addTagByKey(RepositoryStoreConstants.TAG_NAME_DATASET, datasetId);
String sourcePartPath = input.buildStorePathPart(); NativeDocument document = documentFactory.createDocument(elementId); document.addTagByKey(TAG_NAME_IMPORT, identifierHolder.getProcessId()); document.addTagByKey(TAG_NAME_CREATION_TIMESTAMP, String.valueOf(System.currentTimeMillis())); document.addTagByKey(TAG_NAME_CONVERTED_FROM, elementId); if (definitionId != null) { document.addTagByKey(TAG_NAME_IMPORT_DATA_SOURCE_DEFINITIONS, definitionId);
YElement element = item.getyElement(); NativeDocument document = documentFactory.createDocument(element.getId()); document.addTagByKey(TAG_NAME_IMPORT, identifierHolder.getProcessId()); document.addTagByKey(TAG_NAME_CREATION_TIMESTAMP, String.valueOf(System.currentTimeMillis())); document.addTagByKey(TAG_NAME_CONVERTED_FROM, element.getId()); if (definitionId != null) { document.addTagByKey(TAG_NAME_IMPORT_DATA_SOURCE_DEFINITIONS, definitionId);