标签: usergrid

使用Usergrid如何获得嵌套在单个json中的相关实体,而不仅仅是它们的链接

当我查询/mycollections?ql=Select * where name='dfsdfsdfsdfsdfsdf'我得到

{
  "action" : "get",
  "application" : "859e6180-de8a-11e4-9360-f1aabbc15f58",
  "params" : {
    "ql" : [ "Select * where name='dfsdfsdfsdfsdfsdf'" ]
  },
  "path" : "/mycollections",
  "uri" : "http://localhost:8080/myorg/myapp/mycollections",
  "entities" : [ {
    "uuid" : "2ff8961a-dea8-11e4-996b-63ce373ace35",
    "type" : "mycollection",
    "name" : "dfsdfsdfsdfsdfsdf",
    "created" : 1428577466865,
    "modified" : 1428577466865,
    "metadata" : {
      "path" : "/mycollections/2ff8961a-dea8-11e4-996b-63ce373ace35",
      "connections" : {
        "relations" : "/mycollections/2ff8961a-dea8-11e4-996b-63ce373ace35/relations"
      }
    }
  } ],
  "timestamp" : 1428589309204,
  "duration" : 53,
  "organization" : "myorg",
  "applicationName" : "myapp",
  "count" : …
Run Code Online (Sandbox Code Playgroud)

apigee usergrid

7
推荐指数
1
解决办法
185
查看次数

将图像(png文件)添加到使用R创建的pdf文件的标题中

我正在尝试将.png图像(徽标)添加到使用ggplot创建的图形的pdf报告的标题中并打印到pdf.

我找到了以下示例如何将图像添加到ggplot图中.但是,我希望将.png图像添加到ggplot区域之外的pdf标题中.

#-------------------------------------------------------------------------------
#  Example png file
#-------------------------------------------------------------------------------
library(reshape2)
library(png)
mypngfile = download.file('http://api.altmetric.com/donut/502878_64x64.png', 
                           destfile = 'mypng.png', mode = 'wb')
mypng = readPNG('mypng.png')

#-------------------------------------------------------------------------------
# create example plot using mtcars data frame from ggplot
#-------------------------------------------------------------------------------
library(ggplot2)
p.example = qplot(mpg, wt, data = mtcars) + 
  annotation_raster(mypng, ymin = 4.5, ymax= 5, xmin = 30, xmax = 35)

#-------------------------------------------------------------------------------
# print to pdf file with footnote
#-------------------------------------------------------------------------------
fname = "C:/temp/my report.pdf"
pdf(fname, 10.75, 6.5, onefile=TRUE, paper="a4r")
print(p.example)
dev.off()
Run Code Online (Sandbox Code Playgroud)

...产生一个如下所示的pdf:

在此输入图像描述

但是,我希望图像显示在ggplot区域之外 …

pdf graphics r ggplot2 usergrid

6
推荐指数
1
解决办法
1459
查看次数

Apigee Usergrid:缺少批量删除选项

我使用usergrid来存储客户项目的数据.它有两个系列carShowrooms和汽车.到目前为止,我很好.但我有一个场景,我已经刷新了收集车的masterdata.每次我这样做,我都必须删除汽车中的所有现有数据,并将其替换为主库存系统中的传入汽车数据.

现在,通过https://www.npmjs.org/package/usergrid中的文档 ,我发现我一次只能销毁一辆汽车.

car.destroy(function(err){
    if (err){
        //error - car not deleted
        //winston log - tbd
    } else {
        //success - car deleted
    }
});
Run Code Online (Sandbox Code Playgroud)

这对于较小的陈列室来说是好的,但更大的多品牌陈列室有各种各样的汽车 - 有时甚至多达50种不同的品种(8个汽车品牌*大约8种不同的选择).

有批量删除选项吗?如果我在这里遗漏了什么,有人可以指点我.

PS我是usergrid的新手,如果这是一个重复的问题,请标记并指出我正确的网址

javascript node.js apigee usergrid

4
推荐指数
1
解决办法
309
查看次数

无法使用python-requests发布文件+数据

我可以使用curl发布文件

curl -X POST -i -F name='barca' -F country='spain' -F 
file=@/home/messi/Desktop/barca.png 'http://localhost:8080/new_org/hel/concerts'
Run Code Online (Sandbox Code Playgroud)

我可以得到(文件)

 curl -X GET -H 'Accept: image/png' 'http://localhost:8080/new_org/hel/concerts/<id or name of entity>'
Run Code Online (Sandbox Code Playgroud)

但是当我尝试使用同样的东西时requests.post,我得到了错误.有人知道为什么会这样吗?(当文件指针不在最后时遇到错误,但是当文件指针终止时,我得到了响应200但是没有发布文件)

import requests
url = 'http://localhost:8080/new_org/hel/concerts'
file = dict(file=open('/home/messi/Desktop/barca.png', 'rb'))
data = dict(name='barca', country='spain')
response = requests.post(url, files=file, data=data)
Run Code Online (Sandbox Code Playgroud)

错误:(来自usergrid)响应代码:400

{u'duration': 0,
 u'error': u'illegal_argument',
 u'error_description': u'value is null',
 u'exception': u'java.lang.IllegalArgumentException',
 u'timestamp': 1448330119021}
Run Code Online (Sandbox Code Playgroud)

https://github.com/apache/usergrid

python curl python-requests usergrid apigee-baas

3
推荐指数
1
解决办法
3159
查看次数

Usergrid构建错误

当我正在尝试构建Usergrid时,我遇到了以下错误.

[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.752 s
[INFO] Finished at: 2015-12-16T01:02:23+03:30
[INFO] Final Memory: 20M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project usergrid-rest: Could not resolve depen
dencies for project org.apache.usergrid:usergrid-rest:war:2.1.1-SNAPSHOT: Failur
e to find org.apache.usergrid:usergrid-java-client:jar:0.0.10-SNAPSHOT in file:/
/C:\usergrid-master\stack\rest/../m2/repository was cached in the local reposito
ry, resolution will not be reattempted until the update interval of local-depend
encies has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the …
Run Code Online (Sandbox Code Playgroud)

mbaas usergrid

0
推荐指数
1
解决办法
506
查看次数