com.orientechnologies.orient.core.metadata.schema.OType Java Examples

The following examples show how to use com.orientechnologies.orient.core.metadata.schema.OType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BrowseNodeEntityAdapter.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void readFields(final ODocument document, final OrientBrowseNode entity) {
  String repositoryName = document.field(P_REPOSITORY_NAME, OType.STRING);
  String format = document.field(P_FORMAT, OType.STRING);
  String path = document.field(P_PATH, OType.STRING);
  String parentPath = document.field(P_PARENT_PATH, OType.STRING);
  String name = document.field(P_NAME, OType.STRING);

  entity.setRepositoryName(repositoryName);
  entity.setFormat(format);
  entity.setPath(path);
  entity.setParentPath(parentPath);
  entity.setName(name);

  ORID componentId = document.field(P_COMPONENT_ID, ORID.class);
  if (componentId != null) {
    entity.setComponentId(new AttachedEntityId(componentEntityAdapter, componentId));
  }

  ORID assetId = document.field(P_ASSET_ID, ORID.class);
  if (assetId != null) {
    entity.setAssetId(new AttachedEntityId(assetEntityAdapter, assetId));
  }
}
 
Example #2
Source File: VariableInstanceEntityHandler.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
@Override
public void applySchema(OSchemaHelper helper) {
	super.applySchema(helper);
	helper.oProperty("serializerName", OType.STRING, 30)
		  .oProperty("name", OType.STRING, 20)
		  .oProperty("execution", OType.LINK, 40).assignVisualization("listbox")
		  .oProperty("processInstanceId", OType.STRING, 50)
		  .oProperty("caseExecutionId", OType.STRING, 60)
		  .oProperty("caseInstanceId", OType.STRING, 70)
		  .oProperty("task", OType.LINK, 80).assignVisualization("listbox")
		  .oProperty("byteArrayValue", OType.LINK, 90)
		  .oProperty("doubleValue", OType.DOUBLE, 100)
		  .oProperty("longValue", OType.LONG, 110)
		  .oProperty("textValue", OType.STRING, 120)
		  .oProperty("textValue2", OType.STRING, 130)
		  .oProperty("sequenceCounter", OType.LONG, 140)
		  .oProperty("concurrentLocal", OType.BOOLEAN, 150);
}
 
Example #3
Source File: OrientConfigurationEntityAdapter.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void readFields(final ODocument document, final OrientConfiguration entity) {
  String recipeName = document.field(P_RECIPE_NAME, OType.STRING);
  String repositoryName = document.field(P_REPOSITORY_NAME, OType.STRING);
  Boolean online = document.field(P_ONLINE, OType.BOOLEAN);
  Map<String, Map<String, Object>> attributes = document.field(P_ATTRIBUTES, OType.EMBEDDEDMAP);

  ODocument routingRule = document.field(P_ROUTING_RULE_ID, OType.LINK);
  EntityId routingRuleId =
      routingRule == null ? null : new AttachedEntityId(routingRuleEntityAdapter, routingRule.getIdentity());
  entity.setRoutingRuleId(routingRuleId);

  entity.setRecipeName(recipeName);
  entity.setRepositoryName(repositoryName);
  entity.setOnline(online);
  entity.setAttributes(decrypt(attributes));
}
 
Example #4
Source File: SchemaInstallerTest.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
@Override
public void onInitialize(OrienteerWebApplication app, ODatabaseDocument db) {
	OSchemaHelper helper = OSchemaHelper.bind(db);
	helper.oClass(TEST_OCLASS);
	UIVisualizersRegistry registry = app.getUIVisualizersRegistry();
	for(OType type: OType.values())
	{
		if(type == OType.LINKBAG) continue;
		helper.oProperty(type.name().toLowerCase(), type);
		if(type.isLink()) helper.linkedClass(TEST_OCLASS);
		for(String vizualization : registry.getComponentsOptions(type))
		{
			helper.oProperty(type.name().toLowerCase()+vizualization, type).assignVisualization(vizualization);
			if(type.isLink()) helper.linkedClass(TEST_OCLASS);
		}
	}
}
 
