prakash1986 / rapla

Automatically exported from code.google.com/p/rapla
0 stars 0 forks source link

wrong parameter name in RestApiExample.java for resource query #433

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
on line 126
resourceTypes= must be resource=

not working:
URL methodURL =new URL(baseUrl,"resources?resourceTypes="+ resourceTypes+  
"&attributeFilter="+attributeFilter);

correct working:
URL methodURL =new URL(baseUrl,"resources?resource="+ resourceTypes+  
"&attributeFilter="+attributeFilter);

Original issue reported on code.google.com by pdien...@gmail.com on 21 Aug 2014 at 1:45

GoogleCodeExporter commented 9 years ago
I thought it was the parameter name, but the parameter name is correct
it seems that the query does not work with the resourceType given, i get all 
resources back no matter what i fillin.

Original comment by pdien...@gmail.com on 21 Aug 2014 at 2:29

GoogleCodeExporter commented 9 years ago

Original comment by christop...@gmail.com on 23 Aug 2014 at 11:21

GoogleCodeExporter commented 9 years ago
can't reproduce, can you attach a sample data.xml and the query you tested?

Original comment by christop...@gmail.com on 24 Aug 2014 at 3:00

GoogleCodeExporter commented 9 years ago
I have attached the sample data and PDF explaining what I've done

Original comment by pdien...@gmail.com on 25 Aug 2014 at 8:05

Attachments:

GoogleCodeExporter commented 9 years ago
Hi, 

I tried your example with java and it work though i had to replace

println resourceType
String resourceTypes
methodURL =new URL(baseUrl,"resources?resourceTypes="+ resourceTy-pes);

with

String resourceTypes = URLEncoder.encode("["resourceType +"]","UTF-8");
String methodURL =new URL(baseUrl,"resources?resourceTypes="+ resourceTy-pes);

Did you forget to initialize and URLEncode the array?

Original comment by christop...@gmail.com on 28 Aug 2014 at 10:39

GoogleCodeExporter commented 9 years ago
You are right, I deleted 1 line to many,
i did not need the line "String attributeFilter =
URLEncoder.encode("{'name' :'"+ resourceName +"'}","UTF-8");" from the
example.

Thank you for the support!

Patrick

2014-08-28 12:39 GMT+02:00  <rapla@googlecode.com>:

Original comment by pdien...@gmail.com on 28 Aug 2014 at 1:50

GoogleCodeExporter commented 9 years ago
does it work for you now

Original comment by christop...@gmail.com on 28 Aug 2014 at 2:14

GoogleCodeExporter commented 9 years ago
hi,

it's still not working as i expect it to work, i have attached a screenshot to 
clarify what i want todo.

the resource type i want has the key "resource25"

when i use

String resourceTypes = URLEncoder.encode("['resource25']","UTF-8");
String methodURL =new URL(baseUrl,"resources?resourceTypes=" + resourceTypes);

I expect the resources with the names "g.werler, room100, room101, room102, 
room103, room104, room105, room106, room107"

But the result containts all resources under the different resource types we 
have.

Patrick

Original comment by pdien...@gmail.com on 29 Aug 2014 at 9:09

Attachments: