[HippoCMS-scm] [Git][cms-community/hippo-essentials][feature/ESSENTIALS-1046] ESSENTIALS-1046 Improve handling of missing project.basedir property

2017-02-14 Thread Bert Leunis
Bert Leunis pushed to branch feature/ESSENTIALS-1046 at cms-community / 
hippo-essentials


Commits:
1e38ac83 by Bert Leunis at 2017-02-14T14:07:54+01:00
ESSENTIALS-1046 Improve handling of missing project.basedir property
- update license headers

- - - - -


2 changed files:

- 
dashboard/src/main/java/org/onehippo/cms7/essentials/filters/RequirementsCheckFilter.java
- 
plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/utils/ProjectUtils.java


Changes:

=
dashboard/src/main/java/org/onehippo/cms7/essentials/filters/RequirementsCheckFilter.java
=
--- 
a/dashboard/src/main/java/org/onehippo/cms7/essentials/filters/RequirementsCheckFilter.java
+++ 
b/dashboard/src/main/java/org/onehippo/cms7/essentials/filters/RequirementsCheckFilter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Hippo B.V. (http://www.onehippo.com)
+ * Copyright 2017 Hippo B.V. (http://www.onehippo.com)
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -37,7 +37,6 @@ public class RequirementsCheckFilter implements Filter {
 
 }
 
-
 @Override
 public void doFilter(final ServletRequest req, final ServletResponse res, 
final FilterChain chain) throws IOException, ServletException {
 try {


=
plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/utils/ProjectUtils.java
=
--- 
a/plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/utils/ProjectUtils.java
+++ 
b/plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/utils/ProjectUtils.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014-2016 Hippo B.V. (http://www.onehippo.com)
+ * Copyright 2014-2017 Hippo B.V. (http://www.onehippo.com)
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-essentials/commit/1e38ac8372eeebe3a3769496bf190002c4f18bea
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn


[HippoCMS-scm] [Git][cms-community/hippo-essentials][feature/ESSENTIALS-1046] ESSENTIALS-1046 Improve handling of missing project.basedir property

2017-02-10 Thread Marijan Milicevic
Marijan Milicevic pushed to branch feature/ESSENTIALS-1046 at cms-community / 
hippo-essentials


Commits:
714672bd by Marijan Milicevic at 2017-02-10T12:32:20+01:00
ESSENTIALS-1046 Improve handling of missing project.basedir property
- log error messages without stacktrace (stacktrace logged only in debug mode)

- - - - -


2 changed files:

- 
dashboard/src/main/java/org/onehippo/cms7/essentials/filters/RequirementsCheckFilter.java
- 
plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/utils/ProjectUtils.java


Changes:

=
dashboard/src/main/java/org/onehippo/cms7/essentials/filters/RequirementsCheckFilter.java
=
--- 
a/dashboard/src/main/java/org/onehippo/cms7/essentials/filters/RequirementsCheckFilter.java
+++ 
b/dashboard/src/main/java/org/onehippo/cms7/essentials/filters/RequirementsCheckFilter.java
@@ -52,11 +52,13 @@ public class RequirementsCheckFilter implements Filter {
 return;
 }
 if (!file.isDirectory()) {
-sendRedirect(req, res, "Directory: " + directory + " must be a 
directory");
+sendRedirect(req, res, "File: " + directory + " must be a 
directory");
 return;
 }
 } catch (IllegalStateException e) {
-log.error("Error processing req", e);
+if (log.isDebugEnabled()) {
+log.error("Error processing request:", e);
+}
 sendRedirect(req, res, e.getMessage());
 return;
 }
@@ -65,6 +67,7 @@ public class RequirementsCheckFilter implements Filter {
 
 private void sendRedirect(final ServletRequest req, final ServletResponse 
resp, final String error) throws IOException {
 final HttpServletResponse response = (HttpServletResponse) resp;
+log.error(error);
 req.setAttribute("error", error);
 response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, error);
 }


=
plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/utils/ProjectUtils.java
=
--- 
a/plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/utils/ProjectUtils.java
+++ 
b/plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/utils/ProjectUtils.java
@@ -116,7 +116,7 @@ public final class ProjectUtils {
 if (System.getProperty(EssentialConst.PROJECT_BASEDIR_PROPERTY) != 
null && !System.getProperty(EssentialConst.PROJECT_BASEDIR_PROPERTY).isEmpty()) 
{
 return System.getProperty(EssentialConst.PROJECT_BASEDIR_PROPERTY);
 }
-throw new IllegalStateException("System property 'project.basedir' was 
not null or empty. Please start your application with 
-D=project.basedir=/project/path");
+throw new IllegalStateException("System property 'project.basedir' was 
null or empty. Please start your application with 
-D=project.basedir=/project/path");
 }
 
 public static String getEssentialsModuleName() {



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-essentials/commit/714672bd9161fd6cdd545c810b4f2c6b4f71939a
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn