-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a020639
commit 584ed7d
Showing
15 changed files
with
271 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ bin | |
|
||
# build artifacts | ||
target/ | ||
node_modules/ | ||
nashorn_code_cache/ | ||
chromedriver.log | ||
*.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@nuxeo:registry=https://packages.nuxeo.com/repository/npm-public/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
(C) Copyright Nuxeo Corp. (http://nuxeo.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. | ||
--> | ||
<project name="Nuxeo Cold Storage Web" default="build" basedir="."> | ||
|
||
<!-- set executable names based on OS family --> | ||
<condition property="cmd.npm" value="npm.cmd" else="npm"> | ||
<os family="windows"/> | ||
</condition> | ||
|
||
<!-- set npm script names based on OS family --> | ||
<condition property="lint.script" value="win-lint" else="lint"> | ||
<os family="windows"/> | ||
</condition> | ||
|
||
<target name="clean" description="Clean npm dependencies"> | ||
<delete dir="node_modules" /> | ||
</target> | ||
|
||
<target name="install" description="Install npm dependencies" unless="skipInstall"> | ||
<exec executable="${cmd.npm}" failonerror="true"> | ||
<arg value="install" /> | ||
</exec> | ||
</target> | ||
|
||
<target name="build" depends="install" unless="skipBuild"> | ||
<npm-run script="build" /> | ||
</target> | ||
|
||
<macrodef name="npm-run"> | ||
<attribute name="script"/> | ||
<sequential> | ||
<exec executable="${cmd.npm}" failonerror="true"> | ||
<env key="NODE_ENV" value="production"/> | ||
<arg value="run" /> | ||
<arg value="@{script}" /> | ||
</exec> | ||
</sequential> | ||
</macrodef> | ||
|
||
</project> |
1 change: 0 additions & 1 deletion
1
nuxeo-coldstorage-web/elements/nuxeo-move-content-to-coldstorage-button.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
nuxeo-coldstorage-web/elements/nuxeo-move-contents-to-coldstorage-button.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"documentContentView.moveToColdStorage.ask.confirmation": "Send the document content to cold storage?", | ||
"documentContentView.moveToColdStorage.cancel": "Annuler", | ||
"documentContentView.moveToColdStorage.confirm": "Confirmer", | ||
"documentContentView.moveToColdStorage.error": "Error moving the document content to cold storage.", | ||
"documentContentView.moveToColdStorage.label": "Send to cold storage", | ||
"documentContentView.moveToColdStorage.ok": "Ok", | ||
"documentContentView.moveToColdStorage.description": "This will result in increased file retrieval times and a low resolution preview.", | ||
"documentContentView.moveToColdStorage.success": "Document content moved to cold storage successfully.", | ||
"documentContentView.moveToColdStorage.tooltip": "Send to cold storage", | ||
"documentPage.content.storedInColdStorage": "The master file is stored in cold storage.", | ||
"moveDocumentsContentsToColdStorage.ask.confirmation": "Send the documents contents to cold storage?", | ||
"moveDocumentsContentsToColdStorage.description": "This will result in increased file retrieval times and a low resolution preview.", | ||
"moveDocumentsContentsToColdStorage.cancel": "Annuler", | ||
"moveDocumentsContentsToColdStorage.confirm": "Confirmer", | ||
"moveDocumentsContentsToColdStorage.error": "Error moving the documents contents to cold storage.", | ||
"moveDocumentsContentsToColdStorage.success": "Documents contents moved to cold storage successfully.", | ||
"moveDocumentsContentsToColdStorage.tooltip": "Send the selected items to cold storage" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"documentContentView.moveToColdStorage.ask.confirmation": "Send the document content to cold storage?", | ||
"documentContentView.moveToColdStorage.cancel": "Cancel", | ||
"documentContentView.moveToColdStorage.confirm": "Confirm", | ||
"documentContentView.moveToColdStorage.error": "Error moving the document content to cold storage.", | ||
"documentContentView.moveToColdStorage.label": "Send to cold storage", | ||
"documentContentView.moveToColdStorage.ok": "OK", | ||
"documentContentView.moveToColdStorage.description": "This will result in increased file retrieval times and a low resolution preview.", | ||
"documentContentView.moveToColdStorage.success": "Document content moved to cold storage successfully.", | ||
"documentContentView.moveToColdStorage.tooltip": "Send to cold storage", | ||
"documentPage.content.storedInColdStorage": "The master file is stored in cold storage.", | ||
"moveDocumentsContentsToColdStorage.ask.confirmation": "Send the documents contents to cold storage?", | ||
"moveDocumentsContentsToColdStorage.description": "This will result in increased file retrieval times and a low resolution preview.", | ||
"moveDocumentsContentsToColdStorage.cancel": "Cancel", | ||
"moveDocumentsContentsToColdStorage.confirm": "Confirm", | ||
"moveDocumentsContentsToColdStorage.error": "Error moving the documents contents to cold storage.", | ||
"moveDocumentsContentsToColdStorage.success": "Documents contents moved to cold storage successfully.", | ||
"moveDocumentsContentsToColdStorage.tooltip": "Send the selected items to cold storage" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "nuxeo-coldstorage-web", | ||
"version": "0.1.0", | ||
"description": "Nuxeo Cold Storage WebUI integration", | ||
"scripts": { | ||
"build": "rollup -c" | ||
}, | ||
"author": "Nuxeo", | ||
"license": "Apache-2.0", | ||
"devDependencies": { | ||
"@rollup/plugin-node-resolve": "^7.1.3", | ||
"rollup": "^2.33.1", | ||
"rollup-plugin-copy": "^3.3.0", | ||
"rollup-plugin-minify-html-literals": "^1.2.5", | ||
"rollup-plugin-terser": "^7.0.2" | ||
}, | ||
"dependencies": { | ||
"@nuxeo/nuxeo-elements": "~3.0.2-rc.0", | ||
"@nuxeo/nuxeo-ui-elements": "~3.0.2-rc.0", | ||
"@polymer/polymer": "3.3.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.nuxeo</groupId> | ||
<artifactId>nuxeo-coldstorage-parent</artifactId> | ||
<version>11.0.0-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>nuxeo-coldstorage-web</artifactId> | ||
<name>Nuxeo Cold Storage WebUI integration</name> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-antrun-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>clean</id> | ||
<phase>clean</phase> | ||
<configuration> | ||
<target> | ||
<ant antfile="${basedir}/build.xml" dir="${basedir}" target="clean"></ant> | ||
</target> | ||
</configuration> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>npm-build</id> | ||
<phase>process-resources</phase> | ||
<configuration> | ||
<target> | ||
<ant antfile="${basedir}/build.xml" dir="${basedir}"></ant> | ||
</target> | ||
</configuration> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { terser } from 'rollup-plugin-terser'; | ||
import copy from 'rollup-plugin-copy'; | ||
import minifyHTML from 'rollup-plugin-minify-html-literals'; | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import path from 'path'; | ||
|
||
// Replace imports by an export of existing globals in Web UI | ||
// https://github.com/nuxeo/nuxeo-web-ui/blob/master/index.js#L7 | ||
const GLOBALS = { | ||
'@polymer/polymer/lib/legacy/class.js': 'const { mixinBehaviors } = Polymer; export { mixinBehaviors };', | ||
'@polymer/polymer/lib/legacy/polymer.dom.js': 'const { dom, matchesSelector } = Polymer; export { dom, matchesSelector };', | ||
'@polymer/polymer/polymer-element.js': 'const { PolymerElement} = window; export { PolymerElement };', | ||
'@polymer/polymer/lib/elements/dom-module.js': 'const { DomModule} = window; export { DomModule };', | ||
'@polymer/polymer/lib/legacy/polymer.dom.js': 'const { dom, html, matchesSelector } = Polymer; export { dom, html, atchesSelector };', | ||
'@polymer/polymer/lib/utils/html-tag.js': 'const { html } = Polymer; export { html };', | ||
'@polymer/polymer/lib/utils/debounce.js': 'const { enqueueDebouncer, flushDebouncers, Debouncer } = Polymer; export { enqueueDebouncer, flushDebouncers, Debouncer };', | ||
'@nuxeo/nuxeo-ui-elements/nuxeo-i18n-behavior.js': 'const { I18nBehavior } = Nuxeo; export { I18nBehavior };', | ||
'@nuxeo/nuxeo-ui-elements/nuxeo-filters-behavior.js': 'const { FiltersBehavior } = Nuxeo; export { FiltersBehavior };', | ||
'@nuxeo/nuxeo-ui-elements/nuxeo-format-behavior.js': 'const { FormatBehavior } = Nuxeo; export { FormatBehavior };', | ||
} | ||
|
||
// Ignore these imports since they should just be all about custom element definitions which are done already by Web UI | ||
const IGNORES = [ /^\@(nuxeo|polymer)\//]; | ||
|
||
const TARGET = 'target/classes/web/nuxeo.war/ui'; | ||
|
||
export default { | ||
input: "index.js", | ||
output: { | ||
file: `${TARGET}/nuxeo-coldstorage.bundle.js`, | ||
format: "es", | ||
}, | ||
plugins: [ | ||
copy({ | ||
targets: [{ src: "i18n", dest: TARGET }], | ||
}), | ||
resolve(), | ||
{ | ||
transform(code, id) { | ||
// HTML imports | ||
if (path.extname(id) === ".html") { | ||
return `const tmpl = document.createElement('template');tmpl.innerHTML = ${JSON.stringify( | ||
code | ||
)};document.head.appendChild(tmpl.content);`; | ||
} | ||
|
||
const dep = path.relative("./node_modules", id); | ||
|
||
// Rewrite imports | ||
if (GLOBALS[dep]) { | ||
return GLOBALS[dep]; | ||
} | ||
|
||
// Ignore bundled imports | ||
if (IGNORES.some((r) => r.test(dep))) { | ||
return "export default undefined;"; | ||
} | ||
|
||
return code; | ||
}, | ||
}, | ||
...(process.env.NODE_ENV === "production" ? [minifyHTML(), terser()] : []), | ||
], | ||
}; |
8 changes: 8 additions & 0 deletions
8
nuxeo-coldstorage-web/src/main/resources/META-INF/MANIFEST.MF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Bundle-ActivationPolicy: lazy | ||
Bundle-ClassPath: . | ||
Manifest-Version: 1.0 | ||
Bundle-Vendor: Nuxeo | ||
Bundle-Version: 1.0.0 | ||
Bundle-Name: nuxeo-coldstorage-web | ||
Bundle-ManifestVersion: 2 | ||
Bundle-SymbolicName: nuxeo-coldstorage-web;singleton=true |
28 changes: 28 additions & 0 deletions
28
nuxeo-coldstorage-web/src/main/resources/OSGI-INF/deployment-fragment.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0"?> | ||
<fragment version="1"> | ||
|
||
<require>org.nuxeo.web.ui</require> | ||
|
||
<install> | ||
|
||
<unzip from="${bundle.fileName}" to="/" prefix="web"> | ||
<include>web/nuxeo.war/**</include> | ||
<exclude>web/nuxeo.war/ui/i18n/**</exclude> | ||
</unzip> | ||
|
||
<!-- create a temporary folder --> | ||
<delete path="${bundle.fileName}.tmp" /> | ||
<mkdir path="${bundle.fileName}.tmp" /> | ||
<unzip from="${bundle.fileName}" to="${bundle.fileName}.tmp" /> | ||
|
||
<!-- append the translations --> | ||
<append from="${bundle.fileName}.tmp/web/nuxeo.war/ui/i18n/messages.json" | ||
to="nuxeo.war/ui/i18n/messages.json" /> | ||
<append from="${bundle.fileName}.tmp/web/nuxeo.war/ui/i18n/messages-fr.json" | ||
to="nuxeo.war/ui/i18n/messages-fr.json" /> | ||
|
||
<delete path="${bundle.fileName}.tmp" /> | ||
|
||
</install> | ||
|
||
</fragment> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters