\r\n\r\n\r\n```\r\n\r\n2) Then, I have added the contribution in another html file, defining the slot contribution (I named this file \"nuxeo-custom-none-bundle.html\"):\r\n```\r\n\r\n\r\n\r\n \r\n\r\n```\r\n\r\nBoth files are located in the same directory in my project, in web/nuxeo.war/ui.\r\n\r\n3) Finally, I added the extensions:\r\n```\r\n\r\n\t\r\n\t\t/ui/nuxeo-custom-none-bundle.html\r\n\t\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\tnuxeo-custom-none-bundle.html\r\n\t\t\r\n\t\r\n\r\n```\r\n\r\nThe contribution seems to be working properly, as when I access to a document, I can see that the module loaded is the \"nuxeo-document-page-v2\" as expected:\r\n\r\n![type an image title](https://i.imgur.com/ZXnED9V.png)\r\n\r\nHowever, without modifying anything in the copied dom-module, it doesn't work as expected, as for example the comments tab is empty when the document has comments. This only happens if I am logged as Anonymous user (yes, I know that this is what we want to achieve, but this happens because of an error, not because of a filter for anonymous users).\r\n\r\n![type an image title](https://i.imgur.com/Qi2YmxN.png)\r\n\r\nAnyway, what I have tried to do is to use a nuxeo-filter to remove the full \"Comments & Activity\" section according to user.isAnonymous property, but then I found another problem: we don't have the \"user\" object in that module!\r\n\r\nI tried to modify the slot contriution as follows in order to get the \"user\" object in the module:\r\n```\r\n\r\n```\r\nAnd I also added it in \"properties\", inside the Polymer object in the nuxeo-document-page-v2.html file, after the \"document\" property:\r\n```\r\nuser: {\r\n type: Object\r\n},\r\n```\r\nHowever, the behaviour is really strange, as when I try to use the \"user\" object, sometimes it is the user, sometimes it is the document, and sometimes it is undefined. So I don't understand what's happening here.\r\n\r\nSorry for not being able to be more helpful. I will keep trying to make it work.\r\n\r\nRegards.\r\n", "htmlContent" : "

Hello,

\n

thank you Anton Petrov for the information to use the anonymous authentication. In my case, even in “incognito” window in Chrome, it didn't work. I needed to clear my cookies everytime I wanted to login as Administrator. I think there is a bug for windows in this authentication method.

\n

Anyway, I have been trying to hide the Comments and Activity sections from the document view without success, and I don't know if it is possible. As Gregory Carlin said, I have created my own “nuxeo-document-page” contribution like follows:

\n

1) First, I have created my own dom-module, copy of the “nuxeo-document-page” module (this module is defined inside the “elements.html” file, in ${NUXEO_HOME}/nxserver/nuxeo.war/ui). I named the module “nuxeo-document-page-v2”, and the file was “nuxeo-document-page-v2.html”:

\n
<dom-module id=\"nuxeo-document-page-v2\" assetpath=\"document/\">\n  <template>\n    <style include=\"nuxeo-styles\">\n      #details {\n        width: 28px;\n        height: 28px;\n        padding: 5px;\n        opacity: 0.3;\n        margin: 6px 0;\n      }\n\n      :host([opened]) #details {\n        opacity: 1;\n        margin-left: 6px;\n      }\n\n      #documentViewsItems {\n        @apply --layout-horizontal;\n        --paper-listbox-background-color: transparent;\n      }\n\n      #documentViewsItems > [name='comments'] {\n        margin: 0;\n      }\n\n      .scrollerHeader {\n        @apply --layout-horizontal;\n      }\n\n      :host([opened]) .scrollerHeader {\n        box-shadow: 0 3px 5px rgba(0,0,0,0.04) !important;\n        border-radius: 0;\n        background-color: var(--nuxeo-box) !important;\n      }\n\n      .page {\n        @apply --layout-horizontal;\n      }\n\n      .main {\n        @apply --layout-vertical;\n        @apply --layout-flex-2;\n        padding-right: 8px;\n        overflow: hidden;\n      }\n\n      :host([opened]) .main {\n        padding-right: 16px;\n      }\n\n      .side {\n        @apply --layout-vertical;\n        position: relative;\n        margin-bottom: var(--nuxeo-card-margin-bottom, 16px);\n        min-height: 60vh;\n      }\n\n      :host([opened]) .side {\n        @apply --layout-flex;\n      }\n\n      .scroller {\n        @apply --nuxeo-card;\n        margin-bottom: 0;\n        overflow: auto;\n        display: none;\n        left: 0;\n        top: 36px;\n        right: 0;\n        bottom: 0;\n        position: absolute;\n      }\n\n      :host([opened]) .scroller {\n        display: block;\n      }\n\n      .section {\n        margin-bottom: 32px;\n      }\n\n      .section:last-of-type {\n        margin-bottom: 64px;\n      }\n\n      nuxeo-document-view {\n        --nuxeo-document-content-margin-bottom: var(--nuxeo-card-margin-bottom);\n      }\n\n      @media (max-width: 1024px) {\n        #details {\n          opacity: 1;\n          margin-left: 6px;\n          cursor: default;\n        }\n\n        .scrollerHeader {\n          box-shadow: 0 3px 5px rgba(0,0,0,0.04) !important;\n          font-family: var(--nuxeo-app-font);\n          border-radius: 0;\n          background-color: var(--nuxeo-box) !important;\n        }\n\n        .page {\n          @apply --layout-vertical;\n        }\n\n        .main,\n        :host([opened]) .main {\n          padding: 0;\n          max-width: initial;\n          margin-right: 0;\n        }\n\n        .side {\n          padding: 0;\n          max-width: initial;\n          min-height: initial;\n          display: block;\n          margin-bottom: 16px;\n        }\n\n        .scroller {\n          top: 0;\n          position: relative;\n          display: block;\n        }\n      }\n    </style>\n\n    <nuxeo-document-info-bar document=\"[[document]]\"></nuxeo-document-info-bar>\n\n    <div class=\"page\">\n\n      <div class=\"main\">\n        <nuxeo-document-view document=\"[[document]]\"></nuxeo-document-view>\n      </div>\n\n      <div class=\"side\">\n        <div class=\"scrollerHeader\">\n          <paper-icon-button id=\"details\" noink=\"\" icon=\"nuxeo:details\" on-tap=\"_toggleOpened\"></paper-icon-button>\n          <nuxeo-tooltip for=\"details\">[[i18n('documentPage.details.opened')]]</nuxeo-tooltip>\n        </div>\n        <div class=\"scroller\">\n          <div class=\"section\">\n            <nuxeo-document-info document=\"[[document]]\"></nuxeo-document-info>\n          </div>\n\n          <div class=\"section\">\n            <nuxeo-document-metadata document=\"[[document]]\"></nuxeo-document-metadata>\n          </div>\n\n          <div class=\"section\" hidden$=\"[[!_hasCollections(document)]]\">\n            <h3>[[i18n('documentPage.collections')]]</h3>\n            <nuxeo-document-collections document=\"[[document]]\"></nuxeo-document-collections>\n          </div>\n\n          <template is=\"dom-if\" if=\"[[hasFacet(document, 'NXTag')]]\">\n            <div class=\"section\">\n              <h3>[[i18n('documentPage.tags')]]</h3>\n              <nuxeo-tag-suggestion document=\"[[document]]\" allow-new-tags=\"\" placeholder=\"[[i18n('documentPage.tags.placeholder')]]\" readonly=\"[[!isTaggable(document)]]\">\n              </nuxeo-tag-suggestion>\n            </div>\n          </template>\n          <div class=\"section\">\n            <paper-listbox id=\"documentViewsItems\" selected=\"{{selectedTab}}\" attr-for-selected=\"name\">\n              <nuxeo-page-item name=\"comments\" label=\"[[i18n('documentPage.comments')]]\"></nuxeo-page-item>\n              <nuxeo-page-item name=\"activity\" label=\"[[i18n('documentPage.activity')]]\"></nuxeo-page-item>\n            </paper-listbox>\n            <iron-pages selected=\"[[selectedTab]]\" attr-for-selected=\"name\" selected-item=\"{{page}}\">\n              <nuxeo-document-comment-thread name=\"comments\" uid=\"[[document.uid]]\"></nuxeo-document-comment-thread>\n              <nuxeo-document-activity name=\"activity\" document=\"[[document]]\"></nuxeo-document-activity>\n            </iron-pages>\n          </div>\n        </div>\n      </div>\n    </div>\n\n  </template>\n  <script>\n    Polymer({\n      is: 'nuxeo-document-page-v2',\n      behaviors: [Nuxeo.LayoutBehavior],\n      properties: {\n        document: {\n          type: Object\n        },\n        selectedTab: {\n          type: String,\n          value: 'comments',\n          notify: true\n        },\n        opened: {\n          type: Boolean,\n          value: false,\n          notify: true,\n          reflectToAttribute: true,\n          observer: '_openedChanged',\n        }\n      },\n\n      _openedChanged: function() {\n        Polymer.Async.animationFrame.run(function() {\n          // notify that there was a resize\n          this.dispatchEvent(new CustomEvent('resize', {\n            bubbles: false,\n            composed: true,\n          }));\n        });\n      },\n\n      _toggleOpened: function() {\n        this.opened = !this.opened;\n      },\n\n      _isMutable: function(doc) {\n        return !this.hasFacet(doc, 'Immutable') && doc.type !== 'Root' && !this.isTrashed(doc);\n      },\n\n      _hasCollections: function(doc) {\n        return this.hasCollections(doc);\n      }\n    });\n  </script>\n\n</dom-module>\n
\n

2) Then, I have added the contribution in another html file, defining the slot contribution (I named this file “nuxeo-custom-none-bundle.html”):

\n
<link rel=\"import\" href=\"nuxeo-document-page-v2.html\">\n\n<nuxeo-slot-content name=\"documentViewPage\" slot=\"DOCUMENT_VIEWS_PAGES\" order=\"10\">\n  <template>\n    <nuxeo-filter document=\"[[document]]\" expression=\"document.facets.indexOf('Folderish') === -1\n                                                   && document.facets.indexOf('Collection') === -1\">\n      <template>\n        <nuxeo-document-page-v2 name=\"view\" document=\"[[document]]\" opened=\"\"></nuxeo-document-page-v2>\n      </template>\n    </nuxeo-filter>\n  </template>\n</nuxeo-slot-content>\n
\n

Both files are located in the same directory in my project, in web/nuxeo.war/ui.

\n

3) Finally, I added the extensions:

\n
<extension target=\"org.nuxeo.ecm.platform.WebResources\" point=\"resources\">\n    <resource name=\"nuxeo-custom-none-bundle.html\" type=\"import\" shrinkable=\"false\">\n        <uri>/ui/nuxeo-custom-none-bundle.html</uri>\n    </resource>\n</extension>\n<extension target=\"org.nuxeo.ecm.platform.WebResources\" point=\"bundles\">\n    <bundle name=\"web-ui\">\n        <resources append=\"true\">\n            <resource>nuxeo-custom-none-bundle.html</resource>\n        </resources>\n    </bundle>\n</extension>\n
\n

The contribution seems to be working properly, as when I access to a document, I can see that the module loaded is the “nuxeo-document-page-v2” as expected:

\n

\"type

\n

However, without modifying anything in the copied dom-module, it doesn't work as expected, as for example the comments tab is empty when the document has comments. This only happens if I am logged as Anonymous user (yes, I know that this is what we want to achieve, but this happens because of an error, not because of a filter for anonymous users).

\n

\"type

\n

Anyway, what I have tried to do is to use a nuxeo-filter to remove the full “Comments & Activity” section according to user.isAnonymous property, but then I found another problem: we don't have the “user” object in that module!

\n

I tried to modify the slot contriution as follows in order to get the “user” object in the module:

\n
<nuxeo-document-page-v2 name=\"view\" document=\"[[document]]\" user=\"[[user]]\" opened=\"\"></nuxeo-document-page-v2>\n
\n

And I also added it in “properties”, inside the Polymer object in the nuxeo-document-page-v2.html file, after the “document” property:

\n
user: {\n   type: Object\n},\n
\n

However, the behaviour is really strange, as when I try to use the “user” object, sometimes it is the user, sometimes it is the document, and sometimes it is undefined. So I don't understand what's happening here.

\n

Sorry for not being able to be more helpful. I will keep trying to make it work.

\n

Regards.

" }, { "id" : "ad2a1451-d2e1-4352-8ac2-2dd9989c1c9b", "label" : "3", "active" : false, "author" : { "uid" : "b0011555-846d-404a-b4a4-85bc56946f40", "name" : "b0011555-846d-404a-b4a4-85bc56946f40", "email" : "rodricmate@gmail.com", "firstName" : "Rodri", "lastName" : "", "title" : "Member", "score" : 2741, "disabled" : false, "virtual" : false, "badgeCount" : null, "notifications" : { "email" : { "name" : "email", "address" : "rodricmate@gmail.com", "notifs" : [ "EditMyAnswer", "CommentMyAnswer", "EditMyQuestion", "NewQuestionComment", "AnswerMyQuestion", "WeeklyDigest", "VoteMyQuestion", "BadgeAwarded", "VoteMyAnswer", "TagMyQuestion", "CommentMyQuestion", "NewQuestion", "NewAnswerComment", "NewAnswer" ] }, "phone" : null }, "badges" : [ "watcher", "lucky", "editor", "commentator", "watched", "teacher", "fairplay", "striker", "revival", "hope", "scholar", "popular" ], "loginCount" : 55, "lastLogin" : 1585562831066, "avatarUrl" : "https://app.quandora.com/skin/avatar/b0011555-846d-404a-b4a4-85bc56946f40?sz=%s" }, "created" : "2020-02-22T10:35:54.19Z", "createdAt" : "02/22/2020", "title" : null, "content" : "Hello,\r\n\r\nthank you [Anton Petrov](https://app.quandora.com/object/6ac57d57-5a4d-452a-93a3-95ca89435a6e) for the information to use the anonymous authentication. In my case, even in \"incognito\" window in Chrome, it didn't work. I needed to clear my cookies everytime I wanted to login as Administrator. I think there is a bug for windows in this authentication method.\r\n\r\nAnyway, I have been trying to hide the Comments and Activity sections from the document view without success, and I don't know if it is possible. As [Gregory Carlin](https://app.quandora.com/object/135ad47b-aef0-4483-af06-b2ef2500fbad) said, I have created my own \"nuxeo-document-page\" contribution like follows:\r\n\r\n1) First, I have created my own dom-module, copy of the \"nuxeo-document-page\" module (this module is defined inside the \"elements.html\" file, in ${NUXEO_HOME}/nxserver/nuxeo.war/ui). I named the module \"nuxeo-document-page-v2\", and the file was \"nuxeo-document-page-v2.html\":\r\n```\r\n\r\n \r\n \r\n\r\n\r\n```\r\n\r\n2) Then, I have added the contribution in another html file, defining the slot contribution (I named this file \"nuxeo-custom-none-bundle.html\"):\r\n```\r\n\r\n\r\n\r\n \r\n\r\n```\r\n\r\nBoth files are located in the same directory in my project, in web/nuxeo.war/ui.\r\n\r\n3) Finally, I added the extensions:\r\n```\r\n\r\n\t\r\n\t\t/ui/nuxeo-custom-none-bundle.html\r\n\t\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\tnuxeo-custom-none-bundle.html\r\n\t\t\r\n\t\r\n\r\n```\r\n\r\nThe contribution is working good, as when I access to a document, I can see the module loaded is the \"nuxeo-document-page-v2\" as expected:\r\n\r\n![type an image title](https://i.imgur.com/ZXnED9V.png)\r\n\r\nHowever, without modifying anything in the copied dom-module, it doesn't work as expected, as for example the comments tab is empty when the document has comments. This only happens if I am logged as Anonymous user (yes, I know that this is what we want to achieve, but this happens because of an error, not because of a filter for anonymous users).\r\n\r\n![type an image title](https://i.imgur.com/Qi2YmxN.png)\r\n\r\nAnyway, what I have tried to do is to use a nuxeo-filter to remove the full \"Comments & Activity\" section according to user.isAnonymous property, but then I found another problem: we don't have the \"user\" object in that view!\r\n\r\nI tried to modify the slot contriution as follows in order to get the \"user\" object in the module:\r\n```\r\n\r\n```\r\nAnd I also added it in \"properties\", inside the Polymer object in the nuxeo-document-page-v2.html file, after the \"document\" property:\r\n```\r\nuser: {\r\n type: Object\r\n},\r\n```\r\nHowever, the behaviour is really strange, as when I try to use the \"user\" object, sometimes it is the user, sometimes it is the document, and sometimes it is undefined. So I don't understand whats happening here.\r\n\r\nSorry for not being able to be more helpful. I will keep trying to make it work.\r\n\r\nRegards.\r\n", "htmlContent" : "

Hello,

\n

thank you Anton Petrov for the information to use the anonymous authentication. In my case, even in “incognito” window in Chrome, it didn't work. I needed to clear my cookies everytime I wanted to login as Administrator. I think there is a bug for windows in this authentication method.

\n

Anyway, I have been trying to hide the Comments and Activity sections from the document view without success, and I don't know if it is possible. As Gregory Carlin said, I have created my own “nuxeo-document-page” contribution like follows:

\n

1) First, I have created my own dom-module, copy of the “nuxeo-document-page” module (this module is defined inside the “elements.html” file, in ${NUXEO_HOME}/nxserver/nuxeo.war/ui). I named the module “nuxeo-document-page-v2”, and the file was “nuxeo-document-page-v2.html”:

\n
<dom-module id=\"nuxeo-document-page-v2\" assetpath=\"document/\">\n  <template>\n    <style include=\"nuxeo-styles\">\n      #details {\n        width: 28px;\n        height: 28px;\n        padding: 5px;\n        opacity: 0.3;\n        margin: 6px 0;\n      }\n\n      :host([opened]) #details {\n        opacity: 1;\n        margin-left: 6px;\n      }\n\n      #documentViewsItems {\n        @apply --layout-horizontal;\n        --paper-listbox-background-color: transparent;\n      }\n\n      #documentViewsItems > [name='comments'] {\n        margin: 0;\n      }\n\n      .scrollerHeader {\n        @apply --layout-horizontal;\n      }\n\n      :host([opened]) .scrollerHeader {\n        box-shadow: 0 3px 5px rgba(0,0,0,0.04) !important;\n        border-radius: 0;\n        background-color: var(--nuxeo-box) !important;\n      }\n\n      .page {\n        @apply --layout-horizontal;\n      }\n\n      .main {\n        @apply --layout-vertical;\n        @apply --layout-flex-2;\n        padding-right: 8px;\n        overflow: hidden;\n      }\n\n      :host([opened]) .main {\n        padding-right: 16px;\n      }\n\n      .side {\n        @apply --layout-vertical;\n        position: relative;\n        margin-bottom: var(--nuxeo-card-margin-bottom, 16px);\n        min-height: 60vh;\n      }\n\n      :host([opened]) .side {\n        @apply --layout-flex;\n      }\n\n      .scroller {\n        @apply --nuxeo-card;\n        margin-bottom: 0;\n        overflow: auto;\n        display: none;\n        left: 0;\n        top: 36px;\n        right: 0;\n        bottom: 0;\n        position: absolute;\n      }\n\n      :host([opened]) .scroller {\n        display: block;\n      }\n\n      .section {\n        margin-bottom: 32px;\n      }\n\n      .section:last-of-type {\n        margin-bottom: 64px;\n      }\n\n      nuxeo-document-view {\n        --nuxeo-document-content-margin-bottom: var(--nuxeo-card-margin-bottom);\n      }\n\n      @media (max-width: 1024px) {\n        #details {\n          opacity: 1;\n          margin-left: 6px;\n          cursor: default;\n        }\n\n        .scrollerHeader {\n          box-shadow: 0 3px 5px rgba(0,0,0,0.04) !important;\n          font-family: var(--nuxeo-app-font);\n          border-radius: 0;\n          background-color: var(--nuxeo-box) !important;\n        }\n\n        .page {\n          @apply --layout-vertical;\n        }\n\n        .main,\n        :host([opened]) .main {\n          padding: 0;\n          max-width: initial;\n          margin-right: 0;\n        }\n\n        .side {\n          padding: 0;\n          max-width: initial;\n          min-height: initial;\n          display: block;\n          margin-bottom: 16px;\n        }\n\n        .scroller {\n          top: 0;\n          position: relative;\n          display: block;\n        }\n      }\n    </style>\n\n    <nuxeo-document-info-bar document=\"[[document]]\"></nuxeo-document-info-bar>\n\n    <div class=\"page\">\n\n      <div class=\"main\">\n        <nuxeo-document-view document=\"[[document]]\"></nuxeo-document-view>\n      </div>\n\n      <div class=\"side\">\n        <div class=\"scrollerHeader\">\n          <paper-icon-button id=\"details\" noink=\"\" icon=\"nuxeo:details\" on-tap=\"_toggleOpened\"></paper-icon-button>\n          <nuxeo-tooltip for=\"details\">[[i18n('documentPage.details.opened')]]</nuxeo-tooltip>\n        </div>\n        <div class=\"scroller\">\n          <div class=\"section\">\n            <nuxeo-document-info document=\"[[document]]\"></nuxeo-document-info>\n          </div>\n\n          <div class=\"section\">\n            <nuxeo-document-metadata document=\"[[document]]\"></nuxeo-document-metadata>\n          </div>\n\n          <div class=\"section\" hidden$=\"[[!_hasCollections(document)]]\">\n            <h3>[[i18n('documentPage.collections')]]</h3>\n            <nuxeo-document-collections document=\"[[document]]\"></nuxeo-document-collections>\n          </div>\n\n          <template is=\"dom-if\" if=\"[[hasFacet(document, 'NXTag')]]\">\n            <div class=\"section\">\n              <h3>[[i18n('documentPage.tags')]]</h3>\n              <nuxeo-tag-suggestion document=\"[[document]]\" allow-new-tags=\"\" placeholder=\"[[i18n('documentPage.tags.placeholder')]]\" readonly=\"[[!isTaggable(document)]]\">\n              </nuxeo-tag-suggestion>\n            </div>\n          </template>\n          <div class=\"section\">\n            <paper-listbox id=\"documentViewsItems\" selected=\"{{selectedTab}}\" attr-for-selected=\"name\">\n              <nuxeo-page-item name=\"comments\" label=\"[[i18n('documentPage.comments')]]\"></nuxeo-page-item>\n              <nuxeo-page-item name=\"activity\" label=\"[[i18n('documentPage.activity')]]\"></nuxeo-page-item>\n            </paper-listbox>\n            <iron-pages selected=\"[[selectedTab]]\" attr-for-selected=\"name\" selected-item=\"{{page}}\">\n              <nuxeo-document-comment-thread name=\"comments\" uid=\"[[document.uid]]\"></nuxeo-document-comment-thread>\n              <nuxeo-document-activity name=\"activity\" document=\"[[document]]\"></nuxeo-document-activity>\n            </iron-pages>\n          </div>\n        </div>\n      </div>\n    </div>\n\n  </template>\n  <script>\n    Polymer({\n      is: 'nuxeo-document-page-v2',\n      behaviors: [Nuxeo.LayoutBehavior],\n      properties: {\n        document: {\n          type: Object\n        },\n        selectedTab: {\n          type: String,\n          value: 'comments',\n          notify: true\n        },\n        opened: {\n          type: Boolean,\n          value: false,\n          notify: true,\n          reflectToAttribute: true,\n          observer: '_openedChanged',\n        }\n      },\n\n      _openedChanged: function() {\n        Polymer.Async.animationFrame.run(function() {\n          // notify that there was a resize\n          this.dispatchEvent(new CustomEvent('resize', {\n            bubbles: false,\n            composed: true,\n          }));\n        });\n      },\n\n      _toggleOpened: function() {\n        this.opened = !this.opened;\n      },\n\n      _isMutable: function(doc) {\n        return !this.hasFacet(doc, 'Immutable') && doc.type !== 'Root' && !this.isTrashed(doc);\n      },\n\n      _hasCollections: function(doc) {\n        return this.hasCollections(doc);\n      }\n    });\n  </script>\n\n</dom-module>\n
\n

2) Then, I have added the contribution in another html file, defining the slot contribution (I named this file “nuxeo-custom-none-bundle.html”):

\n
<link rel=\"import\" href=\"nuxeo-document-page-v2.html\">\n\n<nuxeo-slot-content name=\"documentViewPage\" slot=\"DOCUMENT_VIEWS_PAGES\" order=\"10\">\n  <template>\n    <nuxeo-filter document=\"[[document]]\" expression=\"document.facets.indexOf('Folderish') === -1\n                                                   && document.facets.indexOf('Collection') === -1\">\n      <template>\n        <nuxeo-document-page-v2 name=\"view\" document=\"[[document]]\" opened=\"\"></nuxeo-document-page-v2>\n      </template>\n    </nuxeo-filter>\n  </template>\n</nuxeo-slot-content>\n
\n

Both files are located in the same directory in my project, in web/nuxeo.war/ui.

\n

3) Finally, I added the extensions:

\n
<extension target=\"org.nuxeo.ecm.platform.WebResources\" point=\"resources\">\n    <resource name=\"nuxeo-custom-none-bundle.html\" type=\"import\" shrinkable=\"false\">\n        <uri>/ui/nuxeo-custom-none-bundle.html</uri>\n    </resource>\n</extension>\n<extension target=\"org.nuxeo.ecm.platform.WebResources\" point=\"bundles\">\n    <bundle name=\"web-ui\">\n        <resources append=\"true\">\n            <resource>nuxeo-custom-none-bundle.html</resource>\n        </resources>\n    </bundle>\n</extension>\n
\n

The contribution is working good, as when I access to a document, I can see the module loaded is the “nuxeo-document-page-v2” as expected:

\n

\"type

\n

However, without modifying anything in the copied dom-module, it doesn't work as expected, as for example the comments tab is empty when the document has comments. This only happens if I am logged as Anonymous user (yes, I know that this is what we want to achieve, but this happens because of an error, not because of a filter for anonymous users).

\n

\"type

\n

Anyway, what I have tried to do is to use a nuxeo-filter to remove the full “Comments & Activity” section according to user.isAnonymous property, but then I found another problem: we don't have the “user” object in that view!

\n

I tried to modify the slot contriution as follows in order to get the “user” object in the module:

\n
<nuxeo-document-page-v2 name=\"view\" document=\"[[document]]\" user=\"[[user]]\" opened=\"\"></nuxeo-document-page-v2>\n
\n

And I also added it in “properties”, inside the Polymer object in the nuxeo-document-page-v2.html file, after the “document” property:

\n
user: {\n   type: Object\n},\n
\n

However, the behaviour is really strange, as when I try to use the “user” object, sometimes it is the user, sometimes it is the document, and sometimes it is undefined. So I don't understand whats happening here.

\n

Sorry for not being able to be more helpful. I will keep trying to make it work.

\n

Regards.

" }, { "id" : "b1a1e331-d3a1-4169-bfde-95db6b395db7", "label" : "2", "active" : false, "author" : { "uid" : "b0011555-846d-404a-b4a4-85bc56946f40", "name" : "b0011555-846d-404a-b4a4-85bc56946f40", "email" : "rodricmate@gmail.com", "firstName" : "Rodri", "lastName" : "", "title" : "Member", "score" : 2741, "disabled" : false, "virtual" : false, "badgeCount" : null, "notifications" : { "email" : { "name" : "email", "address" : "rodricmate@gmail.com", "notifs" : [ "EditMyAnswer", "CommentMyAnswer", "EditMyQuestion", "NewQuestionComment", "AnswerMyQuestion", "WeeklyDigest", "VoteMyQuestion", "BadgeAwarded", "VoteMyAnswer", "TagMyQuestion", "CommentMyQuestion", "NewQuestion", "NewAnswerComment", "NewAnswer" ] }, "phone" : null }, "badges" : [ "watcher", "lucky", "editor", "commentator", "watched", "teacher", "fairplay", "striker", "revival", "hope", "scholar", "popular" ], "loginCount" : 55, "lastLogin" : 1585562831066, "avatarUrl" : "https://app.quandora.com/skin/avatar/b0011555-846d-404a-b4a4-85bc56946f40?sz=%s" }, "created" : "2020-02-22T10:34:03.80Z", "createdAt" : "02/22/2020", "title" : null, "content" : "Hello,\r\n\r\nthank you [Anton Petrov](https://app.quandora.com/object/6ac57d57-5a4d-452a-93a3-95ca89435a6e) for the information to use the anonymous authentication. In my case, even in \"incognito\" window in Chrome, it didn't work. I needed to clear my cookies everytime I wanted to login as Administrator. I think there is a bug for windows in this authentication method.\r\n\r\nAnyway, I have been trying to hide the Comments and Activity sections from the document view without success, and I don't know if it is possible. As [Gregory Carlin](https://app.quandora.com/object/135ad47b-aef0-4483-af06-b2ef2500fbad) said, I have created my own \"nuxeo-document-page\" contribution like follows:\r\n\r\n1) First, I have created my own dom-module, copy of the \"nuxeo-document-page\" module (this module is defined inside the \"elements.html\" file, in ${NUXEO_HOME}/nxserver/nuxeo.war/ui). I named the module \"nuxeo-document-page-v2\", and the file was \"nuxeo-document-page-v2.html\":\r\n```\r\n\r\n \r\n \r\n\r\n\r\n```\r\n\r\n2) Then, I have added the contribution in another html file, defining the slot contribution:\r\n```\r\n\r\n\r\n\r\n \r\n\r\n```\r\n\r\nBoth files are located in the same directory in my project, in web/nuxeo.war/ui.\r\n\r\n3) Finally, I added the extensions:\r\n```\r\n\r\n\t\r\n\t\t/ui/nuxeo-custom-none-bundle.html\r\n\t\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\tnuxeo-custom-none-bundle.html\r\n\t\t\r\n\t\r\n\r\n```\r\n\r\nThe contribution is working good, as when I access to a document, I can see the module loaded is the \"nuxeo-document-page-v2\" as expected:\r\n\r\n![type an image title](https://i.imgur.com/ZXnED9V.png)\r\n\r\nHowever, without modifying anything in the copied dom-module, it doesn't work as expected, as for example the comments tab is empty when the document has comments. This only happens if I am logged as Anonymous user (yes, I know that this is what we want to achieve, but this happens because of an error, not because of a filter for anonymous users).\r\n\r\n![type an image title](https://i.imgur.com/Qi2YmxN.png)\r\n\r\nAnyway, what I have tried to do is to use a nuxeo-filter to remove the full \"Comments & Activity\" section according to user.isAnonymous property, but then I found another problem: we don't have the \"user\" object in that view!\r\n\r\nI tried to modify the slot contriution as follows in order to get the \"user\" object in the module:\r\n```\r\n\r\n```\r\nAnd I also added it in \"properties\", inside the Polymer object in the nuxeo-document-page-v2.html file, after the \"document\" property:\r\n```\r\nuser: {\r\n type: Object\r\n},\r\n```\r\nHowever, the behaviour is really strange, as when I try to use the \"user\" object, sometimes it is the user, sometimes it is the document, and sometimes it is undefined. So I don't understand whats happening here.\r\n\r\nSorry for not being able to be more helpful. I will keep trying to make it work.\r\n\r\nRegards.\r\n", "htmlContent" : "

Hello,

\n

thank you Anton Petrov for the information to use the anonymous authentication. In my case, even in “incognito” window in Chrome, it didn't work. I needed to clear my cookies everytime I wanted to login as Administrator. I think there is a bug for windows in this authentication method.

\n

Anyway, I have been trying to hide the Comments and Activity sections from the document view without success, and I don't know if it is possible. As Gregory Carlin said, I have created my own “nuxeo-document-page” contribution like follows:

\n

1) First, I have created my own dom-module, copy of the “nuxeo-document-page” module (this module is defined inside the “elements.html” file, in ${NUXEO_HOME}/nxserver/nuxeo.war/ui). I named the module “nuxeo-document-page-v2”, and the file was “nuxeo-document-page-v2.html”:

\n
<dom-module id=\"nuxeo-document-page-v2\" assetpath=\"document/\">\n  <template>\n    <style include=\"nuxeo-styles\">\n      #details {\n        width: 28px;\n        height: 28px;\n        padding: 5px;\n        opacity: 0.3;\n        margin: 6px 0;\n      }\n\n      :host([opened]) #details {\n        opacity: 1;\n        margin-left: 6px;\n      }\n\n      #documentViewsItems {\n        @apply --layout-horizontal;\n        --paper-listbox-background-color: transparent;\n      }\n\n      #documentViewsItems > [name='comments'] {\n        margin: 0;\n      }\n\n      .scrollerHeader {\n        @apply --layout-horizontal;\n      }\n\n      :host([opened]) .scrollerHeader {\n        box-shadow: 0 3px 5px rgba(0,0,0,0.04) !important;\n        border-radius: 0;\n        background-color: var(--nuxeo-box) !important;\n      }\n\n      .page {\n        @apply --layout-horizontal;\n      }\n\n      .main {\n        @apply --layout-vertical;\n        @apply --layout-flex-2;\n        padding-right: 8px;\n        overflow: hidden;\n      }\n\n      :host([opened]) .main {\n        padding-right: 16px;\n      }\n\n      .side {\n        @apply --layout-vertical;\n        position: relative;\n        margin-bottom: var(--nuxeo-card-margin-bottom, 16px);\n        min-height: 60vh;\n      }\n\n      :host([opened]) .side {\n        @apply --layout-flex;\n      }\n\n      .scroller {\n        @apply --nuxeo-card;\n        margin-bottom: 0;\n        overflow: auto;\n        display: none;\n        left: 0;\n        top: 36px;\n        right: 0;\n        bottom: 0;\n        position: absolute;\n      }\n\n      :host([opened]) .scroller {\n        display: block;\n      }\n\n      .section {\n        margin-bottom: 32px;\n      }\n\n      .section:last-of-type {\n        margin-bottom: 64px;\n      }\n\n      nuxeo-document-view {\n        --nuxeo-document-content-margin-bottom: var(--nuxeo-card-margin-bottom);\n      }\n\n      @media (max-width: 1024px) {\n        #details {\n          opacity: 1;\n          margin-left: 6px;\n          cursor: default;\n        }\n\n        .scrollerHeader {\n          box-shadow: 0 3px 5px rgba(0,0,0,0.04) !important;\n          font-family: var(--nuxeo-app-font);\n          border-radius: 0;\n          background-color: var(--nuxeo-box) !important;\n        }\n\n        .page {\n          @apply --layout-vertical;\n        }\n\n        .main,\n        :host([opened]) .main {\n          padding: 0;\n          max-width: initial;\n          margin-right: 0;\n        }\n\n        .side {\n          padding: 0;\n          max-width: initial;\n          min-height: initial;\n          display: block;\n          margin-bottom: 16px;\n        }\n\n        .scroller {\n          top: 0;\n          position: relative;\n          display: block;\n        }\n      }\n    </style>\n\n    <nuxeo-document-info-bar document=\"[[document]]\"></nuxeo-document-info-bar>\n\n    <div class=\"page\">\n\n      <div class=\"main\">\n        <nuxeo-document-view document=\"[[document]]\"></nuxeo-document-view>\n      </div>\n\n      <div class=\"side\">\n        <div class=\"scrollerHeader\">\n          <paper-icon-button id=\"details\" noink=\"\" icon=\"nuxeo:details\" on-tap=\"_toggleOpened\"></paper-icon-button>\n          <nuxeo-tooltip for=\"details\">[[i18n('documentPage.details.opened')]]</nuxeo-tooltip>\n        </div>\n        <div class=\"scroller\">\n          <div class=\"section\">\n            <nuxeo-document-info document=\"[[document]]\"></nuxeo-document-info>\n          </div>\n\n          <div class=\"section\">\n            <nuxeo-document-metadata document=\"[[document]]\"></nuxeo-document-metadata>\n          </div>\n\n          <div class=\"section\" hidden$=\"[[!_hasCollections(document)]]\">\n            <h3>[[i18n('documentPage.collections')]]</h3>\n            <nuxeo-document-collections document=\"[[document]]\"></nuxeo-document-collections>\n          </div>\n\n          <template is=\"dom-if\" if=\"[[hasFacet(document, 'NXTag')]]\">\n            <div class=\"section\">\n              <h3>[[i18n('documentPage.tags')]]</h3>\n              <nuxeo-tag-suggestion document=\"[[document]]\" allow-new-tags=\"\" placeholder=\"[[i18n('documentPage.tags.placeholder')]]\" readonly=\"[[!isTaggable(document)]]\">\n              </nuxeo-tag-suggestion>\n            </div>\n          </template>\n          <div class=\"section\">\n            <paper-listbox id=\"documentViewsItems\" selected=\"{{selectedTab}}\" attr-for-selected=\"name\">\n              <nuxeo-page-item name=\"comments\" label=\"[[i18n('documentPage.comments')]]\"></nuxeo-page-item>\n              <nuxeo-page-item name=\"activity\" label=\"[[i18n('documentPage.activity')]]\"></nuxeo-page-item>\n            </paper-listbox>\n            <iron-pages selected=\"[[selectedTab]]\" attr-for-selected=\"name\" selected-item=\"{{page}}\">\n              <nuxeo-document-comment-thread name=\"comments\" uid=\"[[document.uid]]\"></nuxeo-document-comment-thread>\n              <nuxeo-document-activity name=\"activity\" document=\"[[document]]\"></nuxeo-document-activity>\n            </iron-pages>\n          </div>\n        </div>\n      </div>\n    </div>\n\n  </template>\n  <script>\n    Polymer({\n      is: 'nuxeo-document-page-v2',\n      behaviors: [Nuxeo.LayoutBehavior],\n      properties: {\n        document: {\n          type: Object\n        },\n        selectedTab: {\n          type: String,\n          value: 'comments',\n          notify: true\n        },\n        opened: {\n          type: Boolean,\n          value: false,\n          notify: true,\n          reflectToAttribute: true,\n          observer: '_openedChanged',\n        }\n      },\n\n      _openedChanged: function() {\n        Polymer.Async.animationFrame.run(function() {\n          // notify that there was a resize\n          this.dispatchEvent(new CustomEvent('resize', {\n            bubbles: false,\n            composed: true,\n          }));\n        });\n      },\n\n      _toggleOpened: function() {\n        this.opened = !this.opened;\n      },\n\n      _isMutable: function(doc) {\n        return !this.hasFacet(doc, 'Immutable') && doc.type !== 'Root' && !this.isTrashed(doc);\n      },\n\n      _hasCollections: function(doc) {\n        return this.hasCollections(doc);\n      }\n    });\n  </script>\n\n</dom-module>\n
\n

2) Then, I have added the contribution in another html file, defining the slot contribution:

\n
<link rel=\"import\" href=\"nuxeo-document-page-v2.html\">\n\n<nuxeo-slot-content name=\"documentViewPage\" slot=\"DOCUMENT_VIEWS_PAGES\" order=\"10\">\n  <template>\n    <nuxeo-filter document=\"[[document]]\" expression=\"document.facets.indexOf('Folderish') === -1\n                                                   && document.facets.indexOf('Collection') === -1\">\n      <template>\n        <nuxeo-document-page-v2 name=\"view\" document=\"[[document]]\" opened=\"\"></nuxeo-document-page-v2>\n      </template>\n    </nuxeo-filter>\n  </template>\n</nuxeo-slot-content>\n
\n

Both files are located in the same directory in my project, in web/nuxeo.war/ui.

\n

3) Finally, I added the extensions:

\n
<extension target=\"org.nuxeo.ecm.platform.WebResources\" point=\"resources\">\n    <resource name=\"nuxeo-custom-none-bundle.html\" type=\"import\" shrinkable=\"false\">\n        <uri>/ui/nuxeo-custom-none-bundle.html</uri>\n    </resource>\n</extension>\n<extension target=\"org.nuxeo.ecm.platform.WebResources\" point=\"bundles\">\n    <bundle name=\"web-ui\">\n        <resources append=\"true\">\n            <resource>nuxeo-custom-none-bundle.html</resource>\n        </resources>\n    </bundle>\n</extension>\n
\n

The contribution is working good, as when I access to a document, I can see the module loaded is the “nuxeo-document-page-v2” as expected:

\n

\"type

\n

However, without modifying anything in the copied dom-module, it doesn't work as expected, as for example the comments tab is empty when the document has comments. This only happens if I am logged as Anonymous user (yes, I know that this is what we want to achieve, but this happens because of an error, not because of a filter for anonymous users).

\n

\"type

\n

Anyway, what I have tried to do is to use a nuxeo-filter to remove the full “Comments & Activity” section according to user.isAnonymous property, but then I found another problem: we don't have the “user” object in that view!

\n

I tried to modify the slot contriution as follows in order to get the “user” object in the module:

\n
<nuxeo-document-page-v2 name=\"view\" document=\"[[document]]\" user=\"[[user]]\" opened=\"\"></nuxeo-document-page-v2>\n
\n

And I also added it in “properties”, inside the Polymer object in the nuxeo-document-page-v2.html file, after the “document” property:

\n
user: {\n   type: Object\n},\n
\n

However, the behaviour is really strange, as when I try to use the “user” object, sometimes it is the user, sometimes it is the document, and sometimes it is undefined. So I don't understand whats happening here.

\n

Sorry for not being able to be more helpful. I will keep trying to make it work.

\n

Regards.

" }, { "id" : "61513cad-76c6-4252-96af-d5acdbe3a8c0", "label" : "1", "active" : false, "author" : { "uid" : "b0011555-846d-404a-b4a4-85bc56946f40", "name" : "b0011555-846d-404a-b4a4-85bc56946f40", "email" : "rodricmate@gmail.com", "firstName" : "Rodri", "lastName" : "", "title" : "Member", "score" : 2741, "disabled" : false, "virtual" : false, "badgeCount" : null, "notifications" : { "email" : { "name" : "email", "address" : "rodricmate@gmail.com", "notifs" : [ "EditMyAnswer", "CommentMyAnswer", "EditMyQuestion", "NewQuestionComment", "AnswerMyQuestion", "WeeklyDigest", "VoteMyQuestion", "BadgeAwarded", "VoteMyAnswer", "TagMyQuestion", "CommentMyQuestion", "NewQuestion", "NewAnswerComment", "NewAnswer" ] }, "phone" : null }, "badges" : [ "watcher", "lucky", "editor", "commentator", "watched", "teacher", "fairplay", "striker", "revival", "hope", "scholar", "popular" ], "loginCount" : 55, "lastLogin" : 1585562831066, "avatarUrl" : "https://app.quandora.com/skin/avatar/b0011555-846d-404a-b4a4-85bc56946f40?sz=%s" }, "created" : "2020-02-22T10:32:37.17Z", "createdAt" : "02/22/2020", "title" : null, "content" : "Hello,\r\n\r\nthank you [Anton Petrov](https://app.quandora.com/object/6ac57d57-5a4d-452a-93a3-95ca89435a6e) for the information to use the anonymous authentication. In my case, even in \"incognito\" window in Chrome, it didn't work. I needed to clear my cookies everytime I wanted to login as Administrator. I think there is a bug for windows in this authentication method.\r\n\r\nAnyway, I have been trying to hide the Comments and Activity sections from the document view without success, and I don't know if it is possible. As [Gregory Carlin](https://app.quandora.com/object/135ad47b-aef0-4483-af06-b2ef2500fbad) said, I have created my own \"nuxeo-document-page\" contribution like follows:\r\n\r\n1) First, I have created my own dom-module, copy of the \"nuxeo-document-page\" module (this module is definied inside the \"elements.html\" file, in ${NUXEO_HOME}/nxserver/nuxeo.war/ui. I named the module \"nuxeo-document-page-v2\", and the file was \"nuxeo-document-page-v2.html\":\r\n```\r\n\r\n \r\n \r\n\r\n\r\n```\r\n\r\n2) Then, I have added the contribution in another html file, defining the slot contribution:\r\n```\r\n\r\n\r\n\r\n \r\n\r\n```\r\n\r\nBoth files are located in the same directory in my project, in web/nuxeo.war/ui.\r\n\r\n3) Finally, I added the extensions:\r\n```\r\n\r\n\t\r\n\t\t/ui/nuxeo-custom-none-bundle.html\r\n\t\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\tnuxeo-custom-none-bundle.html\r\n\t\t\r\n\t\r\n\r\n```\r\n\r\nThe contribution is working good, as when I access to a document, I can see the module loaded is the \"nuxeo-document-page-v2\" as expected:\r\n\r\n![type an image title](https://i.imgur.com/ZXnED9V.png)\r\n\r\nHowever, without modifying anything in the copied dom-module, it doesn't work as expected, as for example the comments tab is empty when the document has comments. This only happens if I am logged as Anonymous user (yes, I know that this is what we want to achieve, but this happens because of an error, not because of a filter for anonymous users).\r\n\r\n![type an image title](https://i.imgur.com/Qi2YmxN.png)\r\n\r\nAnyway, what I have tried to do is to use a nuxeo-filter to remove the full \"Comments & Activity\" section according to user.isAnonymous property, but then I found another problem: we don't have the \"user\" object in that view!\r\n\r\nI tried to modify the slot contriution as follows in order to get the \"user\" object in the module:\r\n```\r\n\r\n```\r\nAnd I also added it in \"properties\", inside the Polymer object in the nuxeo-document-page-v2.html file, after the \"document\" property:\r\n```\r\nuser: {\r\n type: Object\r\n},\r\n```\r\nHowever, the behaviour is really strange, as when I try to use the \"user\" object, sometimes it is the user, sometimes it is the document, and sometimes it is undefined. So I don't understand whats happening here.\r\n\r\nSorry for not being able to be more helpful. I will keep trying to make it work.\r\n\r\nRegards.\r\n", "htmlContent" : "

Hello,

\n

thank you Anton Petrov for the information to use the anonymous authentication. In my case, even in “incognito” window in Chrome, it didn't work. I needed to clear my cookies everytime I wanted to login as Administrator. I think there is a bug for windows in this authentication method.

\n

Anyway, I have been trying to hide the Comments and Activity sections from the document view without success, and I don't know if it is possible. As Gregory Carlin said, I have created my own “nuxeo-document-page” contribution like follows:

\n

1) First, I have created my own dom-module, copy of the “nuxeo-document-page” module (this module is definied inside the “elements.html” file, in ${NUXEO_HOME}/nxserver/nuxeo.war/ui. I named the module “nuxeo-document-page-v2”, and the file was “nuxeo-document-page-v2.html”:

\n
<dom-module id=\"nuxeo-document-page-v2\" assetpath=\"document/\">\n  <template>\n    <style include=\"nuxeo-styles\">\n      #details {\n        width: 28px;\n        height: 28px;\n        padding: 5px;\n        opacity: 0.3;\n        margin: 6px 0;\n      }\n\n      :host([opened]) #details {\n        opacity: 1;\n        margin-left: 6px;\n      }\n\n      #documentViewsItems {\n        @apply --layout-horizontal;\n        --paper-listbox-background-color: transparent;\n      }\n\n      #documentViewsItems > [name='comments'] {\n        margin: 0;\n      }\n\n      .scrollerHeader {\n        @apply --layout-horizontal;\n      }\n\n      :host([opened]) .scrollerHeader {\n        box-shadow: 0 3px 5px rgba(0,0,0,0.04) !important;\n        border-radius: 0;\n        background-color: var(--nuxeo-box) !important;\n      }\n\n      .page {\n        @apply --layout-horizontal;\n      }\n\n      .main {\n        @apply --layout-vertical;\n        @apply --layout-flex-2;\n        padding-right: 8px;\n        overflow: hidden;\n      }\n\n      :host([opened]) .main {\n        padding-right: 16px;\n      }\n\n      .side {\n        @apply --layout-vertical;\n        position: relative;\n        margin-bottom: var(--nuxeo-card-margin-bottom, 16px);\n        min-height: 60vh;\n      }\n\n      :host([opened]) .side {\n        @apply --layout-flex;\n      }\n\n      .scroller {\n        @apply --nuxeo-card;\n        margin-bottom: 0;\n        overflow: auto;\n        display: none;\n        left: 0;\n        top: 36px;\n        right: 0;\n        bottom: 0;\n        position: absolute;\n      }\n\n      :host([opened]) .scroller {\n        display: block;\n      }\n\n      .section {\n        margin-bottom: 32px;\n      }\n\n      .section:last-of-type {\n        margin-bottom: 64px;\n      }\n\n      nuxeo-document-view {\n        --nuxeo-document-content-margin-bottom: var(--nuxeo-card-margin-bottom);\n      }\n\n      @media (max-width: 1024px) {\n        #details {\n          opacity: 1;\n          margin-left: 6px;\n          cursor: default;\n        }\n\n        .scrollerHeader {\n          box-shadow: 0 3px 5px rgba(0,0,0,0.04) !important;\n          font-family: var(--nuxeo-app-font);\n          border-radius: 0;\n          background-color: var(--nuxeo-box) !important;\n        }\n\n        .page {\n          @apply --layout-vertical;\n        }\n\n        .main,\n        :host([opened]) .main {\n          padding: 0;\n          max-width: initial;\n          margin-right: 0;\n        }\n\n        .side {\n          padding: 0;\n          max-width: initial;\n          min-height: initial;\n          display: block;\n          margin-bottom: 16px;\n        }\n\n        .scroller {\n          top: 0;\n          position: relative;\n          display: block;\n        }\n      }\n    </style>\n\n    <nuxeo-document-info-bar document=\"[[document]]\"></nuxeo-document-info-bar>\n\n    <div class=\"page\">\n\n      <div class=\"main\">\n        <nuxeo-document-view document=\"[[document]]\"></nuxeo-document-view>\n      </div>\n\n      <div class=\"side\">\n        <div class=\"scrollerHeader\">\n          <paper-icon-button id=\"details\" noink=\"\" icon=\"nuxeo:details\" on-tap=\"_toggleOpened\"></paper-icon-button>\n          <nuxeo-tooltip for=\"details\">[[i18n('documentPage.details.opened')]]</nuxeo-tooltip>\n        </div>\n        <div class=\"scroller\">\n          <div class=\"section\">\n            <nuxeo-document-info document=\"[[document]]\"></nuxeo-document-info>\n          </div>\n\n          <div class=\"section\">\n            <nuxeo-document-metadata document=\"[[document]]\"></nuxeo-document-metadata>\n          </div>\n\n          <div class=\"section\" hidden$=\"[[!_hasCollections(document)]]\">\n            <h3>[[i18n('documentPage.collections')]]</h3>\n            <nuxeo-document-collections document=\"[[document]]\"></nuxeo-document-collections>\n          </div>\n\n          <template is=\"dom-if\" if=\"[[hasFacet(document, 'NXTag')]]\">\n            <div class=\"section\">\n              <h3>[[i18n('documentPage.tags')]]</h3>\n              <nuxeo-tag-suggestion document=\"[[document]]\" allow-new-tags=\"\" placeholder=\"[[i18n('documentPage.tags.placeholder')]]\" readonly=\"[[!isTaggable(document)]]\">\n              </nuxeo-tag-suggestion>\n            </div>\n          </template>\n          <div class=\"section\">\n            <paper-listbox id=\"documentViewsItems\" selected=\"{{selectedTab}}\" attr-for-selected=\"name\">\n              <nuxeo-page-item name=\"comments\" label=\"[[i18n('documentPage.comments')]]\"></nuxeo-page-item>\n              <nuxeo-page-item name=\"activity\" label=\"[[i18n('documentPage.activity')]]\"></nuxeo-page-item>\n            </paper-listbox>\n            <iron-pages selected=\"[[selectedTab]]\" attr-for-selected=\"name\" selected-item=\"{{page}}\">\n              <nuxeo-document-comment-thread name=\"comments\" uid=\"[[document.uid]]\"></nuxeo-document-comment-thread>\n              <nuxeo-document-activity name=\"activity\" document=\"[[document]]\"></nuxeo-document-activity>\n            </iron-pages>\n          </div>\n        </div>\n      </div>\n    </div>\n\n  </template>\n  <script>\n    Polymer({\n      is: 'nuxeo-document-page-v2',\n      behaviors: [Nuxeo.LayoutBehavior],\n      properties: {\n        document: {\n          type: Object\n        },\n        selectedTab: {\n          type: String,\n          value: 'comments',\n          notify: true\n        },\n        opened: {\n          type: Boolean,\n          value: false,\n          notify: true,\n          reflectToAttribute: true,\n          observer: '_openedChanged',\n        }\n      },\n\n      _openedChanged: function() {\n        Polymer.Async.animationFrame.run(function() {\n          // notify that there was a resize\n          this.dispatchEvent(new CustomEvent('resize', {\n            bubbles: false,\n            composed: true,\n          }));\n        });\n      },\n\n      _toggleOpened: function() {\n        this.opened = !this.opened;\n      },\n\n      _isMutable: function(doc) {\n        return !this.hasFacet(doc, 'Immutable') && doc.type !== 'Root' && !this.isTrashed(doc);\n      },\n\n      _hasCollections: function(doc) {\n        return this.hasCollections(doc);\n      }\n    });\n  </script>\n\n</dom-module>\n
\n

2) Then, I have added the contribution in another html file, defining the slot contribution:

\n
<link rel=\"import\" href=\"nuxeo-document-page-v2.html\">\n\n<nuxeo-slot-content name=\"documentViewPage\" slot=\"DOCUMENT_VIEWS_PAGES\" order=\"10\">\n  <template>\n    <nuxeo-filter document=\"[[document]]\" expression=\"document.facets.indexOf('Folderish') === -1\n                                                   && document.facets.indexOf('Collection') === -1\">\n      <template>\n        <nuxeo-document-page-v2 name=\"view\" document=\"[[document]]\" opened=\"\"></nuxeo-document-page-v2>\n      </template>\n    </nuxeo-filter>\n  </template>\n</nuxeo-slot-content>\n
\n

Both files are located in the same directory in my project, in web/nuxeo.war/ui.

\n

3) Finally, I added the extensions:

\n
<extension target=\"org.nuxeo.ecm.platform.WebResources\" point=\"resources\">\n    <resource name=\"nuxeo-custom-none-bundle.html\" type=\"import\" shrinkable=\"false\">\n        <uri>/ui/nuxeo-custom-none-bundle.html</uri>\n    </resource>\n</extension>\n<extension target=\"org.nuxeo.ecm.platform.WebResources\" point=\"bundles\">\n    <bundle name=\"web-ui\">\n        <resources append=\"true\">\n            <resource>nuxeo-custom-none-bundle.html</resource>\n        </resources>\n    </bundle>\n</extension>\n
\n

The contribution is working good, as when I access to a document, I can see the module loaded is the “nuxeo-document-page-v2” as expected:

\n

\"type

\n

However, without modifying anything in the copied dom-module, it doesn't work as expected, as for example the comments tab is empty when the document has comments. This only happens if I am logged as Anonymous user (yes, I know that this is what we want to achieve, but this happens because of an error, not because of a filter for anonymous users).

\n

\"type

\n

Anyway, what I have tried to do is to use a nuxeo-filter to remove the full “Comments & Activity” section according to user.isAnonymous property, but then I found another problem: we don't have the “user” object in that view!

\n

I tried to modify the slot contriution as follows in order to get the “user” object in the module:

\n
<nuxeo-document-page-v2 name=\"view\" document=\"[[document]]\" user=\"[[user]]\" opened=\"\"></nuxeo-document-page-v2>\n
\n

And I also added it in “properties”, inside the Polymer object in the nuxeo-document-page-v2.html file, after the “document” property:

\n
user: {\n   type: Object\n},\n
\n

However, the behaviour is really strange, as when I try to use the “user” object, sometimes it is the user, sometimes it is the document, and sometimes it is undefined. So I don't understand whats happening here.

\n

Sorry for not being able to be more helpful. I will keep trying to make it work.

\n

Regards.

" } ] }; Versioning.getActiveVersion = function() { var versions = this.versions; for (var i=0,len=versions.length;i

Select a revision to compare with:
Side by side diff