[HippoCMS-scm] [Git][cms-community/hippo-cms] Pushed new branch bugfix/CMS-9880

2016-03-09 Thread Marijan Milicevic
Marijan Milicevic pushed new branch bugfix/CMS-9880 at cms-community / hippo-cms
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn


[HippoCMS-scm] [Git][cms-community/hippo-addon-channel-manager][feature/cmng-psp1] CHANNELMGR-466: removed 'components' button from DOM when it's not in edit mode

2016-03-09 Thread Canh Ngo
Canh Ngo pushed to branch feature/cmng-psp1 at cms-community / 
hippo-addon-channel-manager


Commits:
ef3f16f1 by Canh Ngo at 2016-03-09T16:22:43+01:00
CHANNELMGR-466: removed 'components' button from DOM when it's not in edit mode

- - - - -


1 changed file:

- frontend-ng/src/angularjs/channel/channel.html


Changes:

=
frontend-ng/src/angularjs/channel/channel.html
=
--- a/frontend-ng/src/angularjs/channel/channel.html
+++ b/frontend-ng/src/angularjs/channel/channel.html
@@ -18,7 +18,7 @@
   
 
+   ng-if="channelCtrl.isEditMode">
   {{ 'TOOLBAR_BUTTON_COMPONENTS' | translate }}
 
 



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/ef3f16f11a3b55515c9f1463fe2478ba6a3b2cd3
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn


[HippoCMS-scm] [Git][cms-community/hippo-addon-channel-manager][feature/cmng-psp1] CHANNELMGR-488: improve iframe height determination.

2016-03-09 Thread Tobias Jeger
Tobias Jeger pushed to branch feature/cmng-psp1 at cms-community / 
hippo-addon-channel-manager


Commits:
175f3374 by Tobias Jeger at 2016-03-09T15:19:40+01:00
CHANNELMGR-488: improve iframe height determination.

- - - - -


1 changed file:

- frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.js


Changes:

