use of com.runwaysdk.dataaccess.MdAttributeConcreteDAOIF in project geoprism-registry by terraframe.
the class MasterListExcelExporter method writeRow.
public void writeRow(Row row, Business object, CellStyle dateStyle) {
int col = 0;
// Write the row
MdAttributeConcreteDAOIF mdGeometry = mdBusiness.definesAttribute(RegistryConstants.GEOMETRY_ATTRIBUTE_NAME);
if (mdGeometry instanceof MdAttributePointDAOIF) {
Point point = (Point) object.getObjectValue(mdGeometry.definesAttribute());
if (point != null) {
row.createCell(col++).setCellValue(point.getX());
row.createCell(col++).setCellValue(point.getY());
}
}
for (MdAttributeConcreteDAOIF mdAttribute : mdAttributes) {
String attributeName = mdAttribute.definesAttribute();
Object value = object.getObjectValue(attributeName);
Cell cell = row.createCell(col++);
if (value != null) {
if (value instanceof String) {
cell.setCellValue((String) value);
} else if (value instanceof Date) {
cell.setCellValue((Date) value);
cell.setCellStyle(dateStyle);
} else if (value instanceof Number) {
cell.setCellValue(((Number) value).doubleValue());
} else if (value instanceof Boolean) {
cell.setCellValue((Boolean) value);
}
}
}
}
use of com.runwaysdk.dataaccess.MdAttributeConcreteDAOIF in project geoprism-registry by terraframe.
the class MasterListExcelExporter method createDataDictionarySheet.
private void createDataDictionarySheet(Workbook workbook) {
Sheet sheet = workbook.createSheet(getSheetName(workbook, "masterlist.data.dictionary"));
Locale locale = Session.getCurrentLocale();
int rowNumber = 0;
for (MdAttributeConcreteDAOIF mdAttribute : mdAttributes) {
if (customAttributeLabels != null && this.customAttributeLabels.containsKey(mdAttribute.definesAttribute())) {
this.createRow(sheet, rowNumber++, this.customAttributeLabels.get(mdAttribute.definesAttribute()), mdAttribute.getDescription(locale));
} else {
this.createRow(sheet, locale, rowNumber++, mdAttribute, mdAttribute.getDescription(locale));
}
}
}
use of com.runwaysdk.dataaccess.MdAttributeConcreteDAOIF in project geoprism-registry by terraframe.
the class MasterListExcelExporter method writeHeader.
public void writeHeader(CellStyle boldStyle, Row header) {
int col = 0;
Locale locale = Session.getCurrentLocale();
MdAttributeConcreteDAOIF mdGeometry = mdBusiness.definesAttribute(RegistryConstants.GEOMETRY_ATTRIBUTE_NAME);
if (mdGeometry instanceof MdAttributePointDAOIF) {
Cell longitude = header.createCell(col++);
longitude.setCellStyle(boldStyle);
longitude.setCellValue(LocalizationFacade.getFromBundles(GeoObjectImportConfiguration.LONGITUDE_KEY));
Cell latitude = header.createCell(col++);
latitude.setCellStyle(boldStyle);
latitude.setCellValue(LocalizationFacade.getFromBundles(GeoObjectImportConfiguration.LATITUDE_KEY));
}
for (MdAttributeConcreteDAOIF mdAttribute : this.mdAttributes) {
Cell cell = header.createCell(col++);
cell.setCellStyle(boldStyle);
cell.setCellValue(mdAttribute.getDisplayLabel(locale));
}
}
use of com.runwaysdk.dataaccess.MdAttributeConcreteDAOIF in project geoprism-registry by terraframe.
the class ServerGeoObjectType method deleteMdAttributeFromAttributeType.
/**
* Delete the {@link MdAttributeConcreteDAOIF} from the given {
*
* @param type
* TODO
* @param mdBusiness
* @param attributeName
*/
@Transaction
public void deleteMdAttributeFromAttributeType(String attributeName) {
MdAttributeConcreteDAOIF mdAttributeConcreteDAOIF = getMdAttribute(this.mdBusiness, attributeName);
if (mdAttributeConcreteDAOIF != null) {
if (mdAttributeConcreteDAOIF instanceof MdAttributeTermDAOIF || mdAttributeConcreteDAOIF instanceof MdAttributeMultiTermDAOIF) {
String attributeTermKey = TermConverter.buildtAtttributeKey(this.mdBusiness.getTypeName(), mdAttributeConcreteDAOIF.definesAttribute());
try {
Classifier attributeTerm = Classifier.getByKey(attributeTermKey);
attributeTerm.delete();
} catch (DataNotFoundException e) {
}
}
mdAttributeConcreteDAOIF.getBusinessDAO().delete();
Optional<AttributeType> optional = this.type.getAttribute(attributeName);
if (optional.isPresent()) {
ListType.deleteMdAttribute(this.universal, optional.get());
}
}
MdAttributeDAOIF mdAttributeDAO = this.mdVertex.definesAttribute(attributeName);
if (mdAttributeDAO != null) {
mdAttributeDAO.getBusinessDAO().delete();
}
}
use of com.runwaysdk.dataaccess.MdAttributeConcreteDAOIF in project geoprism-registry by terraframe.
the class VertexServerGeoObject method getValue.
@Override
public Object getValue(String attributeName, Date date) {
if (attributeName.equals(DefaultAttribute.CODE.getName())) {
return this.getCode();
} else if (attributeName.equals(DefaultAttribute.UID.getName())) {
return this.getUid();
} else if (attributeName.equals(DefaultAttribute.DISPLAY_LABEL.getName())) {
return this.getDisplayLabel(date);
} else if (attributeName.equals(DefaultAttribute.CREATE_DATE.getName())) {
return this.getCreateDate();
} else if (attributeName.equals(DefaultAttribute.EXISTS.getName())) {
return this.getExists(date);
}
DefaultAttribute defaultAttr = DefaultAttribute.getByAttributeName(attributeName);
if (defaultAttr != null && !defaultAttr.isChangeOverTime()) {
return this.vertex.getObjectValue(attributeName);
}
MdAttributeConcreteDAOIF mdAttribute = this.vertex.getMdAttributeDAO(attributeName);
Object value = this.vertex.getObjectValue(attributeName, date);
if (value != null && mdAttribute instanceof MdAttributeTermDAOIF) {
return Classifier.get((String) value);
}
return value;
}
Aggregations