Package org.structr.core.property

Examples of org.structr.core.property.PropertyKey


      Map<Field, PropertyKey> allProperties = getFieldValuesOfType(PropertyKey.class, type);
      Map<Field, View> views = getFieldValuesOfType(View.class, type);

      for (Map.Entry<Field, PropertyKey> entry : allProperties.entrySet()) {

        PropertyKey propertyKey = entry.getValue();
        Field field = entry.getKey();
        Class declaringClass = field.getDeclaringClass();

        if (declaringClass != null) {

          propertyKey.setDeclaringClass(declaringClass);
          registerProperty(declaringClass, propertyKey);

        }

        registerProperty(type, propertyKey);
View Full Code Here


  @Override
  public PropertyKey getPropertyKeyForDatabaseName(Class type, String dbName, boolean createGeneric) {

    Map<String, PropertyKey> classDBNamePropertyMap = getClassDBNamePropertyMapForType(type);
    PropertyKey key = classDBNamePropertyMap.get(dbName);

    if (key == null) {

      // first try: uuid
      if (GraphObject.id.dbName().equals(dbName)) {
View Full Code Here

    if (jsonName == null) {
      return null;
    }

    Map<String, PropertyKey> classJSNamePropertyMap = getClassJSNamePropertyMapForType(type);
    PropertyKey key = classJSNamePropertyMap.get(jsonName);

    if (key == null) {

      // first try: uuid
      if (GraphObject.id.dbName().equals(jsonName)) {
View Full Code Here

        Iterable<PropertyKey> keys = source.getPropertyKeys(localPropertyView);
        if (keys != null) {
          for (PropertyKey key : keys) {

            Object value = source.getProperty(key);
            PropertyKey localKey = key;

            if (localKey.equals(idProperty)) {

              localKey = id;
            }

            if (value != null) {

              jsonObject.add(localKey.jsonName(), serializeProperty(key, value, localPropertyView, depth+1));

            } else {

              jsonObject.add(localKey.jsonName(), null);
            }
          }
        }
      }
View Full Code Here

      } else {

        for (Entry<PropertyKey, Object> entry : source.entrySet()) {

          PropertyKey key = entry.getKey();
          if (key.equals(idProperty)) {

            key = id;
          }

          Object value = entry.getValue();

          object.add(key.jsonName(), serializeProperty(key, value, localPropertyView, depth));
        }
      }

      return object;
    }
View Full Code Here

    if (obj != null && objToRemove != null) {

      try {

        PropertyKey key = StructrApp.getConfiguration().getPropertyKeyForJSONName(obj.getClass(), keyString);
        if (key != null) {

          List collection = (List) obj.getProperty(key);
          collection.remove(objToRemove);
          obj.setProperty(key, collection);
View Full Code Here

        tx.success();
      }

      SecurityContext publicContext = SecurityContext.getInstance(null, AccessMode.Frontend);

      PropertyKey sortKey = AbstractNode.name;
      boolean sortDesc    = false;
      int pageSize        = 2;
      int page            = 1;

      try (final Tx tx = app.tx()) {
View Full Code Here

       
        Result result = app.nodeQuery(type).getResult();

        assertEquals(number, result.size());

        PropertyKey sortKey = AbstractNode.name;
        boolean sortDesc    = false;
        int pageSize        = 10;
        int page            = 1;

        result = app.nodeQuery(type).sort(sortKey).order(sortDesc).page(page).pageSize(pageSize).getResult();
View Full Code Here

       
        Result result = app.nodeQuery(type).getResult();

        assertEquals(number, result.size());

        PropertyKey sortKey = AbstractNode.name;
        boolean sortDesc    = true;
        int pageSize        = 10;
        int page            = 1;

        result = app.nodeQuery(type).sort(sortKey).order(sortDesc).page(page).pageSize(pageSize).getResult();
View Full Code Here

       
        Result result = app.nodeQuery(type).getResult();

        assertEquals(number, result.size());

        PropertyKey sortKey = TestOne.aDate;
        boolean sortDesc    = false;
        int pageSize        = 10;
        int page            = 1;

        result = app.nodeQuery(type).sort(sortKey).order(sortDesc).page(page).pageSize(pageSize).getResult();
View Full Code Here

TOP

Related Classes of org.structr.core.property.PropertyKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.