As suggested by you, I tried to test plugin for 4.2.0 release with dotCMS 4.1.1 and then for dotCMS 4.2.0 as well. In both the cases, I got the success log. Log for 4.2.0 release is:
[INFO] Initializing Spring FrameworkServlet 'class org.springframework.web.servlet.DispatcherServlet_1' DEBUG: DYNAMIC WIRE: [com.dotcms.spring [11](R 11.0)] osgi.wiring.package; (osgi.wiring.package=*) -> [org.apache.felix.framework [0](R 0)] DEBUG: DYNAMIC WIRE: [com.dotcms.spring [11](R 11.0)] osgi.wiring.package; (osgi.wiring.package=*) -> [org.apache.felix.framework [0](R 0)] Started bundle: file:/E:/Dotcms/dotcms_4.2.0/dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/felix/load/com.dotcms.spring-0.1.jarBut when I tried to access the HelloWorld page on the browser with http://localhost:8080/app/spring/examplecontroller, I got 404 page.
One more question how and where I can get the controller calling log to debug?
Thanks.--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1509083922527-0.post%40n5.nabble.com.
For more options, visit https://groups.google.com/d/optout.
Also, if you just want to create a simple RESTful endpoint, the dotCMS plugin framework actually makes this very easy now. You don’t need the complexity of Spring anymore.
You can make a simply annotated class and then in the activator use RestServiceutil.addResource( MyRestService.class );
com.dotcms.rest.config.RestServiceUtil is the import.
com.dotcms.rest.WebResource is also helpful.
Nathan I. Keiter
|
Lead Network Applications Programmer
|
Benefits Advisory Council Member
|
I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAKKUxWcwfPAxgdbNxSmR1p_bSar%2BMzzOptpco7wnwMyd_nL_Cg%40mail.gmail.com.
Thanks, Nathan,
As suggested by you, I have tried to add a simple RESTful-endpoint in dotCMS plugin framework, but I got the following WARNING messages:
30-Oct-2017 10:58:48.690 WARNING [fileinstall-E:\dotcms_4.1.1\dotserver\tomcat-8.0.18\webapps\ROOT\WEB-INF\felix\load] com.dotcms.repackage.org.glassfish.jersey.internal.inject.Providers.checkProviderRuntime A provider com.dotmarketing.osgi.spring.FormDataController registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider com.dotmarketing.osgi.spring.FormDataController will be ignored. DEBUG: Bundle com.dotcms.spring [11] jersey-multipart-config.properties not found by com.dotcms.spring [11] 30-Oct-2017 10:58:49.336 WARNING [fileinstall-E:\dotcms_4.1.1\dotserver\tomcat-8.0.18\webapps\ROOT\WEB-INF\felix\load] com.dotcms.repackage.org.glassfish.jersey.internal.Errors.logErrors The following warnings have been detected: WARNING: A HTTP GET method, public com.dotcms.repackage.javax.ws.rs.core.Response com.dotcms.rest.elasticsearch.ESContentResourcePortlet.search(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.String) throws com.dotmarketing.exception.DotDataException,com.dotmarketing.exception.DotSecurityException, should not consume any entity. example-Servlet.xml read succefully. Started bundle: jardir:E:\dotcms_4.1.1\dotserver\tomcat-8.0.18\webapps\ROOT\WEB- INF\felix\load\com.dotcms.spring-0.1
Please find the files in the attachment.
Also, it will be helpful if you can provide some relevant code for a POST request with JSON response in the context with dotCMS.
Looking forward to your support.
Thanks.
build.gradle--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1509342331211-0.post%40n5.nabble.com.
For more options, visit https://groups.google.com/d/optout.
There is a great example of how to use REST in OSGI here: https://github.com/wezell/com.dotcms.rest.page/blob/master/src/main/java/com/dotcms/plugin/rest/page/ContentWithRelationsResource.java Everything I’ve done with REST is based on Will’s plugin example.
Also, the source code of the built-in REST services gives good hints on how to use it. You can see examples of POST, PUT, and GET here: https://github.com/dotCMS/core/blob/master/dotCMS/src/main/java/com/dotcms/rest/ContentResource.java#L648
Finally, you could look at one of my example REST OSTI plugins: https://github.com/nkeiter/generic-dotCMS-plugin-code-examples/blob/master/dotcms4.1.1/osgi/org.example.nkeiter.contentlet.rest.light/src/main/java/org/example/nkeiter/contentlet/rest/light/service/ContentletRestServiceLight.java
Hope that helps.
Nathan I. Keiter
|
Lead Network Applications Programmer
|
Benefits Advisory Council Member
|
I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1509342331211-0.post%40n5.nabble.com.
Thanks Jason for your support.
Basically, I wish to save a content from front-end using dotCMS REST endpoint but it requires the user to be authenticated to have permission to save data.
That's the pain point for me as I don't want to use user credentials on the front-end ajax call.
For the above-stated purpose, I want to enable a REST API endpoint for me where I just have to pass the content data with content type id and in the backend, it adds authentication credentials and hits the dotCMS REST endpoint for saving data from.
Is there any way to do so.
Currently, I have succeeded in enabling rest call as the following example illustrates:
https://github.com/dotCMS/plugin-seeds/tree/master/OSGi/com.dotcms.spring
https://github.com/dotCMS/plugin-seeds/tree/master/OSGi/com.dotcms.rest
_____________________________________
Sent from http://forumarchive.dotcms.com