Search in sources :

Example 1 with MdAttribute

use of com.runwaysdk.system.metadata.MdAttribute in project geoprism-registry by terraframe.

the class ListTypeVersion method create.

@Transaction
public static ListTypeVersion create(ListTypeEntry listEntry, boolean working, int versionNumber, JsonObject metadata) {
    ListType listType = listEntry.getListType();
    ListTypeVersion version = new ListTypeVersion();
    version.setEntry(listEntry);
    version.setListType(listType);
    version.setForDate(listEntry.getForDate());
    version.setVersionNumber(versionNumber);
    version.setWorking(working);
    if (metadata != null) {
        version.parse(metadata);
    }
    ServerGeoObjectType type = listType.getGeoObjectType();
    if (type.getIsPrivate() && (version.getListVisibility().equals(ListType.PUBLIC) || version.getGeospatialVisibility().equals(ListType.PUBLIC))) {
        throw new UnsupportedOperationException("A list version cannot be public if the Geo-Object Type is private");
    }
    TableMetadata tableMetadata = null;
    tableMetadata = version.createTable();
    version.setMdBusiness(tableMetadata.getMdBusiness());
    version.apply();
    if (tableMetadata != null) {
        Map<MdAttribute, MdAttribute> pairs = tableMetadata.getPairs();
        Set<Entry<MdAttribute, MdAttribute>> entries = pairs.entrySet();
        for (Entry<MdAttribute, MdAttribute> entry : entries) {
            ListTypeAttributeGroup.create(version, entry.getValue(), entry.getKey());
        }
    }
    ListTypeVersion.assignDefaultRolePermissions(version.getMdBusiness());
    return version;
}
Also used : TableMetadata(net.geoprism.registry.masterlist.TableMetadata) Entry(java.util.Map.Entry) ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) MdAttribute(com.runwaysdk.system.metadata.MdAttribute) UnsupportedOperationException(com.amazonaws.services.kms.model.UnsupportedOperationException) Transaction(com.runwaysdk.dataaccess.transaction.Transaction)

Example 2 with MdAttribute

use of com.runwaysdk.system.metadata.MdAttribute in project geoprism-registry by terraframe.

the class ListTypeVersion method createMdAttributeFromAttributeType.

public static TableMetadata createMdAttributeFromAttributeType(ListTypeVersion version, ServerGeoObjectType type, AttributeType attributeType, Collection<Locale> locales) {
    TableMetadata metadata = new TableMetadata();
    metadata.setMdBusiness(version.getMdBusiness());
    createMdAttributeFromAttributeType(metadata, attributeType, type, locales);
    Map<MdAttribute, MdAttribute> pairs = metadata.getPairs();
    Set<Entry<MdAttribute, MdAttribute>> entries = pairs.entrySet();
    for (Entry<MdAttribute, MdAttribute> entry : entries) {
        ListTypeAttributeGroup.create(version, entry.getValue(), entry.getKey());
    }
    return metadata;
}
Also used : TableMetadata(net.geoprism.registry.masterlist.TableMetadata) Entry(java.util.Map.Entry) MdAttribute(com.runwaysdk.system.metadata.MdAttribute)

Example 3 with MdAttribute

use of com.runwaysdk.system.metadata.MdAttribute in project geoprism-registry by terraframe.

the class ListTypeVersion method generateShapefile.

// public List<ExecutableJob> getJobs()
// {
// LinkedList<ExecutableJob> jobs = new LinkedList<ExecutableJob>();
// 
// PublishShapefileJobQuery psjq = new PublishShapefileJobQuery(new
// QueryFactory());
// psjq.WHERE(psjq.getVersion().EQ(this));
// 
// try (OIterator<? extends PublishShapefileJob> it = psjq.getIterator())
// {
// jobs.addAll(it.getAll());
// }
// 
// PublishListTypeVersionJobQuery pmlvj = new
// PublishListTypeVersionJobQuery(new QueryFactory());
// pmlvj.WHERE(pmlvj.getListTypeVersion().EQ(this));
// 
// try (OIterator<? extends PublishListTypeVersionJob> it =
// pmlvj.getIterator())
// {
// jobs.addAll(it.getAll());
// }
// 
// return jobs;
// }
public File generateShapefile() {
    String filename = this.getOid() + ".zip";
    final ListType list = this.getListType();
    final File directory = list.getShapefileDirectory();
    directory.mkdirs();
    final File file = new File(directory, filename);
    MdBusinessDAOIF mdBusiness = MdBusinessDAO.get(this.getMdBusinessOid());
    List<? extends MdAttributeConcreteDAOIF> mdAttributes = mdBusiness.definesAttributesOrdered().stream().filter(mdAttribute -> this.isValid(mdAttribute)).collect(Collectors.toList());
    try {
        ListTypeShapefileExporter exporter = new ListTypeShapefileExporter(this, mdBusiness, mdAttributes, null);
        try (final InputStream istream = exporter.export()) {
            try (final FileOutputStream fos = new FileOutputStream(file)) {
                IOUtils.copy(istream, fos);
            }
        }
    } catch (IOException e) {
        throw new ProgrammingErrorException(e);
    }
    return file;
}
Also used : MdAttributeBooleanDAOIF(com.runwaysdk.dataaccess.MdAttributeBooleanDAOIF) Authenticate(com.runwaysdk.business.rbac.Authenticate) AttributeFloatType(org.commongeoregistry.adapter.metadata.AttributeFloatType) MdAttributeBoolean(com.runwaysdk.system.metadata.MdAttributeBoolean) MdAttributeDateTimeUtil(com.runwaysdk.constants.MdAttributeDateTimeUtil) MdAttributeMomentDAOIF(com.runwaysdk.dataaccess.MdAttributeMomentDAOIF) JSONException(org.json.JSONException) Condition(com.runwaysdk.query.Condition) IndexTypes(com.runwaysdk.constants.IndexTypes) TableMetadata(net.geoprism.registry.masterlist.TableMetadata) Map(java.util.Map) ServerGeoObjectRestriction(net.geoprism.registry.query.ServerGeoObjectRestriction) AttributeBooleanType(org.commongeoregistry.adapter.metadata.AttributeBooleanType) AttributeBoolean(com.runwaysdk.query.AttributeBoolean) ComponentIF(com.runwaysdk.ComponentIF) ListTypeAttributeComparator(net.geoprism.registry.masterlist.ListTypeAttributeComparator) Set(java.util.Set) BusinessFacade(com.runwaysdk.business.BusinessFacade) IOUtils(org.apache.commons.io.IOUtils) JsonArray(com.google.gson.JsonArray) GeoObjectImportConfiguration(net.geoprism.registry.io.GeoObjectImportConfiguration) MdBusiness(com.runwaysdk.system.metadata.MdBusiness) GeoserverRemoveWMSCommand(net.geoprism.registry.command.GeoserverRemoveWMSCommand) MdAttributeLong(com.runwaysdk.system.metadata.MdAttributeLong) SimpleDateFormat(java.text.SimpleDateFormat) JsonParser(com.google.gson.JsonParser) DefaultConfiguration(net.geoprism.DefaultConfiguration) NumberFormat(java.text.NumberFormat) MdAttributeDouble(com.runwaysdk.system.metadata.MdAttributeDouble) ServerParentTreeNode(net.geoprism.registry.model.ServerParentTreeNode) F(com.runwaysdk.query.F) Classification(net.geoprism.registry.model.Classification) BasicVertexQuery(net.geoprism.registry.query.graph.BasicVertexQuery) MdAttributeFloatInfo(com.runwaysdk.constants.MdAttributeFloatInfo) QueryFactory(com.runwaysdk.query.QueryFactory) RoleDAO(com.runwaysdk.business.rbac.RoleDAO) ListTypeShapefileExporter(net.geoprism.registry.shapefile.ListTypeShapefileExporter) VertexGeoObjectQuery(net.geoprism.registry.query.graph.VertexGeoObjectQuery) JsonSerializable(net.geoprism.registry.view.JsonSerializable) MdAttributeNumberDAOIF(com.runwaysdk.dataaccess.MdAttributeNumberDAOIF) ComponentQuery(com.runwaysdk.query.ComponentQuery) MdAttribute(com.runwaysdk.system.metadata.MdAttribute) MdAttributeConcrete(com.runwaysdk.system.metadata.MdAttributeConcrete) Coordinate(com.vividsolutions.jts.geom.Coordinate) AttributeType(org.commongeoregistry.adapter.metadata.AttributeType) MdBusinessDAOIF(com.runwaysdk.dataaccess.MdBusinessDAOIF) AttributeDateType(org.commongeoregistry.adapter.metadata.AttributeDateType) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) File(java.io.File) HierarchyType(org.commongeoregistry.adapter.metadata.HierarchyType) ListCurationHistory(net.geoprism.registry.curation.ListCurationHistory) DataNotFoundException(com.runwaysdk.dataaccess.cache.DataNotFoundException) MultiPoint(com.vividsolutions.jts.geom.MultiPoint) Business(com.runwaysdk.business.Business) MdAttributeFloatDAO(com.runwaysdk.dataaccess.metadata.MdAttributeFloatDAO) MdBusinessDAO(com.runwaysdk.dataaccess.metadata.MdBusinessDAO) BasicVertexRestriction(net.geoprism.registry.query.graph.BasicVertexRestriction) BusinessInfo(com.runwaysdk.constants.BusinessInfo) MdAttributePolygon(com.runwaysdk.system.gis.metadata.MdAttributePolygon) JsonObject(com.google.gson.JsonObject) Operation(com.runwaysdk.business.rbac.Operation) Date(java.util.Date) AttributeLocalType(org.commongeoregistry.adapter.metadata.AttributeLocalType) ValueObject(com.runwaysdk.dataaccess.ValueObject) ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) ClassificationType(net.geoprism.registry.model.ClassificationType) MdAttributeBooleanInfo(com.runwaysdk.constants.MdAttributeBooleanInfo) MdTableInfo(com.runwaysdk.constants.MdTableInfo) ValueQuery(com.runwaysdk.query.ValueQuery) MdAttributeShape(com.runwaysdk.system.gis.metadata.MdAttributeShape) Locale(java.util.Locale) Geometry(com.vividsolutions.jts.geom.Geometry) ParseException(java.text.ParseException) AttributeCharacterType(org.commongeoregistry.adapter.metadata.AttributeCharacterType) Database(com.runwaysdk.dataaccess.database.Database) MdAttributePoint(com.runwaysdk.system.gis.metadata.MdAttributePoint) DateFormat(java.text.DateFormat) GeoserverFacade(net.geoprism.gis.geoserver.GeoserverFacade) BusinessQuery(com.runwaysdk.business.BusinessQuery) MdAttributeCharacterDAO(com.runwaysdk.dataaccess.metadata.MdAttributeCharacterDAO) UnsupportedOperationException(com.amazonaws.services.kms.model.UnsupportedOperationException) LocationInfo(net.geoprism.registry.model.LocationInfo) Collection(java.util.Collection) VertexServerGeoObject(net.geoprism.registry.model.graph.VertexServerGeoObject) MdAttributeConcreteInfo(com.runwaysdk.constants.MdAttributeConcreteInfo) Collectors(java.util.stream.Collectors) ProgressService(net.geoprism.registry.progress.ProgressService) FileNotFoundException(java.io.FileNotFoundException) Page(net.geoprism.registry.view.Page) List(java.util.List) MdAttributeDoubleInfo(com.runwaysdk.constants.MdAttributeDoubleInfo) MdAttributeMultiLineString(com.runwaysdk.system.gis.metadata.MdAttributeMultiLineString) MdAttributeMultiPoint(com.runwaysdk.system.gis.metadata.MdAttributeMultiPoint) MdAttributeMultiPolygon(com.runwaysdk.system.gis.metadata.MdAttributeMultiPolygon) MdAttributeCharacter(com.runwaysdk.system.metadata.MdAttributeCharacter) Entry(java.util.Map.Entry) MdAttributeLineString(com.runwaysdk.system.gis.metadata.MdAttributeLineString) GeometryType(org.commongeoregistry.adapter.constants.GeometryType) MdAttributeIndices(com.runwaysdk.system.metadata.MdAttributeIndices) ProgrammingErrorException(com.runwaysdk.dataaccess.ProgrammingErrorException) Transaction(com.runwaysdk.dataaccess.transaction.Transaction) AttributeClassificationType(org.commongeoregistry.adapter.metadata.AttributeClassificationType) CurationService(net.geoprism.registry.curation.CurationService) HashMap(java.util.HashMap) ListTypeVersionPageQuery(net.geoprism.registry.query.ListTypeVersionPageQuery) LocalizedValue(org.commongeoregistry.adapter.dataaccess.LocalizedValue) MdAttributeLocalInfo(com.runwaysdk.constants.MdAttributeLocalInfo) Progress(net.geoprism.registry.progress.Progress) Constants(com.runwaysdk.constants.Constants) Point(com.vividsolutions.jts.geom.Point) ServiceFactory(net.geoprism.registry.service.ServiceFactory) Classifier(net.geoprism.ontology.Classifier) MdAttributeConcreteDAOIF(com.runwaysdk.dataaccess.MdAttributeConcreteDAOIF) DefaultAttribute(org.commongeoregistry.adapter.constants.DefaultAttribute) LocalizationFacade(com.runwaysdk.localization.LocalizationFacade) BasicCondition(com.runwaysdk.query.BasicCondition) MdAttributeCharacterInfo(com.runwaysdk.constants.MdAttributeCharacterInfo) GeoserverCreateWMSCommand(net.geoprism.registry.command.GeoserverCreateWMSCommand) LocalizedValueConverter(net.geoprism.registry.conversion.LocalizedValueConverter) MdAttributeUUIDDAO(com.runwaysdk.dataaccess.metadata.MdAttributeUUIDDAO) LinkedList(java.util.LinkedList) LocalStruct(com.runwaysdk.business.LocalStruct) MdAttributeGeometry(com.runwaysdk.system.gis.metadata.MdAttributeGeometry) MdAttributeDateTime(com.runwaysdk.system.metadata.MdAttributeDateTime) ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) ServerHierarchyType(net.geoprism.registry.model.ServerHierarchyType) MdAttributeConcreteDAO(com.runwaysdk.dataaccess.metadata.MdAttributeConcreteDAO) Term(org.commongeoregistry.adapter.Term) AttributeTermType(org.commongeoregistry.adapter.metadata.AttributeTermType) FileInputStream(java.io.FileInputStream) AttributeIntegerType(org.commongeoregistry.adapter.metadata.AttributeIntegerType) OIterator(com.runwaysdk.query.OIterator) Session(com.runwaysdk.session.Session) MdAttributePointDAOIF(com.runwaysdk.gis.dataaccess.MdAttributePointDAOIF) Collections(java.util.Collections) InputStream(java.io.InputStream) MdBusinessDAOIF(com.runwaysdk.dataaccess.MdBusinessDAOIF) ListTypeShapefileExporter(net.geoprism.registry.shapefile.ListTypeShapefileExporter) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) FileOutputStream(java.io.FileOutputStream) MdAttributeMultiLineString(com.runwaysdk.system.gis.metadata.MdAttributeMultiLineString) MdAttributeLineString(com.runwaysdk.system.gis.metadata.MdAttributeLineString) IOException(java.io.IOException) File(java.io.File) ProgrammingErrorException(com.runwaysdk.dataaccess.ProgrammingErrorException)

