diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 8c1e10b48952..f8dc8a90a886 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -15,16 +15,16 @@ jobs: with: ref: ${{ github.ref }} fetch-depth: 0 - - name: JDK 11 + - name: JDK 17 uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 distribution: temurin cache: maven - name: Set up Maven uses: stCarolas/setup-maven@v5 with: - maven-version: 3.9.6 + maven-version: 3.9.9 - name: Search for bad unicode translations run: | find . -name \*.properties -exec grep '\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][^0-9a-fA-F]' {} \; &> grep.txt diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index 558a123593b8..1878b9287645 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -10,15 +10,14 @@ jobs: sakai-deploy: runs-on: ubuntu-22.04 env: - JAVA_OPTS: "-Dhttp.agent=Sakai -Xms2512m -Xmx2512m -Dsakai.cookieName=SAKAIID -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Dsakai.demo=true -Djava.awt.headless=true --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED --illegal-access=permit -Dsakai.demo=true" - + JAVA_OPTS: "-Dhttp.agent=Sakai -Xms2512m -Xmx2512m -Dsakai.cookieName=SAKAIID -Dsakai.demo=true" steps: - name: Git Checkout uses: actions/checkout@v4 - - name: JDK 11 + - name: JDK 17 uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 distribution: temurin cache: maven - name: Build with Maven @@ -35,12 +34,14 @@ jobs: curl -s -o tomcat.tar.gz https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.98/bin/apache-tomcat-9.0.98.tar.gz tar --strip-components=1 -xzf tomcat.tar.gz git clone https://github.com/sakaiproject/nightly-config.git sakai + cp sakai/setenv.sh bin/setenv.sh cp sakai/cypress.properties sakai/sakai.properties - sed -i 's:::g' conf/context.xml + cp -f sakai/context.xml conf/context.xml + cp -f sakai/catalina.properties conf/catalina.properties sed -i 's:::g' conf/server.xml mysql -u root -proot -e "create database sakai"; cd .. - mvn --batch-mode -DskipTests install sakai:deploy-exploded -Dmaven.tomcat.home=$TOMCAT_DIR + mvn --batch-mode -DskipTests -Denforcer.skip -Dmaven.source.skip install sakai:deploy-exploded -Dmaven.tomcat.home=$TOMCAT_DIR cd $TOMCAT_DIR bin/catalina.sh start sleep 500s @@ -71,7 +72,7 @@ jobs: - name: Check number of MySQL statements if: always() run: | - export QUERIES=$(grep ProtocolLoggingProxy.info tomcat/logs/catalina.out|grep -v ROLLBACK|grep -v COMMIT | wc -l) + export QUERIES=$(grep StandardClient.debug tomcat/logs/catalina.out|grep -v ROLLBACK|grep -v COMMIT | wc -l) echo "::notice title={MySQL Queries}::$QUERIES" - name: Upload Tomcat log for review if: always() diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 39f0e4bfe8eb..69c2fd4de6b9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -14,16 +14,16 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: JDK 11 + - name: JDK 17 uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 distribution: temurin cache: maven - name: Set up Maven uses: stCarolas/setup-maven@v5 with: - maven-version: 3.9.6 + maven-version: 3.9.9 - name: Build with Maven env: MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true -Dmaven.wagon.http.retryHandler.count=2 -Dmaven.wagon.http.pool=true diff --git a/calendar/calendar-impl/impl/pom.xml b/calendar/calendar-impl/impl/pom.xml index 104106643a8f..9863fe9ef688 100644 --- a/calendar/calendar-impl/impl/pom.xml +++ b/calendar/calendar-impl/impl/pom.xml @@ -92,10 +92,6 @@ commons-logging commons-logging - - xalan - xalan - @@ -109,6 +105,10 @@ + + xalan + serializer + org.springframework spring-context diff --git a/chat/chat-tool/tool/pom.xml b/chat/chat-tool/tool/pom.xml index 4814ba49eae8..9d329c7d0745 100644 --- a/chat/chat-tool/tool/pom.xml +++ b/chat/chat-tool/tool/pom.xml @@ -73,10 +73,6 @@ commons-logging commons-logging - - xml-apis - xmlParserAPIs - diff --git a/citations/citations-tool/tool/pom.xml b/citations/citations-tool/tool/pom.xml index 8c06a5aadead..8e9751de75bf 100644 --- a/citations/citations-tool/tool/pom.xml +++ b/citations/citations-tool/tool/pom.xml @@ -32,16 +32,6 @@ org.sakaiproject sakai-citations-api - org.sakaiproject sakai-citations-util diff --git a/commons/tool/pom.xml b/commons/tool/pom.xml index e1227940767d..2342246b21eb 100644 --- a/commons/tool/pom.xml +++ b/commons/tool/pom.xml @@ -80,12 +80,6 @@ taglibs standard 1.1.2 - - - xalan - xalan - - diff --git a/commons/tool/src/webapp/lib/handlebars.runtime-v4.0.5.js b/commons/tool/src/webapp/lib/handlebars.runtime-v4.0.5.js deleted file mode 100644 index 95049f3b8d4d..000000000000 --- a/commons/tool/src/webapp/lib/handlebars.runtime-v4.0.5.js +++ /dev/null @@ -1,1240 +0,0 @@ -/*! - - handlebars v4.0.5 - -Copyright (C) 2011-2015 by Yehuda Katz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -@license -*/ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["Handlebars"] = factory(); - else - root["Handlebars"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(1)['default']; - - var _interopRequireDefault = __webpack_require__(2)['default']; - - exports.__esModule = true; - - var _handlebarsBase = __webpack_require__(3); - - var base = _interopRequireWildcard(_handlebarsBase); - - // Each of these augment the Handlebars object. No need to setup here. - // (This is done to easily share code between commonjs and browse envs) - - var _handlebarsSafeString = __webpack_require__(17); - - var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString); - - var _handlebarsException = __webpack_require__(5); - - var _handlebarsException2 = _interopRequireDefault(_handlebarsException); - - var _handlebarsUtils = __webpack_require__(4); - - var Utils = _interopRequireWildcard(_handlebarsUtils); - - var _handlebarsRuntime = __webpack_require__(18); - - var runtime = _interopRequireWildcard(_handlebarsRuntime); - - var _handlebarsNoConflict = __webpack_require__(19); - - var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict); - - // For compatibility and usage outside of module systems, make the Handlebars object a namespace - function create() { - var hb = new base.HandlebarsEnvironment(); - - Utils.extend(hb, base); - hb.SafeString = _handlebarsSafeString2['default']; - hb.Exception = _handlebarsException2['default']; - hb.Utils = Utils; - hb.escapeExpression = Utils.escapeExpression; - - hb.VM = runtime; - hb.template = function (spec) { - return runtime.template(spec, hb); - }; - - return hb; - } - - var inst = create(); - inst.create = create; - - _handlebarsNoConflict2['default'](inst); - - inst['default'] = inst; - - exports['default'] = inst; - module.exports = exports['default']; - -/***/ }, -/* 1 */ -/***/ function(module, exports) { - - "use strict"; - - exports["default"] = function (obj) { - if (obj && obj.__esModule) { - return obj; - } else { - var newObj = {}; - - if (obj != null) { - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; - } - } - - newObj["default"] = obj; - return newObj; - } - }; - - exports.__esModule = true; - -/***/ }, -/* 2 */ -/***/ function(module, exports) { - - "use strict"; - - exports["default"] = function (obj) { - return obj && obj.__esModule ? obj : { - "default": obj - }; - }; - - exports.__esModule = true; - -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireDefault = __webpack_require__(2)['default']; - - exports.__esModule = true; - exports.HandlebarsEnvironment = HandlebarsEnvironment; - - var _utils = __webpack_require__(4); - - var _exception = __webpack_require__(5); - - var _exception2 = _interopRequireDefault(_exception); - - var _helpers = __webpack_require__(6); - - var _decorators = __webpack_require__(14); - - var _logger = __webpack_require__(16); - - var _logger2 = _interopRequireDefault(_logger); - - var VERSION = '4.0.5'; - exports.VERSION = VERSION; - var COMPILER_REVISION = 7; - - exports.COMPILER_REVISION = COMPILER_REVISION; - var REVISION_CHANGES = { - 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it - 2: '== 1.0.0-rc.3', - 3: '== 1.0.0-rc.4', - 4: '== 1.x.x', - 5: '== 2.0.0-alpha.x', - 6: '>= 2.0.0-beta.1', - 7: '>= 4.0.0' - }; - - exports.REVISION_CHANGES = REVISION_CHANGES; - var objectType = '[object Object]'; - - function HandlebarsEnvironment(helpers, partials, decorators) { - this.helpers = helpers || {}; - this.partials = partials || {}; - this.decorators = decorators || {}; - - _helpers.registerDefaultHelpers(this); - _decorators.registerDefaultDecorators(this); - } - - HandlebarsEnvironment.prototype = { - constructor: HandlebarsEnvironment, - - logger: _logger2['default'], - log: _logger2['default'].log, - - registerHelper: function registerHelper(name, fn) { - if (_utils.toString.call(name) === objectType) { - if (fn) { - throw new _exception2['default']('Arg not supported with multiple helpers'); - } - _utils.extend(this.helpers, name); - } else { - this.helpers[name] = fn; - } - }, - unregisterHelper: function unregisterHelper(name) { - delete this.helpers[name]; - }, - - registerPartial: function registerPartial(name, partial) { - if (_utils.toString.call(name) === objectType) { - _utils.extend(this.partials, name); - } else { - if (typeof partial === 'undefined') { - throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined'); - } - this.partials[name] = partial; - } - }, - unregisterPartial: function unregisterPartial(name) { - delete this.partials[name]; - }, - - registerDecorator: function registerDecorator(name, fn) { - if (_utils.toString.call(name) === objectType) { - if (fn) { - throw new _exception2['default']('Arg not supported with multiple decorators'); - } - _utils.extend(this.decorators, name); - } else { - this.decorators[name] = fn; - } - }, - unregisterDecorator: function unregisterDecorator(name) { - delete this.decorators[name]; - } - }; - - var log = _logger2['default'].log; - - exports.log = log; - exports.createFrame = _utils.createFrame; - exports.logger = _logger2['default']; - -/***/ }, -/* 4 */ -/***/ function(module, exports) { - - 'use strict'; - - exports.__esModule = true; - exports.extend = extend; - exports.indexOf = indexOf; - exports.escapeExpression = escapeExpression; - exports.isEmpty = isEmpty; - exports.createFrame = createFrame; - exports.blockParams = blockParams; - exports.appendContextPath = appendContextPath; - var escape = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`', - '=': '=' - }; - - var badChars = /[&<>"'`=]/g, - possible = /[&<>"'`=]/; - - function escapeChar(chr) { - return escape[chr]; - } - - function extend(obj /* , ...source */) { - for (var i = 1; i < arguments.length; i++) { - for (var key in arguments[i]) { - if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { - obj[key] = arguments[i][key]; - } - } - } - - return obj; - } - - var toString = Object.prototype.toString; - - exports.toString = toString; - // Sourced from lodash - // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt - /* eslint-disable func-style */ - var isFunction = function isFunction(value) { - return typeof value === 'function'; - }; - // fallback for older versions of Chrome and Safari - /* istanbul ignore next */ - if (isFunction(/x/)) { - exports.isFunction = isFunction = function (value) { - return typeof value === 'function' && toString.call(value) === '[object Function]'; - }; - } - exports.isFunction = isFunction; - - /* eslint-enable func-style */ - - /* istanbul ignore next */ - var isArray = Array.isArray || function (value) { - return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; - }; - - exports.isArray = isArray; - // Older IE versions do not directly support indexOf so we must implement our own, sadly. - - function indexOf(array, value) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { - return i; - } - } - return -1; - } - - function escapeExpression(string) { - if (typeof string !== 'string') { - // don't escape SafeStrings, since they're already safe - if (string && string.toHTML) { - return string.toHTML(); - } else if (string == null) { - return ''; - } else if (!string) { - return string + ''; - } - - // Force a string conversion as this will be done by the append regardless and - // the regex test will do this transparently behind the scenes, causing issues if - // an object's to string has escaped characters in it. - string = '' + string; - } - - if (!possible.test(string)) { - return string; - } - return string.replace(badChars, escapeChar); - } - - function isEmpty(value) { - if (!value && value !== 0) { - return true; - } else if (isArray(value) && value.length === 0) { - return true; - } else { - return false; - } - } - - function createFrame(object) { - var frame = extend({}, object); - frame._parent = object; - return frame; - } - - function blockParams(params, ids) { - params.path = ids; - return params; - } - - function appendContextPath(contextPath, id) { - return (contextPath ? contextPath + '.' : '') + id; - } - -/***/ }, -/* 5 */ -/***/ function(module, exports) { - - 'use strict'; - - exports.__esModule = true; - - var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; - - function Exception(message, node) { - var loc = node && node.loc, - line = undefined, - column = undefined; - if (loc) { - line = loc.start.line; - column = loc.start.column; - - message += ' - ' + line + ':' + column; - } - - var tmp = Error.prototype.constructor.call(this, message); - - // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. - for (var idx = 0; idx < errorProps.length; idx++) { - this[errorProps[idx]] = tmp[errorProps[idx]]; - } - - /* istanbul ignore else */ - if (Error.captureStackTrace) { - Error.captureStackTrace(this, Exception); - } - - if (loc) { - this.lineNumber = line; - this.column = column; - } - } - - Exception.prototype = new Error(); - - exports['default'] = Exception; - module.exports = exports['default']; - -/***/ }, -/* 6 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireDefault = __webpack_require__(2)['default']; - - exports.__esModule = true; - exports.registerDefaultHelpers = registerDefaultHelpers; - - var _helpersBlockHelperMissing = __webpack_require__(7); - - var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing); - - var _helpersEach = __webpack_require__(8); - - var _helpersEach2 = _interopRequireDefault(_helpersEach); - - var _helpersHelperMissing = __webpack_require__(9); - - var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing); - - var _helpersIf = __webpack_require__(10); - - var _helpersIf2 = _interopRequireDefault(_helpersIf); - - var _helpersLog = __webpack_require__(11); - - var _helpersLog2 = _interopRequireDefault(_helpersLog); - - var _helpersLookup = __webpack_require__(12); - - var _helpersLookup2 = _interopRequireDefault(_helpersLookup); - - var _helpersWith = __webpack_require__(13); - - var _helpersWith2 = _interopRequireDefault(_helpersWith); - - function registerDefaultHelpers(instance) { - _helpersBlockHelperMissing2['default'](instance); - _helpersEach2['default'](instance); - _helpersHelperMissing2['default'](instance); - _helpersIf2['default'](instance); - _helpersLog2['default'](instance); - _helpersLookup2['default'](instance); - _helpersWith2['default'](instance); - } - -/***/ }, -/* 7 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _utils = __webpack_require__(4); - - exports['default'] = function (instance) { - instance.registerHelper('blockHelperMissing', function (context, options) { - var inverse = options.inverse, - fn = options.fn; - - if (context === true) { - return fn(this); - } else if (context === false || context == null) { - return inverse(this); - } else if (_utils.isArray(context)) { - if (context.length > 0) { - if (options.ids) { - options.ids = [options.name]; - } - - return instance.helpers.each(context, options); - } else { - return inverse(this); - } - } else { - if (options.data && options.ids) { - var data = _utils.createFrame(options.data); - data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name); - options = { data: data }; - } - - return fn(context, options); - } - }); - }; - - module.exports = exports['default']; - -/***/ }, -/* 8 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireDefault = __webpack_require__(2)['default']; - - exports.__esModule = true; - - var _utils = __webpack_require__(4); - - var _exception = __webpack_require__(5); - - var _exception2 = _interopRequireDefault(_exception); - - exports['default'] = function (instance) { - instance.registerHelper('each', function (context, options) { - if (!options) { - throw new _exception2['default']('Must pass iterator to #each'); - } - - var fn = options.fn, - inverse = options.inverse, - i = 0, - ret = '', - data = undefined, - contextPath = undefined; - - if (options.data && options.ids) { - contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; - } - - if (_utils.isFunction(context)) { - context = context.call(this); - } - - if (options.data) { - data = _utils.createFrame(options.data); - } - - function execIteration(field, index, last) { - if (data) { - data.key = field; - data.index = index; - data.first = index === 0; - data.last = !!last; - - if (contextPath) { - data.contextPath = contextPath + field; - } - } - - ret = ret + fn(context[field], { - data: data, - blockParams: _utils.blockParams([context[field], field], [contextPath + field, null]) - }); - } - - if (context && typeof context === 'object') { - if (_utils.isArray(context)) { - for (var j = context.length; i < j; i++) { - if (i in context) { - execIteration(i, i, i === context.length - 1); - } - } - } else { - var priorKey = undefined; - - for (var key in context) { - if (context.hasOwnProperty(key)) { - // We're running the iterations one step out of sync so we can detect - // the last iteration without have to scan the object twice and create - // an itermediate keys array. - if (priorKey !== undefined) { - execIteration(priorKey, i - 1); - } - priorKey = key; - i++; - } - } - if (priorKey !== undefined) { - execIteration(priorKey, i - 1, true); - } - } - } - - if (i === 0) { - ret = inverse(this); - } - - return ret; - }); - }; - - module.exports = exports['default']; - -/***/ }, -/* 9 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireDefault = __webpack_require__(2)['default']; - - exports.__esModule = true; - - var _exception = __webpack_require__(5); - - var _exception2 = _interopRequireDefault(_exception); - - exports['default'] = function (instance) { - instance.registerHelper('helperMissing', function () /* [args, ]options */{ - if (arguments.length === 1) { - // A missing field in a {{foo}} construct. - return undefined; - } else { - // Someone is actually trying to call something, blow up. - throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); - } - }); - }; - - module.exports = exports['default']; - -/***/ }, -/* 10 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _utils = __webpack_require__(4); - - exports['default'] = function (instance) { - instance.registerHelper('if', function (conditional, options) { - if (_utils.isFunction(conditional)) { - conditional = conditional.call(this); - } - - // Default behavior is to render the positive path if the value is truthy and not empty. - // The `includeZero` option may be set to treat the condtional as purely not empty based on the - // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. - if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) { - return options.inverse(this); - } else { - return options.fn(this); - } - }); - - instance.registerHelper('unless', function (conditional, options) { - return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash }); - }); - }; - - module.exports = exports['default']; - -/***/ }, -/* 11 */ -/***/ function(module, exports) { - - 'use strict'; - - exports.__esModule = true; - - exports['default'] = function (instance) { - instance.registerHelper('log', function () /* message, options */{ - var args = [undefined], - options = arguments[arguments.length - 1]; - for (var i = 0; i < arguments.length - 1; i++) { - args.push(arguments[i]); - } - - var level = 1; - if (options.hash.level != null) { - level = options.hash.level; - } else if (options.data && options.data.level != null) { - level = options.data.level; - } - args[0] = level; - - instance.log.apply(instance, args); - }); - }; - - module.exports = exports['default']; - -/***/ }, -/* 12 */ -/***/ function(module, exports) { - - 'use strict'; - - exports.__esModule = true; - - exports['default'] = function (instance) { - instance.registerHelper('lookup', function (obj, field) { - return obj && obj[field]; - }); - }; - - module.exports = exports['default']; - -/***/ }, -/* 13 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _utils = __webpack_require__(4); - - exports['default'] = function (instance) { - instance.registerHelper('with', function (context, options) { - if (_utils.isFunction(context)) { - context = context.call(this); - } - - var fn = options.fn; - - if (!_utils.isEmpty(context)) { - var data = options.data; - if (options.data && options.ids) { - data = _utils.createFrame(options.data); - data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]); - } - - return fn(context, { - data: data, - blockParams: _utils.blockParams([context], [data && data.contextPath]) - }); - } else { - return options.inverse(this); - } - }); - }; - - module.exports = exports['default']; - -/***/ }, -/* 14 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireDefault = __webpack_require__(2)['default']; - - exports.__esModule = true; - exports.registerDefaultDecorators = registerDefaultDecorators; - - var _decoratorsInline = __webpack_require__(15); - - var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline); - - function registerDefaultDecorators(instance) { - _decoratorsInline2['default'](instance); - } - -/***/ }, -/* 15 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _utils = __webpack_require__(4); - - exports['default'] = function (instance) { - instance.registerDecorator('inline', function (fn, props, container, options) { - var ret = fn; - if (!props.partials) { - props.partials = {}; - ret = function (context, options) { - // Create a new partials stack frame prior to exec. - var original = container.partials; - container.partials = _utils.extend({}, original, props.partials); - var ret = fn(context, options); - container.partials = original; - return ret; - }; - } - - props.partials[options.args[0]] = options.fn; - - return ret; - }); - }; - - module.exports = exports['default']; - -/***/ }, -/* 16 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _utils = __webpack_require__(4); - - var logger = { - methodMap: ['debug', 'info', 'warn', 'error'], - level: 'info', - - // Maps a given level value to the `methodMap` indexes above. - lookupLevel: function lookupLevel(level) { - if (typeof level === 'string') { - var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase()); - if (levelMap >= 0) { - level = levelMap; - } else { - level = parseInt(level, 10); - } - } - - return level; - }, - - // Can be overridden in the host environment - log: function log(level) { - level = logger.lookupLevel(level); - - if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) { - var method = logger.methodMap[level]; - if (!console[method]) { - // eslint-disable-line no-console - method = 'log'; - } - - for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - message[_key - 1] = arguments[_key]; - } - - console[method].apply(console, message); // eslint-disable-line no-console - } - } - }; - - exports['default'] = logger; - module.exports = exports['default']; - -/***/ }, -/* 17 */ -/***/ function(module, exports) { - - // Build out our basic SafeString type - 'use strict'; - - exports.__esModule = true; - function SafeString(string) { - this.string = string; - } - - SafeString.prototype.toString = SafeString.prototype.toHTML = function () { - return '' + this.string; - }; - - exports['default'] = SafeString; - module.exports = exports['default']; - -/***/ }, -/* 18 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _interopRequireWildcard = __webpack_require__(1)['default']; - - var _interopRequireDefault = __webpack_require__(2)['default']; - - exports.__esModule = true; - exports.checkRevision = checkRevision; - exports.template = template; - exports.wrapProgram = wrapProgram; - exports.resolvePartial = resolvePartial; - exports.invokePartial = invokePartial; - exports.noop = noop; - - var _utils = __webpack_require__(4); - - var Utils = _interopRequireWildcard(_utils); - - var _exception = __webpack_require__(5); - - var _exception2 = _interopRequireDefault(_exception); - - var _base = __webpack_require__(3); - - function checkRevision(compilerInfo) { - var compilerRevision = compilerInfo && compilerInfo[0] || 1, - currentRevision = _base.COMPILER_REVISION; - - if (compilerRevision !== currentRevision) { - if (compilerRevision < currentRevision) { - var runtimeVersions = _base.REVISION_CHANGES[currentRevision], - compilerVersions = _base.REVISION_CHANGES[compilerRevision]; - throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); - } else { - // Use the embedded version info since the runtime doesn't know about this revision yet - throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); - } - } - } - - function template(templateSpec, env) { - /* istanbul ignore next */ - if (!env) { - throw new _exception2['default']('No environment passed to template'); - } - if (!templateSpec || !templateSpec.main) { - throw new _exception2['default']('Unknown template object: ' + typeof templateSpec); - } - - templateSpec.main.decorator = templateSpec.main_d; - - // Note: Using env.VM references rather than local var references throughout this section to allow - // for external users to override these as psuedo-supported APIs. - env.VM.checkRevision(templateSpec.compiler); - - function invokePartialWrapper(partial, context, options) { - if (options.hash) { - context = Utils.extend({}, context, options.hash); - if (options.ids) { - options.ids[0] = true; - } - } - - partial = env.VM.resolvePartial.call(this, partial, context, options); - var result = env.VM.invokePartial.call(this, partial, context, options); - - if (result == null && env.compile) { - options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); - result = options.partials[options.name](context, options); - } - if (result != null) { - if (options.indent) { - var lines = result.split('\n'); - for (var i = 0, l = lines.length; i < l; i++) { - if (!lines[i] && i + 1 === l) { - break; - } - - lines[i] = options.indent + lines[i]; - } - result = lines.join('\n'); - } - return result; - } else { - throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); - } - } - - // Just add water - var container = { - strict: function strict(obj, name) { - if (!(name in obj)) { - throw new _exception2['default']('"' + name + '" not defined in ' + obj); - } - return obj[name]; - }, - lookup: function lookup(depths, name) { - var len = depths.length; - for (var i = 0; i < len; i++) { - if (depths[i] && depths[i][name] != null) { - return depths[i][name]; - } - } - }, - lambda: function lambda(current, context) { - return typeof current === 'function' ? current.call(context) : current; - }, - - escapeExpression: Utils.escapeExpression, - invokePartial: invokePartialWrapper, - - fn: function fn(i) { - var ret = templateSpec[i]; - ret.decorator = templateSpec[i + '_d']; - return ret; - }, - - programs: [], - program: function program(i, data, declaredBlockParams, blockParams, depths) { - var programWrapper = this.programs[i], - fn = this.fn(i); - if (data || depths || blockParams || declaredBlockParams) { - programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); - } else if (!programWrapper) { - programWrapper = this.programs[i] = wrapProgram(this, i, fn); - } - return programWrapper; - }, - - data: function data(value, depth) { - while (value && depth--) { - value = value._parent; - } - return value; - }, - merge: function merge(param, common) { - var obj = param || common; - - if (param && common && param !== common) { - obj = Utils.extend({}, common, param); - } - - return obj; - }, - - noop: env.VM.noop, - compilerInfo: templateSpec.compiler - }; - - function ret(context) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - - var data = options.data; - - ret._setup(options); - if (!options.partial && templateSpec.useData) { - data = initData(context, data); - } - var depths = undefined, - blockParams = templateSpec.useBlockParams ? [] : undefined; - if (templateSpec.useDepths) { - if (options.depths) { - depths = context !== options.depths[0] ? [context].concat(options.depths) : options.depths; - } else { - depths = [context]; - } - } - - function main(context /*, options*/) { - return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths); - } - main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams); - return main(context, options); - } - ret.isTop = true; - - ret._setup = function (options) { - if (!options.partial) { - container.helpers = container.merge(options.helpers, env.helpers); - - if (templateSpec.usePartial) { - container.partials = container.merge(options.partials, env.partials); - } - if (templateSpec.usePartial || templateSpec.useDecorators) { - container.decorators = container.merge(options.decorators, env.decorators); - } - } else { - container.helpers = options.helpers; - container.partials = options.partials; - container.decorators = options.decorators; - } - }; - - ret._child = function (i, data, blockParams, depths) { - if (templateSpec.useBlockParams && !blockParams) { - throw new _exception2['default']('must pass block params'); - } - if (templateSpec.useDepths && !depths) { - throw new _exception2['default']('must pass parent depths'); - } - - return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); - }; - return ret; - } - - function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { - function prog(context) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - - var currentDepths = depths; - if (depths && context !== depths[0]) { - currentDepths = [context].concat(depths); - } - - return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths); - } - - prog = executeDecorators(fn, prog, container, depths, data, blockParams); - - prog.program = i; - prog.depth = depths ? depths.length : 0; - prog.blockParams = declaredBlockParams || 0; - return prog; - } - - function resolvePartial(partial, context, options) { - if (!partial) { - if (options.name === '@partial-block') { - partial = options.data['partial-block']; - } else { - partial = options.partials[options.name]; - } - } else if (!partial.call && !options.name) { - // This is a dynamic partial that returned a string - options.name = partial; - partial = options.partials[partial]; - } - return partial; - } - - function invokePartial(partial, context, options) { - options.partial = true; - if (options.ids) { - options.data.contextPath = options.ids[0] || options.data.contextPath; - } - - var partialBlock = undefined; - if (options.fn && options.fn !== noop) { - options.data = _base.createFrame(options.data); - partialBlock = options.data['partial-block'] = options.fn; - - if (partialBlock.partials) { - options.partials = Utils.extend({}, options.partials, partialBlock.partials); - } - } - - if (partial === undefined && partialBlock) { - partial = partialBlock; - } - - if (partial === undefined) { - throw new _exception2['default']('The partial ' + options.name + ' could not be found'); - } else if (partial instanceof Function) { - return partial(context, options); - } - } - - function noop() { - return ''; - } - - function initData(context, data) { - if (!data || !('root' in data)) { - data = data ? _base.createFrame(data) : {}; - data.root = context; - } - return data; - } - - function executeDecorators(fn, prog, container, depths, data, blockParams) { - if (fn.decorator) { - var props = {}; - prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths); - Utils.extend(prog, props); - } - return prog; - } - -/***/ }, -/* 19 */ -/***/ function(module, exports) { - - /* WEBPACK VAR INJECTION */(function(global) {/* global window */ - 'use strict'; - - exports.__esModule = true; - - exports['default'] = function (Handlebars) { - /* istanbul ignore next */ - var root = typeof global !== 'undefined' ? global : window, - $Handlebars = root.Handlebars; - /* istanbul ignore next */ - Handlebars.noConflict = function () { - if (root.Handlebars === Handlebars) { - root.Handlebars = $Handlebars; - } - return Handlebars; - }; - }; - - module.exports = exports['default']; - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) - -/***/ } -/******/ ]) -}); -; \ No newline at end of file diff --git a/deploy/pom.xml b/deploy/pom.xml index 38e73074d45c..979dcafaa30f 100644 --- a/deploy/pom.xml +++ b/deploy/pom.xml @@ -557,11 +557,26 @@ stax2-api compile + + xml-apis + xml-apis + compile + xerces xercesImpl compile + + xalan + xalan + compile + + + xalan + serializer + compile + diff --git a/feedback/pom.xml b/feedback/pom.xml index 36e76981fe61..ee33627a9c30 100644 --- a/feedback/pom.xml +++ b/feedback/pom.xml @@ -46,12 +46,6 @@ taglibs standard 1.1.2 - - - xalan - xalan - - org.sakaiproject.kernel @@ -120,51 +114,12 @@ - - - templates - - - - com.github.jknack - handlebars-maven-plugin - ${handlebars1.version} - - - precompile - prepare-package - - precompile - - - ${basedir}/src/webapp/templates/all.handlebars.js - ${basedir}/src/webapp/WEB-INF/templates/ - .handlebars - false - false - false - UTF-8 - - - - - - - - - - - - - - - com.github.jknack handlebars-maven-plugin - ${handlebars1.version} + ${handlebars4.version} precompile @@ -177,7 +132,6 @@ ${basedir}/src/webapp/WEB-INF/templates/ .handlebars false - false false UTF-8 diff --git a/feedback/src/webapp/WEB-INF/bootstrap.jsp b/feedback/src/webapp/WEB-INF/bootstrap.jsp index 0ec89f21d22c..a33ea9979c2d 100644 --- a/feedback/src/webapp/WEB-INF/bootstrap.jsp +++ b/feedback/src/webapp/WEB-INF/bootstrap.jsp @@ -1,96 +1,96 @@ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - - - - - - + + - - - + + - + ${sakaiHtmlHead} + - var feedback = { - state: 'home', - previousState: '', - userId: '${userId}', - siteId: '${siteId}', - siteExists: '${siteExists}', - language: '${language}', - featureSuggestionUrl: '${featureSuggestionUrl}', - technicalToAddress: '${technicalToAddress}', - helpToAddress: '${helpToAddress}', - suggestionsToAddress: '${suggestionsToAddress}', - supplementalAToAddress: '${supplementalAToAddress}', - supplementalBToAddress: '${supplementalBToAddress}', - contactName: '${contactName}', - enableTechnical: ${enableTechnical}, - enableHelp: ${enableHelp}, - enableSuggestions: ${enableSuggestions}, - enableSupplementalA: ${enableSupplementalA}, - enableSupplementalB: ${enableSupplementalB}, - helpPagesUrl: '${helpPagesUrl}', - helpdeskUrl: '${helpdeskUrl}', - technicalUrl: '${technicalUrl}', - supplementalAUrl: '${supplementalAUrl}', - supplementalBUrl: '${supplementalBUrl}', - helpPagesTarget: '${helpPagesTarget}', - supplementaryInfo: '${supplementaryInfo}', - recaptchaPublicKey: '${recaptchaPublicKey}', - maxAttachmentsMB: ${maxAttachmentsMB}, - showContentPanel: ${showContentPanel}, - showHelpPanel: ${showHelpPanel}, - showTechnicalPanel: ${showTechnicalPanel}, - showSuggestionsPanel: ${showSuggestionsPanel}, - showSupplementalAPanel: ${showSupplementalAPanel}, - showSupplementalBPanel: ${showSupplementalBPanel}, - helpPanelAsLink: ${helpPanelAsLink}, - technicalPanelAsLink: ${technicalPanelAsLink}, - suggestionsPanelAsLink: ${suggestionsPanelAsLink}, - supplementalAPanelAsLink: ${supplementalAPanelAsLink}, - supplementalBPanelAsLink: ${supplementalBPanelAsLink}, - siteUpdaters: [ - - {id: '${su.key}', displayName: '${su.value}'}, - - ], - i18n: { - - ${i.key}: "${i.value}", - - } - }; - - - - ${sakaiHtmlHead} - + + +
+ +
+ +
+
+ +
+
+
- - -
- -
-
- -
-
- -
-
-
-
- + + + + + + + + + - + + \ No newline at end of file diff --git a/feedback/src/webapp/js/feedback.js b/feedback/src/webapp/js/feedback.js index 71cd615d8f6d..365768649b87 100644 --- a/feedback/src/webapp/js/feedback.js +++ b/feedback/src/webapp/js/feedback.js @@ -1,419 +1,412 @@ -(function ($) { - - var TOOLBAR = 'toolbar'; +import FeedbackUtils from "/feedback-tool/js/feedbackutils.js"; +class Feedback { + static TOOLBAR = 'toolbar'; /* STATES */ - var HOME = 'home'; - var CONTENT = 'content'; - var HELPDESK = 'helpdesk'; - var TECHNICAL = 'technical'; - var SUGGESTIONS = 'suggestions'; - var SUPPLEMENTALA = 'supplementala'; - var SUPPLEMENTALB = 'supplementalb'; - var REPORTTECHNICAL = 'reporttechnical'; - var REPORTHELPDESK = 'reporthelpdesk'; - var REPORTSUGGESTIONS = 'reportsuggestions'; - var REPORTSUPPLEMENTALA = 'reportsupplementala'; - var REPORTSUPPLEMENTALB = 'reportsupplementalb'; - + static HOME = 'home'; + static CONTENT = 'content'; + static HELPDESK = 'helpdesk'; + static TECHNICAL = 'technical'; + static SUGGESTIONS = 'suggestions'; + static SUPPLEMENTALA = 'supplementala'; + static SUPPLEMENTALB = 'supplementalb'; + static REPORTTECHNICAL = 'reporttechnical'; + static REPORTHELPDESK = 'reporthelpdesk'; + static REPORTSUGGESTIONS = 'reportsuggestions'; + static REPORTSUPPLEMENTALA = 'reportsupplementala'; + static REPORTSUPPLEMENTALB = 'reportsupplementalb'; /* RESPONSE CODES */ - var SUCCESS = 'SUCCESS'; - var FORBIDDEN = 'FORBIDDEN'; - var BAD_REQUEST = 'BAD_REQUEST'; - var ATTACHMENTS_TOO_BIG = 'ATTACHMENTS_TOO_BIG'; - var BAD_TITLE = 'BAD_TITLE'; - var BAD_DESCRIPTION = 'BAD_DESCRIPTION'; - var RECAPTCHA_FAILURE = 'RECAPTCHA_FAILURE'; - var BAD_RECIPIENT = 'BAD_RECIPIENT'; - var NO_SENDER_ADDRESS = 'NO_SENDER_ADDRESS'; - var BAD_SENDER_ADDRESS = 'BAD_SENDER_ADDRESS'; - var DB_ERROR = 'DB_ERROR'; - - var loggedIn = (feedback.userId != '') ? true : false; - var siteUpdater; - var toAddress; - - feedback.switchState = function (state) { - feedback.switchState(state, null); - }; - - feedback.switchState = function (state, url) { - - $('#feedback-toolbar > li > span').removeClass('current'); + static SUCCESS = 'SUCCESS'; + static FORBIDDEN = 'FORBIDDEN'; + static BAD_REQUEST = 'BAD_REQUEST'; + static ATTACHMENTS_TOO_BIG = 'ATTACHMENTS_TOO_BIG'; + static BAD_TITLE = 'BAD_TITLE'; + static BAD_DESCRIPTION = 'BAD_DESCRIPTION'; + static RECAPTCHA_FAILURE = 'RECAPTCHA_FAILURE'; + static BAD_RECIPIENT = 'BAD_RECIPIENT'; + static NO_SENDER_ADDRESS = 'NO_SENDER_ADDRESS'; + static BAD_SENDER_ADDRESS = 'BAD_SENDER_ADDRESS'; + static DB_ERROR = 'DB_ERROR'; + + constructor(feedback) { + this.feedback = feedback; + this.loggedIn = feedback.userId !== ''; + this.siteUpdater = null; + this.toAddress = null; + + this.initialize(); + } + + initialize() { + Handlebars.registerHelper("translate", FeedbackUtils.translate); + FeedbackUtils.renderTemplate(Feedback.TOOLBAR, { + featureSuggestionUrl: this.feedback.featureSuggestionUrl, + loggedIn: this.loggedIn, + helpPagesUrl: this.feedback.helpPagesUrl, + helpPagesTarget: this.feedback.helpPagesTarget + }, 'feedback-toolbar'); + + $(document).ready(() => { + $('#feedback-home-item').click(() => this.switchState(Feedback.HOME)); + $('#feedback-content-item').click(() => this.switchState(Feedback.CONTENT)); + $('#feedback-technical-item').click(() => this.switchState(Feedback.TECHNICAL, Feedback.REPORTTECHNICAL)); + $('#feedback-helpdesk-item').click(() => this.switchState(Feedback.HELPDESK, Feedback.REPORTHELPDESK)); + }); - $('#feedback-' + state + '-item > span').addClass('current'); + this.switchState(Feedback.HOME); + } + switchState(state, url = null) { + $('#feedback-toolbar > li > span').removeClass('current'); + $('#feedback-' + state + '-item > span').addClass('current'); $('#feedback-error-message-wrapper').hide(); - $('#feedback-info-message-wrapper').hide(); - if (HOME === state) { - - siteUpdater = $('#feedback-siteupdaters').find(':selected').text(); - if (siteUpdater=='') siteUpdater = $('#feedback-contactname').val(); - - toAddress = $('#feedback-destination-email').val(); - - feedback.utils.renderTemplate(HOME, { featureSuggestionUrl: feedback.featureSuggestionUrl, - helpdeskUrl : feedback.helpdeskUrl, - technicalUrl : feedback.technicalUrl, - supplementalAUrl : feedback.supplementalAUrl, - supplementalBUrl : feedback.supplementalBUrl, - supplementaryInfo: feedback.supplementaryInfo, - helpPagesUrl: feedback.helpPagesUrl, - helpPagesTarget: feedback.helpPagesTarget, - loggedIn: loggedIn, showContentPanel : feedback.showContentPanel, - showHelpPanel : feedback.showHelpPanel, - showTechnicalPanel : feedback.showTechnicalPanel, - showSuggestionsPanel : feedback.showSuggestionsPanel, - showSupplementalAPanel : feedback.showSupplementalAPanel, - showSupplementalBPanel : feedback.showSupplementalBPanel, - helpPanelAsLink : feedback.helpPanelAsLink, - technicalPanelAsLink : feedback.technicalPanelAsLink, - suggestionsPanelAsLink : feedback.suggestionsPanelAsLink, - supplementalAPanelAsLink : feedback.supplementalAPanelAsLink, - supplementalBPanelAsLink : feedback.supplementalBPanelAsLink, - enableTechnical : feedback.enableTechnical, - enableSuggestions : feedback.enableSuggestions, - enableSupplementalA : feedback.enableSupplementalA, - enableSupplementalB : feedback.enableSupplementalB, - enableHelp : feedback.enableHelp}, 'feedback-content'); - - $(document).ready(function () { - - if (feedback.helpPagesUrl.length > 0 ) { - $('#feedback-help-wrapper').show(); - } - - $('#feedback-report-content-link').click(function (e) { - feedback.switchState(CONTENT); - }); - - if (!feedback.technicalPanelAsLink && feedback.enableTechnical) { - $('#feedback-technical-item').show().css('display', 'inline'); - $('#feedback-report-technical-wrapper').show(); - $('#feedback-report-technical-link').click(function (e) { - feedback.switchState(TECHNICAL, REPORTTECHNICAL); - }); - } + if (Feedback.HOME === state) { + this.handleHomeState(); + } else if (Feedback.CONTENT === state) { + this.handleContentState(); + } else if ([Feedback.TECHNICAL, Feedback.HELPDESK, Feedback.SUGGESTIONS, Feedback.SUPPLEMENTALA, Feedback.SUPPLEMENTALB].includes(state)) { + this.handleOtherStates(state, url); + } - if(!feedback.helpPanelAsLink && feedback.enableHelp) { - $('#feedback-report-helpdesk-link').click(function (e) { - feedback.switchState(HELPDESK, REPORTHELPDESK); - }); - } - - if(!feedback.suggestionsPanelAsLink && feedback.enableSuggestions) { - $('#feedback-suggest-feature-link').click(function(e) { - feedback.switchState(SUGGESTIONS, REPORTSUGGESTIONS); - }); - } + return false; + } + + handleHomeState() { + this.siteUpdater = $('#feedback-siteupdaters').find(':selected').text(); + if (this.siteUpdater === '') this.siteUpdater = $('#feedback-contactname').val(); + this.toAddress = $('#feedback-destination-email').val(); + FeedbackUtils.renderTemplate(Feedback.HOME, { + featureSuggestionUrl: this.feedback.featureSuggestionUrl, + helpdeskUrl: this.feedback.helpdeskUrl, + technicalUrl: this.feedback.technicalUrl, + supplementalAUrl: this.feedback.supplementalAUrl, + supplementalBUrl: this.feedback.supplementalBUrl, + supplementaryInfo: this.feedback.supplementaryInfo, + helpPagesUrl: this.feedback.helpPagesUrl, + helpPagesTarget: this.feedback.helpPagesTarget, + loggedIn: this.loggedIn, + showContentPanel: this.feedback.showContentPanel, + showHelpPanel: this.feedback.showHelpPanel, + showTechnicalPanel: this.feedback.showTechnicalPanel, + showSuggestionsPanel: this.feedback.showSuggestionsPanel, + showSupplementalAPanel: this.feedback.showSupplementalAPanel, + showSupplementalBPanel: this.feedback.showSupplementalBPanel, + helpPanelAsLink: this.feedback.helpPanelAsLink, + technicalPanelAsLink: this.feedback.technicalPanelAsLink, + suggestionsPanelAsLink: this.feedback.suggestionsPanelAsLink, + supplementalAPanelAsLink: this.feedback.supplementalAPanelAsLink, + supplementalBPanelAsLink: this.feedback.supplementalBPanelAsLink, + enableTechnical: this.feedback.enableTechnical, + enableSuggestions: this.feedback.enableSuggestions, + enableSupplementalA: this.feedback.enableSupplementalA, + enableSupplementalB: this.feedback.enableSupplementalB, + enableHelp: this.feedback.enableHelp + }, 'feedback-content'); + + $(document).ready(() => { + this.setupHomeStateEvents(); + }); + } - if(!feedback.supplementalAPanelAsLink && feedback.enableSupplementalA) { - $('#feedback-report-supplemental-a-link').click(function(e) { - feedback.switchState(SUPPLEMENTALA, REPORTSUPPLEMENTALA); - }); - } + setupHomeStateEvents() { + if (this.feedback.helpPagesUrl.length > 0) { + $('#feedback-help-wrapper').show(); + } + $('#feedback-report-content-link').click(() => this.switchState(Feedback.CONTENT)); - if(!feedback.supplementalBPanelAsLink && feedback.enableSupplementalB) { - $('#feedback-report-supplemental-b-link').click(function(e) { - feedback.switchState(SUPPLEMENTALB, REPORTSUPPLEMENTALB); - }); - } + if (!this.feedback.technicalPanelAsLink && this.feedback.enableTechnical) { + $('#feedback-technical-item').show().css('display', 'inline'); + $('#feedback-report-technical-wrapper').show(); + $('#feedback-report-technical-link').click(() => this.switchState(Feedback.TECHNICAL, Feedback.REPORTTECHNICAL)); + } - if (feedback.supplementaryInfo.length > 0) { - $('#feedback-supplementary-info').show(); - } + if (!this.feedback.helpPanelAsLink && this.feedback.enableHelp) { + $('#feedback-report-helpdesk-link').click(() => this.switchState(Feedback.HELPDESK, Feedback.REPORTHELPDESK)); + } - $('.feedback-explanation-link').click(function (e) { + if (!this.feedback.suggestionsPanelAsLink && this.feedback.enableSuggestions) { + $('#feedback-suggest-feature-link').click(() => this.switchState(Feedback.SUGGESTIONS, Feedback.REPORTSUGGESTIONS)); + } - $(this).next().toggle({ duration: 'fast', - complete: function () { - feedback.fitFrame(); - } }); - }); + if (!this.feedback.supplementalAPanelAsLink && this.feedback.enableSupplementalA) { + $('#feedback-report-supplemental-a-link').click(() => this.switchState(Feedback.SUPPLEMENTALA, Feedback.REPORTSUPPLEMENTALA)); + } + if (!this.feedback.supplementalBPanelAsLink && this.feedback.enableSupplementalB) { + $('#feedback-report-supplemental-b-link').click(() => this.switchState(Feedback.SUPPLEMENTALB, Feedback.REPORTSUPPLEMENTALB)); + } - $('#feedback-info-message-wrapper a').click(function (e) { - $('#feedback-info-message-wrapper').hide(); - }); + if (this.feedback.supplementaryInfo.length > 0) { + $('#feedback-supplementary-info').show(); + } - if(feedback.previousState === CONTENT && (siteUpdater !== null && siteUpdater !=='')) { - feedback.displayInfo(siteUpdater); - } else { - feedback.displayInfo(toAddress); + $('.feedback-explanation-link').click(() => { + $(this).next().toggle({ + duration: 'fast', + complete: () => { + this.fitFrame(); } - - feedback.fitFrame(); }); - } else if (CONTENT === state) { - - feedback.utils.renderTemplate(state, { plugins : feedback.getPluginList(), screenWidth: screen.width, screenHeight: screen.height, oscpu: navigator.oscpu, windowWidth: window.outerWidth, - windowHeight: window.outerHeight, siteExists: feedback.siteExists, siteId: feedback.siteId, contentUrl : feedback.contentUrl, siteUpdaters: feedback.siteUpdaters, loggedIn: loggedIn, destinationAddress: feedback.technicalToAddress, contactName: feedback.contactName}, 'feedback-content'); - - feedback.previousState = state; - $(document).ready(function () { - - feedback.addMouseUpToTextArea(); - feedback.fitFrame(); - - if (feedback.siteUpdaters.length > 0) { - $('#feedback-siteupdaters-wrapper').show(); - } - - $('#feedback-form').ajaxForm(feedback.getFormOptions(feedback.userId.length > 0)); + }); - $('#feedback-max-attachments-mb').html(feedback.maxAttachmentsMB); + $('#feedback-info-message-wrapper a').click(() => { + $('#feedback-info-message-wrapper').hide(); + }); - $('#feedback-attachment').MultiFile( { - max: 5, - namePattern: '$name_$i' - }); + if (this.feedback.previousState === Feedback.CONTENT && (this.siteUpdater !== null && this.siteUpdater !== '')) { + this.displayInfo(this.siteUpdater); + } else { + this.displayInfo(this.toAddress); + } - feedback.setUpCancelButton(); + this.fitFrame(); + } + + handleContentState() { + FeedbackUtils.renderTemplate(Feedback.CONTENT, { + plugins: this.getPluginList(), + screenWidth: screen.width, + screenHeight: screen.height, + oscpu: navigator.oscpu, + windowWidth: window.outerWidth, + windowHeight: window.outerHeight, + siteExists: this.feedback.siteExists, + siteId: this.feedback.siteId, + contentUrl: this.feedback.contentUrl, + siteUpdaters: this.feedback.siteUpdaters, + loggedIn: this.loggedIn, + destinationAddress: this.feedback.technicalToAddress, + contactName: this.feedback.contactName + }, 'feedback-content'); + + this.feedback.previousState = Feedback.CONTENT; + + $(document).ready(() => { + this.addMouseUpToTextArea(); + this.fitFrame(); + + if (this.feedback.siteUpdaters.length > 0) { + $('#feedback-siteupdaters-wrapper').show(); + } - if (!loggedIn) { - // Not logged in, show the sender email box. - $('#feedback-sender-address-wrapper').show(); + $('#feedback-form').ajaxForm(this.getFormOptions(this.feedback.userId.length > 0)); + $('#feedback-max-attachments-mb').html(this.feedback.maxAttachmentsMB); + $('#feedback-attachment').MultiFile({ + max: 5, + namePattern: '$name_$i' + }); - feedback.setUpRecaptcha(); - } else { - // logged in, hide the sender form address - $('#feedback-sender-address-wrapper').hide(); - } + this.setUpCancelButton(); - }); - } else if (TECHNICAL === state || HELPDESK === state || SUGGESTIONS === state || SUPPLEMENTALA === state || SUPPLEMENTALB === state) { - var options = { plugins : feedback.getPluginList(), screenWidth: screen.width, screenHeight: screen.height, oscpu: navigator.oscpu, windowWidth: window.outerWidth, - windowHeight: window.outerHeight, siteExists: feedback.siteExists, url: url, siteId: feedback.siteId, siteUpdaters: feedback.siteUpdaters, loggedIn: loggedIn, contactName: feedback.contactName }; - - if (TECHNICAL === state) { - options['destinationAddress'] = feedback.technicalToAddress; - options['instructionUrl'] = feedback.technicalUrl; - options['instructionKey'] = 'technical_instruction'; - } else if (HELPDESK === state) { - options['destinationAddress'] = feedback.helpToAddress; - options['instructionUrl'] = feedback.helpdeskUrl; - options['instructionKey'] = 'ask_instruction'; - } else if (SUGGESTIONS === state) { - options['destinationAddress'] = feedback.suggestionsToAddress; - options['instructionUrl'] = feedback.featureSuggestionUrl; - options['instructionKey'] = 'suggestion_instruction'; - } else if (SUPPLEMENTALA === state) { - options['destinationAddress'] = feedback.supplementalAToAddress; - options['instructionUrl'] = feedback.supplementalAUrl; - options['instructionKey'] = 'supplemental_a_instruction'; + if (!this.loggedIn) { + $('#feedback-sender-address-wrapper').show(); + this.setUpRecaptcha(); } else { - options['destinationAddress'] = feedback.supplementalBToAddress; - options['instructionUrl'] = feedback.supplementalBUrl; - options['instructionKey'] = 'supplemental_b_instruction'; + $('#feedback-sender-address-wrapper').hide(); } - feedback.utils.renderTemplate("emailForm", options, 'feedback-content'); - - feedback.previousState = state; - $(document).ready(function () { - - feedback.addMouseUpToTextArea(); - - if (!loggedIn) { - // Not logged in, show the sender email box. - $('#feedback-sender-address-wrapper').show(); - - feedback.setUpRecaptcha(); - } else { - // logged in, hide the sender form address - $('#feedback-sender-address-wrapper').hide(); - } + }); + } + + handleOtherStates(state, url) { + let options = { + plugins: this.getPluginList(), + screenWidth: screen.width, + screenHeight: screen.height, + oscpu: navigator.oscpu, + windowWidth: window.outerWidth, + windowHeight: window.outerHeight, + siteExists: this.feedback.siteExists, + url: url, + siteId: this.feedback.siteId, + siteUpdaters: this.feedback.siteUpdaters, + loggedIn: this.loggedIn, + contactName: this.feedback.contactName + }; - feedback.fitFrame(); + options = this.setOptionsForOtherStates(options, state); - $('#feedback-form').ajaxForm(feedback.getFormOptions(feedback.userId.length > 0)); + FeedbackUtils.renderTemplate("emailForm", options, 'feedback-content'); + this.feedback.previousState = state; - $('#feedback-max-attachments-mb').html(feedback.maxAttachmentsMB); + $(document).ready(() => { + this.addMouseUpToTextArea(); - $('#feedback-attachment').MultiFile( { - max: 5, - namePattern: '$name_$i' - } ); + if (!this.loggedIn) { + $('#feedback-sender-address-wrapper').show(); + this.setUpRecaptcha(); + } else { + $('#feedback-sender-address-wrapper').hide(); + } - feedback.setUpCancelButton(); + this.fitFrame(); + $('#feedback-form').ajaxForm(this.getFormOptions(this.feedback.userId.length > 0)); + $('#feedback-max-attachments-mb').html(this.feedback.maxAttachmentsMB); + $('#feedback-attachment').MultiFile({ + max: 5, + namePattern: '$name_$i' }); + + this.setUpCancelButton(); + }); + } + + setOptionsForOtherStates(options, state) { + if (Feedback.TECHNICAL === state) { + options.destinationAddress = this.feedback.technicalToAddress; + options.instructionUrl = this.feedback.technicalUrl; + options.instructionKey = 'technical_instruction'; + } else if (Feedback.HELPDESK === state) { + options.destinationAddress = this.feedback.helpToAddress; + options.instructionUrl = this.feedback.helpdeskUrl; + options.instructionKey = 'ask_instruction'; + } else if (Feedback.SUGGESTIONS === state) { + options.destinationAddress = this.feedback.suggestionsToAddress; + options.instructionUrl = this.feedback.featureSuggestionUrl; + options.instructionKey = 'suggestion_instruction'; + } else if (Feedback.SUPPLEMENTALA === state) { + options.destinationAddress = this.feedback.supplementalAToAddress; + options.instructionUrl = this.feedback.supplementalAUrl; + options.instructionKey = 'supplemental_a_instruction'; + } else { + options.destinationAddress = this.feedback.supplementalBToAddress; + options.instructionUrl = this.feedback.supplementalBUrl; + options.instructionKey = 'supplemental_b_instruction'; } - return false; - }; + return options; + } - feedback.getPluginList = function () { - var plugins = ''; - for(var i = 0; i 0) { - // Recaptcha is enabled, show it. - Recaptcha.create(feedback.recaptchaPublicKey, "feedback-recaptcha-block", - { - theme: "red", - callback: function () { - - feedback.fitFrame(); - $('#feedback-recaptcha-wrapper').show(); - } + } + + setUpRecaptcha() { + if (this.feedback.recaptchaPublicKey.length > 0) { + Recaptcha.create(this.feedback.recaptchaPublicKey, "feedback-recaptcha-block", { + theme: "red", + callback: () => { + this.fitFrame(); + $('#feedback-recaptcha-wrapper').show(); } - ); + }); } - }; + } - feedback.setUpCancelButton = function () { - $('#feedback-cancel-button').click(function (e) { - location.href=""; + setUpCancelButton() { + $('#feedback-cancel-button').click((e) => { + location.href = ""; e.preventDefault(); }); - }; - - feedback.fitFrame = function () { + } + fitFrame() { try { if (window.frameElement) { setMainFrameHeight(window.frameElement.id); } - } catch (err) { } - }; + } catch (err) {} + } - feedback.addMouseUpToTextArea = function () { - - $('textarea').mouseup(function (e) { - feedback.fitFrame(); + addMouseUpToTextArea() { + $('textarea').mouseup(() => { + this.fitFrame(); }); - }; - - feedback.getFormOptions = function (loggedIn) { + } + getFormOptions(loggedIn) { return { dataType: 'html', iframe: true, timeout: 30000, - success: function (responseText, statusText, xhr) { - - if (responseText === SUCCESS) { - feedback.switchState(HOME); + success: (responseText, statusText, xhr) => { + if (responseText === Feedback.SUCCESS) { + this.switchState(Feedback.HOME); } else { - feedback.displayError(responseText); + this.displayError(responseText); } }, - beforeSubmit: function (formArray, $form, options) { - - for (var i=0,j=formArray.length;i { + for (let i = 0, j = formArray.length; i < j; i++) { + let el = formArray[i]; + if (el.name === 'title' && el.value.length < 1) { + this.displayError(Feedback.BAD_TITLE); + return false; + } else if (el.name === 'description' && el.value.length < 1) { + this.displayError(Feedback.BAD_DESCRIPTION); + return false; + } else if (!loggedIn && el.name === 'senderaddress' && (el.value.length === 0 || !this.validateEmail(el.value))) { + this.displayError(el.value.length === 0 ? Feedback.NO_SENDER_ADDRESS : Feedback.BAD_SENDER_ADDRESS); + return false; } } return true; } }; - }; + } - feedback.validateEmail = function (email) { - var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; + validateEmail(email) { + const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); - }; - - feedback.displayError = function (errorCode) { - - if (errorCode === FORBIDDEN) { - $('#feedback-error-message-wrapper span').html(feedback.i18n.error_forbidden); - } else if (errorCode === BAD_REQUEST) { - $('#feedback-error-message-wrapper span').html(feedback.i18n.error_bad_request); - } else if (errorCode === ATTACHMENTS_TOO_BIG) { - $('#feedback-error-message-wrapper span').html(feedback.i18n.error_attachments_too_big); - } else if (errorCode === BAD_TITLE) { - $('#feedback-error-message-wrapper span').html(feedback.i18n.error_bad_title); - } else if (errorCode === BAD_DESCRIPTION) { - $('#feedback-error-message-wrapper span').html(feedback.i18n.error_bad_description); - } else if (errorCode === RECAPTCHA_FAILURE) { - $('#feedback-error-message-wrapper span').html(feedback.i18n.error_recaptcha_failure); - } else if (errorCode === BAD_RECIPIENT) { - $('#feedback-error-message-wrapper span').html(feedback.i18n.error_bad_recipient); - } else if (errorCode === NO_SENDER_ADDRESS) { - $('#feedback-error-message-wrapper span').html(feedback.i18n.error_no_sender_address); - } else if (errorCode === BAD_SENDER_ADDRESS) { - $('#feedback-error-message-wrapper span').html(feedback.i18n.error_bad_sender_address); - } else if (errorCode === DB_ERROR) { - $('#feedback-error-message-wrapper span').html(feedback.i18n.error_db_error); - } else { - $('#feedback-error-message-wrapper span').html(feedback.i18n.error); + } + + displayError(errorCode) { + let errorMessage; + + switch (errorCode) { + case Feedback.FORBIDDEN: + errorMessage = this.feedback.i18n.error_forbidden; + break; + case Feedback.BAD_REQUEST: + errorMessage = this.feedback.i18n.error_bad_request; + break; + case Feedback.ATTACHMENTS_TOO_BIG: + errorMessage = this.feedback.i18n.error_attachments_too_big; + break; + case Feedback.BAD_TITLE: + errorMessage = this.feedback.i18n.error_bad_title; + break; + case Feedback.BAD_DESCRIPTION: + errorMessage = this.feedback.i18n.error_bad_description; + break; + case Feedback.RECAPTCHA_FAILURE: + errorMessage = this.feedback.i18n.error_recaptcha_failure; + break; + case Feedback.BAD_RECIPIENT: + errorMessage = this.feedback.i18n.error_bad_recipient; + break; + case Feedback.NO_SENDER_ADDRESS: + errorMessage = this.feedback.i18n.error_no_sender_address; + break; + default: + errorMessage = this.feedback.i18n.error; + break; } - $('#feedback-error-message-wrapper a').click(function (e) { + $('#feedback-error-message-wrapper span').html(errorMessage); + $('#feedback-error-message-wrapper a').click(() => { $('#feedback-error-message-wrapper').hide(); }); - $('#feedback-error-message-wrapper').show(); - feedback.fitFrame(); + this.fitFrame(); - if (feedback.recaptchaPublicKey.length > 0) { - // Recaptcha is enabled, so we need to reset it. + if (this.feedback.recaptchaPublicKey.length > 0) { Recaptcha.reload(); } - }; + } - - feedback.displayInfo = function (destination) { - if (destination!=null && destination!=''){ - $('#feedback-info-message-wrapper span').html(feedback.i18n['email_success'] + ' ' + destination); + displayInfo(destination) { + if (destination !== undefined && destination !== '') { + $('#feedback-info-message-wrapper span').html(this.feedback.i18n.email_success + ' ' + destination); $('#feedback-info-message-wrapper').show(); - feedback.fitFrame(); + this.fitFrame(); } - }; - - var loggedIn = (feedback.userId != '') ? true : false; - feedback.utils.renderTemplate(TOOLBAR , { featureSuggestionUrl: feedback.featureSuggestionUrl, - loggedIn: loggedIn, - helpPagesUrl: feedback.helpPagesUrl, - helpPagesTarget: feedback.helpPagesTarget}, 'feedback-toolbar'); - - $(document).ready(function () { - - $('#feedback-home-item').click(function (e) { - return feedback.switchState(HOME); - }); - - $('#feedback-content-item').click(function (e) { - return feedback.switchState(CONTENT); - }); - - $('#feedback-technical-item').click(function (e) { - return feedback.switchState(TECHNICAL, REPORTTECHNICAL); - }); - - $('#feedback-helpdesk-item').click(function (e) { - return feedback.switchState(HELPDESK, REPORTHELPDESK); - }); - }); - - feedback.switchState(HOME); + } +} -}) (jQuery); +export default Feedback; \ No newline at end of file diff --git a/feedback/src/webapp/js/feedbackutils.js b/feedback/src/webapp/js/feedbackutils.js index 2ab7ada4ef2b..27debbd45359 100644 --- a/feedback/src/webapp/js/feedbackutils.js +++ b/feedback/src/webapp/js/feedbackutils.js @@ -1,22 +1,18 @@ -(function ($) { +class FeedbackUtils { + static renderTemplate(name, data, output) { + const template = Handlebars.templates[name]; + document.getElementById(output).innerHTML = template(data); + } - feedback.utils = {}; + static translate(key, options) { + let ret = feedback.i18n[key]; + if (options !== undefined) { + for (const prop in options.hash) { + ret = ret.replace("{${prop}}", options.hash[prop]); + } + } + return new Handlebars.SafeString(ret); + } +} - feedback.utils.renderTemplate = function (name, data, output) { - - var template = Handlebars.templates[name]; - document.getElementById(output).innerHTML = template(data); - }; - - Handlebars.registerHelper('translate', function (key, options) { - var ret = feedback.i18n[key]; - if(options != undefined) { - for (var prop in options.hash) { - ret = ret.replace('{'+prop+'}', options.hash[prop]); - } - } - - return new Handlebars.SafeString(ret); - }); - -}) (jQuery); +export default FeedbackUtils; \ No newline at end of file diff --git a/feedback/src/webapp/lib/handlebars.runtime-v1.3.0.js b/feedback/src/webapp/lib/handlebars.runtime-v1.3.0.js deleted file mode 100644 index b94930fa82c7..000000000000 --- a/feedback/src/webapp/lib/handlebars.runtime-v1.3.0.js +++ /dev/null @@ -1,530 +0,0 @@ -/*! - - handlebars v1.3.0 - -Copyright (C) 2011 by Yehuda Katz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -@license -*/ -/* exported Handlebars */ -var Handlebars = (function() { -// handlebars/safe-string.js -var __module3__ = (function() { - "use strict"; - var __exports__; - // Build out our basic SafeString type - function SafeString(string) { - this.string = string; - } - - SafeString.prototype.toString = function() { - return "" + this.string; - }; - - __exports__ = SafeString; - return __exports__; -})(); - -// handlebars/utils.js -var __module2__ = (function(__dependency1__) { - "use strict"; - var __exports__ = {}; - /*jshint -W004 */ - var SafeString = __dependency1__; - - var escape = { - "&": "&", - "<": "<", - ">": ">", - '"': """, - "'": "'", - "`": "`" - }; - - var badChars = /[&<>"'`]/g; - var possible = /[&<>"'`]/; - - function escapeChar(chr) { - return escape[chr] || "&"; - } - - function extend(obj, value) { - for(var key in value) { - if(Object.prototype.hasOwnProperty.call(value, key)) { - obj[key] = value[key]; - } - } - } - - __exports__.extend = extend;var toString = Object.prototype.toString; - __exports__.toString = toString; - // Sourced from lodash - // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt - var isFunction = function(value) { - return typeof value === 'function'; - }; - // fallback for older versions of Chrome and Safari - if (isFunction(/x/)) { - isFunction = function(value) { - return typeof value === 'function' && toString.call(value) === '[object Function]'; - }; - } - var isFunction; - __exports__.isFunction = isFunction; - var isArray = Array.isArray || function(value) { - return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false; - }; - __exports__.isArray = isArray; - - function escapeExpression(string) { - // don't escape SafeStrings, since they're already safe - if (string instanceof SafeString) { - return string.toString(); - } else if (!string && string !== 0) { - return ""; - } - - // Force a string conversion as this will be done by the append regardless and - // the regex test will do this transparently behind the scenes, causing issues if - // an object's to string has escaped characters in it. - string = "" + string; - - if(!possible.test(string)) { return string; } - return string.replace(badChars, escapeChar); - } - - __exports__.escapeExpression = escapeExpression;function isEmpty(value) { - if (!value && value !== 0) { - return true; - } else if (isArray(value) && value.length === 0) { - return true; - } else { - return false; - } - } - - __exports__.isEmpty = isEmpty; - return __exports__; -})(__module3__); - -// handlebars/exception.js -var __module4__ = (function() { - "use strict"; - var __exports__; - - var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; - - function Exception(message, node) { - var line; - if (node && node.firstLine) { - line = node.firstLine; - - message += ' - ' + line + ':' + node.firstColumn; - } - - var tmp = Error.prototype.constructor.call(this, message); - - // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. - for (var idx = 0; idx < errorProps.length; idx++) { - this[errorProps[idx]] = tmp[errorProps[idx]]; - } - - if (line) { - this.lineNumber = line; - this.column = node.firstColumn; - } - } - - Exception.prototype = new Error(); - - __exports__ = Exception; - return __exports__; -})(); - -// handlebars/base.js -var __module1__ = (function(__dependency1__, __dependency2__) { - "use strict"; - var __exports__ = {}; - var Utils = __dependency1__; - var Exception = __dependency2__; - - var VERSION = "1.3.0"; - __exports__.VERSION = VERSION;var COMPILER_REVISION = 4; - __exports__.COMPILER_REVISION = COMPILER_REVISION; - var REVISION_CHANGES = { - 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it - 2: '== 1.0.0-rc.3', - 3: '== 1.0.0-rc.4', - 4: '>= 1.0.0' - }; - __exports__.REVISION_CHANGES = REVISION_CHANGES; - var isArray = Utils.isArray, - isFunction = Utils.isFunction, - toString = Utils.toString, - objectType = '[object Object]'; - - function HandlebarsEnvironment(helpers, partials) { - this.helpers = helpers || {}; - this.partials = partials || {}; - - registerDefaultHelpers(this); - } - - __exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = { - constructor: HandlebarsEnvironment, - - logger: logger, - log: log, - - registerHelper: function(name, fn, inverse) { - if (toString.call(name) === objectType) { - if (inverse || fn) { throw new Exception('Arg not supported with multiple helpers'); } - Utils.extend(this.helpers, name); - } else { - if (inverse) { fn.not = inverse; } - this.helpers[name] = fn; - } - }, - - registerPartial: function(name, str) { - if (toString.call(name) === objectType) { - Utils.extend(this.partials, name); - } else { - this.partials[name] = str; - } - } - }; - - function registerDefaultHelpers(instance) { - instance.registerHelper('helperMissing', function(arg) { - if(arguments.length === 2) { - return undefined; - } else { - throw new Exception("Missing helper: '" + arg + "'"); - } - }); - - instance.registerHelper('blockHelperMissing', function(context, options) { - var inverse = options.inverse || function() {}, fn = options.fn; - - if (isFunction(context)) { context = context.call(this); } - - if(context === true) { - return fn(this); - } else if(context === false || context == null) { - return inverse(this); - } else if (isArray(context)) { - if(context.length > 0) { - return instance.helpers.each(context, options); - } else { - return inverse(this); - } - } else { - return fn(context); - } - }); - - instance.registerHelper('each', function(context, options) { - var fn = options.fn, inverse = options.inverse; - var i = 0, ret = "", data; - - if (isFunction(context)) { context = context.call(this); } - - if (options.data) { - data = createFrame(options.data); - } - - if(context && typeof context === 'object') { - if (isArray(context)) { - for(var j = context.length; i").get(0).files,e.formdata=void 0!==window.FormData;var f=!!a.fn.prop;a.fn.attr2=function(){if(!f)return this.attr.apply(this,arguments);var a=this.prop.apply(this,arguments);return a&&a.jquery||"string"==typeof a?a:this.attr.apply(this,arguments)},a.fn.ajaxSubmit=function(b){function c(c){var d,e,f=a.param(c,b.traditional).split("&"),g=f.length,h=[];for(d=0;g>d;d++)f[d]=f[d].replace(/\+/g," "),e=f[d].split("="),h.push([decodeURIComponent(e[0]),decodeURIComponent(e[1])]);return h}function g(d){for(var e=new FormData,f=0;f').val(m.extraData[n].value).appendTo(x)[0]):k.push(a('').val(m.extraData[n]).appendTo(x)[0]));m.iframeTarget||q.appendTo("body"),r.attachEvent?r.attachEvent("onload",h):r.addEventListener("load",h,!1),setTimeout(b,15);try{x.submit()}catch(p){var s=document.createElement("form").submit;s.apply(x)}}finally{x.setAttribute("action",f),x.setAttribute("enctype",j),c?x.setAttribute("target",c):l.removeAttr("target"),a(k).remove()}}function h(b){if(!s.aborted&&!F){if(E=e(r),E||(d("cannot access response document"),b=A),b===z&&s)return s.abort("timeout"),y.reject(s,"timeout"),void 0;if(b==A&&s)return s.abort("server abort"),y.reject(s,"error","server abort"),void 0;if(E&&E.location.href!=m.iframeSrc||v){r.detachEvent?r.detachEvent("onload",h):r.removeEventListener("load",h,!1);var c,f="success";try{if(v)throw"timeout";var g="xml"==m.dataType||E.XMLDocument||a.isXMLDoc(E);if(d("isXml="+g),!g&&window.opera&&(null===E.body||!E.body.innerHTML)&&--G)return d("requeing onLoad callback, DOM not available"),setTimeout(h,250),void 0;var i=E.body?E.body:E.documentElement;s.responseText=i?i.innerHTML:null,s.responseXML=E.XMLDocument?E.XMLDocument:E,g&&(m.dataType="xml"),s.getResponseHeader=function(a){var b={"content-type":m.dataType};return b[a.toLowerCase()]},i&&(s.status=Number(i.getAttribute("status"))||s.status,s.statusText=i.getAttribute("statusText")||s.statusText);var j=(m.dataType||"").toLowerCase(),k=/(json|script|text)/.test(j);if(k||m.textarea){var l=E.getElementsByTagName("textarea")[0];if(l)s.responseText=l.value,s.status=Number(l.getAttribute("status"))||s.status,s.statusText=l.getAttribute("statusText")||s.statusText;else if(k){var o=E.getElementsByTagName("pre")[0],p=E.getElementsByTagName("body")[0];o?s.responseText=o.textContent?o.textContent:o.innerText:p&&(s.responseText=p.textContent?p.textContent:p.innerText)}}else"xml"==j&&!s.responseXML&&s.responseText&&(s.responseXML=H(s.responseText));try{D=J(s,j,m)}catch(t){f="parsererror",s.error=c=t||f}}catch(t){d("error caught: ",t),f="error",s.error=c=t||f}s.aborted&&(d("upload aborted"),f=null),s.status&&(f=s.status>=200&&s.status<300||304===s.status?"success":"error"),"success"===f?(m.success&&m.success.call(m.context,D,"success",s),y.resolve(s.responseText,"success",s),n&&a.event.trigger("ajaxSuccess",[s,m])):f&&(void 0===c&&(c=s.statusText),m.error&&m.error.call(m.context,s,f,c),y.reject(s,"error",c),n&&a.event.trigger("ajaxError",[s,m,c])),n&&a.event.trigger("ajaxComplete",[s,m]),n&&!--a.active&&a.event.trigger("ajaxStop"),m.complete&&m.complete.call(m.context,s,f),F=!0,m.timeout&&clearTimeout(w),setTimeout(function(){m.iframeTarget?q.attr("src",m.iframeSrc):q.remove(),s.responseXML=null},100)}}}var j,k,m,n,o,q,r,s,t,u,v,w,x=l[0],y=a.Deferred();if(y.abort=function(a){s.abort(a)},c)for(k=0;k'),q.css({position:"absolute",top:"-1000px",left:"-1000px"})),r=q[0],s={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(b){var c="timeout"===b?"timeout":"aborted";d("aborting upload... "+c),this.aborted=1;try{r.contentWindow.document.execCommand&&r.contentWindow.document.execCommand("Stop")}catch(e){}q.attr("src",m.iframeSrc),s.error=c,m.error&&m.error.call(m.context,s,c,b),n&&a.event.trigger("ajaxError",[s,m,c]),m.complete&&m.complete.call(m.context,s,c)}},n=m.global,n&&0===a.active++&&a.event.trigger("ajaxStart"),n&&a.event.trigger("ajaxSend",[s,m]),m.beforeSend&&m.beforeSend.call(m.context,s,m)===!1)return m.global&&a.active--,y.reject(),y;if(s.aborted)return y.reject(),y;t=x.clk,t&&(u=t.name,u&&!t.disabled&&(m.extraData=m.extraData||{},m.extraData[u]=t.value,"image"==t.type&&(m.extraData[u+".x"]=x.clk_x,m.extraData[u+".y"]=x.clk_y)));var z=1,A=2,B=a("meta[name=csrf-token]").attr("content"),C=a("meta[name=csrf-param]").attr("content");C&&B&&(m.extraData=m.extraData||{},m.extraData[C]=B),m.forceSync?g():setTimeout(g,10);var D,E,F,G=50,H=a.parseXML||function(a,b){return window.ActiveXObject?(b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a)):b=(new DOMParser).parseFromString(a,"text/xml"),b&&b.documentElement&&"parsererror"!=b.documentElement.nodeName?b:null},I=a.parseJSON||function(a){return window.eval("("+a+")")},J=function(b,c,d){var e=b.getResponseHeader("content-type")||"",f="xml"===c||!c&&e.indexOf("xml")>=0,g=f?b.responseXML:b.responseText;return f&&"parsererror"===g.documentElement.nodeName&&a.error&&a.error("parsererror"),d&&d.dataFilter&&(g=d.dataFilter(g,c)),"string"==typeof g&&("json"===c||!c&&e.indexOf("json")>=0?g=I(g):("script"===c||!c&&e.indexOf("javascript")>=0)&&a.globalEval(g)),g};return y}if(!this.length)return d("ajaxSubmit: skipping submit process - no element selected"),this;var i,j,k,l=this;"function"==typeof b?b={success:b}:void 0===b&&(b={}),i=b.type||this.attr2("method"),j=b.url||this.attr2("action"),k="string"==typeof j?a.trim(j):"",k=k||window.location.href||"",k&&(k=(k.match(/^([^#]+)/)||[])[1]),b=a.extend(!0,{url:k,success:a.ajaxSettings.success,type:i||a.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},b);var m={};if(this.trigger("form-pre-serialize",[this,b,m]),m.veto)return d("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(b.beforeSerialize&&b.beforeSerialize(this,b)===!1)return d("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var n=b.traditional;void 0===n&&(n=a.ajaxSettings.traditional);var o,p=[],q=this.formToArray(b.semantic,p);if(b.data&&(b.extraData=b.data,o=a.param(b.data,n)),b.beforeSubmit&&b.beforeSubmit(q,this,b)===!1)return d("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[q,this,b,m]),m.veto)return d("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var r=a.param(q,n);o&&(r=r?r+"&"+o:o),"GET"==b.type.toUpperCase()?(b.url+=(b.url.indexOf("?")>=0?"&":"?")+r,b.data=null):b.data=r;var s=[];if(b.resetForm&&s.push(function(){l.resetForm()}),b.clearForm&&s.push(function(){l.clearForm(b.includeHidden)}),!b.dataType&&b.target){var t=b.success||function(){};s.push(function(c){var d=b.replaceTarget?"replaceWith":"html";a(b.target)[d](c).each(t,arguments)})}else b.success&&s.push(b.success);if(b.success=function(a,c,d){for(var e=b.context||this,f=0,g=s.length;g>f;f++)s[f].apply(e,[a,c,d||l,l])},b.error){var u=b.error;b.error=function(a,c,d){var e=b.context||this;u.apply(e,[a,c,d,l])}}if(b.complete){var v=b.complete;b.complete=function(a,c){var d=b.context||this;v.apply(d,[a,c,l])}}var w=a("input[type=file]:enabled",this).filter(function(){return""!==a(this).val()}),x=w.length>0,y="multipart/form-data",z=l.attr("enctype")==y||l.attr("encoding")==y,A=e.fileapi&&e.formdata;d("fileAPI :"+A);var B,C=(x||z)&&!A;b.iframe!==!1&&(b.iframe||C)?b.closeKeepAlive?a.get(b.closeKeepAlive,function(){B=h(q)}):B=h(q):B=(x||z)&&A?g(q):a.ajax(b),l.removeData("jqxhr").data("jqxhr",B);for(var D=0;Dj;j++)if(n=i[j],l=n.name,l&&!n.disabled)if(b&&g.clk&&"image"==n.type)g.clk==n&&(d.push({name:l,value:a(n).val(),type:n.type}),d.push({name:l+".x",value:g.clk_x},{name:l+".y",value:g.clk_y}));else if(m=a.fieldValue(n,!0),m&&m.constructor==Array)for(c&&c.push(n),k=0,p=m.length;p>k;k++)d.push({name:l,value:m[k]});else if(e.fileapi&&"file"==n.type){c&&c.push(n);var q=n.files;if(q.length)for(k=0;kf;f++)c.push({name:d,value:e[f]});else null!==e&&"undefined"!=typeof e&&c.push({name:this.name,value:e})}}),a.param(c)},a.fn.fieldValue=function(b){for(var c=[],d=0,e=this.length;e>d;d++){var f=this[d],g=a.fieldValue(f,b);null===g||"undefined"==typeof g||g.constructor==Array&&!g.length||(g.constructor==Array?a.merge(c,g):c.push(g))}return c},a.fieldValue=function(b,c){var d=b.name,e=b.type,f=b.tagName.toLowerCase();if(void 0===c&&(c=!0),c&&(!d||b.disabled||"reset"==e||"button"==e||("checkbox"==e||"radio"==e)&&!b.checked||("submit"==e||"image"==e)&&b.form&&b.form.clk!=b||"select"==f&&-1==b.selectedIndex))return null;if("select"==f){var g=b.selectedIndex;if(0>g)return null;for(var h=[],i=b.options,j="select-one"==e,k=j?g+1:i.length,l=j?g:0;k>l;l++){var m=i[l];if(m.selected){var n=m.value;if(n||(n=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),j)return n;h.push(n)}}return h}return a(b).val()},a.fn.clearForm=function(b){return this.each(function(){a("input,select,textarea",this).clearFields(b)})},a.fn.clearFields=a.fn.clearInputs=function(b){var c=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var d=this.type,e=this.tagName.toLowerCase();c.test(d)||"textarea"==e?this.value="":"checkbox"==d||"radio"==d?this.checked=!1:"select"==e?this.selectedIndex=-1:"file"==d?/MSIE/.test(navigator.userAgent)?a(this).replaceWith(a(this).clone(!0)):a(this).val(""):b&&(b===!0&&/hidden/.test(d)||"string"==typeof b&&a(this).is(b))&&(this.value="")})},a.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},a.fn.enable=function(a){return void 0===a&&(a=!0),this.each(function(){this.disabled=!a})},a.fn.selected=function(b){return void 0===b&&(b=!0),this.each(function(){var c=this.type;if("checkbox"==c||"radio"==c)this.checked=b;else if("option"==this.tagName.toLowerCase()){var d=a(this).parent("select");b&&d[0]&&"select-one"==d[0].type&&d.find("option").selected(!1),this.selected=b}})},a.fn.ajaxSubmit.debug=!1}); \ No newline at end of file diff --git a/help/help-tool/pom.xml b/help/help-tool/pom.xml index 7c604e642f70..7722f5b60d40 100644 --- a/help/help-tool/pom.xml +++ b/help/help-tool/pom.xml @@ -37,10 +37,6 @@ commons-logging commons-logging - - xml-apis - xmlParserAPIs - diff --git a/jobscheduler/scheduler-tool/pom.xml b/jobscheduler/scheduler-tool/pom.xml index 05b3fe195a59..f89682c13c03 100644 --- a/jobscheduler/scheduler-tool/pom.xml +++ b/jobscheduler/scheduler-tool/pom.xml @@ -67,12 +67,6 @@ taglibs standard 1.0.4 - - - xalan - xalan - - org.apache.commons diff --git a/jsf/jsf-tool-sun/pom.xml b/jsf/jsf-tool-sun/pom.xml index 88edba369058..b1eff08015e4 100644 --- a/jsf/jsf-tool-sun/pom.xml +++ b/jsf/jsf-tool-sun/pom.xml @@ -76,12 +76,6 @@ taglibs standard 1.0.4 - - - xalan - xalan - - diff --git a/jsf/jsf-widgets-sun-depend/pom.xml b/jsf/jsf-widgets-sun-depend/pom.xml index 128c5c0e5c47..78d57f1861ea 100644 --- a/jsf/jsf-widgets-sun-depend/pom.xml +++ b/jsf/jsf-widgets-sun-depend/pom.xml @@ -31,13 +31,6 @@ ${project.groupId} myfaces-widgets - - org.apache.myfaces.core myfaces-api diff --git a/jsf/jsf-widgets/pom.xml b/jsf/jsf-widgets/pom.xml index 4af9f732e258..b812b2b55641 100644 --- a/jsf/jsf-widgets/pom.xml +++ b/jsf/jsf-widgets/pom.xml @@ -67,10 +67,6 @@ commons-logging commons-logging - - xml-apis - xmlParserAPIs - diff --git a/jsf/myfaces-tool/pom.xml b/jsf/myfaces-tool/pom.xml index b91e54b00809..fe1d2c49b4f1 100644 --- a/jsf/myfaces-tool/pom.xml +++ b/jsf/myfaces-tool/pom.xml @@ -74,12 +74,6 @@ taglibs standard 1.0.4 - - - xalan - xalan - - diff --git a/jsf/myfaces-widgets/pom.xml b/jsf/myfaces-widgets/pom.xml index cc0280dfadb1..b63d203408a1 100644 --- a/jsf/myfaces-widgets/pom.xml +++ b/jsf/myfaces-widgets/pom.xml @@ -44,10 +44,6 @@ commons-logging commons-logging - - xml-apis - xmlParserAPIs - diff --git a/jsf2/jsf2-widgets/pom.xml b/jsf2/jsf2-widgets/pom.xml index e60c936aa614..401eb5252a2d 100644 --- a/jsf2/jsf2-widgets/pom.xml +++ b/jsf2/jsf2-widgets/pom.xml @@ -67,10 +67,6 @@ commons-logging commons-logging - - xml-apis - xmlParserAPIs - - 4.0.6 + 4.4.0 1.3 4.13.2 9.37.2 @@ -103,7 +100,7 @@ ${sakai.version} UTF-8 - 11 + 17 target false @@ -347,12 +344,30 @@ 3.0.11 provided + + xml-apis + xml-apis + 2.0.2 + provided + xerces xercesImpl 2.12.2 provided + + xalan + xalan + 2.7.3 + provided + + + xalan + serializer + 2.7.3 + provided + @@ -385,14 +400,6 @@ 8.0.1 provided - - - - xerces - xmlParserAPIs - 2.6.2 - provided - @@ -2575,8 +2582,6 @@ --add-modules java.xml - --add-exports=java.xml/com.sun.org.apache.xml.internal.serializer=ALL-UNNAMED - --add-exports=java.xml/com.sun.org.apache.xml.internal.utils=ALL-UNNAMED @@ -2872,7 +2877,6 @@ commons-configuration:commons-configuration commons-logging:commons-logging log4j:log4j - xalan:xalan javax.mail:mail @@ -2900,8 +2904,29 @@ ${sakai.jdk.version} true - --add-exports=java.xml/com.sun.org.apache.xml.internal.serializer=ALL-UNNAMED - --add-exports=java.xml/com.sun.org.apache.xml.internal.utils=ALL-UNNAMED + --add-exports=java.base/java.io=ALL-UNNAMED + --add-exports=java.base/java.lang.invoke=ALL-UNNAMED + --add-exports=java.base/java.lang.reflect=ALL-UNNAMED + --add-exports=java.base/java.lang=ALL-UNNAMED + --add-exports=java.base/java.math=ALL-UNNAMED + --add-exports=java.base/java.net=ALL-UNNAMED + --add-exports=java.base/java.nio=ALL-UNNAMED + --add-exports=java.base/java.text=ALL-UNNAMED + --add-exports=java.base/java.time=ALL-UNNAMED + --add-exports=java.base/java.util.concurrent.atomic=ALL-UNNAMED + --add-exports=java.base/java.util.concurrent.locks=ALL-UNNAMED + --add-exports=java.base/java.util.concurrent=ALL-UNNAMED + --add-exports=java.base/java.util=ALL-UNNAMED + --add-exports=java.base/jdk.internal.access=ALL-UNNAMED + --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED + --add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED + --add-exports=java.base/sun.util.calendar=ALL-UNNAMED + --add-exports=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED + --add-exports=java.management/sun.management=ALL-UNNAMED + --add-exports=java.sql/java.sql=ALL-UNNAMED + --add-exports=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED + --add-exports=jdk.management/com.sun.management.internal=ALL-UNNAMED
@@ -2937,7 +2962,38 @@ - --illegal-access=permit --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED -Djava.awt.headless=true -Dfile.encoding=${project.build.sourceEncoding} ${random-source} + + --add-opens=java.desktop/java.awt.font=ALL-UNNAMED + --add-opens=java.xml/jdk.xml.internal=ALL-UNNAMED + --add-opens=java.base/java.io=ALL-UNNAMED + --add-opens=java.base/java.lang.invoke=ALL-UNNAMED + --add-opens=java.base/java.lang.reflect=ALL-UNNAMED + --add-opens=java.base/java.lang=ALL-UNNAMED + --add-opens=java.base/java.math=ALL-UNNAMED + --add-opens=java.base/java.net=ALL-UNNAMED + --add-opens=java.base/java.nio=ALL-UNNAMED + --add-opens=java.base/java.text=ALL-UNNAMED + --add-opens=java.base/java.time=ALL-UNNAMED + --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED + --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED + --add-opens=java.base/java.util.concurrent=ALL-UNNAMED + --add-opens=java.base/java.util=ALL-UNNAMED + --add-opens=java.base/jdk.internal.access=ALL-UNNAMED + --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED + --add-opens=java.base/sun.nio.ch=ALL-UNNAMED + --add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED + --add-opens=java.base/sun.util.calendar=ALL-UNNAMED + --add-opens=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED + --add-opens=java.management/sun.management=ALL-UNNAMED + --add-opens=java.sql/java.sql=ALL-UNNAMED + --add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + --add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + --add-opens=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED + --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED + -Dfile.encoding=${project.build.sourceEncoding} + -Djava.awt.headless=true + ${random-source} + diff --git a/msgcntr/messageforums-app/pom.xml b/msgcntr/messageforums-app/pom.xml index f10433bcdbc6..d4760300a7b3 100644 --- a/msgcntr/messageforums-app/pom.xml +++ b/msgcntr/messageforums-app/pom.xml @@ -53,10 +53,6 @@ commons-logging commons-logging - - xml-apis - xmlParserAPIs - diff --git a/pom.xml b/pom.xml index ac46c468f271..230ab8ac48aa 100644 --- a/pom.xml +++ b/pom.xml @@ -109,7 +109,6 @@ serviceworker shortenedurl signup - simple-rss-portlet site site-manage sitestats diff --git a/portal/portal-impl/impl/pom.xml b/portal/portal-impl/impl/pom.xml index 51230313f55d..f9ca8b49d878 100644 --- a/portal/portal-impl/impl/pom.xml +++ b/portal/portal-impl/impl/pom.xml @@ -117,17 +117,6 @@ org.sakaiproject.velocity sakai-velocity-util - - xom - xom - 1.1 - - - xalan - xalan - - - com.fasterxml.jackson.core jackson-databind diff --git a/portal/portal-render-engine-impl/impl/src/webapp/vm/morpheus/includeBodyScripts.vm b/portal/portal-render-engine-impl/impl/src/webapp/vm/morpheus/includeBodyScripts.vm index 5927762699df..9295103510cb 100644 --- a/portal/portal-render-engine-impl/impl/src/webapp/vm/morpheus/includeBodyScripts.vm +++ b/portal/portal-render-engine-impl/impl/src/webapp/vm/morpheus/includeBodyScripts.vm @@ -186,7 +186,7 @@ diff --git a/profile2/impl/src/webapp/WEB-INF/components.xml b/profile2/impl/src/webapp/WEB-INF/components.xml index 67b0761a0cff..d6021eac0050 100644 --- a/profile2/impl/src/webapp/WEB-INF/components.xml +++ b/profile2/impl/src/webapp/WEB-INF/components.xml @@ -93,14 +93,13 @@ + org/sakaiproject/profile2/hbm/ExternalIntegrationInfo.hbm.xml + org/sakaiproject/profile2/hbm/ProfileImageExternal.hbm.xml + org/sakaiproject/profile2/hbm/ProfileImageOfficial.hbm.xml org/sakaiproject/profile2/hbm/ProfileImageUploaded.hbm.xml - org/sakaiproject/profile2/hbm/SakaiPersonMeta.hbm.xml org/sakaiproject/profile2/hbm/ProfilePreferences.hbm.xml - org/sakaiproject/profile2/hbm/ProfileImageExternal.hbm.xml - org/sakaiproject/profile2/hbm/CompanyProfile.hbm.xml + org/sakaiproject/profile2/hbm/SakaiPersonMeta.hbm.xml org/sakaiproject/profile2/hbm/SocialNetworkingInfo.hbm.xml - org/sakaiproject/profile2/hbm/ProfileImageOfficial.hbm.xml - org/sakaiproject/profile2/hbm/ExternalIntegrationInfo.hbm.xml diff --git a/roster2/tool/pom.xml b/roster2/tool/pom.xml index 97900209e590..9e50027711d2 100644 --- a/roster2/tool/pom.xml +++ b/roster2/tool/pom.xml @@ -132,12 +132,6 @@ taglibs standard 1.1.2 - - - xalan - xalan - - org.apache.poi diff --git a/rwiki/rwiki-impl/impl/pom.xml b/rwiki/rwiki-impl/impl/pom.xml index e994a553120e..29dcd018b2f4 100644 --- a/rwiki/rwiki-impl/impl/pom.xml +++ b/rwiki/rwiki-impl/impl/pom.xml @@ -168,11 +168,23 @@ commons-logging commons-logging - - xalan - xalan - + + xml-apis + xml-apis + + + xerces + xercesImpl + + + xalan + xalan + + + xalan + serializer + diff --git a/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/BaseFOPSerializer.java b/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/BaseFOPSerializer.java index aba4ad4479c2..d1bad0741912 100644 --- a/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/BaseFOPSerializer.java +++ b/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/BaseFOPSerializer.java @@ -34,8 +34,8 @@ import javax.xml.transform.URIResolver; import javax.xml.transform.stream.StreamSource; -import com.sun.org.apache.xml.internal.serializer.DOMSerializer; -import com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler; +import org.apache.xml.serializer.DOMSerializer; +import org.apache.xml.serializer.ToXMLSAXHandler; import lombok.extern.slf4j.Slf4j; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder; @@ -47,7 +47,7 @@ import org.apache.fop.fonts.substitute.FontQualifier; import org.apache.fop.fonts.substitute.FontSubstitution; import org.apache.fop.fonts.substitute.FontSubstitutions; -import com.sun.org.apache.xml.internal.serializer.ToSAXHandler; +import org.apache.xml.serializer.ToSAXHandler; import org.w3c.dom.Node; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; diff --git a/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/XHTMLSerializer.java b/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/XHTMLSerializer.java new file mode 100644 index 000000000000..db07cf76529e --- /dev/null +++ b/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/XHTMLSerializer.java @@ -0,0 +1,46 @@ +package uk.ac.cam.caret.sakai.rwiki.component.service.impl; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.xml.serializer.ToXMLStream; +import org.xml.sax.SAXException; + +public class XHTMLSerializer extends ToXMLStream { + private static final String XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; + private static Map emptyTag = new HashMap<>(); + + static { + // inclusion els + emptyTag.put("img", "img"); + emptyTag.put("area", "area"); + emptyTag.put("frame", "frame"); + // non-standard inclusion els + emptyTag.put("layer", "layer"); + emptyTag.put("embed", "embed"); + // form el + emptyTag.put("input", "input"); + // default els + emptyTag.put("base", "base"); + // styling els + emptyTag.put("col", "col"); + emptyTag.put("basefont", "basefont"); + // hidden els + emptyTag.put("link", "link"); + emptyTag.put("meta", "meta"); + // separator els + emptyTag.put("br", "br"); + emptyTag.put("hr", "hr"); + } + + public void endElement(String namespaceURI, String localName, String name) throws SAXException { + if ((namespaceURI != null && !"".equals(namespaceURI) + && !namespaceURI.equals(XHTML_NAMESPACE)) + || emptyTag.containsKey(localName.toLowerCase())) { + super.endElement(namespaceURI, localName, name); + return; + } + this.characters(""); + super.endElement(namespaceURI, localName, name); + } +} diff --git a/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/XSLTEntityHandler.java b/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/XSLTEntityHandler.java index 8ca702cffc34..2dc00d2bd582 100644 --- a/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/XSLTEntityHandler.java +++ b/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/XSLTEntityHandler.java @@ -43,8 +43,8 @@ import javax.xml.transform.sax.SAXResult; import javax.xml.transform.sax.TransformerHandler; -import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory; -import com.sun.org.apache.xml.internal.serializer.Serializer; +import org.apache.xml.serializer.OutputPropertiesFactory; +import org.apache.xml.serializer.Serializer; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; diff --git a/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/XSLTTransform.java b/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/XSLTTransform.java index 6560a80c1936..f2499ef39b4d 100644 --- a/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/XSLTTransform.java +++ b/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/XSLTTransform.java @@ -33,8 +33,8 @@ import org.xml.sax.InputSource; import org.xml.sax.XMLReader; -import com.sun.org.apache.xml.internal.serializer.Serializer; -import com.sun.org.apache.xml.internal.serializer.SerializerFactory; +import org.apache.xml.serializer.Serializer; +import org.apache.xml.serializer.SerializerFactory; /** * Manages a TraxTransform using templates to make it fast to get hold of. @@ -52,10 +52,10 @@ public class XSLTTransform { public XSLTTransform() { classLoader = this.getClass().getClassLoader(); transformerFactory = (SAXTransformerFactory) SAXTransformerFactory.newInstance( - "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl", + "org.apache.xalan.processor.TransformerFactoryImpl", classLoader); parserFactory = SAXParserFactory.newInstance( - "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl", + "org.apache.xerces.jaxp.SAXParserFactoryImpl", classLoader); } diff --git a/rwiki/rwiki-impl/impl/src/webapp/WEB-INF/coreServiceComponents.xml b/rwiki/rwiki-impl/impl/src/webapp/WEB-INF/coreServiceComponents.xml index 2422b4720006..eba7b278b108 100755 --- a/rwiki/rwiki-impl/impl/src/webapp/WEB-INF/coreServiceComponents.xml +++ b/rwiki/rwiki-impl/impl/src/webapp/WEB-INF/coreServiceComponents.xml @@ -142,7 +142,7 @@ -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd 2 - com.sun.org.apache.xml.internal.serializer.ToXMLStream + uk.ac.cam.caret.sakai.rwiki.component.service.impl.XHTMLSerializer yes no diff --git a/rwiki/rwiki-tool/tool/pom.xml b/rwiki/rwiki-tool/tool/pom.xml index 2a6147bd2f24..fd245fac4f6f 100644 --- a/rwiki/rwiki-tool/tool/pom.xml +++ b/rwiki/rwiki-tool/tool/pom.xml @@ -116,12 +116,6 @@ taglibs standard 1.1.2 - - - xalan - xalan - - org.easymock diff --git a/rwiki/rwiki-util/radeox/pom.xml b/rwiki/rwiki-util/radeox/pom.xml index 22ac348294a6..43e42b21d275 100644 --- a/rwiki/rwiki-util/radeox/pom.xml +++ b/rwiki/rwiki-util/radeox/pom.xml @@ -59,5 +59,21 @@ org.apache.commons commons-lang3 + + xml-apis + xml-apis + + + xerces + xercesImpl + + + xalan + xalan + + + xalan + serializer + diff --git a/rwiki/rwiki-util/radeox/src/java/org/radeox/filter/XHTMLFilter.java b/rwiki/rwiki-util/radeox/src/java/org/radeox/filter/XHTMLFilter.java index 70bffa16d388..730a01a54b2a 100644 --- a/rwiki/rwiki-util/radeox/src/java/org/radeox/filter/XHTMLFilter.java +++ b/rwiki/rwiki-util/radeox/src/java/org/radeox/filter/XHTMLFilter.java @@ -23,22 +23,9 @@ package org.radeox.filter; -import java.io.ByteArrayOutputStream; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Stack; - -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import com.sun.org.apache.xml.internal.serializer.ToStream; -import com.sun.org.apache.xml.internal.serializer.ToXMLStream; +import lombok.Setter; import lombok.extern.slf4j.Slf4j; - -import org.apache.commons.lang3.StringUtils; +import org.apache.xml.serializer.ToXMLStream; import org.radeox.api.engine.context.InitialRenderContext; import org.radeox.filter.context.FilterContext; import org.xml.sax.Attributes; @@ -49,450 +36,330 @@ import org.xml.sax.XMLReader; import org.xml.sax.helpers.AttributesImpl; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import java.io.ByteArrayOutputStream; +import java.io.StringReader; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Stack; /* * The paragraph filter finds any text between two empty lines and inserts a *

@author stephan @team sonicteam - * + * * @version $Id: ParagraphFilter.java 4158 2005-11-25 23:25:19Z * ian@caret.cam.ac.uk $ */ @Slf4j -public class XHTMLFilter implements Filter, CacheFilter -{ - - private static SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); - private static final Map blockElements = new HashMap(); - static - { - saxParserFactory.setNamespaceAware(true); - List l = new ArrayList(); - l.add("p"); - blockElements.put("hr", l); // hr cant be nested inside p - blockElements.put("h1", l); - blockElements.put("h2", l); - blockElements.put("h3", l); - blockElements.put("h4", l); - blockElements.put("h5", l); - blockElements.put("h6", l); - blockElements.put("h7", l); - blockElements.put("ul", l); - blockElements.put("ol", l); - blockElements.put("div", l); - blockElements.put("blockquote", l); - } - - private static HashMap emptyTag = new HashMap(); - - static - { - // inclusion els - emptyTag.put("img", "img"); - emptyTag.put("area", "area"); - emptyTag.put("frame", "frame"); - // non-standard inclusion els - emptyTag.put("layer", "layer"); - emptyTag.put("embed", "embed"); - // form el - emptyTag.put("input", "input"); - // default els - emptyTag.put("base", "base"); - // styling els - emptyTag.put("col", "col"); - emptyTag.put("basefont", "basefont"); - // hidden els - emptyTag.put("link", "link"); - emptyTag.put("meta", "meta"); - // separator els - emptyTag.put("br", "br"); - emptyTag.put("hr", "hr"); - // here because our current p implementation is broken - // emptyTag.put("p", "p"); - } - - private static HashMap ignoreEmpty = new HashMap(); - - static - { - ignoreEmpty.put("p", "p"); - } - - private InitialRenderContext initialContext; - - public String filter(String input, FilterContext context) - { - String finalOutput = input; - try - { - DeblockFilter dbf = new DeblockFilter(); - EmptyFilter epf = new EmptyFilter(); - - dbf.setBlockElements(blockElements); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ToXMLStream xser = new ToXMLStream(); - xser.setOutputStream(baos); - xser.setIndent(false); - xser.setEncoding("UTF-8"); - xser.setIndentAmount(4); - dbf.setContentHandler(epf); - epf.setContentHander(xser.asContentHandler()); - - SAXParser parser = saxParserFactory.newSAXParser(); - - XMLReader xmlr = parser.getXMLReader(); - - xmlr.setContentHandler(dbf); - // log.warn("Input is "+input); - xmlr.parse(new InputSource(new StringReader("" + input - + ""))); - - String output = new String(baos.toByteArray(), "UTF-8"); - int startBlock = output.indexOf(""); - int endBlock = output.indexOf(""); - if(startBlock >= 0 && endBlock >= 0) - { - finalOutput = output.substring(startBlock + 4, endBlock); - } - log.debug("Output is "+finalOutput); - } - catch (Throwable t) - { - log.error("Failed to XHTML check " + t.getMessage() - + "\n Input======\n" + input + "\n======="); - return input; - } - - return finalOutput; - } - - public String[] replaces() - { - return FilterPipe.NO_REPLACES; - } - - public String[] before() - { - return FilterPipe.EMPTY_BEFORE; - } - - public void setInitialContext(InitialRenderContext context) - { - initialContext = context; - - } - - public String getDescription() - { - return "Hand Coded XHTML filter"; - } - - public class DeblockFilter implements ContentHandler - { - - private Stack s = new Stack(); - - private ContentHandler ch; - - private Map blockElements = new HashMap(); - - public void setContentHandler(ContentHandler ch) - { - this.ch = ch; - } - - public void setBlockElements(Map blockElements) - { - this.blockElements = blockElements; - - } - - public void addElement(String blockElement, String unnested) - { - List l = (List) blockElements.get(blockElement); - if (l == null) - { - l = new ArrayList(); - blockElements.put(blockElement, l); - } - l.add(unnested); - } - - /** - * Unwind the xpath stack back to the first instance of the requested - * emement - * - * @param deblockElement - */ - private Stack closeTo(List deblockElements) throws SAXException - { - int firstIndex = s.size(); - for (int i = 0; i < s.size(); i++) - { - EStack es = (EStack) s.get(i); - if (deblockElements.contains(es.lname)) - { - firstIndex = i; - } - } - EStack es = null; - Stack sb = new Stack(); - while (s.size() > firstIndex) - { - es = (EStack) s.pop(); - // log.warn("Closing "+es.qname); - ch.endElement(es.ns, es.qname, es.lname); - sb.push(es); - } - // log.warn("End Close"); - return sb; - } - - /** - * Check each element to see if its in a list of elements which is - * should not be inside If it is one of these elements, get a list of - * elements, and unwind to that it is not inside the stack - * - * @{inheritDoc} - */ - public void startElement(String ns, String qname, String lname, - Attributes atts) throws SAXException - { - if (blockElements.get(lname) != null) - { - s.push(new EStack(ns, qname, lname, atts, - closeTo((List) blockElements.get(lname)))); - } - else - { - s.push(new EStack(ns, qname, lname, atts, null)); - } - ch.startElement(ns, qname, lname, atts); - } - - /** - * When we get to the end element, pop the Stack element off the stack. - * If there is arestore path, restore the path back in place by emitting - * start elements - * - * @{inheritDoc} - */ - public void endElement(String arg0, String arg1, String arg2) - throws SAXException - { - ch.endElement(arg0, arg1, arg2); - EStack es = (EStack) s.pop(); - if (es.restore != null) - { - while (es.restore.size() > 0) - { - EStack esr = (EStack) es.restore.pop(); - // log.warn("Restore "+esr.lname); - ch.startElement(esr.ns, esr.qname, esr.lname, esr.atts); - s.push(esr); - } - } - } - - public void characters(char[] arg0, int arg1, int arg2) - throws SAXException - { - ch.characters(arg0, arg1, arg2); - } - - public void ignorableWhitespace(char[] arg0, int arg1, int arg2) - throws SAXException - { - ch.ignorableWhitespace(arg0, arg1, arg2); - } - - public void processingInstruction(String arg0, String arg1) - throws SAXException - { - ch.processingInstruction(arg0, arg1); - } - - public void skippedEntity(String arg0) throws SAXException - { - ch.skippedEntity(arg0); - } - - public void setDocumentLocator(Locator arg0) - { - ch.setDocumentLocator(arg0); - } - - public void startDocument() throws SAXException - { - ch.startDocument(); - } - - public void endDocument() throws SAXException - { - ch.endDocument(); - } - - public void startPrefixMapping(String arg0, String arg1) - throws SAXException - { - ch.startPrefixMapping(arg0, arg1); - } - - public void endPrefixMapping(String arg0) throws SAXException - { - ch.endPrefixMapping(arg0); - } - - } - - public class EmptyFilter implements ContentHandler - { - - - private ContentHandler next = null; - - private EStack lastElement = null; - - public EmptyFilter() - { - } - - public void setContentHander(ContentHandler handler) - { - next = handler; - } - - public void setDocumentLocator(Locator arg0) - { - next.setDocumentLocator(arg0); - } - - public void startDocument() throws SAXException - { - emitLast(); - next.startDocument(); - } - - public void endDocument() throws SAXException - { - emitLast(); - next.endDocument(); - } - - public void startPrefixMapping(String arg0, String arg1) - throws SAXException - { - emitLast(); - next.startPrefixMapping(arg0, arg1); - } - - public void endPrefixMapping(String arg0) throws SAXException - { - emitLast(); - next.endPrefixMapping(arg0); - } - - public void emitLast() throws SAXException - { - if (lastElement != null) - { - // this means that there was a startElement, startElement, - // so the lastElement MUST be emited - next.startElement(lastElement.ns, lastElement.qname, - lastElement.lname, lastElement.atts); - lastElement = null; - } - } - - public void startElement(String ns, String qname, String lname, - Attributes atts) throws SAXException - { - emitLast(); - if (ignoreEmpty.get(lname.toLowerCase()) != null) - { - lastElement = new EStack(ns, qname, lname, atts, null); - } - else - { - next.startElement(ns, qname, lname, atts); - } - } - - public void endElement(String arg0, String arg1, String arg2) - throws SAXException - { - if (lastElement != null) - { - // there was a start, then an end with nothing in between - // so ignore alltogether - lastElement = null; - } - else - { - next.endElement(arg0, arg1, arg2); - } - } - - public void characters(char[] arg0, int arg1, int arg2) - throws SAXException - { - emitLast(); - next.characters(arg0, arg1, arg2); - } - - public void ignorableWhitespace(char[] arg0, int arg1, int arg2) - throws SAXException - { - emitLast(); - next.ignorableWhitespace(arg0, arg1, arg2); - } - - public void processingInstruction(String arg0, String arg1) - throws SAXException - { - emitLast(); - next.processingInstruction(arg0, arg1); - } - - public void skippedEntity(String arg0) throws SAXException - { - emitLast(); - next.skippedEntity(arg0); - } - - - } - - public class EStack - { - public EStack(String ns, String qname, String lname, Attributes atts, - Stack restore) - { - this.ns = ns; - this.qname = qname; - this.lname = lname; - this.atts = new AttributesImpl(atts); - this.restore = restore; - } - - public EStack(EStack es) - { - this.ns = es.ns; - this.qname = es.qname; - this.lname = es.lname; - this.atts = new AttributesImpl(es.atts); - this.restore = es.restore; - } - - Stack restore = null; - - String ns; - - String qname; - - String lname; - - Attributes atts; - } - +public class XHTMLFilter implements Filter, CacheFilter { + + @Setter private InitialRenderContext initialContext; + + private final Map> blockElements = new HashMap<>(); + private final Map emptyTag = new HashMap<>(); + private final Map ignoreEmpty = new HashMap<>(); + private final SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); + + public XHTMLFilter() { + saxParserFactory.setNamespaceAware(true); + List p = List.of("p"); + blockElements.put("hr", p); // hr cant be nested inside p + blockElements.put("h1", p); + blockElements.put("h2", p); + blockElements.put("h3", p); + blockElements.put("h4", p); + blockElements.put("h5", p); + blockElements.put("h6", p); + blockElements.put("h7", p); + blockElements.put("ul", p); + blockElements.put("ol", p); + blockElements.put("div", p); + blockElements.put("blockquote", p); + + // inclusion els + emptyTag.put("img", "img"); + emptyTag.put("area", "area"); + emptyTag.put("frame", "frame"); + // non-standard inclusion els + emptyTag.put("layer", "layer"); + emptyTag.put("embed", "embed"); + // form el + emptyTag.put("input", "input"); + // default els + emptyTag.put("base", "base"); + // styling els + emptyTag.put("col", "col"); + emptyTag.put("basefont", "basefont"); + // hidden els + emptyTag.put("link", "link"); + emptyTag.put("meta", "meta"); + // separator els + emptyTag.put("br", "br"); + emptyTag.put("hr", "hr"); + // here because our current p implementation is broken + // emptyTag.put("p", "p"); + ignoreEmpty.put("p", "p"); + } + + public String filter(String input, FilterContext context) { + String finalOutput = input; + try { + DeBlockFilter deblockFilter = new DeBlockFilter(); + EmptyFilter emptyFilter = new EmptyFilter(); + + deblockFilter.setBlockElements(blockElements); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ToXMLStream xmlStream = new ToXMLStream(); + xmlStream.setOutputStream(outputStream); + xmlStream.setIndent(false); + xmlStream.setEncoding("UTF-8"); + xmlStream.setIndentAmount(4); + deblockFilter.setContentHandler(emptyFilter); + emptyFilter.setContentHandler(xmlStream.asContentHandler()); + + SAXParser parser = saxParserFactory.newSAXParser(); + + XMLReader xmlReader = parser.getXMLReader(); + + xmlReader.setContentHandler(deblockFilter); + xmlReader.parse(new InputSource(new StringReader("" + input + ""))); + + String output = outputStream.toString(StandardCharsets.UTF_8); + int startBlock = output.indexOf(""); + int endBlock = output.indexOf(""); + if (startBlock >= 0 && endBlock >= 0) { + finalOutput = output.substring(startBlock + 4, endBlock); + } + log.debug("Output is {}", finalOutput); + } catch (Exception e) { + log.error("Failed to XHTML check {}\n Input======\n{}\n=======", e, input); + return input; + } + + return finalOutput; + } + + public String[] replaces() { + return FilterPipe.NO_REPLACES; + } + + public String[] before() { + return FilterPipe.EMPTY_BEFORE; + } + + public String getDescription() { + return "Hand Coded XHTML filter"; + } + + public static class DeBlockFilter implements ContentHandler { + + @Setter private Map> blockElements = new HashMap<>(); + @Setter private ContentHandler contentHandler; + private final Stack stack = new Stack<>(); + + public void addElement(String blockElement, String unnested) { + List element = blockElements.computeIfAbsent(blockElement, k -> new ArrayList<>()); + element.add(unnested); + } + + /** + * Unwind the xpath stack back to the first instance of the requested element + */ + private Stack closeTo(List deBlockElements) throws SAXException { + int firstIndex = stack.size(); + for (int i = 0; i < stack.size(); i++) { + EStack es = stack.get(i); + if (deBlockElements.contains(es.lname)) { + firstIndex = i; + } + } + EStack es; + Stack sb = new Stack<>(); + while (stack.size() > firstIndex) { + es = stack.pop(); + contentHandler.endElement(es.ns, es.qname, es.lname); + sb.push(es); + } + return sb; + } + + /** + * Check each element to see if it's in a list of elements which is + * should not be inside If it is one of these elements, get a list of + * elements, and unwind to that it is not inside the stack + */ + public void startElement(String ns, String qname, String lname, Attributes atts) throws SAXException { + if (blockElements.get(lname) != null) { + stack.push(new EStack(ns, qname, lname, atts, closeTo(blockElements.get(lname)))); + } else { + stack.push(new EStack(ns, qname, lname, atts, null)); + } + contentHandler.startElement(ns, qname, lname, atts); + } + + /** + * When we get to the end element, pop the Stack element off the stack. + * If there is a restore path, restore the path back in place by emitting + * start elements + */ + public void endElement(String uri, String localName, String qName) throws SAXException { + contentHandler.endElement(uri, localName, qName); + EStack es = stack.pop(); + if (es.restore != null) { + while (!es.restore.isEmpty()) { + EStack esr = es.restore.pop(); + contentHandler.startElement(esr.ns, esr.qname, esr.lname, esr.atts); + stack.push(esr); + } + } + } + + public void characters(char[] ch, int start, int length) throws SAXException { + contentHandler.characters(ch, start, length); + } + + public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { + contentHandler.ignorableWhitespace(ch, start, length); + } + + public void processingInstruction(String target, String data) throws SAXException { + contentHandler.processingInstruction(target, data); + } + + public void skippedEntity(String name) throws SAXException { + contentHandler.skippedEntity(name); + } + + public void setDocumentLocator(Locator locator) { + contentHandler.setDocumentLocator(locator); + } + + public void startDocument() throws SAXException { + contentHandler.startDocument(); + } + + public void endDocument() throws SAXException { + contentHandler.endDocument(); + } + + public void startPrefixMapping(String prefix, String uri) throws SAXException { + contentHandler.startPrefixMapping(prefix, uri); + } + + public void endPrefixMapping(String prefix) throws SAXException { + contentHandler.endPrefixMapping(prefix); + } + + } + + public class EmptyFilter implements ContentHandler { + @Setter private ContentHandler contentHandler = null; + private EStack lastElement = null; + + public EmptyFilter() { + } + + public void setDocumentLocator(Locator locator) { + contentHandler.setDocumentLocator(locator); + } + + public void startDocument() throws SAXException { + emitLast(); + contentHandler.startDocument(); + } + + public void endDocument() throws SAXException { + emitLast(); + contentHandler.endDocument(); + } + + public void startPrefixMapping(String prefix, String uri) throws SAXException { + emitLast(); + contentHandler.startPrefixMapping(prefix, uri); + } + + public void endPrefixMapping(String prefix) throws SAXException { + emitLast(); + contentHandler.endPrefixMapping(prefix); + } + + public void emitLast() throws SAXException { + if (lastElement != null) { + // this means that there was a startElement, startElement, + // so the lastElement MUST be emitted + contentHandler.startElement(lastElement.ns, lastElement.qname, lastElement.lname, lastElement.atts); + lastElement = null; + } + } + + public void startElement(String ns, String qname, String lname, Attributes atts) throws SAXException { + emitLast(); + if (ignoreEmpty.get(lname.toLowerCase()) != null) { + lastElement = new EStack(ns, qname, lname, atts, null); + } else { + contentHandler.startElement(ns, qname, lname, atts); + } + } + + public void endElement(String uri, String localName, String qName) throws SAXException { + if (lastElement != null) { + // there was a start, then an end with nothing in between + // so ignore all together + lastElement = null; + } else { + contentHandler.endElement(uri, localName, qName); + } + } + + public void characters(char[] ch, int start, int length) throws SAXException { + emitLast(); + contentHandler.characters(ch, start, length); + } + + public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { + emitLast(); + contentHandler.ignorableWhitespace(ch, start, length); + } + + public void processingInstruction(String target, String data) throws SAXException { + emitLast(); + contentHandler.processingInstruction(target, data); + } + + public void skippedEntity(String name) throws SAXException { + emitLast(); + contentHandler.skippedEntity(name); + } + + + } + + public static class EStack { + Attributes atts; + String lname; + String ns; + String qname; + Stack restore; + + public EStack(String ns, String qname, String lname, Attributes atts, Stack restore) { + this.ns = ns; + this.qname = qname; + this.lname = lname; + this.atts = new AttributesImpl(atts); + this.restore = restore; + } + + public EStack(EStack es) { + this.ns = es.ns; + this.qname = es.qname; + this.lname = es.lname; + this.atts = new AttributesImpl(es.atts); + this.restore = es.restore; + } + } } diff --git a/samigo/samigo-app/pom.xml b/samigo/samigo-app/pom.xml index 3e8bc57e7b11..7e9baf6b15cc 100644 --- a/samigo/samigo-app/pom.xml +++ b/samigo/samigo-app/pom.xml @@ -179,10 +179,6 @@ commons-logging commons-logging - - xml-apis - xmlParserAPIs - diff --git a/scormplayer/scorm-impl/adl/pom.xml b/scormplayer/scorm-impl/adl/pom.xml index 106b3173e0de..dbf6151625f7 100644 --- a/scormplayer/scorm-impl/adl/pom.xml +++ b/scormplayer/scorm-impl/adl/pom.xml @@ -50,8 +50,8 @@ xercesImpl - xerces - xmlParserAPIs + xml-apis + xml-apis diff --git a/scormplayer/scorm-impl/pack/pom.xml b/scormplayer/scorm-impl/pack/pom.xml index 92eeb8e450bd..efe4509e6558 100644 --- a/scormplayer/scorm-impl/pack/pom.xml +++ b/scormplayer/scorm-impl/pack/pom.xml @@ -45,8 +45,8 @@ xercesImpl - xerces - xmlParserAPIs + xml-apis + xml-apis diff --git a/scormplayer/scorm-tool/pom.xml b/scormplayer/scorm-tool/pom.xml index f26b49be3cb1..3c6497929f33 100644 --- a/scormplayer/scorm-tool/pom.xml +++ b/scormplayer/scorm-tool/pom.xml @@ -111,8 +111,8 @@ xercesImpl - xerces - xmlParserAPIs + xml-apis + xml-apis org.apache.wicket diff --git a/sections/sections-app/pom.xml b/sections/sections-app/pom.xml index 829a0e15072e..0ae888d35eef 100644 --- a/sections/sections-app/pom.xml +++ b/sections/sections-app/pom.xml @@ -84,10 +84,6 @@ commons-logging commons-logging - - xml-apis - xmlParserAPIs - diff --git a/signup/pom.xml b/signup/pom.xml index e539b07d8301..f05d7c0c299a 100644 --- a/signup/pom.xml +++ b/signup/pom.xml @@ -125,12 +125,6 @@ taglibs standard 1.1.2 - - - xalan - xalan - - javax.servlet.jsp diff --git a/signup/tool/pom.xml b/signup/tool/pom.xml index 591952be8c4d..80f173054f2f 100644 --- a/signup/tool/pom.xml +++ b/signup/tool/pom.xml @@ -92,10 +92,6 @@ commons-logging commons-logging - - xml-apis - xmlParserAPIs - diff --git a/simple-rss-portlet/LICENSE b/simple-rss-portlet/LICENSE deleted file mode 100644 index 3d332846513a..000000000000 --- a/simple-rss-portlet/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. \ No newline at end of file diff --git a/simple-rss-portlet/NOTICE b/simple-rss-portlet/NOTICE deleted file mode 100644 index 1726d2b7b588..000000000000 --- a/simple-rss-portlet/NOTICE +++ /dev/null @@ -1,42 +0,0 @@ -Copyright 2010, JA-SIG, Inc. -This project includes software developed by Jasig. -http://www.jasig.org/ - -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. - -This project includes: - Apache Log4j under The Apache Software License, Version 2.0 - Collections under Apache License, Version 2.0 - Commons IO under The Apache Software License, Version 2.0 - Commons Lang under The Apache Software License, Version 2.0 - Commons Logging under The Apache Software License, Version 2.0 - commons-beanutils under Apache License, Version 2.0 - commons-digester under Apache License, Version 2.0 - Ehcache Core under The Apache Software License, Version 2.0 - jdom under Similar to Apache License but with the acknowledgment clause removed - jstl under Commons Development and Distribution License, Version 1.0 - Logging under The Apache Software License, Version 2.0 - oro under Apache License, Version 2.0 - Pluto Portlet Tag Library under The Apache Software License, Version 2.0 - Portlet API under Commons Development and Distribution License, Version 1.0 - Project Lombok under The MIT License - ROME, RSS and atOM utilitiEs for Java under Apache License, Version 2.0 - servlet-api under Commons Development and Distribution License, Version 1.0 - Simple RSS portlet for uPortal under The Apache Software License, Version 2.0 - SLF4J API Module under MIT License - SLF4J LOG4J-12 Binding under MIT License - standard under Apache License, Version 2.0 - Validator under The Apache Software License, Version 2.0 - xml-apis under Apache License, Version 2.0 - diff --git a/simple-rss-portlet/README.md b/simple-rss-portlet/README.md deleted file mode 100644 index db9f7629ca53..000000000000 --- a/simple-rss-portlet/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# RSS Portlet for Sakai - -An RSS/Atom feed reader portlet for Sakai, based on http://github.com/steveswinsburg/simple-rss-portlet but modified for a [Sakai] (https://www.sakailms.org/) build. This is currently included in Sakai 11. - -### Features -* Renders all forms of RSS and Atom feeds -* Prioritises and displays images contained in the feed -* Feeds and images are cached for quick access diff --git a/simple-rss-portlet/docs/apache-license-2-template.txt b/simple-rss-portlet/docs/apache-license-2-template.txt deleted file mode 100644 index 6b609c614745..000000000000 --- a/simple-rss-portlet/docs/apache-license-2-template.txt +++ /dev/null @@ -1,14 +0,0 @@ -Copyright ${year} ${holder} - - 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. - diff --git a/simple-rss-portlet/docs/channel/example-rss-portlet-config.channel b/simple-rss-portlet/docs/channel/example-rss-portlet-config.channel deleted file mode 100644 index b6ac077d9053..000000000000 --- a/simple-rss-portlet/docs/channel/example-rss-portlet-config.channel +++ /dev/null @@ -1,65 +0,0 @@ - - - Simple RSS Portlet - Example 1 - Simple RSS Portlet - Example 1 - simple-rss-portlet - An example setup for the Simple RSS portlet - RSS - org.jasig.portal.channels.portlet.CSpringPortletAdaptor - 5000 - N - N - N - N - en_US - - Information - - - Everyone - - - - - portletApplicationId - - /simple-rss-portlet - - N - - - portletName - - simple-rss-portlet - - N - - - - - - portlet_title - - The Australian - Business - - - - - - feed_url - - http://feeds.news.com.au/public/rss/2.0/aus_business_811.xml - - - - - - max_items - - 5 - - - - - - diff --git a/simple-rss-portlet/docs/cpd/SimpleRSSPortlet.cpd b/simple-rss-portlet/docs/cpd/SimpleRSSPortlet.cpd deleted file mode 100644 index 282820a7dd64..000000000000 --- a/simple-rss-portlet/docs/cpd/SimpleRSSPortlet.cpd +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - This is a simple RSS and Atom feed reader. - - - org.jasig.portal.channels.portlet.CSpringPortletAdaptor - - - - 1 - - Portlet Descriptor - - - Enter the Portlet web-application path and portlet name. - - - - isFrameworkPortlet - - - - true - true - false - - - true - - Portlet is deployed in the same web-application as uPortal. If checked "Portlet Web Application Path" - is ignored. - - false - - - - portletApplicationId - - - 40 - 2000 - - /pluto-testsuite - - This is the name of the web application the portlet resides in including a preceding /. - - /simple-rss-portlet - - - - portletName - - - 40 - 2000 - - simple-rss-portlet - - This is the name of the portlet as defined in the portlet.xml descriptor. - - simple-rss-portlet - - - - disableDynamicTitle - - - - false - true - false - - - false - - Disable dynamic title - - false - - - - - - - - - - - - - diff --git a/simple-rss-portlet/docs/type/rss.channel-type b/simple-rss-portlet/docs/type/rss.channel-type deleted file mode 100644 index 6e39bf1fb797..000000000000 --- a/simple-rss-portlet/docs/type/rss.channel-type +++ /dev/null @@ -1,6 +0,0 @@ - - RSS Feed - org.jasig.portal.channels.portlet.CSpringPortletAdaptor - Renders an RSS/Atom feed - /org/jasig/portal/channels/rss/SimpleRSSPortlet.cpd - \ No newline at end of file diff --git a/simple-rss-portlet/pom.xml b/simple-rss-portlet/pom.xml deleted file mode 100644 index 0a924d899549..000000000000 --- a/simple-rss-portlet/pom.xml +++ /dev/null @@ -1,256 +0,0 @@ - - - 4.0.0 - - org.jasig.portlet - simple-rss-portlet - RSS portlet for Sakai - An RSS/Atom feed reader. - https://wiki.jasig.org/display/PLT/Simple+RSS+Portlet - - war - - - org.sakaiproject - master - 25-SNAPSHOT - ../master/pom.xml - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - Steve Swinsburg - steve.swinsburg@gmail.com - - - - - scm:git:git@github.com:steveswinsburg/simple-rss-portlet.git - scm:git:git@github.com:steveswinsburg/simple-rss-portlet.git - https://github.com/steveswinsburg/simple-rss-portlet - HEAD - - - - - - - javax.servlet - jstl - - - taglibs - standard - 1.1.2 - - - xalan - xalan - - - - - org.apache.commons - commons-lang3 - - - org.apache.commons - commons-text - - - commons-io - commons-io - - - - - commons-validator - commons-validator - - - oro - oro - 2.0.8 - - - - com.rometools - rome - 1.18.0 - - - org.jdom - jdom - 1.1.3 - - - - - org.sakaiproject.kernel - sakai-component-manager - - - org.sakaiproject.kernel - sakai-kernel-api - - - - - javax.portlet - portlet-api - provided - - - javax.servlet - javax.servlet-api - provided - - - org.apache.pluto - pluto-taglib - 1.1.7 - provided - - - - - - ${project.artifactId} - UTF-8 - true - true - - - - - - - false - src/main/resources - - - - - false - src/main/java - - ** - - - **/*.java - - - - - - ${basedir}/src/main/java - - - - - org.apache.maven.plugins - maven-war-plugin - - - - docs - docs - - - - ${basedir}/src/main/webapp - ${basedir}/src/main/webapp/WEB-INF/web.xml - - - - - - - - - release-sign-artifacts - - - performRelease - true - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.4 - - - sign-artifacts - verify - - sign - - - - - - - - - - - manual-site - - - developer.jasig - ${jasig-site-dist-base}/simple-rss-portlet/${project.version} - - - - - - - sakai-pluto-assemble - - true - - - ${war.name} - - - - org.apache.maven.plugins - maven-war-plugin - - ${project.build.directory}/pluto-resources/web.xml - - - - - - org.apache.pluto - maven-pluto-plugin - 1.1.7 - - - generate-resources - - assemble - - - - - - - - - - - diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/FeedParser.java b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/FeedParser.java deleted file mode 100644 index 231ea3513ec1..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/FeedParser.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - * Copyright 2011-2013 The Australian National University - * - * 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 au.edu.anu.portal.portlets.rss; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.io.FileUtils; -import org.apache.commons.lang3.StringUtils; - -import com.rometools.rome.feed.synd.SyndEnclosure; -import com.rometools.rome.feed.synd.SyndEntry; -import com.rometools.rome.feed.synd.SyndFeed; -import com.rometools.rome.io.FeedException; -import com.rometools.rome.io.SyndFeedInput; -import com.rometools.rome.io.XmlReader; - -import au.edu.anu.portal.portlets.rss.model.Attachment; -import au.edu.anu.portal.portlets.rss.utils.Messages; - - -/** - * This class parses a feed via ROME - * - *

The output is totally dependent on ROME classes. - * There could be an abstraction layer but then it wouldn't be as 'simple' which is what this portlet aims to be.

- * - * @author Steve Swinsburg (steve.swinsburg@anu.edu.au) - * - */ -@Slf4j -public class FeedParser { - - private SyndFeedInput input; - - public FeedParser() { - input = new SyndFeedInput(); - } - - /** - * Parse the given feed url and return the raw type - * @param feedUrl - * @return - */ - public SyndFeed parseFeed(String feedUrl) { - - URL url; - XmlReader reader; - SyndFeed feed; - - try { - - //load the feed - url = new URL(feedUrl); - reader = new XmlReader(url); - feed = input.build(reader); - - return feed; - - } catch (MalformedURLException e) { - log.error(e.getMessage(), e); - } catch (IllegalArgumentException e) { - log.error(e.getMessage(), e); - } catch (FeedException e) { - log.error(e.getMessage(), e); - } catch (IOException e) { - log.error(e.getMessage(), e); - } - return null; - } - - /** - * Parses the entries contained in an RSS feed, extracts the enclosures, converts them to an {@link Attachment} - * adds them to the map with the entry uri as key. - *

The RSS spec says there is only one enclosure per item so this is what we work with. We don't actually check this so it's possible - * that if you have more than one enclosure attached to an item that only the latest one will be presented in the end. - * - * @param feed - * @return - */ - public static Map parseFeedEnclosures(SyndFeed feed) { - - Map attachments = new HashMap(); - - // image mime types that are ok to be rendered as an image - List imageTypes = new ArrayList(); - imageTypes.add("image/jpeg"); - imageTypes.add("image/gif"); - imageTypes.add("image/png"); - imageTypes.add("image/jpg"); - - List entries = feed.getEntries(); - for(SyndEntry entry: entries) { - - //get entry uri, but it could be blank so if so, skip this item - if(StringUtils.isBlank(entry.getUri())) { - continue; - } - - //for each enclosure attached to an entry get the first one and use that. - List enclosures = entry.getEnclosures(); - for(SyndEnclosure e: enclosures) { - - //convert to an Attachment - Attachment a = new Attachment(); - a.setUrl(e.getUrl()); - a.setDisplayLength(formatLength(e.getLength())); - a.setType(e.getType()); - - //process the url into a displayname (get just the filename from the full URL) - String displayName = StringUtils.substringAfterLast(e.getUrl(), "/"); - if(StringUtils.isNotBlank(displayName)){ - a.setDisplayName(displayName); - } else { - a.setDisplayName(Messages.getString("view.attachment.default")); - } - - //check if its an iamge we are able to display as the thumbnail for the entry - if(imageTypes.contains(e.getType())){ - a.setImage(true); - } - - attachments.put(entry.getUri(), a); - } - } - - return attachments; - } - - /** - * Helper to format the length from bytes into a human readable format eg 126 kB - * @param length - * @return - */ - private static String formatLength(long length){ - return FileUtils.byteCountToDisplaySize(length); - } - -} diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/SimpleRSSPortlet.java b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/SimpleRSSPortlet.java deleted file mode 100644 index 1ead718d4e8a..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/SimpleRSSPortlet.java +++ /dev/null @@ -1,554 +0,0 @@ -/** - * Copyright 2011-2013 The Australian National University - * - * 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 au.edu.anu.portal.portlets.rss; - -import java.io.IOException; -import java.util.Map; - -import javax.portlet.ActionRequest; -import javax.portlet.ActionResponse; -import javax.portlet.GenericPortlet; -import javax.portlet.PortletConfig; -import javax.portlet.PortletException; -import javax.portlet.PortletMode; -import javax.portlet.PortletModeException; -import javax.portlet.PortletPreferences; -import javax.portlet.PortletRequest; -import javax.portlet.PortletRequestDispatcher; -import javax.portlet.PortletURL; -import javax.portlet.ReadOnlyException; -import javax.portlet.RenderRequest; -import javax.portlet.RenderResponse; -import javax.portlet.ValidatorException; - -import com.rometools.rome.feed.synd.SyndFeed; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.text.StringEscapeUtils; -import org.apache.commons.lang3.StringUtils; - -import au.edu.anu.portal.portlets.rss.model.Attachment; -import au.edu.anu.portal.portlets.rss.utils.Constants; -import au.edu.anu.portal.portlets.rss.utils.Messages; - -import org.sakaiproject.component.cover.ComponentManager; -import org.sakaiproject.memory.api.Cache; -import org.sakaiproject.memory.api.MemoryService; -import org.sakaiproject.site.api.Site; -import org.sakaiproject.site.api.SitePage; -import org.sakaiproject.site.api.SiteService; -import org.sakaiproject.site.api.ToolConfiguration; -import org.sakaiproject.tool.api.Placement; -import org.sakaiproject.tool.api.ToolManager; -import org.sakaiproject.event.api.EventTrackingService; -import org.sakaiproject.exception.IdUnusedException; - -/** - * SimpleRssPortlet - * - * This is the portlet class. - * - * @author Steve Swinsburg (steve.swinsburg@anu.edu.au) - * - */ -@Slf4j -public class SimpleRSSPortlet extends GenericPortlet{ - - // pages - private String viewUrl; - private String editUrl; - private String errorUrl; - private String noContentUrl; - - //cache - private MemoryService memoryService; - private Cache feedCache; - private Cache> mediaCache; - - private static final String FEED_CACHE_NAME = "au.edu.anu.portal.portlets.cache.SimpleRSSPortletCache.feed"; - private static final String MEDIA_CACHE_NAME = "au.edu.anu.portal.portlets.cache.SimpleRSSPortletCache.media"; - - //pref names - private final String PREF_PORTLET_TITLE = "portlet_title"; - private final String PREF_FEED_URL = "feed_url"; - private final String PREF_MAX_ITEMS = "max_items"; - - // events - private static final String NEWS_READ_EVENT = "news.read"; - private static final String NEWS_REVISE_EVENT = "news.revise"; - private static final String EVENT_REF_TEMPLATE = "/news/site/%s/placement/%s"; - - private EventTrackingService eventServ; - private SiteService siteServ; - private ToolManager toolMan; - - public void init(PortletConfig config) throws PortletException { - super.init(config); - log.info("Simple RSS Portlet init()"); - - //pages - viewUrl = config.getInitParameter("viewUrl"); - editUrl = config.getInitParameter("editUrl"); - errorUrl = config.getInitParameter("errorUrl"); - noContentUrl = config.getInitParameter("noContentUrl"); - - //setup cache - memoryService = ComponentManager.get(MemoryService.class); - feedCache = memoryService.getCache(FEED_CACHE_NAME); - mediaCache = memoryService.getCache(MEDIA_CACHE_NAME); - - // setup event tracking - eventServ = ComponentManager.get(EventTrackingService.class); - siteServ = ComponentManager.get(SiteService.class); - toolMan = ComponentManager.get(ToolManager.class); - - } - - /** - * Delegate to appropriate PortletMode. - */ - protected void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, IOException { - log.debug("Simple RSS doDispatch()"); - - if (StringUtils.equalsIgnoreCase(request.getPortletMode().toString(), "CONFIG")) { - doConfig(request, response); - } - else { - super.doDispatch(request, response); - } - } - - /** - * Render the main view - */ - protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { - log.debug("Simple RSS doView()"); - - //get feed URL - String feedUrl = getConfiguredFeedUrl(request); - - //get feed data - SyndFeed feed = getFeedContent(request, response); - - //catch - errors already handled - if(feed == null) { - return; - } - - //catch and send to no content page - if(feed.getEntries().isEmpty()) { - dispatch(request, response, noContentUrl); - } - - //get the media associated with the entries in this feed - Map media = getFeedMedia(feed, feedUrl); - - //get max items (subtract 1 since it will be used in a 0 based index) - int maxItems = getConfiguredMaxItems(request) - 1; - - request.setAttribute("SyndFeed", feed); - request.setAttribute("Media", media); - request.setAttribute("maxItems", maxItems); - - postEvent(NEWS_READ_EVENT, false); - - dispatch(request, response, viewUrl); - } - - /** - * Custom mode handler for EDIT view - */ - protected void doEdit(RenderRequest request, RenderResponse response) throws PortletException, IOException { - log.debug("Simple RSS doEdit()"); - - //if we have an error message, replay the form - String errorMessage = request.getParameter("errorMessage"); - - if(StringUtils.isNotBlank(errorMessage)) { - //PORT-672 replay data from the request so it is preserved - request.setAttribute("portletTitle", request.getParameter("portletTitle")); - request.setAttribute("feedUrl", request.getParameter("feedUrl")); - request.setAttribute("maxItems", request.getParameter("maxItems")); - } else { - //get it from the preferences - request.setAttribute("portletTitle", getConfiguredPortletTitle(request)); - request.setAttribute("feedUrl", getConfiguredFeedUrl(request)); - request.setAttribute("maxItems", getConfiguredMaxItems(request)); - } - - //check permissions - request.setAttribute("feedUrlIsLocked", isPrefLocked(request, PREF_FEED_URL)); - request.setAttribute("portletTitleIsLocked", isPrefLocked(request, PREF_PORTLET_TITLE)); - - //cancel url - request.setAttribute("cancelUrl", getPortletModeUrl(response, PortletMode.VIEW)); - - //get any error message that is in the request and pass it on - request.setAttribute("errorMessage", request.getParameter("errorMessage")); - - dispatch(request, response, editUrl); - } - - /** - * Custom mode handler for CONFIG view - * Identical to EDIT mode. - */ - protected void doConfig(RenderRequest request, RenderResponse response) throws PortletException, IOException { - log.debug("Simple RSS doConfig()"); - doEdit(request,response); - } - - /** - * Process any portlet actions. - */ - public void processAction(ActionRequest request, ActionResponse response) throws PortletModeException { - log.debug("Simple RSS processAction()"); - - //this handles both EDIT and CONFIG modes in exactly the same way. - //if we need to split, check PortletMode. - - boolean success = true; - //get prefs and submitted values - PortletPreferences prefs = request.getPreferences(); - String portletTitle = StringEscapeUtils.escapeHtml4(StringUtils.trim(request.getParameter("portletTitle"))); - String maxItems = StringUtils.trim(request.getParameter("maxItems")); - String feedUrl = StringUtils.trim(request.getParameter("feedUrl")); - Placement placement = toolMan.getCurrentPlacement(); - - //portlet title could be blank, set to default - if(StringUtils.isBlank(portletTitle)){ - portletTitle=Constants.PORTLET_TITLE_DEFAULT; - if (placement != null) { - portletTitle = placement.getTitle(); - } - } - - boolean feedUrlIsLocked = isPrefLocked(request, PREF_FEED_URL); - boolean portletTitleIsLocked = isPrefLocked(request, PREF_PORTLET_TITLE); - - //check not readonly - try { - //only do this if we know its not locked, ie this is not a preconfigured portlet - if(!portletTitleIsLocked) { - prefs.setValue(PREF_PORTLET_TITLE, portletTitle); - - //Save the page and tool title - try{ - Site siteEdit = siteServ.getSite(placement.getContext()); - for (SitePage sitePage : siteEdit.getPages()) { - for(ToolConfiguration toolConfiguration : sitePage.getTools()){ - if (toolConfiguration.getId().equals(placement.getId())) { - sitePage.setTitle(portletTitle); - toolConfiguration.setTitle(portletTitle); - } - } - } - - siteServ.save(siteEdit); - - }catch(Exception ex){ - log.error("Error saving the news title.", ex); - } - - } - - //only do this if we know its not locked, ie this is not a preconfigured portlet - if(!feedUrlIsLocked) { - prefs.setValue(PREF_FEED_URL, feedUrl); - } - prefs.setValue(PREF_MAX_ITEMS, maxItems); - } catch (ReadOnlyException e) { - success = false; - response.setRenderParameter("errorMessage", Messages.getString("error.form.readonly.error")); - log.error(e.getMessage()); - } - - //validate and save - if(success) { - try { - prefs.store(); - response.setPortletMode(PortletMode.VIEW); - postEvent(NEWS_REVISE_EVENT, true); - - } catch (ValidatorException e) { - //PORT-672 present entered data on the form again - response.setRenderParameter("errorMessage", e.getMessage()); - response.setRenderParameter("portletTitle", portletTitle); - response.setRenderParameter("maxItems", maxItems); - - //this will be null if locked so don't set it, we dont need it - if(!feedUrlIsLocked) { - response.setRenderParameter("feedUrl", feedUrl); - } - log.error(e.getMessage()); - } catch (IOException e) { - response.setRenderParameter("errorMessage", Messages.getString("error.form.save.error")); - log.error(e.getMessage()); - } catch (PortletModeException e) { - log.error(e.getMessage(), e); - } - } - - - } - - /** - * Get the feed content - * @param request - * @param response - * @return Map of params or null if any required data is missing - */ - private SyndFeed getFeedContent(RenderRequest request, RenderResponse response) { - - SyndFeed feed; - - //check cache, otherwise get fresh - //we use the feedUrl as the cacheKey - String feedUrl = getConfiguredFeedUrl(request); - if(StringUtils.isBlank(feedUrl)) { - log.debug("No feed URL configured"); - doError("error.no.config", "error.heading.config", getPortletModeUrl(response, PortletMode.EDIT), request, response); - return null; - } - - String cacheKey = feedUrl; - - feed = feedCache.get(cacheKey); - if(feed != null) { - log.debug("Fetching data from feed cache for: " + cacheKey); - } else { - //get from remote - feed = getRemoteFeed(feedUrl, request, response); - } - - return feed; - } - - /** - * Helper to get the remote feed data and cache it - * @param feedUrl - * @param request - * @param response - * @return - */ - private SyndFeed getRemoteFeed(String feedUrl, RenderRequest request, RenderResponse response) { - - //get feed data - SyndFeed feed = new FeedParser().parseFeed(feedUrl); - if(feed == null) { - log.error("No data was returned from remote server."); - doError("error.no.remote.data", "error.heading.general", request, response); - return null; - } - - //cache the data, - log.debug("Adding data to feed cache for: " + feedUrl); - feedCache.put(feedUrl, feed); - - return feed; - } - - /** - * Helper for extracting the enclosures (media) associated with entries in the feed. - * They are returned as a map of String to Attachment where String is the entry Uri - * - * @param feed The raw SyndFeed to process - * @param feedUrl The url of this feed - * @return - */ - private Map getFeedMedia(SyndFeed feed, String feedUrl) { - - Map media; - - //check cache - media = mediaCache.get(feedUrl); - if(media != null) { - log.debug("Fetching data from media cache for: " + feedUrl); - return media; - } else { - - //parse the enclosures for this feed - media = FeedParser.parseFeedEnclosures(feed); - - //cache the data - log.debug("Adding data to media cache for: " + feedUrl); - mediaCache.put(feedUrl, media); - } - - return media; - } - - /** - * Get the preferred portlet title if set, or default from Constants - * @param request - * @return - */ - private String getConfiguredPortletTitle(RenderRequest request) { - PortletPreferences pref = request.getPreferences(); - String defaultTitle = Constants.PORTLET_TITLE_DEFAULT; - Placement placement = toolMan.getCurrentPlacement(); - - //Get the default title from the current placement - if (placement != null) { - return placement.getTitle(); - } - - return pref.getValue(PREF_PORTLET_TITLE, defaultTitle); - } - - /** - * Get the preferred portlet height if set, or default from Constants - * @param request - * @return - */ - private String getConfiguredFeedUrl(RenderRequest request) { - PortletPreferences pref = request.getPreferences(); - return pref.getValue(PREF_FEED_URL, null); - } - - /** - * Get the preferred max number of items, or default from Constants - * @param request - * @return - */ - private int getConfiguredMaxItems(RenderRequest request) { - PortletPreferences pref = request.getPreferences(); - return Integer.valueOf(pref.getValue(PREF_MAX_ITEMS, Integer.toString(Constants.MAX_ITEMS))); - } - - /** - * Override GenericPortlet.getTitle() to use the preferred title for the portlet instead - */ - @Override - protected String getTitle(RenderRequest request) { - return getConfiguredPortletTitle(request); - } - - - /** - * Helper to handle error messages - * @param messageKey Message bundle key - * @param headingKey optional error heading message bundle key, if not specified, the general one is used - * @param request - * @param response - */ - private void doError(String messageKey, String headingKey, RenderRequest request, RenderResponse response){ - doError(messageKey, headingKey, null, request, response); - } - - /** - * Helper to handle error messages - * @param messageKey Message bundle key - * @param headingKey optional error heading message bundle key, if not specified, the general one is used - * @param link if the message text is to be linked, what is the href? - * @param request - * @param response - */ - private void doError(String messageKey, String headingKey, String link, RenderRequest request, RenderResponse response){ - - //message - request.setAttribute("errorMessage", Messages.getString(messageKey)); - - //optional heading - if(StringUtils.isNotBlank(headingKey)){ - request.setAttribute("errorHeading", Messages.getString(headingKey)); - } else { - request.setAttribute("errorHeading", Messages.getString("error.heading.general")); - } - - if(StringUtils.isNotBlank(link)){ - request.setAttribute("errorLink", link); - } - - //dispatch - try { - dispatch(request, response, errorUrl); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - } - - - /** - * Dispatch to a JSP or servlet - * @param request - * @param response - * @param path - * @throws PortletException - * @throws IOException - */ - protected void dispatch(RenderRequest request, RenderResponse response, String path)throws PortletException, IOException { - response.setContentType("text/html"); - PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher(path); - dispatcher.include(request, response); - } - - - /** - * Helper to get the URL to take us to a portlet mode. - * This will end up in doDispatch. - * - * @param response - * @return - */ - private String getPortletModeUrl(RenderResponse response, PortletMode mode) { - - PortletURL url = response.createRenderURL(); - try { - url.setPortletMode(mode); - } catch (PortletModeException e) { - log.error("Invalid portlet mode: " + mode); - return null; - } - - return url.toString(); - } - - /** - * Helper to check if a preference is locked (ie readonly). This may be set by a channel config to restrict access. - * - * @param request - * @return - */ - private boolean isPrefLocked(PortletRequest request, String prefName) { - PortletPreferences prefs = request.getPreferences(); - try { - return prefs.isReadOnly(prefName); - } catch (IllegalArgumentException e){ - log.debug("Preference does not exist: " + prefName); - return false; - } - } - - private void postEvent(String eventType, boolean modification) { - - try { - Placement placement = toolMan.getCurrentPlacement(); - String siteId = siteServ.getSite(placement.getContext()).getId(); - String eventRef = String.format(EVENT_REF_TEMPLATE, siteId, placement.getId()); - eventServ.post(eventServ.newEvent(eventType, eventRef, modification)); - } - catch (IdUnusedException e) { - log.debug("Failed to post " + eventType + " due to invalid siteId", e); - } - } - - public void destroy() { - log.info("Simple RSS Portlet destroy()"); - memoryService.destroyCache(FEED_CACHE_NAME); - memoryService.destroyCache(MEDIA_CACHE_NAME); - } - -} diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/model/Attachment.java b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/model/Attachment.java deleted file mode 100644 index 9070169e43f7..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/model/Attachment.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright 2011-2013 The Australian National University - * - * 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 au.edu.anu.portal.portlets.rss.model; - -import lombok.Data; - -/** - * Replacement for SyndEnclosure, used for attachments so we can specify a bunch of display properties - * of the item in addition to the rest of the properties of an Enclosure - * - * @author Steve Swinsburg (steve.swinsburg@anu.edu.au) - * - */ - -@Data -public class Attachment { - - private String url; - private String displayName; - private String type; - private String displayLength; - private boolean image; -} diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/Constants.java b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/Constants.java deleted file mode 100644 index 4718bed08ad2..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/Constants.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright 2011-2013 The Australian National University - * - * 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 au.edu.anu.portal.portlets.rss.utils; - -public class Constants { - - public static final String PORTLET_TITLE_DEFAULT="My RSS Feed"; - - public static final int MIN_ITEMS = 1; - public static final int MAX_ITEMS = 5; - - - -} diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/Messages.java b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/Messages.java deleted file mode 100644 index c68341c9771f..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/Messages.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright 2011-2013 The Australian National University - * - * 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 au.edu.anu.portal.portlets.rss.utils; - -import java.text.MessageFormat; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - - -/** - * Messages.java - * - * Handles the retrieval of localised messages and parameter substitution. - * - * @author Steve Swinsburg (steve.swinsburg@anu.edu.au) - * - */ -public class Messages { - private static final String BUNDLE_NAME = "au.edu.anu.portal.portlets.rss.utils.messages"; - - /** - * Get a simple message from the bundle - * - * @param key - * @return - */ - public static String getString(String key) { - return getMessage(key); - } - - /** - * Get a parameterised message from the bundle and perform the parameter substitution on it - * - * @param key - * @return - */ - public static String getString(String key, Object[] arguments) { - return MessageFormat.format(getMessage(key), arguments); - } - - // helper to get the message from the bundle - private static String getMessage(String key) { - try { - return ResourceBundle.getBundle(BUNDLE_NAME, Locale.getDefault()).getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } - -} diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages.properties deleted file mode 100644 index c801ca5fb656..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages.properties +++ /dev/null @@ -1,24 +0,0 @@ - -connection.error=Connection failed - -config.portlet.title=Enter the tool title: -config.portlet.url=Enter the RSS feed URL: -config.portlet.maxitems=Max items to display: - -config.button.submit=Save configuration -config.button.cancel=Cancel - -error.form.readonly.error=Attempt to set value onto readonly field. -error.form.save.error=Saving your preferences failed. - -error.no.remote.data=No data was returned from the remote server. Please ensure the URL added is correct. -error.no.config=Please configure this news tool before using. - -error.heading.general=An error has occurred -error.heading.config=Not yet configured - -edit.preconfigured=This tool is mostly pre-configured by the Portal Administrator and cannot be altered, however you can personalise the available settings below. - -view.attachment.default=Attachment - -error.no.content = No current news/notices. \ No newline at end of file diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_ar.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_ar.properties deleted file mode 100644 index 96ab9aaf3230..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_ar.properties +++ /dev/null @@ -1,24 +0,0 @@ - -connection.error=\u0641\u0634\u0644 \u0627\u0644\u0627\u062a\u0635\u0627\u0644 - -config.portlet.title=\u0623\u062f\u062e\u0644 \u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0623\u062f\u0627\u0629 -config.portlet.url=\u0623\u062f\u062e\u0644 \u0639\u0646\u0648\u0627\u0646 URL \u0644\u062e\u0644\u0627\u0635\u0629 RSS -config.portlet.maxitems=\u0623\u062f\u062e\u0644 \u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0623\u062f\u0627\u0629 - -config.button.submit=\u062d\u0641\u0638 \u0627\u0644\u062a\u0643\u0648\u064a\u0646\n\u00a0 -config.button.cancel=\u0625\u0644\u063a\u0627\u0621 - -error.form.readonly.error=\u062d\u0627\u0648\u0644 \u062a\u0639\u064a\u064a\u0646 \u0627\u0644\u0642\u064a\u0645\u0629 \u0641\u064a \u062d\u0642\u0644 \u0644\u0644\u0642\u0631\u0627\u0621\u0629 \u0641\u0642\u0637 -error.form.save.error=\u0641\u0634\u0644 \u062d\u0641\u0638 \u0627\u0644\u062a\u0641\u0636\u064a\u0644\u0627\u062a \u0627\u0644\u062e\u0627\u0635\u0629 \u0628\u0643.\n\u00a0 - -error.no.remote.data=\u0644\u0645 \u064a\u062a\u0645 \u0625\u0631\u062c\u0627\u0639 \u0623\u064a \u0628\u064a\u0627\u0646\u0627\u062a \u0645\u0646 \u0627\u0644\u062e\u0627\u062f\u0645 \u0627\u0644\u0628\u0639\u064a\u062f. \u064a\u0631\u062c\u0649 \u0627\u0644\u062a\u0623\u0643\u062f \u0645\u0646 \u0635\u062d\u0629 \u0639\u0646\u0648\u0627\u0646 URL \u0627\u0644\u0645\u0636\u0627\u0641 -error.no.config=\u064a\u0631\u062c\u0649 \u062a\u0643\u0648\u064a\u0646 \u0623\u062f\u0627\u0629 \u0627\u0644\u0623\u062e\u0628\u0627\u0631 \u0647\u0630\u0647 \u0642\u0628\u0644 \u0627\u0633\u062a\u062e\u062f\u0627\u0645\u0647\u0627 - -error.heading.general=\u062d\u062f\u062b \u062e\u0637\u0623 -error.heading.config=\u0644\u0645 \u064a\u062a\u0645 \u062a\u0643\u0648\u064a\u0646\u0647 \u0628\u0639\u062f\n\u00a0 - -edit.preconfigured=\u062a\u0645 \u062a\u0643\u0648\u064a\u0646 \u0647\u0630\u0647 \u0627\u0644\u0623\u062f\u0627\u0629 \u0641\u064a \u0627\u0644\u063a\u0627\u0644\u0628 \u0645\u0633\u0628\u0642\u064b\u0627 \u0628\u0648\u0627\u0633\u0637\u0629 \u0645\u0633\u0624\u0648\u0644 \u0645\u0648\u0642\u0639 \u0627\u0644\u0628\u0648\u0627\u0628\u0629 \u0648\u0644\u0627 \u064a\u0645\u0643\u0646 \u062a\u063a\u064a\u064a\u0631\u0647\u0627 \u060c \u0648\u0645\u0639 \u0630\u0644\u0643 \u064a\u0645\u0643\u0646\u0643 \u062a\u062e\u0635\u064a\u0635 \u0627\u0644\u0625\u0639\u062f\u0627\u062f\u0627\u062a \u0627\u0644\u0645\u062a\u0627\u062d\u0629 \u0623\u062f\u0646\u0627\u0647 - -view.attachment.default=\u0645\u0631\u0641\u0642\u0627\u062a - -error.no.content=\u0644\u0627 \u062a\u0648\u062c\u062f \u0623\u062e\u0628\u0627\u0631 / \u0625\u0634\u0639\u0627\u0631\u0627\u062a \u062d\u0627\u0644\u064a\u0629\n\u00a0 diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_bg.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_bg.properties deleted file mode 100644 index bc40315f91a7..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_bg.properties +++ /dev/null @@ -1,24 +0,0 @@ - -connection.error=\u0421\u0432\u044a\u0440\u0437\u0432\u0430\u043d\u0435\u0442\u043e \u0435 \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e - -config.portlet.title=\u0412\u044a\u0432\u0435\u0434\u0435\u0442\u0435 \u0437\u0430\u0433\u043b\u0430\u0432\u0438\u0435\u0442\u043e \u043d\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\: -config.portlet.url=\u0412\u044a\u0432\u0435\u0434\u0435\u0442\u0435 URL \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430 RSS \u043a\u0430\u043d\u0430\u043b\u0430\: -config.portlet.maxitems=\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u0435\u043d \u0431\u0440\u043e\u0439 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0437\u0430 \u043f\u043e\u043a\u0430\u0437\u0432\u0430\u043d\u0435\: - -config.button.submit=\u0417\u0430\u043f\u0430\u0437\u0432\u0430\u043d\u0435 \u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u0442\u0430 -config.button.cancel=\u041e\u0442\u043c\u044f\u043d\u0430 \u043d\u0430 - -error.form.readonly.error=\u041e\u043f\u0438\u0442 \u0437\u0430 \u0437\u0430\u0434\u0430\u0432\u0430\u043d\u0435 \u043d\u0430 \u0441\u0442\u043e\u0439\u043d\u043e\u0441\u0442 \u0432 \u043f\u043e\u043b\u0435 \u0441\u0430\u043c\u043e \u0437\u0430 \u0447\u0435\u0442\u0435\u043d\u0435. -error.form.save.error=\u0417\u0430\u043f\u0430\u0437\u0432\u0430\u043d\u0435\u0442\u043e \u043d\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u043d\u0438\u044f\u0442\u0430 \u0432\u0438 \u043d\u0435 \u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e. - -error.no.remote.data=\u041e\u0442 \u043e\u0442\u0434\u0430\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0441\u044a\u0440\u0432\u044a\u0440 \u043d\u0435 \u0441\u0430 \u0432\u044a\u0440\u043d\u0430\u0442\u0438 \u043d\u0438\u043a\u0430\u043a\u0432\u0438 \u0434\u0430\u043d\u043d\u0438. \u041c\u043e\u043b\u044f, \u0443\u0432\u0435\u0440\u0435\u0442\u0435 \u0441\u0435, \u0447\u0435 \u0434\u043e\u0431\u0430\u0432\u0435\u043d\u0438\u044f\u0442 URL \u0430\u0434\u0440\u0435\u0441 \u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0435\u043d. -error.no.config=\u041c\u043e\u043b\u044f, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0430\u0439\u0442\u0435 \u0442\u043e\u0437\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0437\u0430 \u043d\u043e\u0432\u0438\u043d\u0438, \u043f\u0440\u0435\u0434\u0438 \u0434\u0430 \u0433\u043e \u0438\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u0442\u0435. - -error.heading.general=\u0412\u044a\u0437\u043d\u0438\u043a\u043d\u0430\u043b\u0430 \u0435 \u0433\u0440\u0435\u0448\u043a\u0430 -error.heading.config=\u0412\u0441\u0435 \u043e\u0449\u0435 \u043d\u0435 \u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0430\u043d - -edit.preconfigured=\u0422\u043e\u0437\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0432 \u043f\u043e\u0432\u0435\u0447\u0435\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0438 \u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u043d\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0430\u043d \u043e\u0442 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u043f\u043e\u0440\u0442\u0430\u043b\u0430 \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0434\u0430 \u0431\u044a\u0434\u0435 \u043f\u0440\u043e\u043c\u0435\u043d\u044f\u043d, \u043d\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u0430 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0430\u0442\u0435 \u043d\u0430\u043b\u0438\u0447\u043d\u0438\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e-\u0434\u043e\u043b\u0443. - -view.attachment.default=\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 - -error.no.content=\u041d\u044f\u043c\u0430 \u0442\u0435\u043a\u0443\u0449\u0438 \u043d\u043e\u0432\u0438\u043d\u0438/\u0438\u0437\u0432\u0435\u0441\u0442\u0438\u044f. diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_ca.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_ca.properties deleted file mode 100644 index e656ba897faa..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_ca.properties +++ /dev/null @@ -1,24 +0,0 @@ - -connection.error=La connexi\u00f3 ha fallat - -config.portlet.title=Introdu\u00efu el nom de l\u2019eina\: -config.portlet.url=Introdu\u00efu l\u2019adre\u00e7a URL del contingut RSS\: -config.portlet.maxitems=Nombre m\u00e0xim d\u2019elements a mostrar\: - -config.button.submit=Desa la configuraci\u00f3 -config.button.cancel=Cancel\u00b7la - -error.form.readonly.error=Heu intentat introduir un valor en un camp que nom\u00e9s permet la lectura. -error.form.save.error=No s\u2019han pogut desar les vostres prefer\u00e8ncies. - -error.no.remote.data=El servidor remot no ha retornat dades. Assegureu-vos que l\u2019adre\u00e7a URL \u00e9s correcta. -error.no.config=Cal que configureu l\u2019eina de not\u00edcies abans de fer-la servir. - -error.heading.general=S\u2019ha produ\u00eft un error -error.heading.config=Encara no s\u2019ha configurat - -edit.preconfigured=L\u2019administrador del portal s\u2019ocupa de la major part de la configuraci\u00f3 d\u2019aquesta eina i no ho podeu alterar. Tot i aix\u00f2 podeu personalitzar els elements que apareixen a continuaci\u00f3. - -view.attachment.default=Fitxer adjunt - -error.no.content=Actualment no hi ha not\u00edcies ni avisos. diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_de_DE.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_de_DE.properties deleted file mode 100644 index ca696e148ead..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_de_DE.properties +++ /dev/null @@ -1,15 +0,0 @@ -connection.error=Verbindung fehlgeschlagen -config.portlet.title=Geben Sie den Portlet-Titel\: -config.portlet.url=Geben Sie den RSS-feed URL\: -config.portlet.maxitems=Max anzuzeigenden Elemente\: -config.button.submit=Konfiguration speichern -config.button.cancel=Abbrechen -error.form.readonly.error=Versuch Wert auf Readonly-Feld festgelegt. -error.form.save.error=Speichern Ihre Einstellungen fehlgeschlagen. -error.no.remote.data=Keine Daten wurde vom Server zur\u00fcckgegeben. Bitte stellen Sie sicher,dass die URL hinzugef\u00fcgt korrekt ist. -error.no.config=Bitte konfigurieren Sie dieses portlet -error.heading.general=Ein Fehler ist aufgetreten -error.heading.config=Noch nicht konfiguriert -edit.preconfigured=Dieses Portlet ist \u00fcberwiegend der Portal-Administrator vorkonfiguriert und kann nicht ge\u00e4ndert werden -view.attachment.default=Anlage -error.no.content=Keine aktuellen Nachrichten/Meldungen. diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_es.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_es.properties deleted file mode 100644 index d894d284ec50..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_es.properties +++ /dev/null @@ -1,24 +0,0 @@ - -connection.error=Fallo en la conexi\u00f3n - -config.portlet.title=Introduce el t\u00edtulo de la herramienta\: -config.portlet.url=Introduce la direcci\u00f3n URL del RSS\: -config.portlet.maxitems=M\u00e1ximo n\u00famero de elementos a mostrar\: - -config.button.submit=Guardar configuraci\u00f3n -config.button.cancel=Cancelar - -error.form.readonly.error=Intento de modificar un dato en un campo de solo lectura. -error.form.save.error=Error al guardar las preferencias. - -error.no.remote.data=No se ha recibido datos del servidor remoto. Por favor, revise la URL de conexi\u00f3n. -error.no.config=Por favor, configure esta herramienta de noticias antes de usarla. - -error.heading.general=Ha ocurrido un error -error.heading.config=A\u00fan sin configurar - -edit.preconfigured=Esta herramienta est\u00e1 pre-configurada por el Administrador y no puede ser modificada, sin embargo, puede realizar alguna configuraci\u00f3n en los elementos siguientes. - -view.attachment.default=Archivos adjuntos - -error.no.content=No hay noticias nuevas diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_eu.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_eu.properties deleted file mode 100644 index 12f30bcc9750..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_eu.properties +++ /dev/null @@ -1,24 +0,0 @@ - -connection.error=Konexioak huts egin du - -config.portlet.title=Tresnaren titulua sartu\: -config.portlet.url=Sartu RSS feed-aren URLa\: -config.portlet.maxitems=Erakusteko gehienezko itemak\: - -config.button.submit=Gorde konfigurazioa -config.button.cancel=Utzi - -error.form.readonly.error=Saiatu balorea ezartzen ausazko eremuan. -error.form.save.error=Huts egin du zure hobespenak gordetzeak - -error.no.remote.data=Datarik ez da jaso urrutiko zerbitzaritik. URLa zuzena dela berretsi mesedez. -error.no.config=Konfiguratu tresna berri hau erabili baino lehen. - -error.heading.general=Akats bat izan da. -error.heading.config=Ez dago oraindik konfiguratuta - -edit.preconfigured=Atariko administratzaileak aldez aurretik konfiguratu du tresna hau, hala ere, behean erabilgarri diren ezarpenak pertsonalizatu ditzakezu. - -view.attachment.default=Erantsia - -error.no.content=Ez dago berririk une honetan. diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_fa_IR.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_fa_IR.properties deleted file mode 100644 index 93bda8df18b7..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_fa_IR.properties +++ /dev/null @@ -1,25 +0,0 @@ -#X-Generator: crowdin.com - -connection.error=\u0627\u0631\u062a\u0628\u0627\u0637 \u0646\u0627\u0645\u0648\u0641\u0642 - -config.portlet.title=\u0639\u0646\u0648\u0627\u0646 \u0627\u0628\u0632\u0627\u0631 \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f\: -config.portlet.url=\u0622\u062f\u0631\u0633 \u0641\u06cc\u062f RSS \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f\: -config.portlet.maxitems=\u062d\u062f\u0627\u06a9\u062b\u0631 \u0622\u06cc\u062a\u0645 \u0647\u0627\u06cc \u0642\u0627\u0628\u0644 \u0646\u0645\u0627\u06cc\u0634\: - -config.button.submit=\u0630\u062e\u06cc\u0631\u0647 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a -config.button.cancel=\u0644\u063a\u0648 - -error.form.readonly.error=\u062a\u0644\u0627\u0634 \u0628\u0631\u0627\u06cc \u062a\u0639\u06cc\u06cc\u0646 \u0645\u0642\u062f\u0627\u0631 \u0628\u0631\u0627\u06cc \u0641\u06cc\u0644\u062f \u062a\u0646\u0647\u0627 \u0642\u0627\u0628\u0644 \u062e\u0648\u0627\u0646\u062f\u0646. -error.form.save.error=\u0630\u062e\u06cc\u0631\u0647 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0645\u0648\u0631\u062f \u0646\u0638\u0631 \u0634\u0645\u0627 \u0646\u0627\u0645\u0648\u0641\u0642 \u0628\u0648\u062f - -error.no.remote.data=\u0647\u06cc\u0686 \u062f\u0627\u062f\u0647 \u0627\u06cc \u0627\u0632 \u0633\u0631\u0648\u0631 remote \u062f\u0631\u06cc\u0627\u0641\u062a \u0646\u0634\u062f. \u0627\u0632 \u0635\u062d\u06cc\u062d \u0628\u0648\u062f\u0646 URL \u0627\u0636\u0627\u0641\u0647 \u0634\u062f\u0647 \u0627\u0637\u0645\u06cc\u0646\u0627\u0646 \u062d\u0627\u0635\u0644 \u06a9\u0646\u06cc\u062f. -error.no.config=\u0644\u0637\u0641\u0627 \u0642\u0628\u0644 \u0627\u0632 \u0627\u0633\u062a\u0641\u0627\u062f\u0647\u060c \u0627\u0628\u0632\u0627\u0631 \u0627\u062e\u0628\u0627\u0631 \u0631\u0627 \u062a\u0646\u0638\u06cc\u0645 \u0646\u0645\u0627\u06cc\u06cc\u062f. - -error.heading.general=\u062e\u0637\u0627\u06cc\u06cc \u0631\u062e \u062f\u0627\u062f\u0647 \u0627\u0633\u062a -error.heading.config=\u0647\u0646\u0648\u0632 \u062a\u0646\u0638\u06cc\u0645 \u0646\u0634\u062f\u0647 \u0627\u0633\u062a - -edit.preconfigured=\u0627\u063a\u0644\u0628 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0627\u06cc\u0646 \u0627\u0628\u0632\u0627\u0631 \u0627\u0632 \u0642\u0628\u0644 \u062a\u0648\u0633\u0637 \u0645\u062f\u06cc\u0631 \u067e\u0648\u0631\u062a\u0627\u0644 \u0627\u0646\u062c\u0627\u0645 \u0634\u062f\u0647 \u0648 \u0642\u0627\u0628\u0644 \u062a\u063a\u06cc\u06cc\u0631 \u0646\u0645\u06cc \u0628\u0627\u0634\u062f. \u0628\u0627 \u0627\u06cc\u0646\u062d\u0627\u0644 \u0634\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0645\u0648\u062c\u0648\u062f \u062f\u0631 \u067e\u0627\u06cc\u06cc\u0646\u060c \u0627\u06cc\u0646 \u0627\u0628\u0632\u0627\u0631 \u0631\u0627 \u0634\u062e\u0635\u06cc\u200c\u0633\u0627\u0632\u06cc \u0646\u0645\u0627\u06cc\u06cc\u062f. - -view.attachment.default=\u067e\u06cc\u0648\u0633\u062a - -error.no.content=\u0627\u0637\u0644\u0627\u0639\u06cc\u0647/\u062e\u0628\u0631 \u062c\u062f\u06cc\u062f\u06cc \u0648\u062c\u0648\u062f \u0646\u062f\u0627\u0631\u062f. diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_fr.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_fr.properties deleted file mode 100644 index 065b4304a8d4..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_fr.properties +++ /dev/null @@ -1,20 +0,0 @@ - -config.button.cancel = annuler -config.button.submit = Sauvegarder la configuration -config.portlet.maxitems = Nombre maximum de fils d'actualit\u00E9s \u00E0 afficher: -config.portlet.title = Entrez le titre du portlet: -config.portlet.url = Entrez l'url du flux RSS: - -connection.error = Erreur de connexion - -edit.preconfigured = Ce portlet est prinicpalement pr\u00E9-configur\u00E9 par l'administrateur du portail et ne peut pas \u00EAtre modifi\u00E9, cependant vous pouvez personnaliser les r\u00E9glages disponibles ci-dessous. - -error.form.readonly.error = Tentative de modification d'une valeur d'un champ en lecture seule. -error.form.save.error = La sauvegarde de vos pr\u00E9f\u00E9rences utilisateurs a \u00E9chou\u00E9. -error.heading.config = Pas encore configur\u00E9 -error.heading.general = Une erreur est survenue -error.no.config = Veuillez configurer ce portlet. -error.no.content = Rien \u00E0 afficher actuellement -error.no.remote.data = Aucune donn\u00E9e retourn\u00E9e du serveur distant. Veuillez contacter un administrateur. - -view.attachment.default = Liens diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_fr_FR.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_fr_FR.properties deleted file mode 100644 index 291ab30eb5c4..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_fr_FR.properties +++ /dev/null @@ -1,24 +0,0 @@ - -connection.error=Connection failed - -config.portlet.title=Enter the tool title\: -config.portlet.url=Enter the RSS feed URL\: -config.portlet.maxitems=Max items to display\: - -config.button.submit=Save configuration -config.button.cancel=Annuler - -error.form.readonly.error=Attempt to set value onto readonly field. -error.form.save.error=Saving your preferences failed. - -error.no.remote.data=Aucune donn\u00e9e n'a \u00e9t\u00e9 renvoy\u00e9e par le serveur distant. Veuillez vous assurer que l'URL ajout\u00e9e est correcte. -error.no.config=Please configure this news tool before using. - -error.heading.general=An error has occurred -error.heading.config=Not yet configured - -edit.preconfigured=Cet outil est g\u00e9n\u00e9ralement pr\u00e9configur\u00e9 par l'administrateur du portail et ne peut pas \u00eatre modifi\u00e9. Toutefois, vous pouvez personnaliser les param\u00e8tres disponibles ci-dessous. - -view.attachment.default=Attachment - -error.no.content=No current news/notices. diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_ja.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_ja.properties deleted file mode 100644 index dcb4095af939..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_ja.properties +++ /dev/null @@ -1,15 +0,0 @@ -connection.error=\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u306b\u5931\u6557\u3057\u307e\u3057\u305f -config.portlet.title=\u30c4\u30fc\u30eb\u30bf\u30a4\u30c8\u30eb\u3092\u5165\u529b\: -config.portlet.url=RSS\u30d5\u30a3\u30fc\u30c9URL\u3092\u5165\u529b\: -config.portlet.maxitems=\u8868\u793a\u3059\u308b\u6700\u5927\u30a2\u30a4\u30c6\u30e0\uff1a -config.button.submit=\u8a2d\u5b9a\u3092\u4fdd\u5b58 -config.button.cancel=\u30ad\u30e3\u30f3\u30bb\u30eb -error.form.readonly.error=\u30ea\u30fc\u30c9\u30aa\u30f3\u30ea\u30fc\u30d5\u30a9\u30fc\u30eb\u30c9\u306b\u5024\u3092\u8a2d\u5b9a\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u307e\u3059\uff0e -error.form.save.error=\u8a2d\u5b9a\u306e\u4fdd\u5b58\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u30fb -error.no.remote.data=\u30ea\u30e2\u30fc\u30c8\u30b5\u30fc\u30d0\u304b\u3089\u30c7\u30fc\u30bf\u304c\u8fd4\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\uff0e\u8ffd\u52a0\u3057\u305fURL\u304c\u6b63\u3057\u3044\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u4e0b\u3055\u3044\uff0e -error.no.config=\u4f7f\u7528\u3059\u308b\u524d\u306b\u3053\u306e\u30cb\u30e5\u30fc\u30b9\u30c4\u30fc\u30eb\u3092\u8a2d\u5b9a\u3057\u3066\u4e0b\u3055\u3044\uff0e -error.heading.general=\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f -error.heading.config=\u307e\u3060\u672a\u8a2d\u5b9a\u3067\u3059 -edit.preconfigured=\u3053\u306e\u30c4\u30fc\u30eb\u306f\u30dd\u30fc\u30bf\u30eb\u7ba1\u7406\u8005\u306b\u3088\u3063\u3066\u5927\u62b5\u306f\u4e8b\u524d\u306b\u8a2d\u5b9a\u3055\u308c\u5909\u66f4\u3067\u304d\u307e\u305b\u3093\u304c\uff0c\u4ee5\u4e0b\u306e\u5229\u7528\u53ef\u80fd\u306a\u8a2d\u5b9a\u3092\u30d1\u30fc\u30bd\u30ca\u30e9\u30a4\u30ba\u3067\u304d\u307e\u3059\uff0e -view.attachment.default=\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb -error.no.content=\u30cb\u30e5\u30fc\u30b9/\u8b66\u544a\u306f\u73fe\u5728\u3042\u308a\u307e\u305b\u3093\uff0e diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_pt.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_pt.properties deleted file mode 100644 index 991c3f7f5f23..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_pt.properties +++ /dev/null @@ -1,15 +0,0 @@ -connection.error = Falha na conex\u00E3o -config.portlet.title = Digite o t\u00EDtulo do portlet: -config.portlet.url = Digite o URL de feed RSS: -config.portlet.maxitems = Itens de Max para exibir: -config.button.submit = Salvar configura\u00E7\u00E3o -config.button.cancel = Cancelar -error.form.readonly.error = Tentativa de definir o valor no campo readonly. -error.form.save.error = Salvar suas prefer\u00EAncias falhou. -error.no.remote.data = Nenhum dado foi retornado do servidor remoto. Certifique-se de que a URL adicionada est\u00E1 correta. -error.no.config = Por favor configure este portlet -error.heading.general = Ocorreu um erro -error.heading.config = Ainda n\u00E3o configurado -edit.preconfigured = Este portlet \u00E9 principalmente pr\u00E9-configurado pelo administrador do Portal e n\u00E3o pode ser alterado -view.attachment.default = Acess\u00F3rio -error.no.content = Nenhuma not\u00EDcia atuais/avisos. diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_ro_RO.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_ro_RO.properties deleted file mode 100644 index 1a10b5592fd2..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_ro_RO.properties +++ /dev/null @@ -1,24 +0,0 @@ - -connection.error=Eroare conectare - -config.portlet.title=Introd. titlul instrumentului\: -config.portlet.url=Introduceti URL-ul feed-ului RSS. -config.portlet.maxitems=Nr max de elemente de afisat\: - -config.button.submit=Salvati configurare -config.button.cancel=Anuleaza - -error.form.readonly.error=Incercati sa setati valoarea in camp numai de citire. -error.form.save.error=Salvarea preferintelor nu a reusit. - -error.no.remote.data=Nu au fost returnate date de la serverul distant. Asigurati-va ca adresa URL adaugata este corecta. -error.no.config=Va rugam sa configurati acest instrument de stiri inainte de utilizare. - -error.heading.general=A aparut o eroare -error.heading.config=Nu a fost inca configurat. - -edit.preconfigured=Acest instrument este preconfigurat in mare parte de administratorul portalului si nu poate fi modificat, totusi puteti personaliza setarile disponibile mai jos. - -view.attachment.default=Ata\u0219ament - -error.no.content=Nu exista stiri/note curente. diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_sr.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_sr.properties deleted file mode 100644 index d8dbc5e0e4aa..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_sr.properties +++ /dev/null @@ -1,24 +0,0 @@ - -connection.error=Veza nije uspostavljena - -config.portlet.title=Unesi naziv alatke\: -config.portlet.url=Unesi URL RSS upliva podataka\: -config.portlet.maxitems=Maksimalan broj stavki za prikaz\: - -config.button.submit=Sa\u010duvaj konfiguraciju -config.button.cancel=Otka\u017ei - -error.form.readonly.error=Poku\u0161aj da postavi\u0161 vrednost u polje samo za \u010ditanje. -error.form.save.error=\u010cuvanje tvojih preferencija nije uspelo. - -error.no.remote.data=Nisu vra\u0107eni podaci sa udaljenog servera. Uveri se da je dodat ta\u010dan URL. -error.no.config=Konfiguri\u0161i ovu alatku za vesti pre upotrebe. - -error.heading.general=Do\u0161lo je do gre\u0161ke -error.heading.config=Jo\u0161 nije konfigurisano - -edit.preconfigured=Ovaj alat je uglavnom unapred konfigurisan od strane administratora portala i ne mo\u017ee se menjati, ali mo\u017ee\u0161 personalizovati dostupna pode\u0161avanja ispod. - -view.attachment.default=Prilog - -error.no.content=Nema aktuelnih vesti/obave\u0161tenja. diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_sv.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_sv.properties deleted file mode 100644 index 3934e814d3b9..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_sv.properties +++ /dev/null @@ -1,15 +0,0 @@ -connection.error = Anslutning misslyckades -config.portlet.title = Ange portletens titel: -config.portlet.url = Ange RSS feed URL: -config.portlet.maxitems = Max objekt som ska visas: -config.button.submit = Spara konfigurationen -config.button.cancel = Avbryt -error.form.readonly.error = F\u00F6rs\u00F6k att s\u00E4tta v\u00E4rde p\u00E5 skrivskyddade f\u00E4ltet. -error.form.save.error = Det gick inte att spara dina inst\u00E4llningar. -error.no.remote.data = Inga data returnerades fr\u00E5n fj\u00E4rrservern. Kontrollera att URL: en till \u00E4r korrekta. -error.no.config = Konfigurera portleten -error.heading.general = Ett fel har uppst\u00E5tt -error.heading.config = \u00C4nnu inte konfigurerat -edit.preconfigured = Portleten \u00E4r mestadels f\u00F6rkonfigurerad av Portal-administrat\u00F6r som inte kan \u00E4ndras -view.attachment.default = Bifogad fil -error.no.content = Inga aktuella nyheter/meddelanden. diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_tr_TR.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_tr_TR.properties deleted file mode 100644 index 333285ed71e9..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_tr_TR.properties +++ /dev/null @@ -1,15 +0,0 @@ -connection.error=Ba\u011flant\u0131 ba\u015far\u0131s\u0131z -config.portlet.title=Ara\u00e7 ba\u015fl\u0131\u011f\u0131n\u0131 gir. -config.portlet.url=RSS besleme URL'sini gir. -config.portlet.maxitems=G\u00f6r\u00fcnt\u00fclenecek maksimum \u00f6ge\: -config.button.submit=Ayarlar\u0131 Kaydet -config.button.cancel=\u0130ptal -error.form.readonly.error=Salt okunur alana de\u011fer atamaya \u00e7al\u0131\u015f\u0131n. -error.form.save.error=Ayarlar\u0131n\u0131z kaydedilemedi. -error.no.remote.data=Uzak sunucudan herhangi bir veri al\u0131nmad\u0131. L\u00fctfen eklenen URL'nin do\u011fru oldu\u011fundan emin olun. -error.no.config=L\u00fctfen bu haber arac\u0131n\u0131 kullanmadan \u00f6nce yap\u0131land\u0131r\u0131n. -error.heading.general=Bir sorun olu\u015ftu. -error.heading.config=Hen\u00fcz yap\u0131land\u0131r\u0131lmad\u0131. -edit.preconfigured=Bu ara\u00e7 \u00e7o\u011funlukla Portal Y\u00f6neticisi taraf\u0131ndan \u00f6nceden yap\u0131land\u0131r\u0131lm\u0131\u015ft\u0131r ve de\u011fi\u015ftirilemez fakat a\u015fa\u011f\u0131daki ayarlar\u0131 ki\u015fiselle\u015ftirebilirsiniz. -view.attachment.default=Ek -error.no.content=Mevcut haber/duyuru bulunmamaktad\u0131r. diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_zh_CN.properties b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_zh_CN.properties deleted file mode 100644 index 3f6a17e270d5..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/utils/messages_zh_CN.properties +++ /dev/null @@ -1,24 +0,0 @@ - -connection.error=\u8FDE\u63A5\u5931\u8D25 - -config.portlet.title=\u8F93\u5165\u5DE5\u5177\u540D\u79F0\uFF1A -config.portlet.url=\u8F93\u5165RSS\u8BA2\u9605\u5730\u5740\uFF1A -config.portlet.maxitems=\u663E\u793A\u6570\u91CF\u6700\u5927\u503C\uFF1A - -config.button.submit=\u4FDD\u5B58\u8BBE\u7F6E -config.button.cancel=\u53D6\u6D88 - -error.form.readonly.error=\u5C1D\u8BD5\u4FEE\u6539\u53EA\u8BFB\u5B57\u6BB5\u3002 -error.form.save.error=\u4FDD\u5B58\u8BBE\u7F6E\u5931\u8D25\u3002 - -error.no.remote.data=\u8FDC\u7A0B\u670D\u52A1\u5668\u6CA1\u6709\u8FD4\u56DE\u4EFB\u4F55\u6570\u636E\u3002\u8BF7\u786E\u8BA4\u5730\u5740\u662F\u5426\u6B63\u786E\u3002 -error.no.config=\u8BF7\u5728\u4F7F\u7528\u524D\u5148\u914D\u7F6E\u6B64\u65B0\u95FB\u5DE5\u5177\u3002 - -error.heading.general=\u53D1\u751F\u4E86\u9519\u8BEF -error.heading.config=\u672A\u914D\u7F6E - -edit.preconfigured=\u6B64\u5DE5\u5177\u4E00\u822C\u4E8B\u5148\u6709\u95E8\u6237\u7BA1\u7406\u5458\u8FDB\u884C\u914D\u7F6E\u5E76\u4E14\u4E0D\u80FD\u88AB\u4FEE\u6539\uFF0C\u4F46\u60A8\u53EF\u4EE5\u4FEE\u6539\u4EE5\u4E0B\u914D\u7F6E\u3002 - -view.attachment.default=\u9644\u4EF6 - -error.no.content = \u76EE\u524D\u6CA1\u6709\u65B0\u95FB/\u901A\u77E5\u3002 \ No newline at end of file diff --git a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/validator/SimpleRSSPreferencesValidator.java b/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/validator/SimpleRSSPreferencesValidator.java deleted file mode 100644 index d72b445d7730..000000000000 --- a/simple-rss-portlet/src/main/java/au/edu/anu/portal/portlets/rss/validator/SimpleRSSPreferencesValidator.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * Copyright 2011-2013 The Australian National University - * - * 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 au.edu.anu.portal.portlets.rss.validator; - -import java.util.Arrays; -import java.util.Collections; - -import javax.portlet.PortletPreferences; -import javax.portlet.PreferencesValidator; -import javax.portlet.ValidatorException; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.validator.routines.UrlValidator; -import org.apache.commons.validator.routines.IntegerValidator; - -import au.edu.anu.portal.portlets.rss.utils.Constants; - -/** - * A validator for the preferences of the Simple RSS Portlet - * - * @author Steve Swinsburg (steve.swinsburg@anu.edu.au) - * @throws ValidatorException if there are any errors - */ -public class SimpleRSSPreferencesValidator implements PreferencesValidator { - private final String PREF_FEED_URL = "feed_url"; - - @Override - public void validate(PortletPreferences prefs) throws ValidatorException { - - //get prefs as strings - String max_items = prefs.getValue("max_items", Integer.toString(Constants.MAX_ITEMS)); - String feed_url = prefs.getValue(PREF_FEED_URL, null); - - //check readonly - boolean feedUrlIsLocked = prefs.isReadOnly(PREF_FEED_URL); - - /** - * max_items - */ - IntegerValidator integerValidator = IntegerValidator.getInstance(); - Integer maxItems = integerValidator.validate(max_items); - - - //check it's a number - if(maxItems == null) { - throw new ValidatorException("Invalid value, must be a number", Collections.singleton("max_items")); - } - - //check greater than or equal to a minimum of 1 - if(!integerValidator.minValue(maxItems, Constants.MIN_ITEMS)) { - throw new ValidatorException("Invalid number, must be greater than 0", Collections.singleton("max_items")); - } - - /** - * feed_url - */ - //only validate if it's not readonly - if(!feedUrlIsLocked) { - String[] schemes = {"http","https"}; - DetailedUrlValidator urlValidator = new DetailedUrlValidator(schemes); - - //check not null - if(StringUtils.isBlank(feed_url)){ - throw new ValidatorException("You must specify a URL for the RSS feed", Collections.singleton(PREF_FEED_URL)); - } - - //check valid scheme - if(!urlValidator.isValidScheme(feed_url)){ - throw new ValidatorException("Invalid feed scheme. Must be one of: " + Arrays.toString(schemes), Collections.singleton(PREF_FEED_URL)); - } - - //check valid URL - if(!urlValidator.isValid(feed_url)){ - throw new ValidatorException("Invalid feed URL", Collections.singleton(PREF_FEED_URL)); - - } - } - - /** - * portlet_title not validated here as it is reasonable to allow blank entry. We deal with this later - */ - - } - - -} - -/** - * This is a replacement for commons-validator UrlValidator. - * - * The original has all protected methods so we can't get individual components tested. - * This simply overrides them and allows us to do so. - * Note that the impl of isValidScheme is custom. - * - * - * @author Steve Swinsburg (steve.swinsburg@anu.edu.au) - * - */ -class DetailedUrlValidator extends UrlValidator { - - private static final long serialVersionUID = 1L; - - private String[] schemes; - - public DetailedUrlValidator(String[] schemes) { - super(schemes); - this.schemes = schemes; - } - - @Override - protected boolean isValidScheme(String url) { - - //check if url starts with one of the schemes - if(StringUtils.startsWithAny(url, schemes)) { - return true; - } - return false; - - } - - - -} diff --git a/simple-rss-portlet/src/main/resources/ehcache.xml b/simple-rss-portlet/src/main/resources/ehcache.xml deleted file mode 100644 index e43f6a618ec2..000000000000 --- a/simple-rss-portlet/src/main/resources/ehcache.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/simple-rss-portlet/src/main/webapp/WEB-INF/portlet.xml b/simple-rss-portlet/src/main/webapp/WEB-INF/portlet.xml deleted file mode 100644 index 0dfe0823e25a..000000000000 --- a/simple-rss-portlet/src/main/webapp/WEB-INF/portlet.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - Simple RSS Portlet - simple-rss-portlet - simple-rss-portlet - au.edu.anu.portal.portlets.rss.SimpleRSSPortlet - - 0 - - text/html - VIEW - EDIT - CONFIG - - en - - Simple RSS Portlet - Simple RSS Portlet - rss, atom, feed - - - - viewUrl - /pages/view.jsp - - - editUrl - /pages/edit.jsp - - - errorUrl - /pages/error.jsp - - - noContentUrl - /pages/nocontent.jsp - - - - - au.edu.anu.portal.portlets.rss.validator.SimpleRSSPreferencesValidator - - - - - - \ No newline at end of file diff --git a/simple-rss-portlet/src/main/webapp/WEB-INF/sakai/simple-rss-portlet.xml b/simple-rss-portlet/src/main/webapp/WEB-INF/sakai/simple-rss-portlet.xml deleted file mode 100644 index c1399bb15e80..000000000000 --- a/simple-rss-portlet/src/main/webapp/WEB-INF/sakai/simple-rss-portlet.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/simple-rss-portlet/src/main/webapp/WEB-INF/web.xml b/simple-rss-portlet/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index e548e70c8a07..000000000000 --- a/simple-rss-portlet/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - simple-rss-portlet - - \ No newline at end of file diff --git a/simple-rss-portlet/src/main/webapp/pages/edit.jsp b/simple-rss-portlet/src/main/webapp/pages/edit.jsp deleted file mode 100644 index dbb98da031f9..000000000000 --- a/simple-rss-portlet/src/main/webapp/pages/edit.jsp +++ /dev/null @@ -1,69 +0,0 @@ -<%-- - - Copyright 2011-2013 The Australian National University - - 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. - ---%> -<%@ page contentType="text/html" isELIgnored="false" %> - -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> - -<%@ page import="java.util.List" %> -<%@ page import="java.util.ArrayList" %> -<%@ page import="java.util.LinkedHashMap" %> - -<%@ page import="au.edu.anu.portal.portlets.rss.utils.Constants" %> - - - - - - - - -

- - -

${errorMessage}

-
- - -
- - -

-
- - -

- -
- -

- - - -

- -
- -

- - -

-
- -
diff --git a/simple-rss-portlet/src/main/webapp/pages/error.jsp b/simple-rss-portlet/src/main/webapp/pages/error.jsp deleted file mode 100644 index 9eeb415582c3..000000000000 --- a/simple-rss-portlet/src/main/webapp/pages/error.jsp +++ /dev/null @@ -1,43 +0,0 @@ -<%-- - - Copyright 2011-2013 The Australian National University - - 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. - ---%> -<%@ page contentType="text/html" isELIgnored="false" %> - -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %> - - - -
- -
-

-

- - - ${errorMessage} - - - ${errorMessage} - - -

-
- -
- - diff --git a/simple-rss-portlet/src/main/webapp/pages/nocontent.jsp b/simple-rss-portlet/src/main/webapp/pages/nocontent.jsp deleted file mode 100644 index 0e683f6188ee..000000000000 --- a/simple-rss-portlet/src/main/webapp/pages/nocontent.jsp +++ /dev/null @@ -1,35 +0,0 @@ -<%-- - - Copyright 2011-2013 The Australian National University - - 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. - ---%> -<%@ page contentType="text/html" isELIgnored="false" %> - -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> - - - - - - - - -
-

-
- - diff --git a/simple-rss-portlet/src/main/webapp/pages/view.jsp b/simple-rss-portlet/src/main/webapp/pages/view.jsp deleted file mode 100644 index 4e5b0ba08ea6..000000000000 --- a/simple-rss-portlet/src/main/webapp/pages/view.jsp +++ /dev/null @@ -1,71 +0,0 @@ -<%-- - - Copyright 2011-2013 The Australian National University - - 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. - ---%> -<%@ page contentType="text/html" isELIgnored="false" %> - -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %> - - - -
- -
- - - ${SyndFeed.image.description} - - -

${SyndFeed.description}

-
- -
- -
-
- diff --git a/site-manage/site-manage-tool/tool/pom.xml b/site-manage/site-manage-tool/tool/pom.xml index a92a6739dda9..2dd06bbe3d0b 100644 --- a/site-manage/site-manage-tool/tool/pom.xml +++ b/site-manage/site-manage-tool/tool/pom.xml @@ -96,10 +96,6 @@ commons-logging commons-logging - - xalan - xalan - diff --git a/site/admin-perms-tool/pom.xml b/site/admin-perms-tool/pom.xml index 306f3fb35878..149cf2c0647e 100644 --- a/site/admin-perms-tool/pom.xml +++ b/site/admin-perms-tool/pom.xml @@ -88,12 +88,6 @@ standard 1.1.2 runtime - - - xalan - xalan - - diff --git a/sitestats/pom.xml b/sitestats/pom.xml index b610995f38eb..8f37f492f561 100644 --- a/sitestats/pom.xml +++ b/sitestats/pom.xml @@ -84,10 +84,6 @@ commons-logging commons-logging - - xalan - xalan - diff --git a/syllabus/syllabus-app/pom.xml b/syllabus/syllabus-app/pom.xml index 808816eea95e..5963a4ceb8a3 100644 --- a/syllabus/syllabus-app/pom.xml +++ b/syllabus/syllabus-app/pom.xml @@ -17,12 +17,6 @@ taglibs standard 1.1.2 - - - xalan - xalan - - org.sakaiproject.kernel @@ -74,10 +68,6 @@ commons-logging commons-logging - - xml-apis - xmlParserAPIs - diff --git a/tags/tags-impl/impl/pom.xml b/tags/tags-impl/impl/pom.xml index a7a2fa651820..17fd13ffd104 100644 --- a/tags/tags-impl/impl/pom.xml +++ b/tags/tags-impl/impl/pom.xml @@ -36,12 +36,6 @@ json-simple ${json.simple.version} - - - com.github.jknack - handlebars - ${handlebars2.version} - org.apache.commons commons-lang3 diff --git a/tags/tags-tool/tool/pom.xml b/tags/tags-tool/tool/pom.xml index b8d9bc119064..bb544bf601fe 100644 --- a/tags/tags-tool/tool/pom.xml +++ b/tags/tags-tool/tool/pom.xml @@ -21,7 +21,7 @@ com.github.jknack handlebars - ${handlebars2.version} + ${handlebars4.version} org.apache.commons diff --git a/tags/tags-tool/tool/src/java/org/sakaiproject/tags/tool/views/index.hbs b/tags/tags-tool/tool/src/java/org/sakaiproject/tags/tool/views/index.hbs index 17d10100259e..6b5af8f72b5f 100644 --- a/tags/tags-tool/tool/src/java/org/sakaiproject/tags/tool/views/index.hbs +++ b/tags/tags-tool/tool/src/java/org/sakaiproject/tags/tool/views/index.hbs @@ -7,7 +7,7 @@

{{{t this "tagcollections"}}}

-
+
{{#if canCreate}} {{{t this "Create Tag Collection"}}} {{/if}} diff --git a/tags/tags-tool/tool/src/java/org/sakaiproject/tags/tool/views/tagsintagcollection.hbs b/tags/tags-tool/tool/src/java/org/sakaiproject/tags/tool/views/tagsintagcollection.hbs index ebd4f9c2304f..91d4481c7c66 100644 --- a/tags/tags-tool/tool/src/java/org/sakaiproject/tags/tool/views/tagsintagcollection.hbs +++ b/tags/tags-tool/tool/src/java/org/sakaiproject/tags/tool/views/tagsintagcollection.hbs @@ -7,7 +7,7 @@

{{{t this "tagsintagcollection"}}} : {{actualtagcollectionname}}

-
+ diff --git a/user/user-tool-prefs/tool/pom.xml b/user/user-tool-prefs/tool/pom.xml index d5825a23f5b4..e0373d15c98f 100644 --- a/user/user-tool-prefs/tool/pom.xml +++ b/user/user-tool-prefs/tool/pom.xml @@ -38,10 +38,6 @@ commons-logging commons-logging - - xml-apis - xmlParserAPIs - diff --git a/userauditservice/tool/pom.xml b/userauditservice/tool/pom.xml index 4c55353e5b9a..19cbfd6b5e91 100644 --- a/userauditservice/tool/pom.xml +++ b/userauditservice/tool/pom.xml @@ -77,10 +77,6 @@ commons-logging commons-logging - - xml-apis - xmlParserAPIs - diff --git a/usermembership/tool/pom.xml b/usermembership/tool/pom.xml index 73134ed67e53..e5bac9a1ff61 100644 --- a/usermembership/tool/pom.xml +++ b/usermembership/tool/pom.xml @@ -101,10 +101,6 @@ commons-logging commons-logging - - xml-apis - xmlParserAPIs -