Example #5
Source File: OrienteerUsersModule.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
private OClass updateUserOClass(OSchemaHelper helper) {
    helper.oClass(OUser.CLASS_NAME)
            .oProperty(OrienteerUser.PROP_ID, OType.STRING).notNull()
                .updateCustomAttribute(CustomAttribute.UI_READONLY, true)
            .oProperty(OrienteerUser.PROP_RESTORE_ID, OType.STRING)
                .updateCustomAttribute(CustomAttribute.UI_READONLY, true)
                .updateCustomAttribute(REMOVE_CRON_RULE, "0 0/1 * * * ?")
                .updateCustomAttribute(REMOVE_SCHEDULE_START_TIMEOUT, "86400000")
            .oProperty(OrienteerUser.PROP_RESTORE_ID_CREATED, OType.DATETIME)
                .updateCustomAttribute(CustomAttribute.UI_READONLY, true)
            .oProperty(OrienteerUser.PROP_EMAIL, OType.STRING)
                .set(OProperty.ATTRIBUTES.COLLATE, "ci")
            .oProperty(OrienteerUser.PROP_FIRST_NAME, OType.STRING)
            .oProperty(OrienteerUser.PROP_LAST_NAME, OType.STRING)
            .oProperty(OrienteerUser.PROP_SOCIAL_NETWORKS, OType.LINKLIST, 0)
                .assignTab(TAB_SOCIAL_NETWORKS)
                .assignVisualization(UIVisualizersRegistry.VISUALIZER_TABLE);

    helper.setupRelationship(OrienteerUser.CLASS_NAME, OrienteerUser.PROP_SOCIAL_NETWORKS, OUserSocialNetwork.CLASS_NAME, OUserSocialNetwork.PROP_USER);

    return helper.getOClass();
}
 
Example #6
Source File: LuceneListIndexing.java    From orientdb-lucene with Apache License 2.0 6 votes vote down vote up
@BeforeClass
public void init() {
  initDB();

  OSchema schema = databaseDocumentTx.getMetadata().getSchema();
  OClass oClass = schema.createClass("City");

  OClass person = schema.createClass("Person");

  person.createProperty("name", OType.STRING);
  person.createProperty("tags", OType.EMBEDDEDLIST, OType.STRING);

  oClass.createProperty("name", OType.STRING);
  oClass.createProperty("tags", OType.EMBEDDEDLIST, OType.STRING);

  databaseDocumentTx.command(new OCommandSQL("create index City.tags on City (tags) FULLTEXT ENGINE LUCENE")).execute();

  databaseDocumentTx.command(new OCommandSQL("create index Person.name_tags on Person (name,tags) FULLTEXT ENGINE LUCENE"))
      .execute();
}
 
Example #7
Source File: OrientDbLoader.java    From nextreports-server with Apache License 2.0 6 votes vote down vote up
protected void createProperties(Row row) {
    OClass clazz;
    if (className != null) {
        clazz = getOrCreateClass(className);
    } else {
        clazz = ((ODocument) row.getPayload()).getSchemaClass();
    }

    int count = row.getFieldCount();
    for (int i = 0; i < count; i++) {
        String fieldName = row.getFieldName(i);
        OProperty property = clazz.getProperty(fieldName);
        if (property == null) {
            OType type = OType.getTypeByClass(row.getFieldType(i));
            try {
                clazz.createProperty(fieldName, type);
            } catch (OSchemaException e) {
                log.error(e.getMessage(), e);
            }

            log.debug("Created property '{}' of type '{}'", fieldName, type);
        }
    }
}
 
Example #8
Source File: JsonUtil.java    From Orienteer with Apache License 2.0 6 votes vote down vote up
private static OArchitectOProperty convertOPropertyFromJson(JSONObject jsonObject) {
    String name = !jsonObject.isNull(NAME) ? jsonObject.getString(NAME) : null;
    OType type = !jsonObject.isNull(TYPE) ? OType.valueOf(jsonObject.getString(TYPE)) : null;
    OArchitectOProperty property = null;
    if (!Strings.isNullOrEmpty(name) && type != null) {
        property = new OArchitectOProperty(name, type);
        if (!jsonObject.isNull(SUBCLASS_PROPERTY)) {
            String subClassProperty = jsonObject.getString(SUBCLASS_PROPERTY);
            property.setSubClassProperty(subClassProperty.equals("1") || subClassProperty.equals("true"));
        }
        if (!jsonObject.isNull(LINKED_CLASS_NAME)) {
            property.setLinkedClass(jsonObject.getString(LINKED_CLASS_NAME));
        }
        if (!jsonObject.isNull(ORDER)) {
            property.setOrder(jsonObject.getInt(ORDER));
        }
        if (!jsonObject.isNull(INVERSE_PROPERY_ENABLE)) {
            property.setInversePropertyEnable(jsonObject.getBoolean(INVERSE_PROPERY_ENABLE));
            if (!jsonObject.isNull(INVERSE_PROPERTY)) {
                property.setInverseProperty(convertInverseProperty(jsonObject.getJSONObject(INVERSE_PROPERTY)));
            }
        }
    }
    return property;
}
 
Example #9
Source File: LegacyKeyStoreUpgradeService.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
public void upgradeSchema() throws Exception {
  log.debug("Updgrading schema for trust store");
  try (ODatabaseDocumentTx db = databaseInstance.get().connect()) {
    OSchema schema = db.getMetadata().getSchema();
    OClass type = schema.getClass(DB_CLASS);
    if (type == null) {
      type = schema.createClass(DB_CLASS);
      type.createProperty(P_NAME, OType.STRING).setMandatory(true).setNotNull(true);
      type.createProperty(P_BYTES, OType.BINARY).setMandatory(true).setNotNull(true);
      type.createIndex(I_NAME, INDEX_TYPE.UNIQUE, P_NAME);
      log.debug("Created schema type {}: properties={}, indexes={}", type, type.properties(), type.getIndexes());
    }
    else {
      // NOTE: Upgrade steps run on each node but within a cluster, another node might already have upgraded the db
      log.debug("Skipped creating existing schema type {}: properties={}, indexes={}", type, type.properties(),
          type.getIndexes());
    }
  }
}
 
Example #10
Source File: OEdgeTransformerTest.java    From orientdb-etl with Apache License 2.0 6 votes vote down vote up
@Override
public void setUp() {
  OGlobalConfiguration.USE_WAL.setValue(true);

  super.setUp();
  final OrientVertexType v1 = graph.createVertexType("V1");
  final OrientVertexType v2 = graph.createVertexType("V2");

  final OrientEdgeType edgeType = graph.createEdgeType("Friend");
  edgeType.createProperty("in", OType.LINK, v2);
  edgeType.createProperty("out", OType.LINK, v1);

  // ASSURE NOT DUPLICATES
  edgeType.createIndex("out_in", OClass.INDEX_TYPE.UNIQUE, "in", "out");

  graph.addVertex("class:V2").setProperty("name", "Luca");
  graph.commit();
}
 
Example #11
Source File: TaskEntityHandler.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
    public void applySchema(OSchemaHelper helper) {
        super.applySchema(helper);
        helper.oProperty("name", OType.STRING, 20).markAsDocumentName().markDisplayable()
                .oProperty("parentTask", OType.LINK, 30).assignVisualization("listbox")
                .oProperty("childTasks", OType.LINKLIST, 31).assignVisualization("table")
                .oProperty("description", OType.STRING, 40).markDisplayable()
                .oProperty("priority", OType.INTEGER, 50).markDisplayable()
                .oProperty("createTime", OType.DATETIME, 60).markDisplayable()
                .oProperty("owner", OType.LINK, 70).markDisplayable()
                .oProperty("assignee", OType.LINK, 80).markDisplayable()
                .oProperty("delegationStateString", OType.STRING, 90)
                .oProperty("execution", OType.LINK, 100).assignVisualization("listbox")
                .oProperty("processInstance", OType.LINK, 110).markAsLinkToParent().markDisplayable()
                .oProperty("processDefinition", OType.LINK, 120)
                .oProperty("caseExecutionId", OType.STRING, 130)
                .oProperty("caseInstanceId", OType.STRING, 140)
                .oProperty("caseDefinitionId", OType.STRING, 150)
                .oProperty("taskDefinitionKey", OType.STRING, 160)
                .oProperty("dueDate", OType.DATETIME, 170).markDisplayable()
                .oProperty("followUpDate", OType.DATETIME, 180).markDisplayable()
                .oProperty("suspensionState", OType.INTEGER, 190)
                .oProperty("variables", OType.LINKLIST, 200).assignVisualization("table")
                .oProperty("candidatesIdentityLinks", OType.LINKLIST, 200).assignVisualization("table")
        	                    .defaultTab("form")
                .oProperty("historyActivityInstances", OType.LINKLIST, 210).assignVisualization("table")
                .oProperty("historyCaseActivityEventInstances", OType.LINKLIST, 220).assignVisualization("table")
                .oProperty("historyDetailEvents", OType.LINKLIST, 230).assignVisualization("table")
                .oProperty("historicProcessInstances", OType.LINKLIST, 240).assignVisualization("table")
                .oProperty("historyVariableInstances", OType.LINKLIST, 250).assignVisualization("table")
                .oProperty("userOperationLogEntryEvents", OType.LINKLIST, 260).assignVisualization("table");
//                .oProperty("tenantId", OType.STRING, 200); // Tenants are not supported
    }
 