Example 4 with MdAttribute

use of com.runwaysdk.system.metadata.MdAttribute in project geoprism-registry by terraframe.

the class MasterListVersion method generateShapefile.

public File generateShapefile() {
    String filename = this.getOid() + ".zip";
    final MasterList list = this.getMasterlist();
    final File directory = list.getShapefileDirectory();
    directory.mkdirs();
    final File file = new File(directory, filename);
    MdBusinessDAOIF mdBusiness = MdBusinessDAO.get(this.getMdBusinessOid());
    List<? extends MdAttributeConcreteDAOIF> mdAttributes = mdBusiness.definesAttributesOrdered().stream().filter(mdAttribute -> this.isValid(mdAttribute)).collect(Collectors.toList());
    try {
        MasterListShapefileExporter exporter = new MasterListShapefileExporter(this, mdBusiness, mdAttributes, null);
        try (final InputStream istream = exporter.export()) {
            try (final FileOutputStream fos = new FileOutputStream(file)) {
                IOUtils.copy(istream, fos);
            }
        }
    } catch (IOException e) {
        throw new ProgrammingErrorException(e);
    }
    return file;
}
Also used : MdAttributeBooleanDAOIF(com.runwaysdk.dataaccess.MdAttributeBooleanDAOIF) Authenticate(com.runwaysdk.business.rbac.Authenticate) AttributeFloatType(org.commongeoregistry.adapter.metadata.AttributeFloatType) MdAttributeBoolean(com.runwaysdk.system.metadata.MdAttributeBoolean) MdAttributeMomentDAOIF(com.runwaysdk.dataaccess.MdAttributeMomentDAOIF) JSONException(org.json.JSONException) Condition(com.runwaysdk.query.Condition) IndexTypes(com.runwaysdk.constants.IndexTypes) GeoJSONWriter(org.wololo.jts2geojson.GeoJSONWriter) TableMetadata(net.geoprism.registry.masterlist.TableMetadata) Map(java.util.Map) AttributeBooleanType(org.commongeoregistry.adapter.metadata.AttributeBooleanType) AttributeBoolean(com.runwaysdk.query.AttributeBoolean) ComponentIF(com.runwaysdk.ComponentIF) ListTypeAttributeComparator(net.geoprism.registry.masterlist.ListTypeAttributeComparator) Set(java.util.Set) BusinessFacade(com.runwaysdk.business.BusinessFacade) IOUtils(org.apache.commons.io.IOUtils) MdVertexDAOIF(com.runwaysdk.dataaccess.MdVertexDAOIF) JsonArray(com.google.gson.JsonArray) GeoObjectImportConfiguration(net.geoprism.registry.io.GeoObjectImportConfiguration) MdBusiness(com.runwaysdk.system.metadata.MdBusiness) GeoserverRemoveWMSCommand(net.geoprism.registry.command.GeoserverRemoveWMSCommand) MdAttributeLong(com.runwaysdk.system.metadata.MdAttributeLong) VertexObject(com.runwaysdk.business.graph.VertexObject) SimpleDateFormat(java.text.SimpleDateFormat) ExecutableJob(com.runwaysdk.system.scheduler.ExecutableJob) JsonParser(com.google.gson.JsonParser) DefaultConfiguration(net.geoprism.DefaultConfiguration) NumberFormat(java.text.NumberFormat) MdAttributeDouble(com.runwaysdk.system.metadata.MdAttributeDouble) ServerParentTreeNode(net.geoprism.registry.model.ServerParentTreeNode) Calendar(java.util.Calendar) QueryFactory(com.runwaysdk.query.QueryFactory) RoleDAO(com.runwaysdk.business.rbac.RoleDAO) VertexGeoObjectQuery(net.geoprism.registry.query.graph.VertexGeoObjectQuery) ComponentQuery(com.runwaysdk.query.ComponentQuery) MdAttribute(com.runwaysdk.system.metadata.MdAttribute) MdClassificationDAOIF(com.runwaysdk.dataaccess.MdClassificationDAOIF) MdAttributeConcrete(com.runwaysdk.system.metadata.MdAttributeConcrete) AttributeType(org.commongeoregistry.adapter.metadata.AttributeType) MdBusinessDAOIF(com.runwaysdk.dataaccess.MdBusinessDAOIF) AttributeDateType(org.commongeoregistry.adapter.metadata.AttributeDateType) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) File(java.io.File) HierarchyType(org.commongeoregistry.adapter.metadata.HierarchyType) DataNotFoundException(com.runwaysdk.dataaccess.cache.DataNotFoundException) Business(com.runwaysdk.business.Business) MdBusinessDAO(com.runwaysdk.dataaccess.metadata.MdBusinessDAO) MasterListShapefileExporter(net.geoprism.registry.shapefile.MasterListShapefileExporter) BusinessInfo(com.runwaysdk.constants.BusinessInfo) MdAttributePolygon(com.runwaysdk.system.gis.metadata.MdAttributePolygon) JsonObject(com.google.gson.JsonObject) Operation(com.runwaysdk.business.rbac.Operation) Date(java.util.Date) AttributeLocalType(org.commongeoregistry.adapter.metadata.AttributeLocalType) ValueObject(com.runwaysdk.dataaccess.ValueObject) ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) MdAttributeBooleanInfo(com.runwaysdk.constants.MdAttributeBooleanInfo) PublishMasterListVersionJobQuery(net.geoprism.registry.etl.PublishMasterListVersionJobQuery) MdTableInfo(com.runwaysdk.constants.MdTableInfo) ValueQuery(com.runwaysdk.query.ValueQuery) MdAttributeShape(com.runwaysdk.system.gis.metadata.MdAttributeShape) Locale(java.util.Locale) Geometry(com.vividsolutions.jts.geom.Geometry) ParseException(java.text.ParseException) AttributeCharacterType(org.commongeoregistry.adapter.metadata.AttributeCharacterType) Database(com.runwaysdk.dataaccess.database.Database) MdAttributePoint(com.runwaysdk.system.gis.metadata.MdAttributePoint) DateFormat(java.text.DateFormat) GeoserverFacade(net.geoprism.gis.geoserver.GeoserverFacade) BusinessQuery(com.runwaysdk.business.BusinessQuery) MdAttributeCharacterDAO(com.runwaysdk.dataaccess.metadata.MdAttributeCharacterDAO) LocationInfo(net.geoprism.registry.model.LocationInfo) Collection(java.util.Collection) VertexServerGeoObject(net.geoprism.registry.model.graph.VertexServerGeoObject) MdAttributeConcreteInfo(com.runwaysdk.constants.MdAttributeConcreteInfo) Collectors(java.util.stream.Collectors) ProgressService(net.geoprism.registry.progress.ProgressService) FileNotFoundException(java.io.FileNotFoundException) List(java.util.List) MdAttributeDoubleInfo(com.runwaysdk.constants.MdAttributeDoubleInfo) MdAttributeMultiLineString(com.runwaysdk.system.gis.metadata.MdAttributeMultiLineString) MdAttributeMultiPoint(com.runwaysdk.system.gis.metadata.MdAttributeMultiPoint) MdAttributeMultiPolygon(com.runwaysdk.system.gis.metadata.MdAttributeMultiPolygon) MdAttributeCharacter(com.runwaysdk.system.metadata.MdAttributeCharacter) Entry(java.util.Map.Entry) MdClassificationDAO(com.runwaysdk.dataaccess.metadata.graph.MdClassificationDAO) MdAttributeLineString(com.runwaysdk.system.gis.metadata.MdAttributeLineString) GeometryType(org.commongeoregistry.adapter.constants.GeometryType) MdAttributeIndices(com.runwaysdk.system.metadata.MdAttributeIndices) AbstractClassification(com.runwaysdk.system.AbstractClassification) ProgrammingErrorException(com.runwaysdk.dataaccess.ProgrammingErrorException) PublishMasterListVersionJob(net.geoprism.registry.etl.PublishMasterListVersionJob) Transaction(com.runwaysdk.dataaccess.transaction.Transaction) AttributeClassificationType(org.commongeoregistry.adapter.metadata.AttributeClassificationType) HashMap(java.util.HashMap) LocalizedValue(org.commongeoregistry.adapter.dataaccess.LocalizedValue) MdAttributeLocalInfo(com.runwaysdk.constants.MdAttributeLocalInfo) Progress(net.geoprism.registry.progress.Progress) ServiceFactory(net.geoprism.registry.service.ServiceFactory) Classifier(net.geoprism.ontology.Classifier) MdAttributeConcreteDAOIF(com.runwaysdk.dataaccess.MdAttributeConcreteDAOIF) PublishShapefileJob(net.geoprism.registry.etl.PublishShapefileJob) DefaultAttribute(org.commongeoregistry.adapter.constants.DefaultAttribute) LocalizationFacade(com.runwaysdk.localization.LocalizationFacade) BasicCondition(com.runwaysdk.query.BasicCondition) MdAttributeCharacterInfo(com.runwaysdk.constants.MdAttributeCharacterInfo) GeoserverCreateWMSCommand(net.geoprism.registry.command.GeoserverCreateWMSCommand) LocalizedValueConverter(net.geoprism.registry.conversion.LocalizedValueConverter) MdAttributeUUIDDAO(com.runwaysdk.dataaccess.metadata.MdAttributeUUIDDAO) LinkedList(java.util.LinkedList) MdAttributeGeometry(com.runwaysdk.system.gis.metadata.MdAttributeGeometry) MdAttributeDateTime(com.runwaysdk.system.metadata.MdAttributeDateTime) ServerGeoObjectIF(net.geoprism.registry.model.ServerGeoObjectIF) ServerHierarchyType(net.geoprism.registry.model.ServerHierarchyType) MdAttributeConcreteDAO(com.runwaysdk.dataaccess.metadata.MdAttributeConcreteDAO) Term(org.commongeoregistry.adapter.Term) AttributeTermType(org.commongeoregistry.adapter.metadata.AttributeTermType) FileInputStream(java.io.FileInputStream) AttributeIntegerType(org.commongeoregistry.adapter.metadata.AttributeIntegerType) OIterator(com.runwaysdk.query.OIterator) PublishShapefileJobQuery(net.geoprism.registry.etl.PublishShapefileJobQuery) Session(com.runwaysdk.session.Session) MdAttributePointDAOIF(com.runwaysdk.gis.dataaccess.MdAttributePointDAOIF) Collections(java.util.Collections) JSONArray(org.json.JSONArray) InputStream(java.io.InputStream) MasterListShapefileExporter(net.geoprism.registry.shapefile.MasterListShapefileExporter) MdBusinessDAOIF(com.runwaysdk.dataaccess.MdBusinessDAOIF) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) FileOutputStream(java.io.FileOutputStream) MdAttributeMultiLineString(com.runwaysdk.system.gis.metadata.MdAttributeMultiLineString) MdAttributeLineString(com.runwaysdk.system.gis.metadata.MdAttributeLineString) IOException(java.io.IOException) File(java.io.File) ProgrammingErrorException(com.runwaysdk.dataaccess.ProgrammingErrorException)

