Search in sources :

Example 1 with ExportPipeline

use of com.opentext.ia.sdk.dto.export.ExportPipeline in project infoarchive-sip-sdk by Enterprise-Content-Management.

the class WhenUsingInfoArchive method init.

@BeforeEach
public void init() throws IOException {
    prepareConfiguration();
    connection = new PropertiesBasedArchiveConnection(configuration);
    connection.setRestClient(restClient);
    Services resource = new Services();
    Link link = mock(Link.class);
    Tenant tenant = new Tenant();
    application = new Application();
    applications = mock(Applications.class);
    federations = mock(XdbFederations.class);
    Spaces spaces = mock(Spaces.class);
    XdbDatabases databases = mock(XdbDatabases.class);
    FileSystemRoots fileSystemRoots = mock(FileSystemRoots.class);
    FileSystemRoot fileSystemRoot = new FileSystemRoot();
    when(fileSystemRoots.first()).thenReturn(fileSystemRoot);
    Holdings holdings = mock(Holdings.class);
    ReceiverNodes receiverNodes = mock(ReceiverNodes.class);
    SpaceRootXdbLibraries spaceRootLibraries = mock(SpaceRootXdbLibraries.class);
    SpaceRootFolders rootFolders = mock(SpaceRootFolders.class);
    FileSystemFolders systemFolders = mock(FileSystemFolders.class);
    Stores stores = mock(Stores.class);
    IngestNodes ingestionNodes = mock(IngestNodes.class);
    RetentionPolicies retentionPolicies = mock(RetentionPolicies.class);
    Pdis pdis = mock(Pdis.class);
    PdiSchemas pdiSchemas = mock(PdiSchemas.class);
    Ingests ingests = mock(Ingests.class);
    XdbLibraries libraries = mock(XdbLibraries.class);
    Contents contents = new Contents();
    Aics aics = mock(Aics.class);
    LinkContainer aips = new LinkContainer();
    Queries queries = mock(Queries.class);
    QueryQuotas quotas = mock(QueryQuotas.class);
    ResultConfigurationHelpers helpers = mock(ResultConfigurationHelpers.class);
    ExportConfigurations exportConfigurations = mock(ExportConfigurations.class);
    ExportPipelines exportPipelines = mock(ExportPipelines.class);
    ExportTransformations exportTransformations = mock(ExportTransformations.class);
    Searches searches = mock(Searches.class);
    SearchCompositions compositions = mock(SearchCompositions.class);
    XForms xForms = mock(XForms.class);
    XForm xForm = mock(XForm.class);
    CryptoObjects cryptoObjects = mock(CryptoObjects.class);
    PdiCryptoes pdiCryptos = mock(PdiCryptoes.class);
    HoldingCryptoes holdingCryptos = mock(HoldingCryptoes.class);
    StorageEndPoints storageEndPoints = mock(StorageEndPoints.class);
    CustomStorages customStorages = mock(CustomStorages.class);
    ContentAddressedStorages contentAddressedStorages = mock(ContentAddressedStorages.class);
    Aic aic = new Aic();
    links.put(InfoArchiveLinkRelations.LINK_TENANT, link);
    links.put(InfoArchiveLinkRelations.LINK_APPLICATIONS, link);
    links.put(InfoArchiveLinkRelations.LINK_AIPS, link);
    links.put(InfoArchiveLinkRelations.LINK_INGEST, link);
    resource.setLinks(links);
    tenant.setLinks(links);
    application.setLinks(links);
    contents.getLinks().put(LINK_DOWNLOAD, new Link());
    when(restClient.follow(any(LinkContainer.class), eq(LINK_CONTENTS), eq(Contents.class))).thenReturn(contents);
    when(restClient.get(BILLBOARD_URI, Services.class)).thenReturn(resource);
    when(restClient.follow(resource, LINK_TENANT, Tenant.class)).thenReturn(tenant);
    ProductInfo productInfo = new ProductInfo();
    BuildProperties buildProperties = new BuildProperties();
    buildProperties.setServerVersion("16.3");
    productInfo.setBuildProperties(buildProperties);
    when(restClient.follow(resource, LINK_PRODUCT_INFO, ProductInfo.class)).thenReturn(productInfo);
    when(link.getHref()).thenReturn(BILLBOARD_URI);
    when(restClient.follow(application, InfoArchiveLinkRelations.LINK_AIPS, LinkContainer.class)).thenReturn(aips);
    aips.setLinks(links);
    mockCollection(Applications.class, applications);
    mockCollection(XdbFederations.class, federations);
    mockCollection(Spaces.class, spaces);
    mockCollection(XdbDatabases.class, databases);
    mockCollection(FileSystemRoots.class, fileSystemRoots);
    mockCollection(Holdings.class, holdings);
    mockCollection(ReceiverNodes.class, receiverNodes);
    mockCollection(SpaceRootXdbLibraries.class, spaceRootLibraries);
    mockCollection(SpaceRootFolders.class, rootFolders);
    mockCollection(FileSystemFolders.class, systemFolders);
    mockCollection(Stores.class, stores);
    mockCollection(IngestNodes.class, ingestionNodes);
    mockCollection(RetentionPolicies.class, retentionPolicies);
    mockCollection(Pdis.class, pdis);
    mockCollection(PdiSchemas.class, pdiSchemas);
    mockCollection(Ingests.class, ingests);
    mockCollection(XdbLibraries.class, libraries);
    mockCollection(Aics.class, aics);
    mockCollection(QueryQuotas.class, quotas);
    mockCollection(Queries.class, queries);
    mockCollection(ResultConfigurationHelpers.class, helpers);
    mockCollection(ExportConfigurations.class, exportConfigurations);
    mockCollection(ExportPipelines.class, exportPipelines);
    mockCollection(ExportTransformations.class, exportTransformations);
    mockCollection(Searches.class, searches);
    mockCollection(SearchCompositions.class, compositions);
    mockCollection(XForms.class, xForms);
    mockCollection(CryptoObjects.class, cryptoObjects);
    mockCollection(PdiCryptoes.class, pdiCryptos);
    mockCollection(HoldingCryptoes.class, holdingCryptos);
    mockCollection(StorageEndPoints.class, storageEndPoints);
    mockCollection(CustomStorages.class, customStorages);
    mockCollection(ContentAddressedStorages.class, contentAddressedStorages);
    when(restClient.createCollectionItem(any(LinkContainer.class), any(XForm.class), eq(LINK_SELF))).thenReturn(xForm);
    mockByName(federations, new XdbFederation());
    mockByName(databases, new XdbDatabase());
    mockByName(applications, application);
    mockByName(spaces, new Space());
    mockByName(spaceRootLibraries, new SpaceRootXdbLibrary());
    mockByName(rootFolders, new SpaceRootFolder());
    mockByName(fileSystemRoots, new FileSystemRoot());
    mockByName(systemFolders, new FileSystemFolder());
    mockByName(stores, new Store());
    mockByName(receiverNodes, new ReceiverNode());
    mockByName(ingestionNodes, new IngestNode());
    mockByName(retentionPolicies, new RetentionPolicy());
    mockByName(pdis, new Pdi());
    mockByName(pdiSchemas, new PdiSchema());
    mockByName(ingests, new Ingest());
    mockByName(libraries, new XdbLibrary());
    mockByName(holdings, new Holding());
    mockByName(aics, aic);
    mockByName(quotas, new QueryQuota());
    mockByName(queries, new Query());
    mockByName(helpers, new ResultConfigurationHelper());
    mockByName(exportConfigurations, new ExportConfiguration());
    mockByName(exportPipelines, new ExportPipeline());
    mockByName(exportTransformations, new ExportTransformation());
    mockByName(searches, new Search());
    mockByName(compositions, new SearchComposition());
    mockByName(xForms, new XForm());
    mockByName(cryptoObjects, new CryptoObject());
    mockByName(pdiCryptos, new PdiCrypto());
    mockByName(holdingCryptos, new HoldingCrypto());
    mockByName(storageEndPoints, new StorageEndPoint());
    mockByName(customStorages, new CustomStorage());
    mockByName(contentAddressedStorages, new ContentAddressedStorage());
    when(restClient.put(any(), eq(SearchComposition.class), any(AllSearchComponents.class))).thenReturn(new SearchComposition());
    when(aics.getItems()).thenReturn(Stream.of(aic));
}
Also used : SearchQuery(com.opentext.ia.sdk.dto.query.SearchQuery) AllSearchComponents(com.opentext.ia.sdk.dto.result.AllSearchComponents) ExportPipelines(com.opentext.ia.sdk.dto.export.ExportPipelines) PropertiesBasedArchiveConnection(com.opentext.ia.sdk.server.configuration.PropertiesBasedArchiveConnection) LinkContainer(com.opentext.ia.sdk.support.http.rest.LinkContainer) BuildProperties(com.opentext.ia.sdk.dto.ProductInfo.BuildProperties) Link(com.opentext.ia.sdk.support.http.rest.Link) ExportPipeline(com.opentext.ia.sdk.dto.export.ExportPipeline) ExportConfiguration(com.opentext.ia.sdk.dto.export.ExportConfiguration) ExportConfigurations(com.opentext.ia.sdk.dto.export.ExportConfigurations) ExportTransformations(com.opentext.ia.sdk.dto.export.ExportTransformations) ExportTransformation(com.opentext.ia.sdk.dto.export.ExportTransformation) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with ExportPipeline

use of com.opentext.ia.sdk.dto.export.ExportPipeline in project infoarchive-sip-sdk by Enterprise-Content-Management.

the class PropertiesBasedApplicationConfigurer method createTenantLevelExportPipeline.

private ExportPipeline createTenantLevelExportPipeline(String name) {
    ExportPipeline result = createObject(name, ExportPipeline.class);
    result.setDescription("gzip envelope for csv export");
    result.setIncludesContent(false);
    result.setInputFormat("ROW_COLUMN");
    result.setOutputFormat("csv");
    result.setEnvelopeFormat("gz");
    result.setType("XPROC");
    result.setComposite(true);
    result.setCollectionBasedExport(false);
    result.setContent(String.format("<p:declare-step version=\"2.0\" xmlns:p=\"http://www.w3.org/ns/xproc\" " + "xmlns:ia=\"http://infoarchive.emc.com/xproc\">%n    <p:input port=\"source\" sequence=\"true\"/>%n    " + "<ia:search-results-csv/>%n    <ia:gzip/>%n    <ia:store-export-result format=\"csv\"/>%n</p:declare-step>"));
    return result;
}
Also used : ExportPipeline(com.opentext.ia.sdk.dto.export.ExportPipeline)

Example 3 with ExportPipeline

use of com.opentext.ia.sdk.dto.export.ExportPipeline in project infoarchive-sip-sdk by Enterprise-Content-Management.

the class PropertiesBasedApplicationConfigurer method createExportPipeline.

private ExportPipeline createExportPipeline(String name) {
    ExportPipeline result = createObject(name, ExportPipeline.class);
    result.setComposite(templatedBoolean(EXPORT_PIPELINE_COMPOSITE_TEMPLATE, name));
    result.setContent(templatedString(EXPORT_PIPELINE_CONTENT_TEMPLATE, name));
    result.setDescription(templatedString(EXPORT_PIPELINE_DESCRIPTION_TEMPLATE, name));
    result.setEnvelopeFormat(templatedString(EXPORT_PIPELINE_ENVELOPE_FORMAT_TEMPLATE, name));
    result.setIncludesContent(templatedBoolean(EXPORT_PIPELINE_INCLUDES_CONTENT_TEMPLATE, name));
    result.setInputFormat(templatedString(EXPORT_PIPELINE_INPUT_FORMAT_TEMPLATE, name));
    result.setOutputFormat(templatedString(EXPORT_PIPELINE_OUTPUT_FORMAT_TEMPLATE, name));
    result.setType(templatedString(EXPORT_PIPELINE_TYPE_TEMPLATE, name));
    result.setCollectionBasedExport(templatedBoolean(EXPORT_PIPELINE_COLLECTION_BASED_TEMPLATE, name));
    return result;
}
Also used : ExportPipeline(com.opentext.ia.sdk.dto.export.ExportPipeline)

Example 4 with ExportPipeline

use of com.opentext.ia.sdk.dto.export.ExportPipeline in project infoarchive-sip-sdk by Enterprise-Content-Management.

the class PropertiesBasedApplicationConfigurer method ensureTenantLevelExportPipelines.

private void ensureTenantLevelExportPipelines() throws IOException {
    ExportPipeline exportPipeline = ensureNamedItem(cache.getTenant(), LINK_EXPORT_PIPELINE, ExportPipelines.class, "search-results-csv-gzip", this::createTenantLevelExportPipeline);
    cacheObject(TYPE_EXPORT_PIPELINE, exportPipeline);
}
Also used : ExportPipeline(com.opentext.ia.sdk.dto.export.ExportPipeline)

Aggregations

ExportPipeline (com.opentext.ia.sdk.dto.export.ExportPipeline)4 BuildProperties (com.opentext.ia.sdk.dto.ProductInfo.BuildProperties)1 ExportConfiguration (com.opentext.ia.sdk.dto.export.ExportConfiguration)1 ExportConfigurations (com.opentext.ia.sdk.dto.export.ExportConfigurations)1 ExportPipelines (com.opentext.ia.sdk.dto.export.ExportPipelines)1 ExportTransformation (com.opentext.ia.sdk.dto.export.ExportTransformation)1 ExportTransformations (com.opentext.ia.sdk.dto.export.ExportTransformations)1 SearchQuery (com.opentext.ia.sdk.dto.query.SearchQuery)1 AllSearchComponents (com.opentext.ia.sdk.dto.result.AllSearchComponents)1 PropertiesBasedArchiveConnection (com.opentext.ia.sdk.server.configuration.PropertiesBasedArchiveConnection)1 Link (com.opentext.ia.sdk.support.http.rest.Link)1 LinkContainer (com.opentext.ia.sdk.support.http.rest.LinkContainer)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1