Example #12
Source File: LuceneInsertUpdateTransactionTest.java    From orientdb-lucene with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public void init() {
  initDB();
  OSchema schema = databaseDocumentTx.getMetadata().getSchema();

  if (schema.getClass("City") == null) {
    OClass oClass = schema.createClass("City");
    oClass.createProperty("name", OType.STRING);
  }
  databaseDocumentTx.command(new OCommandSQL("create index City.name on City (name) FULLTEXT ENGINE LUCENE")).execute();

}
 
Example #13
Source File: TriggerEntityAdapter.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void defineType(final OClass type) {
  super.defineType(type);

  type.createProperty(P_NAME, OType.STRING)
      .setMandatory(true)
      .setNotNull(true);
  type.createProperty(P_GROUP, OType.STRING)
      .setMandatory(true)
      .setNotNull(false); // nullable
  type.createProperty(P_JOB_NAME, OType.STRING)
      .setMandatory(true)
      .setNotNull(true);
  type.createProperty(P_JOB_GROUP, OType.STRING)
      .setMandatory(true)
      .setNotNull(false); // nullable
  type.createProperty(P_CALENDAR_NAME, OType.STRING)
      .setMandatory(true)
      .setNotNull(false); // nullable
  type.createProperty(P_STATE, OType.STRING)
      .setMandatory(true)
      .setNotNull(true);

  type.createIndex(I_NAME_GROUP, INDEX_TYPE.UNIQUE, P_NAME, P_GROUP);
  type.createIndex(I_JOB_NAME_JOB_GROUP, INDEX_TYPE.NOTUNIQUE, P_JOB_NAME, P_JOB_GROUP);
  type.createIndex(I_CALENDAR_NAME, INDEX_TYPE.NOTUNIQUE, P_CALENDAR_NAME);
  type.createIndex(I_STATE, INDEX_TYPE.NOTUNIQUE, P_STATE);
}
 
Example #14
Source File: UIVisualizersRegistry.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
public void registerUIComponentFactory(IVisualizer visualizer)
{
	for(OType oType : visualizer.getSupportedTypes())
	{
		registryTable.put(oType, visualizer.getName(), visualizer);
	}
}
 
Example #15
Source File: ContentStore.java    From jbake with MIT License 5 votes vote down vote up
private void createDocType(final OSchema schema, final String docType) {
    logger.debug("Create document class '{}'", docType);


    OClass page = schema.createClass(docType);

    // Primary key
    String attribName = DocumentAttributes.SOURCE_URI.toString();
    page.createProperty(attribName, OType.STRING).setNotNull(true);
    page.createIndex(docType + "sourceUriIndex", OClass.INDEX_TYPE.UNIQUE, attribName);

    attribName = DocumentAttributes.SHA1.toString();
    page.createProperty(attribName, OType.STRING).setNotNull(true);
    page.createIndex(docType + "sha1Index", OClass.INDEX_TYPE.NOTUNIQUE, attribName);

    attribName = DocumentAttributes.CACHED.toString();
    page.createProperty(attribName, OType.BOOLEAN).setNotNull(true);
    page.createIndex(docType + "cachedIndex", OClass.INDEX_TYPE.NOTUNIQUE, attribName);

    attribName = DocumentAttributes.RENDERED.toString();
    page.createProperty(attribName, OType.BOOLEAN).setNotNull(true);
    page.createIndex(docType + "renderedIndex", OClass.INDEX_TYPE.NOTUNIQUE, attribName);

    attribName = DocumentAttributes.STATUS.toString();
    page.createProperty(attribName, OType.STRING).setNotNull(true);
    page.createIndex(docType + "statusIndex", OClass.INDEX_TYPE.NOTUNIQUE, attribName);
}
 
Example #16
Source File: OrientCPrivilegeEntityAdapter.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void readFields(final ODocument document, final OrientCPrivilege entity) throws Exception {
  entity.setId(document.<String>field(P_ID, OType.STRING));
  entity.setName(document.<String>field(P_NAME, OType.STRING));
  entity.setDescription(document.<String>field(P_DESCRIPTION, OType.STRING));
  entity.setType(document.<String>field(P_TYPE, OType.STRING));
  entity.setReadOnly(false);
  entity.setProperties(Maps.newHashMap(document.<Map<String, String>>field(P_PROPERTIES, OType.EMBEDDEDMAP)));

  entity.setVersion(document.getVersion());
}
 
Example #17
Source File: OrientCUserRoleMappingEntityAdapter.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void readFields(final ODocument document, final OrientCUserRoleMapping entity) throws Exception {
  entity.setUserId(document.<String>field(P_USER_ID, OType.STRING));
  entity.setSource(document.<String>field(P_SOURCE, OType.STRING));
  entity.setRoles(Sets.newHashSet(document.<Set<String>>field(P_ROLES, OType.EMBEDDEDSET)));

  entity.setVersion(String.valueOf(document.getVersion()));
}
 
Example #18
Source File: OrientCRoleEntityAdapter.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void readFields(final ODocument document, final OrientCRole entity) throws Exception {
  entity.setId(document.<String>field(P_ID, OType.STRING));
  entity.setName(document.<String>field(P_NAME, OType.STRING));
  entity.setDescription(document.<String>field(P_DESCRIPTION, OType.STRING));
  entity.setPrivileges(Sets.newHashSet(document.<Set<String>>field(P_PRIVILEGES, OType.EMBEDDEDSET)));
  entity.setRoles(Sets.newHashSet(document.<Set<String>>field(P_ROLES, OType.EMBEDDEDSET)));
  entity.setReadOnly(false);

  entity.setVersion(document.getVersion());
}
 
Example #19
Source File: ImportDataFromJson.java    From orientdb-lucene with Apache License 2.0 5 votes vote down vote up
protected void importGeometry(ODatabaseDocumentTx db, String file, final String clazz, String geomClazz) throws IOException {

    OClass points = db.getMetadata().getSchema().createClass(clazz);
    points.createProperty("geometry", OType.EMBEDDED, db.getMetadata().getSchema().getClass(geomClazz));
    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    OIOUtils.copyStream(new FileInputStream(new File(file)), out, -1);
    ODocument doc = new ODocument().fromJSON(out.toString(), "noMap");
    List<ODocument> collection = doc.field("collection");

//    OShapeFactory builder = OShapeFactory.INSTANCE;

    final AtomicLong atomicLong = new AtomicLong(0);

    TimerTask task = new TimerTask() {
      @Override
      public void run() {
        OLogManager.instance().info(this, clazz + " per second [%d]", atomicLong.get());
        atomicLong.set(0);
      }
    };
    Orient.instance().scheduleTask(task, 1000, 1000);
    for (ODocument entries : collection) {
      ODocumentInternal.removeOwner(entries, doc);
      ODocumentInternal.removeOwner(entries, (ORecordElement) collection);
      entries.setClassName(clazz);
      String wkt = entries.field("GeometryWkt");
      try {
//        ODocument location = builder.toDoc(wkt);
//        entries.field("geometry", location, OType.EMBEDDED);
//        db.save(entries);
//
//        atomicLong.incrementAndGet();
      } catch (Exception e) {

      }
    }
    task.cancel();
  }
 
