diff --git a/OSGi/com.dotcms.3rd.party/build.gradle b/OSGi/com.dotcms.3rd.party/build.gradle index 83f1ab1b..11f07911 100644 --- a/OSGi/com.dotcms.3rd.party/build.gradle +++ b/OSGi/com.dotcms.3rd.party/build.gradle @@ -11,7 +11,7 @@ repositories { dependencies { compile fileTree(dir: 'src/main/resources/libs', include: '*.jar') - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.* diff --git a/OSGi/com.dotcms.actionlet/build.gradle b/OSGi/com.dotcms.actionlet/build.gradle index 04eb8a51..4b6a5660 100644 --- a/OSGi/com.dotcms.actionlet/build.gradle +++ b/OSGi/com.dotcms.actionlet/build.gradle @@ -10,7 +10,7 @@ repositories { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.* diff --git a/OSGi/com.dotcms.aop/build.gradle b/OSGi/com.dotcms.aop/build.gradle index 6a6c2363..5cd550f4 100644 --- a/OSGi/com.dotcms.aop/build.gradle +++ b/OSGi/com.dotcms.aop/build.gradle @@ -1,3 +1,5 @@ +import java.util.jar.JarFile + plugins { id 'biz.aQute.bnd.builder' version '3.3.0' } @@ -72,10 +74,11 @@ dependencies { ajc "org.aspectj:aspectjtools:1.8.10" providedCompile "org.aspectj:aspectjrt:1.8.10" - providedCompile (group: 'com.dotcms', name: 'dotcms', version: '5.1.6'){ + providedCompile (group: 'com.dotcms', name: 'dotcms', version: '5.2.0'){ transitive = true } - aspects (group: 'com.dotcms', name: 'dotcms', version: '5.1.6') + aspects (group: 'com.dotcms', name: 'dotcms', version: '5.2.0') + providedCompile "javax.servlet:javax.servlet-api:3.1.0" } diff --git a/OSGi/com.dotcms.aop/src/main/java/com/dotcms/plugin/aop/rest/MyContentResource.java b/OSGi/com.dotcms.aop/src/main/java/com/dotcms/plugin/aop/rest/MyContentResource.java index ee34d4ca..30d199df 100644 --- a/OSGi/com.dotcms.aop/src/main/java/com/dotcms/plugin/aop/rest/MyContentResource.java +++ b/OSGi/com.dotcms.aop/src/main/java/com/dotcms/plugin/aop/rest/MyContentResource.java @@ -1,24 +1,25 @@ package com.dotcms.plugin.aop.rest; -import com.dotcms.repackage.javax.ws.rs.*; -import com.dotcms.repackage.javax.ws.rs.core.Context; -import com.dotcms.repackage.javax.ws.rs.core.MediaType; -import com.dotcms.repackage.javax.ws.rs.core.Response; -import com.dotcms.repackage.org.glassfish.jersey.server.JSONP; import com.dotcms.rest.InitDataObject; import com.dotcms.rest.ResponseEntityView; import com.dotcms.rest.WebResource; import com.dotcms.rest.annotation.NoCache; import com.dotcms.rest.exception.mapper.ExceptionMapperUtil; import com.dotcms.util.LogTime; -import com.dotcms.vanityurl.business.VanityUrlAPI; import com.dotmarketing.business.APILocator; import com.dotmarketing.exception.DotDataException; +import com.dotmarketing.exception.DotSecurityException; import com.dotmarketing.portlets.contentlet.business.ContentletAPI; import com.dotmarketing.portlets.contentlet.model.Contentlet; import com.liferay.portal.model.User; +import org.glassfish.jersey.server.JSONP; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; @Path("/v1/custom/content") public class MyContentResource { @@ -26,34 +27,23 @@ public class MyContentResource { private final WebResource webResource = new WebResource(); private final MyContentService contentService = new MyContentService(); private final ContentletAPI contentletAPI = APILocator.getContentletAPI(); - private final VanityUrlAPI vanityUrlAPI = APILocator.getVanityUrlAPI(); @GET @Path("/inode/{inode}") @Produces(MediaType.APPLICATION_JSON) @LogTime public Response getContentByInode(@Context final HttpServletRequest request, - @PathParam("inode") final String inode) { + @Context final HttpServletResponse response, + @PathParam("inode") final String inode) throws DotSecurityException, DotDataException { final InitDataObject initData = this.webResource.init - (null, true, request, false, null); + (request, response, false); final User user = initData.getUser(); - Contentlet contentlet = null; - Response response = null; - - try { - - contentlet = this.contentService.hydrateContentLet + final Contentlet contentlet = this.contentService.hydrateContentLet (this.contentletAPI.find(inode, user, true)); - response = Response.ok(new ResponseEntityView (contentlet)).build(); - } catch (Exception e) { + return Response.ok(new ResponseEntityView (contentlet)).build(); - response = ExceptionMapperUtil.createResponse - (e, Response.Status.INTERNAL_SERVER_ERROR); - } - - return response; } @Path("/lastMonth") @@ -61,21 +51,12 @@ public Response getContentByInode(@Context final HttpServletRequest request, @JSONP @NoCache @Produces({MediaType.APPLICATION_JSON, "application/javascript"}) - public Response deleteLastMonthContent(@Context final HttpServletRequest request) { + public Response deleteLastMonthContent(@Context final HttpServletRequest request, + @Context final HttpServletResponse response) throws DotDataException { - final InitDataObject initData = this.webResource.init - (null, true, request, true, null); - Response response = null; - - try { - - response = Response.ok(new ResponseEntityView + this.webResource.init + (request, response, false); + return Response.ok(new ResponseEntityView (this.contentService.deleteLastMonthContent())).build(); - } catch (DotDataException e) { - response = ExceptionMapperUtil.createResponse - (e, Response.Status.INTERNAL_SERVER_ERROR); - } - - return response; } } \ No newline at end of file diff --git a/OSGi/com.dotcms.custom.spring/build.gradle b/OSGi/com.dotcms.custom.spring/build.gradle index 7be66765..dd35860e 100644 --- a/OSGi/com.dotcms.custom.spring/build.gradle +++ b/OSGi/com.dotcms.custom.spring/build.gradle @@ -14,7 +14,7 @@ configurations { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } //Resolve dependencies. These jars can be downloaded from our Maven Repo //In case you want to create a Controller using other Spring version, //just change the version Attribute. diff --git a/OSGi/com.dotcms.dynamic.skeleton/build.gradle b/OSGi/com.dotcms.dynamic.skeleton/build.gradle index 55db3c45..21231bd5 100644 --- a/OSGi/com.dotcms.dynamic.skeleton/build.gradle +++ b/OSGi/com.dotcms.dynamic.skeleton/build.gradle @@ -23,7 +23,7 @@ dependencies { // include all jars within the resource libs compile fileTree(dir: 'src/main/resources/libs', include: '*.jar') // Using all jar from artifactory part of the dotcms group - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.* diff --git a/OSGi/com.dotcms.fixasset/build.gradle b/OSGi/com.dotcms.fixasset/build.gradle index 0a4c83ee..b3ab8921 100644 --- a/OSGi/com.dotcms.fixasset/build.gradle +++ b/OSGi/com.dotcms.fixasset/build.gradle @@ -10,7 +10,7 @@ repositories { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.* diff --git a/OSGi/com.dotcms.hooks/build.gradle b/OSGi/com.dotcms.hooks/build.gradle index 7b0a8f5a..3737f888 100644 --- a/OSGi/com.dotcms.hooks/build.gradle +++ b/OSGi/com.dotcms.hooks/build.gradle @@ -10,7 +10,7 @@ repositories { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.* diff --git a/OSGi/com.dotcms.job/build.gradle b/OSGi/com.dotcms.job/build.gradle index 9ef0c327..f1673f67 100644 --- a/OSGi/com.dotcms.job/build.gradle +++ b/OSGi/com.dotcms.job/build.gradle @@ -10,7 +10,7 @@ repositories { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.* diff --git a/OSGi/com.dotcms.override/build.gradle b/OSGi/com.dotcms.override/build.gradle index af500133..f49fd574 100644 --- a/OSGi/com.dotcms.override/build.gradle +++ b/OSGi/com.dotcms.override/build.gradle @@ -10,7 +10,7 @@ repositories { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.* diff --git a/OSGi/com.dotcms.pushpublish.listener/build.gradle b/OSGi/com.dotcms.pushpublish.listener/build.gradle index 406ed390..3588a41b 100644 --- a/OSGi/com.dotcms.pushpublish.listener/build.gradle +++ b/OSGi/com.dotcms.pushpublish.listener/build.gradle @@ -10,7 +10,7 @@ repositories { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.* diff --git a/OSGi/com.dotcms.rest/build.gradle b/OSGi/com.dotcms.rest/build.gradle index 05799ba8..adfa0ae2 100644 --- a/OSGi/com.dotcms.rest/build.gradle +++ b/OSGi/com.dotcms.rest/build.gradle @@ -10,7 +10,7 @@ repositories { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.* diff --git a/OSGi/com.dotcms.rest/src/main/java/com/dotcms/plugin/rest/ExampleResource.java b/OSGi/com.dotcms.rest/src/main/java/com/dotcms/plugin/rest/ExampleResource.java index 88f800d3..6ccafd6b 100644 --- a/OSGi/com.dotcms.rest/src/main/java/com/dotcms/plugin/rest/ExampleResource.java +++ b/OSGi/com.dotcms.rest/src/main/java/com/dotcms/plugin/rest/ExampleResource.java @@ -4,15 +4,15 @@ import javax.servlet.http.HttpServletRequest; -import com.dotcms.repackage.javax.ws.rs.GET; -import com.dotcms.repackage.javax.ws.rs.POST; -import com.dotcms.repackage.javax.ws.rs.PUT; -import com.dotcms.repackage.javax.ws.rs.Path; -import com.dotcms.repackage.javax.ws.rs.PathParam; -import com.dotcms.repackage.javax.ws.rs.core.CacheControl; -import com.dotcms.repackage.javax.ws.rs.core.Context; -import com.dotcms.repackage.javax.ws.rs.core.Response; -import com.dotcms.repackage.javax.ws.rs.core.Response.ResponseBuilder; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.core.CacheControl; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.ResponseBuilder; import com.dotcms.rest.InitDataObject; import com.dotcms.rest.WebResource; import com.dotmarketing.business.DotStateException; diff --git a/OSGi/com.dotcms.ruleengine.velocityscriptingactionlet/build.gradle b/OSGi/com.dotcms.ruleengine.velocityscriptingactionlet/build.gradle index f32ada36..d6b4f9ec 100644 --- a/OSGi/com.dotcms.ruleengine.velocityscriptingactionlet/build.gradle +++ b/OSGi/com.dotcms.ruleengine.velocityscriptingactionlet/build.gradle @@ -15,7 +15,7 @@ configurations { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } testCompile 'org.mockito:mockito-core:2.0.31-beta' testCompile 'org.hamcrest:hamcrest-all:1.3' diff --git a/OSGi/com.dotcms.ruleengine.visitoripconditionlet/build.gradle b/OSGi/com.dotcms.ruleengine.visitoripconditionlet/build.gradle index 329bb852..bb166cd0 100644 --- a/OSGi/com.dotcms.ruleengine.visitoripconditionlet/build.gradle +++ b/OSGi/com.dotcms.ruleengine.visitoripconditionlet/build.gradle @@ -15,7 +15,7 @@ configurations { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } testCompile 'org.mockito:mockito-core:2.0.31-beta' testCompile 'org.hamcrest:hamcrest-all:1.3' diff --git a/OSGi/com.dotcms.servlet/build.gradle b/OSGi/com.dotcms.servlet/build.gradle index f88efcac..13ada63e 100644 --- a/OSGi/com.dotcms.servlet/build.gradle +++ b/OSGi/com.dotcms.servlet/build.gradle @@ -11,7 +11,7 @@ repositories { dependencies { compile fileTree(dir: '../com.dotcms.simpleService/build/libs/', include: '*.jar')//As this example depends on the com.dotcms.simpleService example - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.* diff --git a/OSGi/com.dotcms.simpleService/build.gradle b/OSGi/com.dotcms.simpleService/build.gradle index df8c048a..46f35c8a 100644 --- a/OSGi/com.dotcms.simpleService/build.gradle +++ b/OSGi/com.dotcms.simpleService/build.gradle @@ -10,7 +10,7 @@ repositories { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.* diff --git a/OSGi/com.dotcms.spring/build.gradle b/OSGi/com.dotcms.spring/build.gradle index 66aa00d7..34e0e481 100644 --- a/OSGi/com.dotcms.spring/build.gradle +++ b/OSGi/com.dotcms.spring/build.gradle @@ -10,7 +10,7 @@ repositories { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.* diff --git a/OSGi/com.dotcms.staticpublish.listener/build.gradle b/OSGi/com.dotcms.staticpublish.listener/build.gradle index c36d0007..62fa8fc7 100644 --- a/OSGi/com.dotcms.staticpublish.listener/build.gradle +++ b/OSGi/com.dotcms.staticpublish.listener/build.gradle @@ -14,7 +14,7 @@ configurations { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } compileOnly('com.hierynomus:sshj:0.23.0'){ exclude group: 'org.bouncycastle' //Why we exlude? See README's important notes. diff --git a/OSGi/com.dotcms.tuckey/build.gradle b/OSGi/com.dotcms.tuckey/build.gradle index fae5b400..84bbe2e1 100644 --- a/OSGi/com.dotcms.tuckey/build.gradle +++ b/OSGi/com.dotcms.tuckey/build.gradle @@ -10,7 +10,7 @@ repositories { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.* diff --git a/OSGi/com.dotcms.viewtool/build.gradle b/OSGi/com.dotcms.viewtool/build.gradle index a8efa879..153b1e00 100644 --- a/OSGi/com.dotcms.viewtool/build.gradle +++ b/OSGi/com.dotcms.viewtool/build.gradle @@ -10,7 +10,7 @@ repositories { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.* diff --git a/OSGi/com.dotcms.webinterceptor/build.gradle b/OSGi/com.dotcms.webinterceptor/build.gradle index b376c0ba..f141e5f0 100644 --- a/OSGi/com.dotcms.webinterceptor/build.gradle +++ b/OSGi/com.dotcms.webinterceptor/build.gradle @@ -10,7 +10,7 @@ repositories { } dependencies { - compile('com.dotcms:dotcms:5.1.6') { transitive = true } + compile('com.dotcms:dotcms:5.2.0') { transitive = true } } import java.util.jar.*