Search in sources :

Example 56 with PropertyMap

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;
}
Also used : SchemaProperty(org.structr.core.entity.SchemaProperty) PropertyMap(org.structr.core.property.PropertyMap)

Example 57 with PropertyMap

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;
}
Also used : SchemaProperty(org.structr.core.entity.SchemaProperty) PropertyMap(org.structr.core.property.PropertyMap)

Example 58 with PropertyMap

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;
}
Also used : SchemaProperty(org.structr.core.entity.SchemaProperty) PropertyMap(org.structr.core.property.PropertyMap)

Example 59 with PropertyMap

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;
}
Also used : SchemaProperty(org.structr.core.entity.SchemaProperty) PropertyMap(org.structr.core.property.PropertyMap)

Example 60 with PropertyMap

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;
}
Also used : SchemaProperty(org.structr.core.entity.SchemaProperty) PropertyMap(org.structr.core.property.PropertyMap)

Aggregations

PropertyMap (org.structr.core.property.PropertyMap)233 FrameworkException (org.structr.common.error.FrameworkException)100 Tx (org.structr.core.graph.Tx)93 Test (org.junit.Test)60 App (org.structr.core.app.App)34 StructrApp (org.structr.core.app.StructrApp)34 PropertyKey (org.structr.core.property.PropertyKey)34 LinkedList (java.util.LinkedList)28 NodeInterface (org.structr.core.graph.NodeInterface)25 SchemaProperty (org.structr.core.entity.SchemaProperty)23 SecurityContext (org.structr.common.SecurityContext)22 StructrUiTest (org.structr.web.StructrUiTest)21 GraphObject (org.structr.core.GraphObject)20 Result (org.structr.core.Result)19 File (org.structr.web.entity.File)19 DOMNode (org.structr.web.entity.dom.DOMNode)19 TestOne (org.structr.core.entity.TestOne)17 AbstractNode (org.structr.core.entity.AbstractNode)16 Folder (org.structr.web.entity.Folder)15 Page (org.structr.web.entity.dom.Page)15