Example #20
Source File: EventSubscriptionEntityHandler.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
public void applySchema(OSchemaHelper helper) {
	super.applySchema(helper);
	helper.domain(OClassDomain.SYSTEM);
	helper.oProperty("eventType", OType.STRING, 10)
		  .oProperty("eventName", OType.STRING, 20)
		  .oProperty("execution", OType.LINK, 30).assignVisualization("listbox")
		  .oProperty("processInstanceId", OType.STRING, 40)
		  .oProperty("activityId", OType.STRING, 50)
		  .oProperty("configuration", OType.STRING, 60)
		  .oProperty("created", OType.DATETIME, 70);
}
 
Example #21
Source File: OrientAnonymousConfigurationEntityAdapter.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void readFields(final ODocument document, final OrientAnonymousConfiguration entity) {
  boolean enabled = document.field(P_ENABLED, OType.BOOLEAN);
  String userId = document.field(P_USER_ID, OType.STRING);
  String realmName = document.field(P_REALM_NAME, OType.STRING);

  entity.setEnabled(enabled);
  entity.setUserId(userId);
  entity.setRealmName(realmName);
}
 
Example #22
Source File: OrientCapabilityStorageItemEntityAdapter.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void defineType(final OClass type) {
  type.createProperty(P_VERSION, OType.INTEGER);
  type.createProperty(P_TYPE, OType.STRING);
  type.createProperty(P_ENABLED, OType.BOOLEAN);
  type.createProperty(P_NOTES, OType.STRING);
  type.createProperty(P_PROPERTIES, OType.EMBEDDEDMAP);
}
 
Example #23
Source File: ModuledDataInstallator.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
protected void updateOModuleSchema(ODatabaseDocument db) {
	OSchemaHelper helper = OSchemaHelper.bind(db);
	helper.oClass(IOrienteerModule.OMODULE_CLASS)
			.oProperty(IOrienteerModule.OMODULE_NAME, OType.STRING, 0).markDisplayable().markAsDocumentName()
			.oProperty(IOrienteerModule.OMODULE_VERSION, OType.INTEGER, 10).markDisplayable()
			.oProperty(IOrienteerModule.OMODULE_ACTIVATE, OType.BOOLEAN, 20).markDisplayable().defaultValue("true");
	db.command(new OCommandSQL("update "+IOrienteerModule.OMODULE_CLASS+" set "+IOrienteerModule.OMODULE_ACTIVATE+" = true where "+
									IOrienteerModule.OMODULE_ACTIVATE +" is null")).execute();
}
 
Example #24
Source File: OrientEmailConfigurationEntityAdapter.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void defineType(final OClass type) {
  type.createProperty(P_ENABLED, OType.BOOLEAN);
  type.createProperty(P_HOST, OType.STRING);
  type.createProperty(P_PORT, OType.INTEGER);
  type.createProperty(P_USERNAME, OType.STRING);
  type.createProperty(P_PASSWORD, OType.STRING);
  type.createProperty(P_FROM_ADDRESS, OType.STRING);
  type.createProperty(P_SUBJECT_PREFIX, OType.STRING);
  type.createProperty(P_START_TLS_ENABLED, OType.BOOLEAN);
  type.createProperty(P_START_TLS_REQUIRED, OType.BOOLEAN);
  type.createProperty(P_SSL_ON_CONNECT_ENABLED, OType.BOOLEAN);
  type.createProperty(P_SSL_CHECK_SERVER_IDENTITY_ENABLED, OType.BOOLEAN);
  type.createProperty(P_NEXUS_TRUST_STORE_ENABLED, OType.BOOLEAN);
}
 
Example #25
Source File: BucketEntityAdapter.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void readFields(final ODocument document, final Bucket entity) {
  String repositoryName = document.field(P_REPOSITORY_NAME, OType.STRING);
  Map<String, Object> attributes = document.field(P_ATTRIBUTES, OType.EMBEDDEDMAP);

  entity.setRepositoryName(repositoryName);
  entity.attributes(new NestedAttributesMap(P_ATTRIBUTES, detachable(attributes)));
}
 
Example #26
Source File: OrientRoutingRuleEntityAdapter.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void defineType(final OClass type) {
  type.createProperty(P_DESCRIPTION, OType.STRING).setMandatory(true).setNotNull(true);
  type.createProperty(P_NAME, OType.STRING).setMandatory(true).setNotNull(true);
  type.createProperty(P_MATCHERS, OType.EMBEDDEDLIST).setMandatory(true).setNotNull(true);
  type.createProperty(P_MODE, OType.STRING).setMandatory(true).setNotNull(true);
}
 