Example 5 with MdAttribute

use of com.runwaysdk.system.metadata.MdAttribute in project geoprism-registry by terraframe.

the class MasterListVersion method create.

@Transaction
public static MasterListVersion create(MasterList list, Date forDate, String versionType) {
    MasterListVersion version = new MasterListVersion();
    version.setMasterlist(list);
    version.setForDate(forDate);
    version.setVersionType(versionType);
    TableMetadata metadata = null;
    // if (version.isNew())
    // {
    metadata = version.createTable();
    version.setMdBusiness(metadata.getMdBusiness());
    // }
    version.apply();
    if (metadata != null) {
        Map<MdAttribute, MdAttribute> pairs = metadata.getPairs();
        Set<Entry<MdAttribute, MdAttribute>> entries = pairs.entrySet();
        for (Entry<MdAttribute, MdAttribute> entry : entries) {
            MasterListAttributeGroup.create(version, entry.getValue(), entry.getKey());
        }
    }
    // if (version.isNew())
    // {
    MasterListVersion.assignDefaultRolePermissions(version.getMdBusiness());
    return version;
}
Also used : TableMetadata(net.geoprism.registry.masterlist.TableMetadata) Entry(java.util.Map.Entry) MdAttribute(com.runwaysdk.system.metadata.MdAttribute) Transaction(com.runwaysdk.dataaccess.transaction.Transaction)

