use of org.structr.core.property.PropertyMap in project structr by structr.
the class StructrStringProperty method createDatabaseSchema.
@Override
SchemaProperty createDatabaseSchema(final App app, final AbstractSchemaNode schemaNode) throws FrameworkException {
final SchemaProperty property = super.createDatabaseSchema(app, schemaNode);
final PropertyMap properties = new PropertyMap();
properties.put(SchemaProperty.propertyType, Type.String.name());
properties.put(SchemaProperty.format, getFormat());
properties.put(SchemaProperty.contentType, getContentType());
property.setProperties(SecurityContext.getSuperUserInstance(), properties);
return property;
}
use of org.structr.core.property.PropertyMap in project structr by structr.
the class StructrDateProperty method createDatabaseSchema.
@Override
SchemaProperty createDatabaseSchema(final App app, final AbstractSchemaNode schemaNode) throws FrameworkException {
final SchemaProperty property = super.createDatabaseSchema(app, schemaNode);
final PropertyMap properties = new PropertyMap();
properties.put(SchemaProperty.propertyType, Type.Date.name());
properties.put(SchemaProperty.format, datePattern);
property.setProperties(SecurityContext.getSuperUserInstance(), properties);
return property;
}
use of org.structr.core.property.PropertyMap in project structr by structr.
the class StructrEnumProperty method createDatabaseSchema.
@Override
SchemaProperty createDatabaseSchema(final App app, final AbstractSchemaNode schemaNode) throws FrameworkException {
final SchemaProperty property = super.createDatabaseSchema(app, schemaNode);
final PropertyMap properties = new PropertyMap();
properties.put(SchemaProperty.propertyType, Type.Enum.name());
properties.put(SchemaProperty.fqcn, this.fqcn);
properties.put(SchemaProperty.format, StringUtils.join(getEnums(), ", "));
property.setProperties(SecurityContext.getSuperUserInstance(), properties);
return property;
}
use of org.structr.core.property.PropertyMap in project structr by structr.
the class StructrIntegerArrayProperty method createDatabaseSchema.
@Override
SchemaProperty createDatabaseSchema(final App app, final AbstractSchemaNode schemaNode) throws FrameworkException {
final SchemaProperty property = super.createDatabaseSchema(app, schemaNode);
final PropertyMap properties = new PropertyMap();
properties.put(SchemaProperty.propertyType, Type.IntegerArray.name());
if (minimum != null && maximum != null) {
final StringBuilder range = new StringBuilder();
if (exclusiveMinimum) {
range.append("]");
} else {
range.append("[");
}
range.append(minimum);
range.append(",");
range.append(maximum);
if (exclusiveMaximum) {
range.append("[");
} else {
range.append("]");
}
properties.put(SchemaProperty.format, range.toString());
}
property.setProperties(SecurityContext.getSuperUserInstance(), properties);
return property;
}
use of org.structr.core.property.PropertyMap in project structr by structr.
the class StructrIntegerProperty method createDatabaseSchema.
@Override
SchemaProperty createDatabaseSchema(final App app, final AbstractSchemaNode schemaNode) throws FrameworkException {
final SchemaProperty property = super.createDatabaseSchema(app, schemaNode);
final PropertyMap properties = new PropertyMap();
properties.put(SchemaProperty.propertyType, Type.Integer.name());
if (minimum != null && maximum != null) {
final StringBuilder range = new StringBuilder();
if (exclusiveMinimum) {
range.append("]");
} else {
range.append("[");
}
range.append(minimum);
range.append(",");
range.append(maximum);
if (exclusiveMaximum) {
range.append("[");
} else {
range.append("]");
}
properties.put(SchemaProperty.format, range.toString());
}
property.setProperties(SecurityContext.getSuperUserInstance(), properties);
return property;
}
Aggregations