Example #27
Source File: AuthorizationEntityHandler.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
public void applySchema(OSchemaHelper helper) {
    super.applySchema(helper);

    helper.oProperty("authorizationType", OType.INTEGER, 10)
            .oProperty("groupId", OType.STRING, 20)
            .oProperty("userId", OType.STRING, 30)
            .oProperty("resourceType", OType.INTEGER, 40)
            .oProperty("resourceId", OType.STRING, 50)
            .oProperty("permission", OType.INTEGER, 60);
}
 
Example #28
Source File: PlantUmlService.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
public void describe(Writer writer, OProperty oProperty)
{
	PrintWriter out = toPrintWriter(writer);
	OType type = oProperty.getType();
	String min = oProperty.getMin();
	String max = oProperty.getMax();
	String range = null;
	
	if(min!=null || max!=null)
	{
		range = Objects.equal(min, max)?min:(min!=null?min:"0")+".."+(max!=null?max:"*");
	}
	else if(type.isMultiValue())
	{
		range = "*";
	}
	
	boolean isEmbedded = type.equals(OType.EMBEDDED) || type.equals(OType.EMBEDDEDLIST) 
			|| type.equals(OType.EMBEDDEDMAP) || type.equals(OType.EMBEDDEDSET);
	
	if(oProperty.getLinkedClass()!=null
			&& (isEmbedded || type.isLink()))
	{
		out.append(oProperty.getOwnerClass().getName());
		if(isEmbedded) out.append("\"1\" *-- ");
		else out.append(" -> ");
		if(range!=null) out.append('"').append(range).append("\" ");
		out.append(oProperty.getLinkedClass().getName());
		out.append(" : ").append(oProperty.getName());
	}
	else
	{
		out.append(oProperty.getOwnerClass().getName())
			.append(" : ")
			.append(oProperty.getName()).append(" : ").append(type.name());
	}
	out.println();
}
 
Example #29
Source File: ResourceEntityHandler.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
public void applySchema(OSchemaHelper helper) {
	super.applySchema(helper);
	helper.oProperty("name", OType.STRING, 0).markAsDocumentName().markDisplayable()
		  .oProperty("deployment", OType.LINK, 10).assignVisualization("listbox").markDisplayable()
		  .oProperty("bytes", OType.BINARY, 20)
		  .oProperty("generated", OType.BOOLEAN, 40).defaultValue("true").notNull();
}
 
Example #30
Source File: AssetEntityAdapter.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void readFields(final ODocument document, final Asset entity) {
  super.readFields(document, entity);

  ORID componentId = document.field(P_COMPONENT, ORID.class);
  String name = document.field(P_NAME, OType.STRING);
  Long size = document.field(P_SIZE, OType.LONG);
  String contentType = document.field(P_CONTENT_TYPE, OType.STRING);
  String blobRef = document.field(P_BLOB_REF, OType.STRING);
  Date lastDownloaded = document.field(P_LAST_DOWNLOADED, OType.DATETIME);
  Date blobCreated = document.field(P_BLOB_CREATED, OType.DATETIME);
  Date blobUpdated = document.field(P_BLOB_UPDATED, OType.DATETIME);
  String createdBy = document.field(P_CREATED_BY, OType.STRING);
  String createdByIp = document.field(P_CREATED_BY_IP, OType.STRING);

  if (componentId != null) {
    entity.componentId(new AttachedEntityId(componentEntityAdapter, componentId));
  }
  entity.name(name);
  entity.size(size);
  entity.contentType(contentType);
  entity.createdBy(createdBy);
  entity.createdByIp(createdByIp);
  if (blobRef != null) {
    entity.blobRef(BlobRef.parse(blobRef));
  }
  if (lastDownloaded != null) {
    entity.lastDownloaded(new DateTime(lastDownloaded));
  }
  if (blobCreated != null) {
    entity.blobCreated(new DateTime(blobCreated));
  }
  if (blobUpdated != null) {
    entity.blobUpdated(new DateTime(blobUpdated));
  }
}