@Override public void dropProperty(final String iPropertyName) { delegate.dropProperty(iPropertyName); }
@Override protected void perfromSingleAction(AjaxRequestTarget target, OProperty object) { object.getOwnerClass().dropProperty(object.getName()); }
protected void installWidgetsSchemaV3(ODatabaseDocument db) { OSchemaHelper helper = OSchemaHelper.bind(db); OClass widgetClass = helper.oClass(OCLASS_WIDGET).getOClass(); if(!widgetClass.existsProperty(OPROPERTY_TITLE)) { db.command(new OSQLSynchQuery<Void>("UPDATE "+OCLASS_WIDGET+" REMOVE title")); } OClass classToFix = db.getMetadata().getSchema() .getClass(AbstractHtmlJsPaneWidget.WIDGET_OCLASS_NAME); if(classToFix!=null && classToFix.existsProperty("title") && !widgetClass.existsProperty("title")) classToFix.dropProperty("title"); helper.oClass(OCLASS_WIDGET) .oProperty(OPROPERTY_TITLE, OType.EMBEDDEDMAP, 0).assignVisualization("localization"); }
role.dropProperty("rules");
destClass.dropProperty(linkName); sourceClass.dropProperty(linkName);
destClass.dropProperty(linkName); sourceClass.dropProperty(linkName);
private void convertNameProperty(OrienteerWebApplication app, ODatabaseDocument db, String className) { boolean wasInTransacton = db.getTransaction().isActive(); db.commit(); for(ODocument doc : db.browseClass(className)) { Object value = doc.field("name"); if(value instanceof String) { doc.field("temp", (Object) doc.field("name")); doc.field("name", (String) null); doc.save(); } } OClass oClass = db.getMetadata().getSchema().getClass(className); oClass.dropProperty("name"); OProperty nameProperty = oClass.createProperty("name", OType.EMBEDDEDMAP); CustomAttribute.VISUALIZATION_TYPE.setValue(nameProperty, "localization"); for(ODocument doc : db.browseClass(className)) { if(doc.containsField("temp")) { doc.field("name", CommonUtils.toMap("en", doc.field("temp"))); doc.removeField("temp"); doc.save(); } } if(wasInTransacton) db.begin(); }
public void load() { final OClass userClass = getDatabase().getMetadata().getSchema().getClass("OUser"); if (userClass != null) { // @COMPATIBILITY <1.3.0 if (!userClass.existsProperty("status")) { userClass.createProperty("status", OType.STRING).setMandatory(true).setNotNull(true); } OProperty p = userClass.getProperty("name"); if (p == null) p = userClass.createProperty("name", OType.STRING).setMandatory(true).setNotNull(true).setMin("1") .setRegexp("\\S+(.*\\S+)*"); if (userClass.getInvolvedIndexes("name") == null) p.createIndex(INDEX_TYPE.UNIQUE); // ROLE final OClass roleClass = getDatabase().getMetadata().getSchema().getClass("ORole"); final OProperty rules = roleClass.getProperty("rules"); if (rules != null && !OType.EMBEDDEDMAP.equals(rules.getType())) { roleClass.dropProperty("rules"); } if (!roleClass.existsProperty("inheritedRole")) { roleClass.createProperty("inheritedRole", OType.LINK, roleClass); } p = roleClass.getProperty("name"); if (p == null) p = roleClass.createProperty("name", OType.STRING).setMandatory(true).setNotNull(true); if (roleClass.getInvolvedIndexes("name") == null) p.createIndex(INDEX_TYPE.UNIQUE); } }