Search in sources :

Example 6 with RegistryObjectMetacardType

use of org.codice.ddf.registry.common.metacard.RegistryObjectMetacardType in project ddf by codice.

the class IdentityNodeInitializationTest method setUp.

@Before
public void setUp() throws Exception {
    parser = spy(new XmlParser());
    identityNodeInitialization = spy(new IdentityNodeInitialization());
    registryTransformer = spy(new RegistryTransformer());
    metacardMarshaller = spy(new MetacardMarshaller(parser));
    registryTransformer.setParser(parser);
    registryTransformer.setRegistryMetacardType(new RegistryObjectMetacardType());
    identityNodeInitialization.setRegistryTransformer(registryTransformer);
    identityNodeInitialization.setMetacardMarshaller(metacardMarshaller);
    identityNodeInitialization.setFederationAdminService(federationAdminService);
    identityNodeInitialization.setExecutorService(executorService);
    System.setProperty(SystemInfo.SITE_NAME, TEST_SITE_NAME);
    System.setProperty(SystemInfo.VERSION, TEST_VERSION);
    testMetacard = getTestMetacard();
    testMetacard.setAttribute(new AttributeImpl(Metacard.METADATA, ""));
}
Also used : XmlParser(org.codice.ddf.parser.xml.XmlParser) RegistryTransformer(org.codice.ddf.registry.transformer.RegistryTransformer) MetacardMarshaller(org.codice.ddf.registry.schemabindings.helper.MetacardMarshaller) AttributeImpl(ddf.catalog.data.impl.AttributeImpl) RegistryObjectMetacardType(org.codice.ddf.registry.common.metacard.RegistryObjectMetacardType) Before(org.junit.Before)

Example 7 with RegistryObjectMetacardType

use of org.codice.ddf.registry.common.metacard.RegistryObjectMetacardType in project ddf by codice.

the class RegistryPublicationActionProviderTest method getRegistryMetacard.

private Metacard getRegistryMetacard(String regId) {
    MetacardImpl mcard = new MetacardImpl(new RegistryObjectMetacardType());
    mcard.setTags(Collections.singleton(RegistryConstants.REGISTRY_TAG));
    if (StringUtils.isNotEmpty(regId)) {
        mcard.setAttribute(RegistryObjectMetacardType.REGISTRY_ID, regId);
    }
    return mcard;
}
Also used : RegistryObjectMetacardType(org.codice.ddf.registry.common.metacard.RegistryObjectMetacardType) MetacardImpl(ddf.catalog.data.impl.MetacardImpl)

Example 8 with RegistryObjectMetacardType

use of org.codice.ddf.registry.common.metacard.RegistryObjectMetacardType in project ddf by codice.

the class RegistryPublicationManagerTest method getRegistryMetacard.

private Metacard getRegistryMetacard(String regId) {
    MetacardImpl mcard = new MetacardImpl(new RegistryObjectMetacardType());
    mcard.setTags(Collections.singleton(RegistryConstants.REGISTRY_TAG));
    if (StringUtils.isNotEmpty(regId)) {
        mcard.setAttribute(RegistryObjectMetacardType.REGISTRY_ID, regId);
    }
    return mcard;
}
Also used : RegistryObjectMetacardType(org.codice.ddf.registry.common.metacard.RegistryObjectMetacardType) MetacardImpl(ddf.catalog.data.impl.MetacardImpl)

Example 9 with RegistryObjectMetacardType

use of org.codice.ddf.registry.common.metacard.RegistryObjectMetacardType in project ddf by codice.

the class TestRegistryStore method getDefaultMetacard.

private MetacardImpl getDefaultMetacard() {
    InputStream inputStream = getClass().getResourceAsStream("/csw-full-registry-package.xml");
    BufferedReader buffer = new BufferedReader(new InputStreamReader(inputStream));
    String xml = buffer.lines().collect(Collectors.joining("\n"));
    MetacardImpl mcard = new MetacardImpl(new RegistryObjectMetacardType());
    mcard.setId("testId");
    mcard.setTags(Collections.singleton(RegistryConstants.REGISTRY_TAG));
    mcard.setAttribute(RegistryObjectMetacardType.REGISTRY_ID, "registryId");
    mcard.setContentTypeName(RegistryConstants.REGISTRY_NODE_METACARD_TYPE_NAME);
    mcard.setMetadata(xml);
    mcard.setTitle("testRegistryMetacard");
    return mcard;
}
Also used : InputStreamReader(java.io.InputStreamReader) InputStream(java.io.InputStream) BufferedReader(java.io.BufferedReader) RegistryObjectMetacardType(org.codice.ddf.registry.common.metacard.RegistryObjectMetacardType) MetacardImpl(ddf.catalog.data.impl.MetacardImpl)

Example 10 with RegistryObjectMetacardType

use of org.codice.ddf.registry.common.metacard.RegistryObjectMetacardType in project ddf by codice.

the class RegistryReportBuilderTest method setup.

@Before
public void setup() {
    parser = new XmlParser();
    registryTransformer = spy(new RegistryTransformer());
    registryTransformer.setParser(parser);
    registryTransformer.setRegistryMetacardType(new RegistryObjectMetacardType());
    configurator = parser.configureParser(Arrays.asList(RegistryObjectType.class.getPackage().getName(), EbrimConstants.OGC_FACTORY.getClass().getPackage().getName(), EbrimConstants.GML_FACTORY.getClass().getPackage().getName()), this.getClass().getClassLoader());
    reportHelper = new RegistryReportBuilder();
    reportHelper.setup();
}
Also used : XmlParser(org.codice.ddf.parser.xml.XmlParser) RegistryTransformer(org.codice.ddf.registry.transformer.RegistryTransformer) RegistryObjectMetacardType(org.codice.ddf.registry.common.metacard.RegistryObjectMetacardType) Before(org.junit.Before)

Aggregations

RegistryObjectMetacardType (org.codice.ddf.registry.common.metacard.RegistryObjectMetacardType)10 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)7 Before (org.junit.Before)6 XmlParser (org.codice.ddf.parser.xml.XmlParser)5 MetacardMarshaller (org.codice.ddf.registry.schemabindings.helper.MetacardMarshaller)3 AttributeImpl (ddf.catalog.data.impl.AttributeImpl)2 FederationAdminService (org.codice.ddf.registry.federationadmin.service.internal.FederationAdminService)2 SlotTypeHelper (org.codice.ddf.registry.schemabindings.helper.SlotTypeHelper)2 RegistryTransformer (org.codice.ddf.registry.transformer.RegistryTransformer)2 BundleContext (org.osgi.framework.BundleContext)2 MetacardTypeImpl (ddf.catalog.data.impl.MetacardTypeImpl)1 ResultImpl (ddf.catalog.data.impl.ResultImpl)1 ContactAttributes (ddf.catalog.data.impl.types.ContactAttributes)1 CoreAttributes (ddf.catalog.data.impl.types.CoreAttributes)1 DateTimeAttributes (ddf.catalog.data.impl.types.DateTimeAttributes)1 MediaAttributes (ddf.catalog.data.impl.types.MediaAttributes)1 TopicAttributes (ddf.catalog.data.impl.types.TopicAttributes)1 QueryRequest (ddf.catalog.operation.QueryRequest)1 BufferedReader (java.io.BufferedReader)1 InputStream (java.io.InputStream)1