\r\n\r\n\r\n```\r\n\r\nnuxeo-document-content from elements.html\r\n```\r\n
nuxeo-workspace-view-layout.html
\n<dom-module id=\"nuxeo-workspace-view-layout\">\n\n <template>\n <nuxeo-document-content document=\"[[document]]\"></nuxeo-document-content>\n </template>\n\n <script>\n Polymer({\n is: 'nuxeo-workspace-view-layout',\n behaviors: [Nuxeo.LayoutBehavior],\n properties: {\n /**\n * @doctype Workspace\n */\n document: {\n type: Object\n }\n }\n });\n </script>\n\n</dom-module>\n
\nnuxeo-document-content from elements.html
\n<dom-module id=\"nuxeo-document-content\" assetpath=\"nuxeo-results/\">\n <template>\n\n <style include=\"nuxeo-styles\">\n :host {\n display: block;\n }\n\n .results {\n @apply --layout-vertical;\n @apply --layout-flex;\n min-height: var(--nuxeo-document-content-min-height, calc(100vh - 216px - var(--nuxeo-app-top)));\n margin-bottom: var(--nuxeo-document-content-margin-bottom, 0);\n }\n\n .results.dragging {\n border: 2px dashed var(--nuxeo-primary-color);\n }\n\n .ellipsis {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n display: block;\n width: calc(100% - 38px);\n }\n\n .capitalize {\n text-transform: capitalize;\n }\n\n nuxeo-tag {\n margin-right: 2px;\n }\n </style>\n\n <nuxeo-connection id=\"nxcon\"></nuxeo-connection>\n\n <nuxeo-page-provider id=\"nxProvider\" provider=\"[[provider]]\" page-size=\"[[pageSize]]\" aggregations=\"{{aggregations}}\" enrichers=\"[[enrichers]]\" params=\"[[params]]\" schemas=\"[[schemas]]\" headers=\"[[headers]]\" fetch-aggregates=\"\">\n </nuxeo-page-provider>\n\n <nuxeo-results id=\"results\" display-mode=\"table\" name=\"[[document.uid]]\" nx-provider=\"[[nxProvider]]\" selected-items=\"{{selectedItems}}\" document=\"[[document]]\" display-quick-filters=\"\" display-sort=\"[[_canSort(document, sortOptions)]]\" sort-options=\"[[sortOptions]]\">\n <nuxeo-data-grid name=\"grid\" icon=\"nuxeo:view-thumbnails\" class=\"results\" empty-label=\"[[emptyLabel]]\" empty-label-when-filtered=\"[[emptyLabelWhenFiltered]]\" selection-enabled=\"\" draggable$=\"[[_hasWritePermission(document)]]\" drop-target-filter=\"[[_dropTargetFilter]]\">\n <template>\n <nuxeo-document-grid-thumbnail class=\"grid-box\" tabindex$=\"{{tabIndex}}\" selected$=\"{{selected}}\" index=\"[[index]]\" doc=\"[[item]]\" on-navigate=\"_navigate\" selected-items=\"[[selectedItems]]\">\n </nuxeo-document-grid-thumbnail>\n </template>\n </nuxeo-data-grid>\n\n <nuxeo-data-table name=\"table\" icon=\"nuxeo:view-list\" class=\"results\" settings-enabled=\"\" empty-label=\"[[emptyLabel]]\" empty-label-when-filtered=\"[[emptyLabelWhenFiltered]]\" selection-enabled=\"\" on-row-clicked=\"_navigate\" draggable$=\"[[_hasWritePermission(document)]]\" drop-target-filter=\"[[_dropTargetFilter]]\">\n <nuxeo-data-table-column name=\"[[i18n('documentContentView.datatable.header.title')]]\" field=\"dc:title\" sort-by=\"[[_displaySort(document, 'dc:title')]]\" filter-by=\"title\" flex=\"100\">\n <template>\n <nuxeo-document-thumbnail document=\"[[item]]\"></nuxeo-document-thumbnail>\n <a class=\"title ellipsis\" href$=\"[[urlFor('browse', item.path)]]\" on-tap=\"_navigate\">[[item.title]]</a>\n </template>\n </nuxeo-data-table-column>\n <nuxeo-data-table-column name=\"[[i18n('documentContentView.datatable.header.type')]]\" field=\"type\" hidden=\"\">\n <template>\n <nuxeo-tag>[[formatDocType(item.type)]]</nuxeo-tag>\n </template>\n </nuxeo-data-table-column>\n <nuxeo-data-table-column name=\"[[i18n('documentContentView.datatable.header.modified')]]\" field=\"dc:modified\" sort-by=\"[[_displaySort(document, 'dc:modified')]]\" filter-by=\"dc_modified_agg\" flex=\"50\">\n <template is=\"header\">\n <nuxeo-dropdown-aggregation placeholder=\"[[i18n('documentContentView.datatable.header.modified')]]\" data=\"[[aggregations.dc_modified_agg]]\" value=\"{{column.filterValue}}\" multiple=\"\">\n </nuxeo-dropdown-aggregation>\n </template>\n <template>\n <nuxeo-date datetime=\"[[item.properties.dc:modified]]\"></nuxeo-date>\n </template>\n </nuxeo-data-table-column>\n <nuxeo-data-table-column name=\"[[i18n('documentContentView.datatable.header.lastContributor')]]\" filter-by=\"dc_last_contributor_agg\" field=\"dc:lastContributor\" sort-by=\"[[_displaySort(document, 'dc:lastContributor')]]\" flex=\"50\">\n <template is=\"header\">\n <nuxeo-dropdown-aggregation placeholder=\"[[i18n('documentContentView.datatable.header.lastContributor')]]\" data=\"[[aggregations.dc_last_contributor_agg]]\" value=\"{{column.filterValue}}\" multiple=\"\">\n </nuxeo-dropdown-aggregation>\n </template>\n <template>\n <nuxeo-user-tag user=\"[[item.properties.dc:lastContributor]]\"></nuxeo-user-tag>\n </template>\n </nuxeo-data-table-column>\n <nuxeo-data-table-column name=\"[[i18n('documentContentView.datatable.header.state')]]\" field=\"currentLifeCycleState\" hidden=\"\">\n <template><span class=\"capitalize\">[[formatLifecycleState(item.state)]]</span></template>\n </nuxeo-data-table-column>\n <nuxeo-data-table-column name=\"[[i18n('documentContentView.datatable.header.version')]]\" field=\"versionLabel\" hidden=\"\">\n <template>\n [[formatVersion(item)]]\n </template>\n </nuxeo-data-table-column>\n <nuxeo-data-table-column name=\"[[i18n('documentContentView.datatable.header.created')]]\" field=\"dc:created\" sort-by=\"[[_displaySort(document, 'dc:created')]]\" flex=\"50\" hidden=\"\">\n <template>\n <nuxeo-date datetime=\"[[item.properties.dc:created]]\"></nuxeo-date>\n </template>\n </nuxeo-data-table-column>\n <nuxeo-data-table-column name=\"[[i18n('documentContentView.datatable.header.author')]]\" field=\"dc:creator\" sort-by=\"[[_displaySort(document, 'dc:creator')]]\" hidden=\"\">\n <template>\n <nuxeo-user-tag user=\"[[item.properties.dc:creator]]\"></nuxeo-user-tag>\n </template>\n </nuxeo-data-table-column>\n <nuxeo-data-table-column name=\"[[i18n('documentContentView.datatable.header.nature')]]\" field=\"dc:nature\" hidden=\"\">\n <template>\n <nuxeo-tag hidden$=\"[[!item.properties.dc:nature]]\">\n [[formatDirectory(item.properties.dc:nature)]]\n </nuxeo-tag>\n </template>\n </nuxeo-data-table-column>\n <nuxeo-data-table-column name=\"[[i18n('documentContentView.datatable.header.coverage')]]\" field=\"dc:coverage\" hidden=\"\">\n <template>\n <nuxeo-tag hidden$=\"[[!item.properties.dc:coverage]]\">\n [[formatDirectory(item.properties.dc:coverage)]]\n </nuxeo-tag>\n </template>\n </nuxeo-data-table-column>\n <nuxeo-data-table-column name=\"[[i18n('documentContentView.datatable.header.subjects')]]\" field=\"dc:subjects\" hidden=\"\" flex=\"60\">\n <template>\n <template is=\"dom-repeat\" items=\"[[item.properties.dc:subjects]]\" as=\"subject\">\n <nuxeo-tag>[[formatDirectory(subject)]]</nuxeo-tag>\n </template>\n </template>\n </nuxeo-data-table-column>\n </nuxeo-data-table>\n </nuxeo-results>\n\n </template>\n\n <script>\n Polymer({\n is: 'nuxeo-document-content',\n behaviors: [Nuxeo.DocumentContentBehavior],\n properties: {\n /**\n * The parameters to be passed on to `provider`.\n */\n params: {\n type: Object\n },\n /**\n * The name of the page provider to be used.\n */\n provider: {\n type: String,\n value: 'advanced_document_content'\n },\n /**\n * The number of results per page.\n */\n pageSize: {\n type: Number,\n value: 40\n },\n /**\n * List of comma separated values of the document schemas to be returned.\n * All document schemas are returned by default.\n */\n schemas: {\n type: String,\n value: 'dublincore,common,uid,file'\n },\n /**\n * List of content enrichers passed on to `provider`.\n * Already set by default are thumbnail, permissions and highlight.\n */\n enrichers: {\n type: String,\n value: 'thumbnail, permissions'\n },\n /**\n * The headers passed on to `provider`.\n * Already set by default are 'X-NXfetch.document': 'properties' and 'X-NXtranslate.directoryEntry': 'label'.\n */\n headers: {\n type: String,\n value: {'X-NXfetch.document': 'properties', 'X-NXtranslate.directoryEntry': 'label'}\n },\n /**\n * The label to be dislayed when there are no results.\n */\n emptyLabel: String,\n /**\n * The label to be dislayed when there are no results with filtering applied.\n */\n emptyLabelWhenFiltered: String\n },\n\n _computeParams: function(document) {\n if (document) {\n if (this.hasFacet(document, 'Orderable')) {\n this.$.nxProvider.set('sort', { 'ecm:pos': 'ASC' });\n } else {\n this.$.nxProvider.set('sort', {});\n }\n return { 'ecm_parentId': document.uid, 'ecm_trashed': this.isTrashed(document) }\n }\n return {};\n }\n });\n </script>\n\n</dom-module>\n
"
} ]
};
Versioning.getActiveVersion = function() {
var versions = this.versions;
for (var i=0,len=versions.length;i