Aggregations

MdAttribute (com.runwaysdk.system.metadata.MdAttribute)6 Entry (java.util.Map.Entry)6 TableMetadata (net.geoprism.registry.masterlist.TableMetadata)6 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)4 JsonArray (com.google.gson.JsonArray)2 JsonObject (com.google.gson.JsonObject)2 JsonParser (com.google.gson.JsonParser)2 ComponentIF (com.runwaysdk.ComponentIF)2 Business (com.runwaysdk.business.Business)2 BusinessFacade (com.runwaysdk.business.BusinessFacade)2 BusinessQuery (com.runwaysdk.business.BusinessQuery)2 Authenticate (com.runwaysdk.business.rbac.Authenticate)2 Operation (com.runwaysdk.business.rbac.Operation)2 RoleDAO (com.runwaysdk.business.rbac.RoleDAO)2 BusinessInfo (com.runwaysdk.constants.BusinessInfo)2 IndexTypes (com.runwaysdk.constants.IndexTypes)2 MdAttributeBooleanInfo (com.runwaysdk.constants.MdAttributeBooleanInfo)2 MdAttributeCharacterInfo (com.runwaysdk.constants.MdAttributeCharacterInfo)2 MdAttributeConcreteInfo (com.runwaysdk.constants.MdAttributeConcreteInfo)2 MdAttributeDoubleInfo (com.runwaysdk.constants.MdAttributeDoubleInfo)2