=
frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.js
=
--- 
a/frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.js
+++ 
b/frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.js
@@ -74,10 +74,15 @@ export class OverlaySyncService {
 
   _syncHeight() {
 if (this.iframeJQueryElement && this.overlayJQueryElement) {
-  const html = this._getIframeWindow().document.documentElement;
+  const doc = this._getIframeWindow().document;
 
-  if (html !== null) {
-const height = html.offsetHeight;
+  if (doc) {
+const html = doc.documentElement;
+const body = doc.body;
+
+// cross-browser document height checking
+const height = Math.max(body.scrollHeight, body.offsetHeight,
+html.clientHeight, html.scrollHeight, 
html.offsetHeight);
 
 // Prevent weird twitching at certain widths
 html.style.overflow = 'hidden';



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/175f33746e0a9ea950d55c12277cbb9e59964b92
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn


[HippoCMS-scm] [Git][cms-community/hippo-cms][feature/translations-psp1] CMS-9977 resource bundles must be imported after the project namespace is initialized

2016-03-09 Thread Unico Hommes
Unico Hommes pushed to branch feature/translations-psp1 at cms-community / 
hippo-cms


Commits:
54ee6450 by Unico Hommes at 2016-03-09T15:19:24+01:00
CMS-9977 resource bundles must be imported after the project namespace is 
initialized

- - - - -


1 changed file:

- 
automatic-export/repository/src/main/java/org/onehippo/cms7/autoexport/InitializeItemFactory.java


Changes:

=
automatic-export/repository/src/main/java/org/onehippo/cms7/autoexport/InitializeItemFactory.java
=
--- 
a/automatic-export/repository/src/main/java/org/onehippo/cms7/autoexport/InitializeItemFactory.java
+++ 
b/automatic-export/repository/src/main/java/org/onehippo/cms7/autoexport/InitializeItemFactory.java
@@ -62,7 +62,7 @@ class InitializeItemFactory {
 sequence = 3.1;
 }
 else if (path.startsWith("/hippo:configuration/hippo:translations")) {
-sequence = 3.1;
+sequence = 3.2;
 name = namePrefix + "translations";
 resourceBundles = "translations.json";
 }



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


[HippoCMS-scm] [Git][cms-community/hippo-cms][release/2.26] 2 commits: CMS-9962 IE11 throws createStyleSheet error: method not supported

2016-03-09 Thread Mathijs den Burger
Mathijs den Burger pushed to branch release/2.26 at cms-community / hippo-cms


Commits:
3affe88c by Marijan Milicevic at 2016-03-03T13:42:21+01:00
CMS-9962 IE11 throws createStyleSheet error: method not supported
- check if ie version is less than 11

- - - - -
767ae18d by Mathijs den Burger at 2016-03-09T14:59:30+01:00
CMS-9962 Reintegrate bugfix/CMS-9962

- - - - -


1 changed file:

- 
richtext/ckeditor/frontend/src/main/java/org/hippoecm/frontend/plugins/ckeditor/CKEditorPanel.js


Changes:

=
richtext/ckeditor/frontend/src/main/java/org/hippoecm/frontend/plugins/ckeditor/CKEditorPanel.js
=
--- 
a/richtext/ckeditor/frontend/src/main/java/org/hippoecm/frontend/plugins/ckeditor/CKEditorPanel.js
+++ 
b/richtext/ckeditor/frontend/src/main/java/org/hippoecm/frontend/plugins/ckeditor/CKEditorPanel.js
@@ -156,16 +156,16 @@
 });
 };
 
-if (Wicket.Browser.isIE()) {
+if (Wicket.Browser.isIELessThan11()) {
 CKEDITOR_READY.when(function() {
 /*
-  Replace CKEditor's 'appendStyleText' method. IE chokes on the 
original because it calls createStyleSheet()
+ Replace CKEditor's 'appendStyleText' method. IE < 11 chokes on 
the original because it calls createStyleSheet()
   with an empty string as argument. That throws an Error when the 
page is served by an HTTP server.
  */
 CKEDITOR.dom.document.prototype.appendStyleText = 
function(cssStyleText) {
-var style = this.$.createStyleSheet();
-style.cssText = cssStyleText;
-return style;
+var styleSheet = this.$.createStyleSheet();
+styleSheet.cssText = cssStyleText;
+return styleSheet;
 };
 });
 }



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-cms/compare/3b0537822f76cea9d4653b003de26a3ed2c305cf...767ae18d7dceaff269ea398e6f5fcb51a5d79acb
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn


[HippoCMS-scm] [Git][cms-community/hippo-addon-channel-manager][feature/cmng-psp1] CHANNELMGR-481: minor rework after reviewing scaling service unit tests.

2016-03-09 Thread Tobias Jeger
Tobias Jeger pushed to branch feature/cmng-psp1 at cms-community / 
hippo-addon-channel-manager


Commits:
5c321787 by Tobias Jeger at 2016-03-09T14:19:33+01:00
CHANNELMGR-481: minor rework after reviewing scaling service unit tests.

- - - - -


1 changed file:

- frontend-ng/src/angularjs/channel/hippoIframe/scaling.service.spec.js


Changes:

=
frontend-ng/src/angularjs/channel/hippoIframe/scaling.service.spec.js
=
--- a/frontend-ng/src/angularjs/channel/hippoIframe/scaling.service.spec.js
+++ b/frontend-ng/src/angularjs/channel/hippoIframe/scaling.service.spec.js
@@ -38,7 +38,7 @@ describe('ScalingService', function () {
 elementsToScale = jasmine.createSpyObj('elementsToScale', ['velocity']);
 
 spyOn(iframeJQueryElement, 'find').and.callFake(function (selector) {
-  return selector === '.cm-scale' ? elementsToScale : $j(selector);
+  return selector === '.cm-scale' ? elementsToScale : 
$j('#test-hippo-iframe ' + selector);
 });
   });
 
@@ -141,7 +141,7 @@ describe('ScalingService', function () {
 
 expect(elementsToScale.velocity).toHaveBeenCalledWith('finish');
 expect(elementsToScale.velocity).toHaveBeenCalledWith('scroll', {
-  container: $j('.channel-iframe-base'),
+  container: baseJQueryElement,
   offset: -25,
   duration: ScalingService.scaleDuration,
   easing: ScalingService.scaleEasing,



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/5c3217877b3bdf8cdd9467a586fd96f5c990fc1b
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn


[HippoCMS-scm] [Git][cms-community/hippo-testsuite] Pushed new branch feature/translations-psp1

2016-03-09 Thread Ard Schrijvers
Ard Schrijvers pushed new branch feature/translations-psp1 at cms-community / 
hippo-testsuite
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn


[HippoCMS-scm] [Git][cms-community/hippo-addon-channel-manager][feature/cmng-psp1] 6 commits: CHANNELMGR-373 improve readability of getComponent methods

2016-03-09 Thread Mathijs den Burger
Mathijs den Burger pushed to branch feature/cmng-psp1 at cms-community / 
hippo-addon-channel-manager


Commits:
64a4ca8b by Mathijs den Burger at 2016-03-09T13:24:51+01:00
CHANNELMGR-373 improve readability of getComponent methods

- - - - -
5cec02a4 by Mathijs den Burger at 2016-03-09T13:24:51+01:00
CHANNELMGR-373 use const instead of let

- - - - -
9953c1c2 by Mathijs den Burger at 2016-03-09T13:24:51+01:00
CHANNELMGR-373 remove redundant test

The second test is just an extended version of the first, so remove
the first.

- - - - -
8f03bf9b by Mathijs den Burger at 2016-03-09T13:24:51+01:00
CHANNELMGR-481 remove push-width attribute from hippoIframe

It's not used anymore, the service is called directly. Also renamed
'updatePushWidth' to 'setPushWidth'.

- - - - -
2255d911 by Mathijs den Burger at 2016-03-09T13:24:51+01:00
CHANNELMGR-481 improve wording in comment

- - - - -
8175436c by Mathijs den Burger at 2016-03-09T13:24:51+01:00
CHANNELMGR-481 add unit tests for ScalingService

- - - - -


11 changed files:

- frontend-ng/src/angularjs/channel/channel.controller.js
- frontend-ng/src/angularjs/channel/channel.controller.spec.js
- frontend-ng/src/angularjs/channel/channel.html
- frontend-ng/src/angularjs/channel/hippoIframe/hippoIframe.directive.js
- + frontend-ng/src/angularjs/channel/hippoIframe/scaling.service.fixture.html
- frontend-ng/src/angularjs/channel/hippoIframe/scaling.service.js
- + frontend-ng/src/angularjs/channel/hippoIframe/scaling.service.spec.js
- frontend-ng/src/angularjs/channel/page/componentRendering.service.js
- frontend-ng/src/angularjs/channel/page/element/containerElement.js
- frontend-ng/src/angularjs/channel/page/pageStructure.service.js
- frontend-ng/src/angularjs/channel/page/pageStructure.service.spec.js


Changes:

=
frontend-ng/src/angularjs/channel/channel.controller.js
=
--- a/frontend-ng/src/angularjs/channel/channel.controller.js
+++ b/frontend-ng/src/angularjs/channel/channel.controller.js
@@ -51,7 +51,7 @@ export class ChannelCtrl {
 this.$mdSidenav(sidenav).close();
   }
 });
-this.ScalingService.updatePushWidth(0);
+this.ScalingService.setPushWidth(0);
   }
 
   _createPreviewConfiguration() {
@@ -73,7 +73,7 @@ export class ChannelCtrl {
   }
 });
 this.$mdSidenav(name).toggle();
-this.ScalingService.updatePushWidth(this._isSidenavOpen(name) ? 
$('.md-sidenav-left').width() : 0);
+this.ScalingService.setPushWidth(this._isSidenavOpen(name) ? 
$('.md-sidenav-left').width() : 0);
   }
 
   getCatalog() {


=
frontend-ng/src/angularjs/channel/channel.controller.spec.js
=
--- a/frontend-ng/src/angularjs/channel/channel.controller.spec.js
+++ b/frontend-ng/src/angularjs/channel/channel.controller.spec.js
@@ -49,7 +49,7 @@ describe('ChannelCtrl', function () {
 
   ScalingService = jasmine.createSpyObj('ScalingService', [
 'init',
-'updatePushWidth',
+'setPushWidth',
   ]);
 
   ChannelCtrl = $controller('ChannelCtrl', {


=
frontend-ng/src/angularjs/channel/channel.html
=
--- a/frontend-ng/src/angularjs/channel/channel.html
+++ b/frontend-ng/src/angularjs/channel/channel.html
@@ -51,8 +51,7 @@
 flex
 layout="row"
 path="channelCtrl.iframeUrl"
-push-width="channelCtrl.pushWidth"
 select-mode="channelCtrl.isEditMode">
   
 
-
\ No newline at end of file
+


=
frontend-ng/src/angularjs/channel/hippoIframe/hippoIframe.directive.js
=
--- a/frontend-ng/src/angularjs/channel/hippoIframe/hippoIframe.directive.js
+++ b/frontend-ng/src/angularjs/channel/hippoIframe/hippoIframe.directive.js
@@ -23,7 +23,6 @@ export function hippoIframe() {
 bindToController: {
   path: '=',
   selectMode: '=',
-  pushWidth: '=',
 },
 templateUrl: 'channel/hippoIframe/hippoIframe.html',
 controller: 'hippoIframeCtrl',


=
frontend-ng/src/angularjs/channel/hippoIframe/scaling.service.fixture.html
=
--- /dev/null
+++ b/frontend-ng/src/angularjs/channel/hippoIframe/scaling.service.fixture.html
@@ -0,0 +1,23 @@
+
+
+
+  
+
+  
+
+  
+


=
frontend-ng/src/angularjs/channel/hippoIframe/scaling.service.js
=
--- a/frontend-ng/src/angularjs/channel/hippoIframe/scaling.service.js
+++ b/frontend-ng/src/angularjs/channel/hippoIframe/scaling.service.js
@@ -24,7 +24,7 @@ export class ScalingService {
 
 this.$rootScope = $rootScope;
 
-this.pushWidth = 0; // all sidenavs are closed to start with
+this.pushWidth = 0; // all sidenavs are initially closed
 this.scaleFactor = 1.0;
 this.scaleDuration = 

[HippoCMS-scm] [Git][cms-community/hippo-plugin-taxonomy][feature/translations-psp1] HIPPLUG-1200 fix demo version

2016-03-09 Thread Unico Hommes
Unico Hommes pushed to branch feature/translations-psp1 at cms-community / 
hippo-plugin-taxonomy


Commits:
2184c56c by Unico Hommes at 2016-03-09T13:14:42+01:00
HIPPLUG-1200 fix demo version

- - - - -


1 changed file:

- demo/pom.xml


Changes:

=
demo/pom.xml
=
--- a/demo/pom.xml
+++ b/demo/pom.xml
@@ -25,7 +25,7 @@
 
   Hippo Plugin Taxonomy Demo
   hippo-plugin-taxonomy-demo
-  3.0.0-translations-psp1-SNAPSHOT
+  3.0.0-SNAPSHOT
   pom
 
   



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-plugin-taxonomy/commit/2184c56c6aaae5a17b22e7cef65c96d4bdb9ff4a
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn


[HippoCMS-scm] [Git][cms-community/hippo-addon-channel-manager][feature/cmng-psp1] CHANNELMGR-331: limit display width of catalog component icons. This looked ugly on gogreen.

2016-03-09 Thread Tobias Jeger
Tobias Jeger pushed to branch feature/cmng-psp1 at cms-community / 
hippo-addon-channel-manager


Commits:
f696d35a by Tobias Jeger at 2016-03-09T13:13:44+01:00
CHANNELMGR-331: limit display width of catalog component icons. This looked 
ugly on gogreen.

- - - - -


1 changed file:

- frontend-ng/src/styles/_lists.scss


Changes:

=
frontend-ng/src/styles/_lists.scss
=
--- a/frontend-ng/src/styles/_lists.scss
+++ b/frontend-ng/src/styles/_lists.scss
@@ -15,4 +15,8 @@
 md-list-item .component-icon {
   width: 40px;
   padding-right: 4px;
+
+  img {
+max-width: 100%;
+  }
 }



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/f696d35a4a29edaaa78dab9f4cf8e1aa33c77cd5
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn


[HippoCMS-scm] [Git][cms-community/hippo-plugin-selections][feature/translations-psp1] HIPPLUG-1274 convert bootstrap content for translations psp1

2016-03-09 Thread Unico Hommes
Unico Hommes pushed to branch feature/translations-psp1 at cms-community / 
hippo-plugin-selections


Commits:
6c3e4071 by Unico Hommes at 2016-03-09T13:01:55+01:00
HIPPLUG-1274 convert bootstrap content for translations psp1

- - - - -


6 changed files:

- demo/content/src/main/resources/configuration/modules/autoexport-module.xml
- demo/content/src/main/resources/content/documents/valuelists/chained.xml
- demo/content/src/main/resources/hippoecm-extension.xml
- demo/content/src/main/resources/selection-demo-namespace.xml
- + demo/content/src/main/resources/translations.json
- demo/pom.xml


Changes:

=
demo/content/src/main/resources/configuration/modules/autoexport-module.xml
=
--- 
a/demo/content/src/main/resources/configuration/modules/autoexport-module.xml
+++ 
b/demo/content/src/main/resources/configuration/modules/autoexport-module.xml
@@ -6,8 +6,7 @@
   false
 
 
-  bootstrap/content:/content
-  bootstrap/configuration:/
+  content:/
 
   
 


=
demo/content/src/main/resources/content/documents/valuelists/chained.xml
=
--- a/demo/content/src/main/resources/content/documents/valuelists/chained.xml
+++ b/demo/content/src/main/resources/content/documents/valuelists/chained.xml
@@ -1,15 +1,17 @@
-
-http://www.jcp.org/jcr/sv/1.0; sv:name="chained">
+http://www.jcp.org/jcr/sv/1.0; sv:name="chained">
   
 hippostd:folder
   
   
+hippo:named
 mix:referenceable
-hippo:translated
   
   
 461acf46-1c10-4aa6-ab7d-a393d2647a9d
   
+  
+Interdependent / Chained
+  
   
 new-document
 new-folder
@@ -19,19 +21,22 @@
   hippo:handle
 
 
+  hippo:named
   mix:referenceable
-  hippo:translated
 
 
   59ae78cc-192b-4764-8224-6e73133efb26
 
+
+  1 - Continents
+
 
   
 selection:valuelist
   
   
-mix:referenceable
 hippotranslation:translated
+mix:referenceable
   
   
 57164487-d849-4f54-bf17-16b0e5025a4c
@@ -69,36 +74,28 @@
 
   
 
-
-  
-hippo:translation
-  
-  
-
-  
-  
-1 - Continents
-  
-
   
   
 
   hippo:handle
 
 
+  hippo:named
   mix:referenceable
-  hippo:translated
 
 
   a941736b-4d51-4038-8ffa-4c5fa5bfdc9e
 
+
+  1.1 - Africa
+
 
   
 selection:valuelist
   
   
-mix:referenceable
 hippotranslation:translated
+mix:referenceable
   
   
 835e7193-5266-4deb-b880-fdc7df331388
@@ -158,36 +155,28 @@
 
   
 
-
-  
-hippo:translation
-  
-  
-
-  
-  
-1.1 - Africa
-  
-
   
   
 
   hippo:handle
 
 
+  hippo:named
   mix:referenceable
-  hippo:translated
 
 
   5966ae23-3395-473a-9ced-0a5f7db48903
 
+
+  1.2 - Europe
+
 
   
 selection:valuelist
   
   
-mix:referenceable
 hippotranslation:translated
+mix:referenceable
   
   
 419201e3-d746-479e-98ad-18377d01fa7f
@@ -196,7 +185,6 @@
 live
 preview
   
-  
   
 fe560ef3-3fc5-40d8-b1c4-34f21d88474c
   
@@ -281,27 +269,5 @@
 
   
 
-
-  
-hippo:translation
-  
-  
-
-  
-  
-1.2 - Europe
-  
-
-  
-  
-
-  hippo:translation
-
-
-  
-
-
-  Interdependent / Chained
-
   
 


=
demo/content/src/main/resources/hippoecm-extension.xml
=
--- a/demo/content/src/main/resources/hippoecm-extension.xml
+++ b/demo/content/src/main/resources/hippoecm-extension.xml
@@ -1,4 +1,4 @@
-
+
 
-http://www.jcp.org/jcr/sv/1.0; sv:name="hippo:initialize">  
+-->http://www.jcp.org/jcr/sv/1.0; 
sv:name="hippo:initialize">  

 hippo:initializefolder 
 
@@ -449,7 +448,7 @@
  
   33100.5 
   
- 
+ 
   editor 
  
 
@@ -552,7 +551,7 @@
 
   
   
-  
+  
 
   hippo:initializeitem
 
@@ -566,4 +565,15 @@
   30010
 
   
+  
+
+  hippo:initializeitem
+
+
+  32051
+
+
+  translations.json
+
+  
 


=
demo/content/src/main/resources/selection-demo-namespace.xml
=
--- a/demo/content/src/main/resources/selection-demo-namespace.xml
+++ b/demo/content/src/main/resources/selection-demo-namespace.xml
@@ -1,5 +1,4 @@
-
-http://www.jcp.org/jcr/sv/1.0; sv:name="selectiondemo">
+http://www.jcp.org/jcr/sv/1.0; sv:name="selectiondemo">
   
 hipposysedit:namespace
   
@@ -52,8 +51,8 @@
   hipposysedit:templatetype
   

[HippoCMS-scm] [Git][cms-community/hippo-addon-channel-manager][feature/cmng-psp1] CHANNELMGR-483: Remove the edit button when the user has no write access in the current channel.

2016-03-09 Thread Tobias Jeger
Tobias Jeger pushed to branch feature/cmng-psp1 at cms-community / 
hippo-addon-channel-manager


Commits:
f511261f by Tobias Jeger at 2016-03-09T12:37:40+01:00
CHANNELMGR-483: Remove the edit button when the user has no write access in the 
current channel.

- - - - -


4 changed files:

- frontend-ng/src/angularjs/api/session.service.js
- frontend-ng/src/angularjs/api/session.service.spec.js
- frontend-ng/src/angularjs/channel/channel.controller.js
- frontend-ng/src/angularjs/channel/channel.html


Changes:

=
frontend-ng/src/angularjs/api/session.service.js
=
--- a/frontend-ng/src/angularjs/api/session.service.js
+++ b/frontend-ng/src/angularjs/api/session.service.js
@@ -19,15 +19,20 @@ export class SessionService {
 'ngInject';
 
 this.HstService = HstService;
-this.canWrite = false;
+
+this._canWrite = false;
   }
 
   initialize(channel) {
 return this.HstService
   .initializeSession(channel.hostname, channel.mountId)
   .then((canWrite) => {
-this.canWrite = canWrite;
+this._canWrite = canWrite;
 return channel;
   });
   }
+
+  hasWriteAccess() {
+return this._canWrite;
+  }
 }


=
frontend-ng/src/angularjs/api/session.service.spec.js
=
--- a/frontend-ng/src/angularjs/api/session.service.spec.js
+++ b/frontend-ng/src/angularjs/api/session.service.spec.js
@@ -38,7 +38,7 @@ describe('SessionService', function () {
   });
 
   it('should always be readonly before initialization', function () {
-expect(sessionService.canWrite).toEqual(false);
+expect(sessionService.hasWriteAccess()).toEqual(false);
   });
 
   it('should resolve a promise with the channel argument when initialization 
is successful', function () {
@@ -67,7 +67,7 @@ describe('SessionService', function () {
 sessionService.initialize(channelMock);
 deferred.resolve(true);
 $rootScope.$apply();
-expect(sessionService.canWrite).toEqual(true);
+expect(sessionService.hasWriteAccess()).toEqual(true);
   });
 
 });


=
frontend-ng/src/angularjs/channel/channel.controller.js
=
--- a/frontend-ng/src/angularjs/channel/channel.controller.js
+++ b/frontend-ng/src/angularjs/channel/channel.controller.js
@@ -18,13 +18,14 @@ const SIDENAVS = ['components'];
 
 export class ChannelCtrl {
 
-  constructor($log, $mdSidenav, ChannelService, ScalingService) {
+  constructor($log, $mdSidenav, ChannelService, ScalingService, 
SessionService) {
 'ngInject';
 
 this.$log = $log;
 this.$mdSidenav = $mdSidenav;
 this.ChannelService = ChannelService;
 this.ScalingService = ScalingService;
+this.SessionService = SessionService;
 
 this.iframeUrl = ChannelService.getUrl();
 this.isEditMode = false;
@@ -40,6 +41,10 @@ export class ChannelCtrl {
 this._closeSidenavs();
   }
 
+  isEditable() {
+return this.SessionService.hasWriteAccess();
+  }
+
   _closeSidenavs() {
 SIDENAVS.forEach((sidenav) => {
   if (this._isSidenavOpen(sidenav)) {


=
frontend-ng/src/angularjs/channel/channel.html
=
--- a/frontend-ng/src/angularjs/channel/channel.html
+++ b/frontend-ng/src/angularjs/channel/channel.html
@@ -22,7 +22,9 @@
   {{ 'TOOLBAR_BUTTON_COMPONENTS' | translate }}
 
 
-
+
   {{ channelCtrl.isEditMode ? 
'remove_red_eye' : 'mode_edit' }}
   {{ channelCtrl.isEditMode ? 'TOOLBAR_SWITCH_VIEWER_MODE_VIEW' : 
'TOOLBAR_SWITCH_VIEWER_MODE_EDIT' | translate }}
 



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/f511261faf919febd9b0c48f1cc0bfacbca9e832
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn


[HippoCMS-scm] [Git][cms-community/hippo-addon-channel-manager][feature/cmng-psp1-CHANNELMGR-469] 2 commits: CHANNELMGR-469: added test cases for PageStructureService#removeComponent()

2016-03-09 Thread Canh Ngo
Canh Ngo pushed to branch feature/cmng-psp1-CHANNELMGR-469 at cms-community / 
hippo-addon-channel-manager


Commits:
41866afb by Canh Ngo at 2016-03-09T10:24:44+01:00
CHANNELMGR-469: added test cases for PageStructureService#removeComponent()

- - - - -
f94d29de by Canh Ngo at 2016-03-09T12:18:17+01:00
CHANNELMGR-469: created test-case for HippoIframeController#deleteComponent()

- - - - -


3 changed files:

- + frontend-ng/src/angularjs/channel/hippoIframe/hippoIframe.controller.spec.js
- frontend-ng/src/angularjs/channel/page/pageStructure.service.js
- frontend-ng/src/angularjs/channel/page/pageStructure.service.spec.js


Changes:

=
frontend-ng/src/angularjs/channel/hippoIframe/hippoIframe.controller.spec.js
=
--- /dev/null
+++ 
b/frontend-ng/src/angularjs/channel/hippoIframe/hippoIframe.controller.spec.js
@@ -0,0 +1,79 @@
+/*
+ *
+ *  * Copyright 2016 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.
+ *  * You may obtain a copy of the License at
+ *  *
+ *  *  http://www.apache.org/licenses/LICENSE-2.0
+ *  *
+ *  * Unless required by applicable law or agreed to in writing, software
+ *  * distributed under the License is distributed on an "AS IS" BASIS,
+ *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  * See the License for the specific language governing permissions and
+ *  * limitations under the License.
+ *
+ */
+
+describe('hippoIframeCtrl', function () {
+  'use strict';
+
+  var PageStructureService;
+  var $mdDialog;
+  var hippoIframeCtrl;
+  var $element;
+  var scope;
+  var $q;
+
+  beforeEach(function () {
+module('hippo-cm');
+
+inject(function ($controller, _$rootScope_, _$q_, _$mdDialog_, 
_PageStructureService_) {
+  scope = _$rootScope_.$new();
+  $q = _$q_;
+
+  $mdDialog = _$mdDialog_;
+  PageStructureService = _PageStructureService_;
+
+  spyOn(PageStructureService, 'removeComponent');
+  spyOn(PageStructureService, 'showComponentProperties');
+
+  console.log('initiating controller');
+  hippoIframeCtrl = $controller('hippoIframeCtrl', {
+$scope: scope,
+  });
+});
+  });
+
+  it('initializes mock services', function () {
+expect(PageStructureService.removeComponent).toBeDefined();
+expect(PageStructureService.showComponentProperties).toBeDefined();
+expect($mdDialog.show).toBeDefined();
+expect($mdDialog.confirm).toBeDefined();
+expect(hippoIframeCtrl).toBeDefined();
+  });
+
+  it('shows component properties dialog after rejecting the delete operation', 
function () {
+spyOn($mdDialog, 'show').and.returnValue($q.reject());
+
+hippoIframeCtrl.deleteComponent('1234');
+scope.$digest();
+
+expect($mdDialog.confirm).toHaveBeenCalled();
+expect($mdDialog.show).toHaveBeenCalled();
+
expect(PageStructureService.showComponentProperties).toHaveBeenCalledWith('1234');
+  });
+
+  it('shows the confirmation dialog and deletes selected component', function 
() {
+spyOn($mdDialog, 'show').and.returnValue($q.when([]));
+
+hippoIframeCtrl.deleteComponent('1234');
+scope.$digest();
+
+expect($mdDialog.confirm).toHaveBeenCalled();
+expect($mdDialog.show).toHaveBeenCalled();
+expect(PageStructureService.removeComponent).toHaveBeenCalledWith('1234');
+  });
+
+});


=
frontend-ng/src/angularjs/channel/page/pageStructure.service.js
=
--- a/frontend-ng/src/angularjs/channel/page/pageStructure.service.js
+++ b/frontend-ng/src/angularjs/channel/page/pageStructure.service.js
@@ -19,10 +19,11 @@ import { ComponentElement } from 
'./element/componentElement';
 
 export class PageStructureService {
 
-  constructor($log, HstConstants, hstCommentsProcessorService, HstService, 
ChannelService, CmsService, PageMetaDataService) {
+  constructor($q, $log, HstConstants, hstCommentsProcessorService, HstService, 
ChannelService, CmsService, PageMetaDataService) {
 'ngInject';
 
 // Injected
+this.$q = $q;
 this.$log = $log;
 this.HST = HstConstants;
 this.HstService = HstService;
@@ -90,7 +91,7 @@ export class PageStructureService {
   /**
* Remove the component identified by given Id
* @param componentId
-   * @returns {*} the removed component object
+   * @returns {*} a promise with removed successfully component
*/
   removeComponent(componentId) {
 let component = null;
@@ -100,13 +101,13 @@ export class PageStructureService {
 });
 
 if (!foundContainer) {
-  console.log('Remove component ' + componentId + ' failed');
-  return null;
+  return this.$q.reject();
 }
 // request back-end to remove component
 return this._removeHstComponent(foundContainer.getId(), componentId)
   .then(() => {
  

[HippoCMS-scm] [Git][cms-community/hippo-plugin-poll][feature/translations-psp1] HIPPLUG-1274 convert bootstrap content for translations psp1

2016-03-09 Thread Unico Hommes
Unico Hommes pushed to branch feature/translations-psp1 at cms-community / 
hippo-plugin-poll


Commits:
a89876be by Unico Hommes at 2016-03-09T12:20:03+01:00
HIPPLUG-1274 convert bootstrap content for translations psp1

- - - - -


5 changed files:

- demo/content/src/main/resources/configuration/modules/autoexport-module.xml
- demo/content/src/main/resources/content/documents/poll-demo/common.xml
- 
demo/content/src/main/resources/content/documents/poll-demo/custom-poll-documents.xml
- demo/content/src/main/resources/content/documents/poll-demo/poll-documents.xml
- demo/pom.xml


Changes:

=
demo/content/src/main/resources/configuration/modules/autoexport-module.xml
=
--- 
a/demo/content/src/main/resources/configuration/modules/autoexport-module.xml
+++ 
b/demo/content/src/main/resources/configuration/modules/autoexport-module.xml
@@ -6,8 +6,7 @@
   false
 
 
-  bootstrap/content:/content
-  bootstrap/configuration:/
+  content:/
 
   
 


=
demo/content/src/main/resources/content/documents/poll-demo/common.xml
=
--- a/demo/content/src/main/resources/content/documents/poll-demo/common.xml
+++ b/demo/content/src/main/resources/content/documents/poll-demo/common.xml
@@ -1,16 +1,18 @@
-
-http://www.jcp.org/jcr/sv/1.0; sv:name="common">
+http://www.jcp.org/jcr/sv/1.0; sv:name="common">
   
 hippostd:folder
   
   
-mix:referenceable
 hippotranslation:translated
-hippo:translated
+hippo:named
+mix:referenceable
   
   
 4925daf0-1eb7-47eb-a4c2-602b74ff19e5
   
+  
+Common
+  
   
 new-translated-folder
 new-document
@@ -21,47 +23,27 @@
   
 en
   
-  
-  
-
-  hippo:translation
-
-
-  
-
-
-  Common
-
-  
   
 
   hippo:handle
 
 
+  hippo:named
   mix:referenceable
-  hippo:translated
 
 
   810949d9-dc3c-4bb8-89b9-261580f68518
 
-
-  
-hippo:translation
-  
-  
-
-  
-  
-Home Page
-  
-
+
+  Home Page
+
 
   
 polldemo:textdocument
   
   
-mix:referenceable
 hippotranslation:translated
+mix:referenceable
   
   
 b846d112-f7c5-4d5d-ac02-dfc52b7f6ee6
@@ -70,6 +52,9 @@
 live
 preview
   
+  
+common/homepage
+  
   
 admin
   
@@ -106,7 +91,6 @@
   
 polldemo Home Page
   
-  
   
 
   hippostd:html
@@ -137,30 +121,22 @@ vote again./p
   hippo:handle
 
 
+  hippo:named
   mix:referenceable
-  hippo:translated
 
 
   523d103a-d878-465a-b4fe-095f874d7a7a
 
-
-  
-hippo:translation
-  
-  
-
-  
-  
-About Us
-  
-
+
+  About Us
+
 
   
 polldemo:textdocument
   
   
-mix:referenceable
 hippotranslation:translated
+mix:referenceable
   
   
 1801751e-77b2-4dfb-8420-9d8168df2668
@@ -169,6 +145,9 @@ vote again./p
 live
 preview
   
+  
+common/about-us
+  
   
 admin
   
@@ -202,7 +181,6 @@ vote again./p
   
 About us
   
-  
   
 
   hippostd:html
@@ -218,30 +196,22 @@ vote again./p
   hippo:handle
 
 
+  hippo:named
   mix:referenceable
-  hippo:translated
 
 
   1a72e601-14ed-42f7-96af-4753dde2eb70
 
-
-  
-hippo:translation
-  
-  
-
-  
-  
-myPollComponentDocument
-  
-
+
+  myPollComponentDocument
+
 
   
 polldemo:textdocument
   
   
-mix:referenceable
 hippotranslation:translated
+mix:referenceable
   
   
 3f4c0138-9f0d-468d-8b57-9d22bac34b21
@@ -250,6 +220,9 @@ vote again./p
 live
 preview
   
+  
+common/mypollcomponentdocument
+  
   
 admin
   
@@ -286,7 +259,6 @@ vote again./p
   
 Poll Component Demo
   
-  
   
 
   hippostd:html


=
demo/content/src/main/resources/content/documents/poll-demo/custom-poll-documents.xml
=
--- 
a/demo/content/src/main/resources/content/documents/poll-demo/custom-poll-documents.xml
+++ 
b/demo/content/src/main/resources/content/documents/poll-demo/custom-poll-documents.xml
@@ -1,16 +1,18 @@
-
-http://www.jcp.org/jcr/sv/1.0; 
sv:name="custom-poll-documents">
+http://www.jcp.org/jcr/sv/1.0; sv:name="custom-poll-documents">
   
 hippostd:folder
   
   
-mix:referenceable
 hippotranslation:translated
-hippo:translated
+hippo:named
+

[HippoCMS-scm] [Git][cms-community/hippo-cms][release/2.26] 5 commits: CMS-9925 [Backport 7.9] initial exact clone of wicket 6.21.0 CsrfPreventRequestCyclyListener

2016-03-09 Thread Ard Schrijvers
Ard Schrijvers pushed to branch release/2.26 at cms-community / hippo-cms


Commits:
f98ba1d3 by Ard Schrijvers at 2016-03-09T11:05:35+01:00
CMS-9925 [Backport 7.9] initial exact clone of wicket 6.21.0 
CsrfPreventRequestCyclyListener

(cherry picked from commit 7b237e9301e2f96ba72060fc62fdc621ca550619)
(cherry picked from commit 0e383917a991d59de1d202c0fb4e78d37cc3342a)
(cherry picked from commit eb1fc97e57d26f9e0dcd667d166e92089cb61378)

- - - - -
802907a6 by Ard Schrijvers at 2016-03-09T11:10:18+01:00
CMS-9925 [Backport 7.9] make sure the CsrfPreventionRequestCycleListener forked 
from wicket can also handle requests from behind a proxy like httpd

(cherry picked from commit 06d5bb0e2edb088eeb842fbae1448d53c7b655bf)

- - - - -
20828873 by Ard Schrijvers at 2016-03-09T11:53:21+01:00
CMS-9925 [Backport 7.9] Add support for a comma/tab/return/space separated 
accepted-origin-whitelist in wicket filter init param or context 
param

for example in cms webapp:
  context-param
descriptionThe address of the repository/description
param-nameaccepted-origin-whitelist/param-name
param-valueexample.com, example.org/param-value
  /context-param

  Note that the whitelisting works for subdomains as well, so for above, 
www.example.com and www.example.org are both whitelisted

(cherry picked from commit 8e866fd5cc2b48cdba985be7d5c906e7cd04059c)
(cherry picked from commit 6e6c4f0a846c8c3fc0b9e41d97be120cc7b0437c)
(cherry picked from commit f1d35fbf341b1e907a7774612b4a942d1ce6d2bf)

- - - - -
72025920 by Ard Schrijvers at 2016-03-09T12:10:30+01:00
CMS-9925 Add support for a comma/tab/return/space separated 
accepted-origin-whitelist in wicket filter init param or context 
param and keep the original wicket (apache) license because of original fork 
add a comment below it why it was forked and from which location. Added a rat 
exclusion for the CsrfPreventRequestCyclyListener

(cherry picked from commit da9a98a347b13a4bad82e46ca80a17300f54697c)
(cherry picked from commit 1d0b1138ce18dd6afc23fa58df964418432c387e)
(cherry picked from commit fb9fa7c4c87b710527a5dbc5a4c58da8291367c7)

- - - - -
3b053782 by Ard Schrijvers at 2016-03-09T12:17:41+01:00
CMS-9925 Reintegrate bugfix/CMS-9925

- - - - -


4 changed files:

- + api/src/main/java/org/hippoecm/frontend/util/RequestUtils.java
- engine/src/main/java/org/hippoecm/frontend/Main.java
- + 
engine/src/main/java/org/hippoecm/frontend/http/CsrfPreventionRequestCycleListener.java
- pom.xml


Changes:

=
api/src/main/java/org/hippoecm/frontend/util/RequestUtils.java
=
--- /dev/null
+++ b/api/src/main/java/org/hippoecm/frontend/util/RequestUtils.java
@@ -0,0 +1,134 @@
+/*
+ *  Copyright 2015-2016 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.
+ *  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.hippoecm.frontend.util;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.wicket.request.Request;
+import org.apache.wicket.request.http.WebRequest;
+
+/**
+ * Wicket {@link Request} related utilities.
+ */
+public class RequestUtils {
+
+private RequestUtils() {
+}
+
+/**
+ * Returns the remote client address or null if remote client address 
information is unavailable.
+ * @param request wicket request
+ * @return the remote client address or null if remote client address 
information is unavailable
+ */
+public static String getFarthestRemoteAddr(final Request request) {
+String [] remoteAddrs = getRemoteAddrs(request);
+
+if (ArrayUtils.isNotEmpty(remoteAddrs)) {
+return remoteAddrs[0];
+}
+
+return null;
+}
+
+/**
+ * Returns the remote host addresses related to this request.
+ * If there's any proxy server between the client and the server,
+ * then the proxy addresses are contained in the returned array.
+ * The lowest indexed element is the farthest downstream client and
+ * each successive proxy addresses are the next elements.
+ * @param request wicket request
+ * @return remote host addresses as non-null string array
+ */
+public static String [] getRemoteAddrs(final Request request) {
+if (request instanceof WebRequest) {
+WebRequest webRequest = (WebRequest) request;
+
+String xff = 

[HippoCMS-scm] [Git][cms-community/hippo-addon-channel-manager][feature/cmng-psp1] CHANNELMGR-487: Fix unit test after change in HstService api.

2016-03-09 Thread Tobias Jeger
Tobias Jeger pushed to branch feature/cmng-psp1 at cms-community / 
hippo-addon-channel-manager


Commits:
08397190 by Tobias Jeger at 2016-03-09T12:17:14+01:00
CHANNELMGR-487: Fix unit test after change in HstService api.

- - - - -


1 changed file:

- frontend-ng/src/angularjs/api/hst.service.spec.js


Changes:

=
frontend-ng/src/angularjs/api/hst.service.spec.js
=
--- a/frontend-ng/src/angularjs/api/hst.service.spec.js
+++ b/frontend-ng/src/angularjs/api/hst.service.spec.js
@@ -25,7 +25,8 @@ describe('HstService', function () {
   var apiUrlPrefix = '/testApiUrlPrefix';
   var rootUuid = 'cafebabe';
   var hostname = 'test.host.name';
-  var handshakeUrl = contextPath + apiUrlPrefix + '/' + rootUuid + 
'./composermode/' + hostname;
+  var mountId = '1234';
+  var handshakeUrl = contextPath + apiUrlPrefix + '/' + rootUuid + 
'./composermode/' + hostname + '/' + mountId;
 
   beforeEach(function () {
 module('hippo-cm-api');
@@ -74,7 +75,7 @@ describe('HstService', function () {
 
   it('should construct a valid handshake url when initializing a channel 
session', function () {
 $httpBackend.expectGET(handshakeUrl).respond(200);
-hstService.initializeSession(hostname);
+hstService.initializeSession(hostname, mountId);
 $httpBackend.flush();
   });
 
@@ -94,7 +95,7 @@ describe('HstService', function () {
 it('should resolve a promise', function () {
   var promiseSpy = jasmine.createSpy('promiseSpy');
   $httpBackend.expectGET(handshakeUrl).respond(200);
-  hstService.initializeSession(hostname).then(promiseSpy);
+  hstService.initializeSession(hostname, mountId).then(promiseSpy);
   $httpBackend.flush();
   expect(promiseSpy).toHaveBeenCalled();
 });
@@ -102,7 +103,7 @@ describe('HstService', function () {
 it('should resolve with true if response data parameter canWrite is true', 
function () {
   var promiseSpy = jasmine.createSpy('promiseSpy');
   $httpBackend.expectGET(handshakeUrl).respond(200, { data: { canWrite: 
true } });
-  hstService.initializeSession(hostname).then(promiseSpy);
+  hstService.initializeSession(hostname, mountId).then(promiseSpy);
   $httpBackend.flush();
   expect(promiseSpy).toHaveBeenCalledWith(true);
 });
@@ -110,7 +111,7 @@ describe('HstService', function () {
 it('should resolve with false if response data parameter canWrite is 
false', function () {
   var promiseSpy = jasmine.createSpy('promiseSpy');
   $httpBackend.expectGET(handshakeUrl).respond(200, { data: { canWrite: 
false } });
-  hstService.initializeSession(hostname).then(promiseSpy);
+  hstService.initializeSession(hostname, mountId).then(promiseSpy);
   $httpBackend.flush();
   expect(promiseSpy).toHaveBeenCalledWith(false);
 });
@@ -118,7 +119,7 @@ describe('HstService', function () {
 it('should resolve with false if response data parameter is missing', 
function () {
   var promiseSpy = jasmine.createSpy('promiseSpy');
   $httpBackend.expectGET(handshakeUrl).respond(200);
-  hstService.initializeSession(hostname).then(promiseSpy);
+  hstService.initializeSession(hostname, mountId).then(promiseSpy);
   $httpBackend.flush();
   expect(promiseSpy).toHaveBeenCalledWith(false);
 });
@@ -128,7 +129,7 @@ describe('HstService', function () {
 var catchSpy = jasmine.createSpy('catchSpy');
 $httpBackend.expectGET(handshakeUrl).respond(500);
 hstService
-  .initializeSession(hostname)
+  .initializeSession(hostname, mountId)
   .catch(catchSpy);
 
 $httpBackend.flush();



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/083971909ea483014d0e146b54d6b78e0f32471e
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn


[HippoCMS-scm] [Git][cms-community/hippo-cms][bugfix/CMS-9925] 4 commits: CMS-9925 [Backport 7.9] initial exact clone of wicket 6.21.0 CsrfPreventRequestCyclyListener

2016-03-09 Thread Ard Schrijvers
Ard Schrijvers pushed to branch bugfix/CMS-9925 at cms-community / hippo-cms


Commits:
f98ba1d3 by Ard Schrijvers at 2016-03-09T11:05:35+01:00
CMS-9925 [Backport 7.9] initial exact clone of wicket 6.21.0 
CsrfPreventRequestCyclyListener

(cherry picked from commit 7b237e9301e2f96ba72060fc62fdc621ca550619)
(cherry picked from commit 0e383917a991d59de1d202c0fb4e78d37cc3342a)
(cherry picked from commit eb1fc97e57d26f9e0dcd667d166e92089cb61378)

- - - - -
802907a6 by Ard Schrijvers at 2016-03-09T11:10:18+01:00
CMS-9925 [Backport 7.9] make sure the CsrfPreventionRequestCycleListener forked 
from wicket can also handle requests from behind a proxy like httpd

(cherry picked from commit 06d5bb0e2edb088eeb842fbae1448d53c7b655bf)

- - - - -
20828873 by Ard Schrijvers at 2016-03-09T11:53:21+01:00
CMS-9925 [Backport 7.9] Add support for a comma/tab/return/space separated 
accepted-origin-whitelist in wicket filter init param or context 
param

for example in cms webapp:
  context-param
descriptionThe address of the repository/description
param-nameaccepted-origin-whitelist/param-name
param-valueexample.com, example.org/param-value
  /context-param

  Note that the whitelisting works for subdomains as well, so for above, 
www.example.com and www.example.org are both whitelisted

(cherry picked from commit 8e866fd5cc2b48cdba985be7d5c906e7cd04059c)
(cherry picked from commit 6e6c4f0a846c8c3fc0b9e41d97be120cc7b0437c)
(cherry picked from commit f1d35fbf341b1e907a7774612b4a942d1ce6d2bf)

- - - - -
72025920 by Ard Schrijvers at 2016-03-09T12:10:30+01:00
CMS-9925 Add support for a comma/tab/return/space separated 
accepted-origin-whitelist in wicket filter init param or context 
param and keep the original wicket (apache) license because of original fork 
add a comment below it why it was forked and from which location. Added a rat 
exclusion for the CsrfPreventRequestCyclyListener

(cherry picked from commit da9a98a347b13a4bad82e46ca80a17300f54697c)
(cherry picked from commit 1d0b1138ce18dd6afc23fa58df964418432c387e)
(cherry picked from commit fb9fa7c4c87b710527a5dbc5a4c58da8291367c7)

- - - - -


4 changed files:

- + api/src/main/java/org/hippoecm/frontend/util/RequestUtils.java
- engine/src/main/java/org/hippoecm/frontend/Main.java
- + 
engine/src/main/java/org/hippoecm/frontend/http/CsrfPreventionRequestCycleListener.java
- pom.xml


Changes:

=
api/src/main/java/org/hippoecm/frontend/util/RequestUtils.java
=
--- /dev/null
+++ b/api/src/main/java/org/hippoecm/frontend/util/RequestUtils.java
@@ -0,0 +1,134 @@
+/*
+ *  Copyright 2015-2016 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.
+ *  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.hippoecm.frontend.util;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.wicket.request.Request;
+import org.apache.wicket.request.http.WebRequest;
+
+/**
+ * Wicket {@link Request} related utilities.
+ */
+public class RequestUtils {
+
+private RequestUtils() {
+}
+
+/**
+ * Returns the remote client address or null if remote client address 
information is unavailable.
+ * @param request wicket request
+ * @return the remote client address or null if remote client address 
information is unavailable
+ */
+public static String getFarthestRemoteAddr(final Request request) {
+String [] remoteAddrs = getRemoteAddrs(request);
+
+if (ArrayUtils.isNotEmpty(remoteAddrs)) {
+return remoteAddrs[0];
+}
+
+return null;
+}
+
+/**
+ * Returns the remote host addresses related to this request.
+ * If there's any proxy server between the client and the server,
+ * then the proxy addresses are contained in the returned array.
+ * The lowest indexed element is the farthest downstream client and
+ * each successive proxy addresses are the next elements.
+ * @param request wicket request
+ * @return remote host addresses as non-null string array
+ */
+public static String [] getRemoteAddrs(final Request request) {
+if (request instanceof WebRequest) {
+WebRequest webRequest = (WebRequest) request;
+
+String xff = webRequest.getHeader("X-Forwarded-For");
+
+if (xff != null) {
+String [] addrs = xff.split(",");
+
+  

[HippoCMS-scm] [Git][cms-community/hippo-addon-channel-manager][feature/cmng-psp1] CHANNELMGR-487: supply the rendering mount id whet setting the "composermode" in…

2016-03-09 Thread Tobias Jeger
Tobias Jeger pushed to branch feature/cmng-psp1 at cms-community / 
hippo-addon-channel-manager


Commits:
bab4b4a3 by Tobias Jeger at 2016-03-09T12:08:06+01:00
CHANNELMGR-487: supply the rendering mount id whet setting the 
composermode in order to make CM-originated back-end calls 
independent of preview iframe-originated ones.

- - - - -


2 changed files:

- frontend-ng/src/angularjs/api/hst.service.js
- frontend-ng/src/angularjs/api/session.service.js


Changes:

=
frontend-ng/src/angularjs/api/hst.service.js
=
--- a/frontend-ng/src/angularjs/api/hst.service.js
+++ b/frontend-ng/src/angularjs/api/hst.service.js
@@ -39,8 +39,8 @@ export class HstService {
 this.config = ConfigService;
   }
 
-  initializeSession(hostname) {
-return this.doGet(this.config.rootUuid, 'composermode', hostname)
+  initializeSession(hostname, mountId) {
+return this.doGet(this.config.rootUuid, 'composermode', hostname, mountId)
   .then((response) => !!(response && response.data && 
response.data.canWrite));
   }
 


=
frontend-ng/src/angularjs/api/session.service.js
=
--- a/frontend-ng/src/angularjs/api/session.service.js
+++ b/frontend-ng/src/angularjs/api/session.service.js
@@ -24,7 +24,7 @@ export class SessionService {
 
   initialize(channel) {
 return this.HstService
-  .initializeSession(channel.hostname)
+  .initializeSession(channel.hostname, channel.mountId)
   .then((canWrite) => {
 this.canWrite = canWrite;
 return channel;



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/bab4b4a3fc9b1aa6488611b1e3a721c0414b77d4
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn


[HippoCMS-scm] [Git][cms-community/hippo-site-toolkit][feature/cmng-psp1] HSTTWO-3614: Add support for setting the rendering mount id during the initial c…

2016-03-09 Thread Tobias Jeger
Tobias Jeger pushed to branch feature/cmng-psp1 at cms-community / 
hippo-site-toolkit


Commits:
9785a477 by Tobias Jeger at 2016-03-09T12:06:22+01:00
HSTTWO-3614: Add support for setting the rendering mount id during the initial 
composermode call. This makes the timing of CM-related calls to the back-end 
independent of the calls issued by the preview iframe.

- - - - -


1 changed file:

- 
client-modules/page-composer/src/main/java/org/hippoecm/hst/pagecomposer/jaxrs/services/RootResource.java


Changes:

=
client-modules/page-composer/src/main/java/org/hippoecm/hst/pagecomposer/jaxrs/services/RootResource.java
=
--- 
a/client-modules/page-composer/src/main/java/org/hippoecm/hst/pagecomposer/jaxrs/services/RootResource.java
+++ 
b/client-modules/page-composer/src/main/java/org/hippoecm/hst/pagecomposer/jaxrs/services/RootResource.java
@@ -133,13 +133,15 @@ public class RootResource extends AbstractConfigResource {
 }
 
 @GET
-@Path("/composermode/{renderingHost}/")
+@Path("/composermode/{renderingHost}/{mountId}")
 @Produces(MediaType.APPLICATION_JSON)
 public Response composerModeGet(@Context HttpServletRequest servletRequest,
-@PathParam("renderingHost") String 
renderingHost) {
+@PathParam("renderingHost") String 
renderingHost,
+@PathParam("mountId") String mountId) {
 HttpSession session = servletRequest.getSession(true);
 session.setAttribute(ContainerConstants.RENDERING_HOST, renderingHost);
 session.setAttribute(ContainerConstants.COMPOSER_MODE_ATTR_NAME, 
Boolean.TRUE);
+
session.setAttribute(ContainerConstants.CMS_REQUEST_RENDERING_MOUNT_ID, 
mountId);
 boolean canWrite;
 try {
 HstRequestContext requestContext = 
getPageComposerContextService().getRequestContext();



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-site-toolkit/commit/9785a477320c71fe5b5b4e9e833864e0c37bb383
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn


[HippoCMS-scm] [Git][cms-community/hippo-plugin-dashboard-document-wizard][feature/translations-psp1] HIPPLUG-1274 convert bootstrap content for translations-psp1

2016-03-09 Thread Unico Hommes
Unico Hommes pushed to branch feature/translations-psp1 at cms-community / 
hippo-plugin-dashboard-document-wizard


Commits:
106f6475 by Unico Hommes at 2016-03-09T11:47:02+01:00
HIPPLUG-1274 convert bootstrap content for translations-psp1

- - - - -


14 changed files:

- 
demo/bootstrap/configuration/src/main/resources/configuration/queries/templates/new-events-document.xml
- 
demo/bootstrap/configuration/src/main/resources/configuration/queries/templates/new-events-folder.xml
- 
demo/bootstrap/configuration/src/main/resources/configuration/queries/templates/new-news-document.xml
- 
demo/bootstrap/configuration/src/main/resources/configuration/queries/templates/new-news-folder.xml
- demo/bootstrap/configuration/src/main/resources/hippoecm-extension.xml
- 
demo/bootstrap/configuration/src/main/resources/namespaces/dashboarddocumentwizarddemo/eventsdocument.xml
- 
demo/bootstrap/configuration/src/main/resources/namespaces/dashboarddocumentwizarddemo/newsdocument.xml
- + demo/bootstrap/configuration/src/main/resources/translations.json
- demo/bootstrap/content/src/main/resources/content.xml
- demo/bootstrap/content/src/main/resources/content/documents/administration.xml
- 
demo/bootstrap/content/src/main/resources/content/documents/administration/labels.xml
- 
demo/bootstrap/content/src/main/resources/content/documents/dashboarddocumentwizarddemo/events.xml
- 
demo/bootstrap/content/src/main/resources/content/documents/dashboarddocumentwizarddemo/news.xml
- demo/pom.xml


Changes:

=
demo/bootstrap/configuration/src/main/resources/configuration/queries/templates/new-events-document.xml
=
--- 
a/demo/bootstrap/configuration/src/main/resources/configuration/queries/templates/new-events-document.xml
+++ 
b/demo/bootstrap/configuration/src/main/resources/configuration/queries/templates/new-events-document.xml
@@ -2,9 +2,6 @@
   
 hippostd:templatequery
   
-  
-hippo:translated
-  
   
 adddocument_ico
   
@@ -32,74 +29,4 @@
   
 
//element(*,hipposysedit:namespacefolder)/element(*,mix:referenceable)/element(*,hipposysedit:templatetype)/hipposysedit:prototypes/element(hipposysedit:prototype,dashboarddocumentwizarddemo:eventsdocument)
   
-  
-
-  hippo:translation
-
-
-  
org.hippoecm.repository.standardworkflow.FolderWorkflow
-
-
-  en
-
-
-  new event
-
-  
-  
-
-  hippo:translation
-
-
-  
org.hippoecm.repository.standardworkflow.FolderWorkflow
-
-
-  nl
-
-
-  nieuw event
-
-  
-  
-
-  hippo:translation
-
-
-  
org.hippoecm.repository.standardworkflow.FolderWorkflow
-
-
-  fr
-
-
-  nouveau event
-
-  
-  
-
-  hippo:translation
-
-
-  
org.hippoecm.repository.standardworkflow.FolderWorkflow
-
-
-  it
-
-
-  nouvo event
-
-  
-  
-
-  hippo:translation
-
-
-  
org.hippoecm.repository.standardworkflow.FolderWorkflow
-
-
-  de
-
-
-  Neues Event
-
-  
 


=
demo/bootstrap/configuration/src/main/resources/configuration/queries/templates/new-events-folder.xml
=
--- 
a/demo/bootstrap/configuration/src/main/resources/configuration/queries/templates/new-events-folder.xml
+++ 
b/demo/bootstrap/configuration/src/main/resources/configuration/queries/templates/new-events-folder.xml
@@ -4,7 +4,6 @@
   
   
 hipposys:implementation
-hippo:translated
   
   
 addfolder_ico
@@ -35,8 +34,8 @@
 hippostd:folder
   
   
-mix:referenceable
 hippotranslation:translated
+mix:referenceable
   
   
 fe61963f-6d5f-42da-9d8e-3c6974ebe98e
@@ -53,74 +52,4 @@
   
 
   
-  
-
-  hippo:translation
-
-
-  
org.hippoecm.repository.standardworkflow.FolderWorkflow
-
-
-  en
-
-
-  new events folder
-
-  
-  
-
-  hippo:translation
-
-
-  
org.hippoecm.repository.standardworkflow.FolderWorkflow
-
-
-  nl
-
-
-  nieuwe eventsmap
-
-  
-  
-
-  hippo:translation
-
-
-  
org.hippoecm.repository.standardworkflow.FolderWorkflow
-
-
-  it
-
-
-  nuova cartella events
-
-  
-  
-
-  hippo:translation
-
-
-  
org.hippoecm.repository.standardworkflow.FolderWorkflow
-
-
-  fr
-
-
-  un nouveau dossier events
-
-  
-  
-
-  hippo:translation
-
-
-  
org.hippoecm.repository.standardworkflow.FolderWorkflow
-
-
-  it
-
-
-  Nuova cartella events
-
-  
 


=
demo/bootstrap/configuration/src/main/resources/configuration/queries/templates/new-news-document.xml
=
--- 

[HippoCMS-scm] [Git][cms-community/hippo-cms] Deleted branch bugfix/CMS-9919

2016-03-09 Thread Ard Schrijvers
Ard Schrijvers deleted branch bugfix/CMS-9919 at cms-community / hippo-cms
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn


[HippoCMS-scm] [Git][cms-community/hippo-cms][release/2.24] 4 commits: :CMS-9919 copyright

2016-03-09 Thread Ard Schrijvers
Ard Schrijvers pushed to branch release/2.24 at cms-community / hippo-cms


Commits:
a813da1a by Ard Schrijvers at 2016-02-09T13:51:25+01:00
:CMS-9919 copyright

- - - - -
722d6233 by Ard Schrijvers at 2016-02-10T16:39:00+01:00
CMS-9919 add support to short circuit cross origin requests and add support for 
origin whitelisting

- - - - -
3c04b37a by Ard Schrijvers at 2016-02-11T14:02:31+01:00
CMS-9919 adjust license header to account for the original wicket based logic 
which is still preserved

- - - - -
d54f5eb2 by Ard Schrijvers at 2016-03-09T10:31:42+01:00
CMS-9919 Reintegrate bugfix/CMS-9919

- - - - -


3 changed files:

- engine/src/main/java/org/hippoecm/frontend/Main.java
- + 
engine/src/main/java/org/hippoecm/frontend/http/CsrfPreventionWebRequestCycle.java
- pom.xml


Changes:

=
engine/src/main/java/org/hippoecm/frontend/Main.java
=
--- a/engine/src/main/java/org/hippoecm/frontend/Main.java
+++ b/engine/src/main/java/org/hippoecm/frontend/Main.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2008-2013 Hippo B.V. (http://www.onehippo.com)
+ *  Copyright 2008-2016 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.
@@ -17,7 +17,6 @@ package org.hippoecm.frontend;
 
 import java.io.IOException;
 import java.net.URL;
-import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -30,6 +29,7 @@ import javax.jcr.SimpleCredentials;
 import javax.jcr.observation.EventListener;
 import javax.jcr.observation.EventListenerIterator;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.math.NumberUtils;
 import org.apache.wicket.Application;
 import org.apache.wicket.IRequestTarget;
@@ -48,7 +48,6 @@ import org.apache.wicket.request.IRequestCycleProcessor;
 import org.apache.wicket.request.RequestParameters;
 import 
org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy;
 import 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget;
-import org.apache.wicket.resource.loader.IStringResourceLoader;
 import org.apache.wicket.session.ISessionStore;
 import org.apache.wicket.session.pagemap.LeastRecentlyAccessedEvictionStrategy;
 import org.apache.wicket.settings.IExceptionSettings;
@@ -56,6 +55,7 @@ import org.apache.wicket.settings.IResourceSettings;
 import org.apache.wicket.util.lang.Bytes;
 import org.apache.wicket.util.string.StringValueConversionException;
 import org.apache.wicket.util.time.Duration;
+import org.hippoecm.frontend.http.CsrfPreventionWebRequestCycle;
 import org.hippoecm.frontend.model.JcrHelper;
 import org.hippoecm.frontend.model.JcrNodeModel;
 import org.hippoecm.frontend.model.UserCredentials;
@@ -90,6 +90,9 @@ public class Main extends PluginApplication {
 public final static String OUTPUT_WICKETPATHS = "output-wicketpaths";
 public final static String PLUGIN_APPLICATION_NAME_PARAMETER = "config";
 
+// comma separated init parameter
+public final static String ACCEPTED_ORIGIN_WHITELIST = 
"accepted-origin-whitelist";
+
 /**
  * Wicket RequestCycleSettings timeout configuration parameter name in 
development mode.
  */
@@ -107,6 +110,9 @@ public class Main extends PluginApplication {
 
 private HippoRepository repository;
 
+// array of accepted origins or {@code null} if no configured
+private String[] acceptedOrigins;
+
 @Override
 protected void init() {
 super.init();
@@ -117,6 +123,8 @@ public class Main extends PluginApplication {
 getSessionSettings().setPageMapEvictionStrategy(new 
LeastRecentlyAccessedEvictionStrategy(1));
 
 
getApplicationSettings().setPageExpiredErrorPage(PageExpiredErrorPage.class);
+
+acceptedOrigins = 
StringUtils.split(getConfigurationParameter(ACCEPTED_ORIGIN_WHITELIST, null), " 
,\t\f\r\n");
 try {
 String cfgParam = getConfigurationParameter(MAXUPLOAD_PARAM, null);
 if (cfgParam != null && cfgParam.trim().length() > 0) {
@@ -398,6 +406,11 @@ DEFAULT_DEVELOPMENT_REQUEST_TIMEOUT_MS);
 }
 
 @Override
+public RequestCycle newRequestCycle(final Request request, final Response 
response) {
+return new CsrfPreventionWebRequestCycle(this, (WebRequest)request, 
response, acceptedOrigins);
+}
+
+@Override
 protected IRequestCycleProcessor newRequestCycleProcessor() {
 return new PluginRequestCycleProcessor();
 }


=
engine/src/main/java/org/hippoecm/frontend/http/CsrfPreventionWebRequestCycle.java
=
--- /dev/null
+++ 
b/engine/src/main/java/org/hippoecm/frontend/http/CsrfPreventionWebRequestCycle.java
@@ -0,0 +1,296 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license