You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@usergrid.apache.org by shawnfeldman <gi...@git.apache.org> on 2015/07/27 23:21:36 UTC

[GitHub] incubator-usergrid pull request: move to single map converter code...

GitHub user shawnfeldman opened a pull request:

    https://github.com/apache/incubator-usergrid/pull/323

    move to single map converter codebase.  

    location fields: convert to lat lon for ES otherwise its latitude longitude

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-usergrid USERGRID-880

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-usergrid/pull/323.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #323
    
----
commit ab059f64990a030bbe2a079b80850a3c2ca3f263
Author: Shawn Feldman <sf...@apache.org>
Date:   2015-07-27T21:20:15Z

    convert to lat lon for ES otherwise its latitude longitude

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-usergrid pull request: move to single map converter code...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-usergrid/pull/323


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-usergrid pull request: move to single map converter code...

Posted by shawnfeldman <gi...@git.apache.org>.
Github user shawnfeldman commented on a diff in the pull request:

    https://github.com/apache/incubator-usergrid/pull/323#discussion_r35879482
  
    --- Diff: stack/core/src/main/java/org/apache/usergrid/corepersistence/util/CpEntityMapUtils.java ---
    @@ -160,217 +101,8 @@ public static Entity fromMap(
          */
         public static Map toMap(EntityObject entity) {
     
    -        Map<String, Object> entityMap = new TreeMap<>();
    -
    -        for (Object f : entity.getFields().toArray()) {
    -            Field field = (Field) f;
    -
    -            if (f instanceof ListField || f instanceof ArrayField) {
    -                List list = (List) field.getValue();
    -                entityMap.put(field.getName(),
    -                        new ArrayList( processCollectionForMap(list)));
    -
    -            } else if (f instanceof SetField) {
    -                Set set = (Set) field.getValue();
    -                entityMap.put(field.getName(),
    -                        new ArrayList( processCollectionForMap(set)));
    -
    -            } else if (f instanceof EntityObjectField) {
    -                EntityObject eo = (EntityObject) field.getValue();
    -                entityMap.put( field.getName(), toMap(eo)); // recursion
    -
    -            } else if (f instanceof StringField) {
    -                entityMap.put(field.getName(), ((String) field.getValue()));
    -
    -            } else if (f instanceof LocationField) {
    -                LocationField locField = (LocationField) f;
    -                Map<String, Object> locMap = new HashMap<String, Object>();
    -
    -                // field names lat and lon trigger ElasticSearch geo location
    -                locMap.put("lat", locField.getValue().getLatitude());
    -                locMap.put("lon", locField.getValue().getLongitude());
    -                entityMap.put( field.getName(), field.getValue());
    --- End diff --
    
    serializes wrong value


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---