use of org.bimserver.models.store.ExtendedDataSchema in project BIMserver by opensourceBIM.
the class AddGeometryReports method execute.
@Override
public Void execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException, ServerException {
ExtendedDataSchema htmlSchema = (ExtendedDataSchema) getDatabaseSession().querySingle(StorePackage.eINSTANCE.getExtendedDataSchema_Name(), "GEOMETRY_GENERATION_REPORT_HTML_1_1");
ExtendedDataSchema jsonSchema = (ExtendedDataSchema) getDatabaseSession().querySingle(StorePackage.eINSTANCE.getExtendedDataSchema_Name(), "GEOMETRY_GENERATION_REPORT_JSON_1_1");
storeExtendedData(getDatabaseSession(), htmlSchema, htmlBytes, "text/html", "html", timeToGenerateMs);
storeExtendedData(getDatabaseSession(), jsonSchema, jsonBytes, "application/json", "json", timeToGenerateMs);
return null;
}
use of org.bimserver.models.store.ExtendedDataSchema in project BIMserver by opensourceBIM.
the class RemoveUserFromExtendedDataSchemaDatabaseAction method execute.
@Override
public Void execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
User user = getDatabaseSession().get(StorePackage.eINSTANCE.getUser(), uoid, OldQuery.getDefault());
if (user == null) {
throw new UserException("User with oid " + uoid + " not found");
}
ExtendedDataSchema extendedDataSchema = getDatabaseSession().get(StorePackage.eINSTANCE.getExtendedDataSchema(), edsid, OldQuery.getDefault());
if (extendedDataSchema == null) {
throw new UserException("ExtendedDataSchema with oid " + edsid + " not found");
}
user.getSchemas().remove(extendedDataSchema);
getDatabaseSession().store(user);
getDatabaseSession().store(extendedDataSchema);
return null;
}
Aggregations