Hello,
Another webengine syntax question
I have a site called testapp (which maps to a Main module) and and a
Document type called ChallengePost (which has an underlying webobject
called ChallengeWebObject). The home page of this simple site renders
using the default index.ftl. From this simple page I want to force
creation of the ChallengePost document using the create.ftl in the
views\ChallengePost directory. I don't want the @views/create to use the
default views\Document which is the default.
If I use "
http://localhost:8080/nuxeo/site/testapp/repository/@views/create" the
default views\Document\create.ftl is rendered and I can create a document
of the type ChallengePost. The "repository" path returns a document root.
What is the URL syntax to force re-direction to the
views\ChallengePost\create.ftl?
Is there some syntax like "
http://localhost:8080/nuxeo/site/testapp/@views/ChallengePost/create" or
do i need to return a document context in order to have create mapped to
the right create/ftl?
As an alternative, I have tried the following code snippet from my main
module mapped to the path "challengepost"
@GET
@Path("challengepost")
public Object createChallengePost() throws Exception {
PathRef pathRef = new PathRef("/default-domain/sections/bruce/");
DocumentModel doc = ctx.getCoreSession().getDocument(pathRef);
return (ChallengeWebObject) ctx.newObject("ChallengePost", doc);
}
And then used the URL "
http://localhost:8080/nuxeo/site/testapp/challengepost", but that
generates an error
10:04:41,272 ERROR [SynchronousDispatcher] Failed executing GET
/testapp/challengepost
org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find
MessageBodyWriter for response object of type:
ca.metalogic.prototype.ChallengeWebObject of media type:
text/html;charset=UTF-8
at
org.jboss.resteasy.core.DispatcherUtilities.resolveResponseInvoker(DispatcherUtilities.java:114)
at
org.jboss.resteasy.core.SynchronousDispatcher.writeJaxrsResponse(SynchronousDispatcher.java:401)
Do i have to create my own writer for my own objects?
Thanks,
Bruce._______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm