Search in sources :

Example 1 with ParameterDefinition

use of org.bimserver.models.store.ParameterDefinition in project BIMserver by opensourceBIM.

the class BimServer method convertSettings.

public ObjectType convertSettings(DatabaseSession session, Plugin plugin) throws BimserverDatabaseException {
    ObjectType settings = session.create(ObjectType.class);
    ObjectDefinition settingsDefinition = plugin.getSettingsDefinition();
    if (plugin.getSettingsDefinition() != null) {
        for (ParameterDefinition parameterDefinition : settingsDefinition.getParameters()) {
            Parameter parameter = session.create(Parameter.class);
            parameter.setName(parameterDefinition.getName());
            parameter.setIdentifier(parameterDefinition.getIdentifier());
            if (parameterDefinition.getDefaultValue() != null) {
                Type value = cloneAndAdd(session, parameterDefinition.getDefaultValue());
                parameter.setValue(value);
            }
            settings.getParameters().add(parameter);
        }
    }
    return settings;
}
Also used : ObjectType(org.bimserver.models.store.ObjectType) StringType(org.bimserver.models.store.StringType) LongType(org.bimserver.models.store.LongType) PluginBundleType(org.bimserver.models.store.PluginBundleType) DoubleType(org.bimserver.models.store.DoubleType) ObjectType(org.bimserver.models.store.ObjectType) BooleanType(org.bimserver.models.store.BooleanType) Type(org.bimserver.models.store.Type) Parameter(org.bimserver.models.store.Parameter) ObjectDefinition(org.bimserver.models.store.ObjectDefinition) ParameterDefinition(org.bimserver.models.store.ParameterDefinition)

Example 2 with ParameterDefinition

use of org.bimserver.models.store.ParameterDefinition in project BIMserver by opensourceBIM.

the class AbstractSerializerPlugin method getSettingsDefinition.

@Override
public ObjectDefinition getSettingsDefinition() {
    ObjectDefinition objectDefinition = StoreFactory.eINSTANCE.createObjectDefinition();
    ParameterDefinition extensionParameter = StoreFactory.eINSTANCE.createParameterDefinition();
    extensionParameter.setIdentifier(EXTENSION);
    extensionParameter.setName(EXTENSION);
    extensionParameter.setDescription("Extension of the downloaded file");
    PrimitiveDefinition stringType = StoreFactory.eINSTANCE.createPrimitiveDefinition();
    stringType.setType(PrimitiveEnum.STRING);
    extensionParameter.setType(stringType);
    StringType defaultExtensionValue = StoreFactory.eINSTANCE.createStringType();
    defaultExtensionValue.setValue(getDefaultExtension());
    extensionParameter.setDefaultValue(defaultExtensionValue);
    objectDefinition.getParameters().add(extensionParameter);
    ParameterDefinition contentTypeParameter = StoreFactory.eINSTANCE.createParameterDefinition();
    contentTypeParameter.setIdentifier(CONTENT_TYPE);
    contentTypeParameter.setName(CONTENT_TYPE);
    contentTypeParameter.setDescription("Content-Type in the HTTP header of the downloaded file");
    contentTypeParameter.setType(stringType);
    StringType defaultContentTypeValue = StoreFactory.eINSTANCE.createStringType();
    defaultContentTypeValue.setValue(getDefaultContentType());
    contentTypeParameter.setDefaultValue(defaultContentTypeValue);
    objectDefinition.getParameters().add(contentTypeParameter);
    return objectDefinition;
}
Also used : StringType(org.bimserver.models.store.StringType) ObjectDefinition(org.bimserver.models.store.ObjectDefinition) PrimitiveDefinition(org.bimserver.models.store.PrimitiveDefinition) ParameterDefinition(org.bimserver.models.store.ParameterDefinition)

Example 3 with ParameterDefinition

use of org.bimserver.models.store.ParameterDefinition in project BIMserver by opensourceBIM.

the class AbstractWebModulePlugin method getSettingsDefinition.

@Override
public ObjectDefinition getSettingsDefinition() {
    ObjectDefinition objectDefinition = StoreFactory.eINSTANCE.createObjectDefinition();
    PrimitiveDefinition stringDefinition = StoreFactory.eINSTANCE.createPrimitiveDefinition();
    stringDefinition.setType(PrimitiveEnum.STRING);
    ParameterDefinition contextPathParameter = StoreFactory.eINSTANCE.createParameterDefinition();
    contextPathParameter.setIdentifier("contextPath");
    contextPathParameter.setName("contextPath");
    contextPathParameter.setDescription("Context Path to run this Web Module on");
    StringType defaultValue = StoreFactory.eINSTANCE.createStringType();
    defaultValue.setValue(getDefaultContextPath());
    contextPathParameter.setDefaultValue(defaultValue);
    contextPathParameter.setType(stringDefinition);
    objectDefinition.getParameters().add(contextPathParameter);
    return objectDefinition;
}
Also used : StringType(org.bimserver.models.store.StringType) ObjectDefinition(org.bimserver.models.store.ObjectDefinition) PrimitiveDefinition(org.bimserver.models.store.PrimitiveDefinition) ParameterDefinition(org.bimserver.models.store.ParameterDefinition)

Aggregations

ObjectDefinition (org.bimserver.models.store.ObjectDefinition)3 ParameterDefinition (org.bimserver.models.store.ParameterDefinition)3 StringType (org.bimserver.models.store.StringType)3 PrimitiveDefinition (org.bimserver.models.store.PrimitiveDefinition)2 BooleanType (org.bimserver.models.store.BooleanType)1 DoubleType (org.bimserver.models.store.DoubleType)1 LongType (org.bimserver.models.store.LongType)1 ObjectType (org.bimserver.models.store.ObjectType)1 Parameter (org.bimserver.models.store.Parameter)1 PluginBundleType (org.bimserver.models.store.PluginBundleType)1 Type (org.bimserver.models.store.Type)1