Suat,

but maybe one minor thing: could you give me a list of parameters that are valid for the POST request in creating or updating content items? because in the Doku, it says 'constraints' for the JSON constraint, a few lines below it is called '|||||*jsonCons', then there is 'disposition', but only for files, etc... *|||||
So the docu seems to be a bit inconsistent here.

Thank you,
Melanie


Am 05.10.2012 17:25, schrieb Melanie Reiplinger:
Hi Suat,

thank you a lot. I was also having problems doing the POST via jQuery.ajax, because I couldn't make the upload of files with Multipart-Formdata (FromData object) work. But maybe I will try this after you completed the changes, and work on something different for the time being.

Best,
Melanie

Am 05.10.2012 17:20, schrieb Suat Gonul:
Hi Melanie,

Currently, I and my colleague are working on the RESTful services of
Contenthub. We are going over the RESTful services providing ContentItem
submission there will be an overall improvement on the services. We will
adapt the services so that they will also support the multipart
serialization of ContentItems. All documentations will also be updated.
I hope the implementation will be finished in the next week. I will open
issues for these developments and inform this list.

You can specify a uri for your item with form elements as follows:
curl -i -X POST --data "content=James M. Barrie is a famous Scottish
author.&constraints={author:\"mere\"}&title=PeterPan&id=myid"
http://dev.iks-project.eu:8081/contenthub/contenthub/store

The url parameter is only considered if you do not specify the "content"
parameter. In this case, the content is fetched from the given url.

Hope this helps, best,
Suat

On 10/5/2012 5:32 PM, Melanie Reiplinger wrote:
Hi all,

I was trying the form element specification for content items. Seems
if I use form elements, then I cannot specify an urn for my item - I
get an ugly exception thrown (shown below).

And another more thing: what happens with the url I specify? I can't
see them anywhere at my items.

Best,
Melanie

curl -i -X POST --data "content=James M. Barrie is a famous Scottish
author.&constraints={author:\"mere\"}&title=PeterPan&url=\"http://foo.bar.de\"";
http://dev.iks-project.eu:8081/contenthub/contenthub/store/PP
HTTP/1.1 500 There is no textual for the content item
Content-Type: text/html; charset=iso-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 7484
Server: Jetty(6.1.x)

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 500 There is no textual for the content item</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /contenthub/contenthub/store/PP. Reason:
<pre>    There is no textual for the content item</pre></p><h3>Caused
by:</h3><p
re>org.apache.stanbol.contenthub.servicesapi.store.StoreException:
There is no t                                         extual for the
content item
         at
org.apache.stanbol.contenthub.store.solr.SolrStoreImpl.addDefaultFiel
ds(SolrStoreImpl.java:375)
         at
org.apache.stanbol.contenthub.store.solr.SolrStoreImpl.put(SolrStoreI
mpl.java:320)
         at
org.apache.stanbol.contenthub.store.solr.SolrStoreImpl.put(SolrStoreI
mpl.java:342)
         at
org.apache.stanbol.contenthub.store.solr.SolrStoreImpl.enhanceAndPut(
SolrStoreImpl.java:314)
         at
org.apache.stanbol.contenthub.web.resources.StoreResource.createEnhan
ceAndRedirect(StoreResource.java:659)
         at
org.apache.stanbol.contenthub.web.resources.StoreResource.createEnhan
ceAndRedirect(StoreResource.java:802)
         at
org.apache.stanbol.contenthub.web.resources.StoreResource.createConte
ntItemWithId(StoreResource.java:496)
at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
         at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at
com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMe
thodInvokerFactory.java:60)
         at
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMeth
odDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchPr
ovider.java:205)
         at
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDi
spatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
         at
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethod
Rule.java:288)
         at
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHa
ndPathRule.java:147)
         at
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(Resourc
eClassRule.java:108)
         at
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHa
ndPathRule.java:147)
         at
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(R
ootResourceClassesRule.java:84)
         at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequ
est(WebApplicationImpl.java:1483)
         at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequ
est(WebApplicationImpl.java:1414)
         at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleReque
st(WebApplicationImpl.java:1363)
         at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleReque
st(WebApplicationImpl.java:1353)
         at
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponen
t.java:414)
         at
com.sun.jersey.spi.container.servlet.ServletContainer.service(Servlet
Container.java:537)
         at
com.sun.jersey.spi.container.servlet.ServletContainer.service(Servlet
Container.java:708)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at
org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(S
ervletHandler.java:96)
         at
org.apache.felix.http.base.internal.handler.ServletHandler.handle(Ser
vletHandler.java:79)
         at
org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(S
ervletPipeline.java:42)
         at
org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.do
Filter(InvocationFilterChain.java:49)
         at
org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter
(HttpFilterChain.java:33)
         at
org.apache.stanbol.commons.httpqueryheaders.impl.QueryHeadersFilter.d
oFilter(QueryHeadersFilter.java:75)
         at
org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(Fi
lterHandler.java:88)
         at
org.apache.felix.http.base.internal.handler.FilterHandler.handle(Filt
erHandler.java:76)
         at
org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.do
Filter(InvocationFilterChain.java:47)
         at
org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter
(HttpFilterChain.java:33)
         at
org.apache.stanbol.commons.security.auth.AuthenticatingFilter$1.run(A
uthenticatingFilter.java:157)
         at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at
org.apache.stanbol.commons.security.auth.AuthenticatingFilter.doFilte
r(AuthenticatingFilter.java:153)
         at
org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(Fi
lterHandler.java:88)
         at
org.apache.felix.http.base.internal.handler.FilterHandler.handle(Filt
erHandler.java:76)
         at
org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.do
Filter(InvocationFilterChain.java:47)
         at
org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter
(HttpFilterChain.java:33)
         at
org.apache.felix.http.base.internal.handler.FilterHandler.handle(Filt
erHandler.java:78)
         at
org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.do
Filter(InvocationFilterChain.java:47)
         at
org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter
(HttpFilterChain.java:33)
         at
org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(
FilterPipeline.java:48)
         at
org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Disp
atcher.java:39)
         at
org.apache.felix.http.base.internal.DispatcherServlet.service(Dispatc
herServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511 )
         at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:3 90)
         at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:1 82)
         at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:7 65)
         at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:1 52)
         at org.mortbay.jetty.Server.handle(Server.java:326)
         at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:54 2)
         at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnectio
n.java:943)
         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
         at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
         at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
         at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.ja
va:410)
         at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.j
ava:582)
</pre>
<hr /><i><small>Powered by Jetty://</small></i><br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>

</body>
</html>




Reply via email to