...
').append($inputContainer.find('textarea').clone()).html());
-
- $("#documentPreviewContainer .commentItem").removeClass("focus");
- $("#documentPreviewContainer .commentItem[data-comment=" + commentId + "]").addClass("focus");
-
- var ele = $("#documentPreviewContainer .commentInputBox");
- var elementToScroll = "#documentPreviewContainer .comments .commentList";
- if (this.checkDevice().isMobile === true) {
- ele = $("#documentPreviewContainer [data-comment=" + commentId + "]");
- elementToScroll = "#documentPreviewContainer .commentArea";
- }
- if(ele.length > 0 && ele.offset() && ele.parent().offset()) {
- var nTop = ele.offset().top - ele.parent().offset().top + ele.parent().scrollTop();
- $(elementToScroll).animate({
- scrollTop: nTop
- },1000);
- }
-
- self.initCKEditor();
- self.clearErrorMessage();
- self.showCommentLink(true, true, false);
- });
-
- if(scrollToCommentId && this.checkDevice().isMobile === true) {
- var ele = $("#documentPreviewContainer [data-comment=" + scrollToCommentId + "]");
-
- if(ele.length > 0 && ele.offset() && ele.parent().offset()) {
- var nTop = ele.offset().top - ele.parent().offset().top + ele.parent().scrollTop();
- $("#documentPreviewContainer .commentArea").animate({
- scrollTop: nTop
- },1000);
- }
- }
- self.showCommentLink(this.checkDevice().isMobile, false, true);
- },
-
- showCommentBlockForActivity: function(comments, parentCommentId) {
- $("#documentPreviewContainer .commentItem").removeClass("focus");
- this.moveCKEditorInOriginalLocation();
- this.initCKEditor();
- this.clearErrorMessage();
- this.showCommentLink(false, true, true);
- resizeEventHandler();
- },
-
- getSubCommentsSize: function(comments, parentCommentId) {
- var count = 0;
- comments.forEach(function(comment) {
- if(comment.parentCommentId == parentCommentId) {
- count++;
- }
- })
- return count;
- },
-
- convertDate: function(dateStr) {
- var postedTime = Date.parse(dateStr);
-
- var time = (new Date().getTime() - postedTime) / 1000;
- var value;
- if (time < 60) {
- return eXo.ecm.WCMUtils.getBundle("TimeConvert.label.Less_Than_A_Minute",eXo.env.portal.language);
- } else {
- if (time < 120) {
- return eXo.ecm.WCMUtils.getBundle("TimeConvert.label.About_A_Minute",eXo.env.portal.language);
- } else {
- if (time < 3600) {
- value = Math.round(time / 60);
- return eXo.ecm.WCMUtils.getBundle("TimeConvert.type.MINUTES",eXo.env.portal.language).replace("{0}", value);
- } else {
- if (time < 7200) {
- return eXo.ecm.WCMUtils.getBundle("TimeConvert.label.About_An_Hour",eXo.env.portal.language);
- } else {
- if (time < 86400) {
- value = Math.round(time / 3600);
- return eXo.ecm.WCMUtils.getBundle("TimeConvert.type.HOURS",eXo.env.portal.language).replace("{0}", value);
- } else {
- if (time < 172800) {
- return eXo.ecm.WCMUtils.getBundle("TimeConvert.label.About_A_Day",eXo.env.portal.language);
- } else {
- if (time < 2592000) {
- value = Math.round(time / 86400);
- return eXo.ecm.WCMUtils.getBundle("TimeConvert.type.DAYS",eXo.env.portal.language).replace("{0}", value);
- } else {
- if (time < 5184000) {
- return eXo.ecm.WCMUtils.getBundle("TimeConvert.label.About_A_Month",eXo.env.portal.language);
- } else {
- value = Math.round(time / 2592000);
- return eXo.ecm.WCMUtils.getBundle("TimeConvert.type.MONTHS",eXo.env.portal.language).replace("{0}", value);
- }
- }
- }
- }
- }
- }
- }
- }
- },
-
- postComment: function () {
- var self = this;
- var commentInput = $('#documentPreviewContainer #commentInput');
- if(commentInput != null && $.trim(commentInput.val())) {
- var commentContent = commentInput.val();
- var commentActivityParentId = commentInput.attr("data-parent-comment");
- if(this.settings.activity.id != null) {
- var postData = { poster : eXo.env.portal.userName , title : commentContent, parentCommentId : commentActivityParentId };
- // post comment on the activity
- return $.ajax({
- type: 'POST',
- url: '/portal/rest/v1/social/activities/' + this.settings.activity.id + '/comments',
- data: JSON.stringify(postData),
- contentType: 'application/json'
- }).done(function (data) {
- self.loadComments(commentActivityParentId, data.id);
- self.moveCKEditorInOriginalLocation();
- self.initCKEditor();
- self.clearErrorMessage();
- }).fail(function () {
- self.showErrorMessage("${UIActivity.comment.canNotAddComment}");
- console.log("Can not post comment!");
- });
- }
- }
- },
-
- deleteComment: function(commentId) {
- var self = this;
-
- if(this.settings.activity.id != null) {
- return $.ajax({
- type: 'DELETE',
- url: '/portal/rest/v1/social/comments/' + commentId
- }).done(function (data) {
- self.loadComments();
- self.clearErrorMessage();
- }).fail(function () {
- self.showErrorMessage("${UIActivity.comment.canNotDeleteComment}");
- console.log("Can not delete comment!");
- });
- }
- },
-
- render: function () {
- var self = this;
-
- this.createSkeleton();
-
- var docContentContainer = $('#documentPreviewContent');
-
- if(!$('.commentsLoaded').length) {
- $(window).on('resize', resizeEventHandler);
- $(document).on('keyup', closeEventHandler);
- if(!window.previewDocumentEventsSet) {
- $(document).keyup(function(event) {
- if(event && event.keyCode && (event.keyCode == 37 || event.keyCode == 39) && $("#NavCommands").length && $("#NavCommands").is(":visible")) {
- event.stopPropagation();
- event.preventDefault();
- if(event.keyCode == 37) {
- self.goToPrevious();
- } else if(event.keyCode == 39) {
- self.goToNext();
- }
- }
- })
- $(document).on("swipe", function(event) {
- if(window.innerWidth < 767 && $("#NavCommands").length && $("#NavCommands").is(":visible")) {
- if(event.direction === 'left') {
- self.goToNext();
- } else if(event.direction === 'right') {
- self.goToPrevious();
- }
- }
- })
- }
- window.previewDocumentEventsSet = true;
-
- // Bind close event. Return body scroll, turn off keyup
- $(".exitWindow > .uiIconClose", $('#uiDocumentPreview')).click(function() {
- $('.spaceButtomNavigation').removeClass('hidden');
- $('body').removeClass('modal-open');
- $("#documentPreviewContainer").remove();
- setTimeout(function() {
- $('body').css('overflow', 'visible');
- $(document).off('keyup', closeEventHandler);
- $(window).off('resize', resizeEventHandler);
- }, 500);
- });
-
- $(".closeIcon > .uiIconClose", $('#uiDocumentPreview')).click(function() {
- $('body').removeClass('modal-open');
- $("#documentPreviewContainer").remove();
- setTimeout(function() {
- $('body').css('overflow', 'visible');
- $(document).off('keyup', closeEventHandler);
- $(window).off('resize', resizeEventHandler);
- }, 500);
- });
-
- if(this.settings.showComments) {
- if(this.settings.activity.id != null) {
- // render like link and nb of likes
- this.refreshLikeLink();
- $('#documentPreviewContainer .nbOfLikes').html(this.settings.activity.likes);
- } else {
- // hide like link since there is no linked activity
- $('#documentPreviewContainer #previewLikeLink').hide();
- }
-
- this.initCKEditor();
-
- if($('#CommentButton [data-action-initialized]').length == 0) {
- $('#CommentButton').on('click', function(event) {
- self.postComment();
- self.showCommentLink(this.checkDevice().isMobile, false, true);
- });
- $('#CommentButton').attr("data-action-initialized", "true");
- }
-
- if($('#CancelButton [data-action-initialized]').length == 0) {
- $('#CancelButton').on('click', function(event) {
- $('#documentPreviewContainer .commentArea')[0].style.display = "none";
- $('#documentPreviewContent')[0].style.display = "block";
- $('.previewBtn')[0].style.display = "block"
- resizeEventHandler();
- });
- $('#CancelButton').attr("data-action-initialized", "true");
- }
-
- if ($('.showComments [data-action-initialized]').length == 0) {
- $('.showComments').on('click', function (event) {
- var $uiDocumentPreview = $('#uiDocumentPreview');
- var $commentArea = $('.commentArea', $uiDocumentPreview);
- var $commentList = $('.commentList', $commentArea);
- if ($('#cke_commentInput .cke_contents').length > 0) {
- $('#cke_commentInput .cke_contents')[0].style.height = "100px";
- }
- if ($('#documentPreviewContent')[0].style.display === "none") {
- $('#documentPreviewContainer .commentArea')[0].style.display = "none";
- $('#documentPreviewContent')[0].style.display = "block";
- $("#documentPreviewContainer .parentCommentBlock").removeClass("hidden");
- $("#documentPreviewContainer .uiIconComment").removeClass("hiddenComment");
- } else {
- $('#documentPreviewContainer .commentArea')[0].style.display = "block";
- $('#documentPreviewContent')[0].style.display = "none";
- $("#documentPreviewContainer .parentCommentBlock").addClass("hidden");
- $("#documentPreviewContainer .uiIconComment").addClass("hiddenComment");
-
- self.moveCKEditorInOriginalLocation();
- self.initCKEditor();
- self.clearErrorMessage();
- self.showCommentLink(this.checkDevice().isMobile, false, false);
- }
- });
- $('.showComments').attr("data-action-initialized", "true");
- }
- }
-
- $('.loading', docContentContainer).show();
- this.show();
- }
-
- docContentContainer.load(eXo.env.portal.context + '/' + eXo.env.portal.rest + '/contentviewer/' + this.settings.doc.repository + '/' + this.settings.doc.workspace + '/' + this.settings.doc.id, function() {
- $('.loading', docContentContainer).hide();
- resizeEventHandler();
- });
- },
- showCommentLink: function(showComment, showCKEditor, isCKEditorInBottom) {
- if(showComment) {
- $('#documentPreviewContainer .parentCommentBlock').removeClass("hidden");
- } else {
- $('#documentPreviewContainer .parentCommentBlock').addClass("hidden");
- }
-
- if (this.checkDevice().isMobile === true) {
- var commentLinkRelative = showComment && showCKEditor;
- if(commentLinkRelative) {
- $('#documentPreviewContainer .parentCommentBlock').removeClass("FixedBlock");
- } else {
- $('#documentPreviewContainer .parentCommentBlock').addClass("FixedBlock");
- }
- if(showCKEditor) {
- $("#documentPreviewContainer .commentArea").addClass("commentBoxOpen");
- $('#documentPreviewContainer .commentInputBox').removeClass("hidden");
- } else {
- $("#documentPreviewContainer .commentArea").removeClass("commentBoxOpen");
- $('#documentPreviewContainer .commentInputBox').addClass("hidden");
- }
- }
-
- if(isCKEditorInBottom) {
- $("#documentPreviewContainer .commentList").addClass("commentBoxOpen");
- } else {
- $("#documentPreviewContainer .commentList").removeClass("commentBoxOpen");
- }
- },
- moveCKEditorInOriginalLocation: function() {
- $('#documentPreviewContainer #commentInput').attr("data-parent-comment", null)
- try {
- $('#documentPreviewContainer #commentInput').ckeditorGet().destroy(true);
- } catch(e) {
- }
-
- var $inputContainer = $("#documentPreviewContainer .commentInputBox");
- $inputContainer.insertAfter($("#documentPreviewContainer .comments"));
- $inputContainer.removeClass("subCommentBlock");
- $inputContainer.find("#documentPreviewContainer .commentBox .commentTextInput").html($('
').append($inputContainer.find('textarea').clone()).html());
- },
- initCKEditor: async function() {
- await new Promise(resolve => window.require(["SHARED/commons-editor"], resolve));
- var commentInput = $('#documentPreviewContainer #commentInput');
- var extraPlugins = 'simpleLink,selectImage,suggester';
-
- // TODO this line is mandatory when a custom skin is defined, it should not be mandatory
- CKEDITOR.basePath = '/commons-extension/ckeditor/';
- var toolbarHeight = 39;
- commentInput.ckeditor({
- customConfig: eXo.env.portal.context + '/' + eXo.env.portal.rest + '/richeditor/configuration?type=document-preview&v=' + eXo.env.client.assetsVersion,
- extraPlugins: extraPlugins,
- typeOfRelation: 'mention_comment',
- spaceURL: this.settings.activity.spaceURL,
- on : {
- instanceReady : function ( evt ) {
- // Hide the editor toolbar
- $("#CommentButton").prop("disabled", true);
- $('#' + evt.editor.id + '_bottom').removeClass('cke_bottom_visible');
-
- },
- focus : function ( evt ) {
- // Show the editor toolbar, except for smartphones in landscape mode
- if ($(window).width() > 767 || $(window).width() < $(window).height()) {
- //$('#' + evt.editor.id + '_bottom').css('display', 'block');
- evt.editor.execCommand('autogrow');
- var $content = $('#' + evt.editor.id + '_contents');
- var contentHeight = $content.height();
- var $ckeBottom = $('#' + evt.editor.id + '_bottom');
- $ckeBottom[0].style.display = "block";
- var originalHeight = $ckeBottom.css('height', 'auto').outerHeight();
- toolbarHeight = $ckeBottom.addClass('cke_bottom_visible').outerHeight();
- var heightToAddVisibleClass = toolbarHeight - originalHeight;
- $ckeBottom.removeClass('cke_bottom_visible').css('height', '0px');
- $ckeBottom.animate({
- height: "" + toolbarHeight
- }, {
- step: function(number, tween) {
- $content.height(contentHeight - number);
- if (number >= heightToAddVisibleClass) {
- $ckeBottom.addClass('cke_bottom_visible');
- }
- }
- });
- } else {
- $('#' + evt.editor.id + '_bottom').removeClass('cke_bottom_visible');
- $('#' + evt.editor.id + '_bottom')[0].style.display = "none";
- }
- },
- blur : function ( evt ) {
- // Hide the editor toolbar
- if ($(window).width() > 767 || $(window).width() < $(window).height()) {
- $('#' + evt.editor.id + '_contents').css('height', $('#' + evt.editor.id + '_contents').height() + toolbarHeight);
- $('#' + evt.editor.id + '_bottom').css('height', '0px');
- $('#' + evt.editor.id + '_bottom').removeClass('cke_bottom_visible');
- }
- },
- change: function( evt) {
- var newData = evt.editor.getData();
- var pureText = newData? newData.replace(/<[^>]*>/g, "").replace(/ /g,"").trim() : "";
-
- if (pureText.length > 0 && pureText.length <= MAX_LENGTH) {
- $("#CommentButton").removeAttr("disabled");
- } else {
- $("#CommentButton").prop("disabled", true);
- }
-
- if (pureText.length <= MAX_LENGTH) {
- evt.editor.getCommand('selectImage').enable();
- } else {
- evt.editor.getCommand('selectImage').disable();
- }
- },
- key: function( evt) {
- var newData = evt.editor.getData();
- var pureText = newData? newData.replace(/<[^>]*>/g, "").replace(/ /g,"").trim() : "";
- if (pureText.length > MAX_LENGTH) {
- if ([8, 46, 33, 34, 35, 36, 37,38,39,40].indexOf(evt.data.keyCode) < 0) {
- evt.cancel();
- }
- }
- }
- }
- });
- },
- show: function () {
- $('#documentPreviewContainer').show();
- $('body').css('overflow', 'hidden');
- },
-
- hide: function () {
- $('#documentPreviewContainer').hide();
- $('body').css('overflow', '');
- },
-
- goToNext: function () {
- if(this.settings && this.settings.activity && this.settings.activity.next) {
- $(this.settings.activity.next).click();
- }
- },
-
- goToPrevious: function () {
- if(this.settings && this.settings.activity && this.settings.activity.previous) {
- $(this.settings.activity.previous).click();
- }
- }
- };
-
- // Bind Esc key
- var closeEventHandler = function(e) {
- $('#presentationMode').blur();
- if (e.keyCode == 27 && ("presentationMode" != e.target.id || $.browser.mozilla)) {
- $(".exitWindow > .uiIconClose", $('#uiDocumentPreview')).trigger("click");
- }
- }
-
- var applyReverseEllipsis = function($parent) {
- $parent.find('.ellipsis-reverse').each(function() {
- var $ellipsisContent = $(this).find(".ellipsis-reverse-content");
- var $ellipsisApply = $(this).find(".ellipsis-reverse-apply");
- var $ellipsisApplyContent = $(this).find(".ellipsis-reverse-apply-content");
- var $ellipsisFirstChild = $ellipsisApplyContent.find(' :first-child');
- if(!$ellipsisApplyContent.length
- || !$ellipsisContent.length
- || !$(this).offset()
- || !$ellipsisFirstChild
- || !$ellipsisFirstChild.offset()
- || !$ellipsisFirstChild.length) {
- return;
- }
- var applyEllipsisReverse = $ellipsisFirstChild.offset().left - $(this).offset().left -15;
- if(applyEllipsisReverse > 0) {
- $ellipsisContent.addClass("hidden");
- } else {
- $ellipsisContent.removeClass("hidden");
- }
- })
- };
-
- // Resize Event
- var resizeEventHandler = function() {
- var pdfDisplayAreaHeight = window.innerHeight - 125;
- var $uiDocumentPreview = $('#uiDocumentPreview');
-
- // Show empty preview message
- var $blockToAppendTo = $uiDocumentPreview.find(".UIResizableBlock");
- if($blockToAppendTo.length == 0 && !documentPreview.settings.doc.isWebContent) {
- $blockToAppendTo = $("#documentPreviewContent");
- if($blockToAppendTo.find(".EmptyDocumentPreview").length == 0) {
- $blockToAppendTo.append("
${UIActivity.comment.noPreviewOfDocument}
");
- }
- }
- // Show Next & previous buttons inside resizable div
- if($uiDocumentPreview.find("#NavCommands").length == 0) {
- if(documentPreview.settings.activity.next || documentPreview.settings.activity.previous) {
- $blockToAppendTo.find(".fileContent").before('
' +
- '
').after('
' +
- '
');
- }
- }
- applyReverseEllipsis($uiDocumentPreview);
-
- var $remoteEditDocument = $uiDocumentPreview.find(".remoteEditBtn");
- if($remoteEditDocument.length == 1 && !$remoteEditDocument.hasClass("updated")) {
- // Update label only once et when activity has multiple files
- $(document).ready(function(){
- eXo.ecm.OpenDocumentInOffice.updateLabel(documentPreview.settings.doc.workspace + ":" + documentPreview.settings.doc.path, documentPreview.settings.activity.id);
- });
- $remoteEditDocument.hasClass("updated");
- }
-
- // Calculate margin
- $('#outerContainer', $uiDocumentPreview).height(pdfDisplayAreaHeight); // pdf viewer
- var $commentArea = $('.commentArea', $uiDocumentPreview);
- var $commentAreaTitle = $('.title', $commentArea);
- var $commentInputBox = $('.commentInputBox', $commentArea);
- var $commentList = $('.commentList', $commentArea);
- var $highlightBox = $('.highlightBox', $commentArea);
- var $actionBarCommentArea = $('.actionBar', $commentArea);
- $commentList.scrollTop(20000);
-
- // Media viewer, no preview file
- var $navigationContainer = $(".navigationContainer", $uiDocumentPreview);
- var $emptyDocumentPreview = $(".EmptyDocumentPreview", $uiDocumentPreview);
- var $uiContentBox = $('.uiContentBox', $navigationContainer);
- var $video = $('.videoContent', $uiContentBox);
- var $flowplayerContentDetail = $('.ContentDetail', $uiContentBox);
- var $flowplayerPlayerContent = $('.PlayerContent', $flowplayerContentDetail);
- var $flowplayer = $('object', $flowplayerPlayerContent);
- var $flashViewer = $('.FlashViewer', $uiContentBox);
- var $embedFlashViewer = $('embed', $flashViewer);
- var $windowmediaplayer = $('#MediaPlayer1', $uiContentBox);
- var $embedWMP = $('embed', $windowmediaplayer);
-
- $emptyDocumentPreview.height(pdfDisplayAreaHeight - 40);
- $navigationContainer.height(pdfDisplayAreaHeight);
- $uiContentBox.height(pdfDisplayAreaHeight);
- $flowplayerContentDetail.height(pdfDisplayAreaHeight);
- $flowplayerPlayerContent.height(pdfDisplayAreaHeight - 5);
- $flashViewer.height(pdfDisplayAreaHeight - 5);
-
- $flowplayer.css('max-width', $uiContentBox.width() - 2);
- $flowplayer.css('max-height', $uiContentBox.height() - 3);
- $flowplayer.css('width', '100%');
- $flowplayer.css('height', '100%');
-
- $video.css('max-width', $uiContentBox.width() - 2);
- $video.css('max-height', $uiContentBox.height() - 3);
- $video.css('width', '100%');
- $video.css('height', '100%');
-
- $windowmediaplayer.css('max-width', $uiContentBox.width() - 2);
- $windowmediaplayer.css('max-height', $uiContentBox.height() - 7);
- $windowmediaplayer.css('width', '100%');
- $windowmediaplayer.css('height', '100%');
- $embedWMP.css('width', '100%');
- $embedWMP.css('height', '100%')
-
- $embedFlashViewer.css('max-width', $uiContentBox.width() - 2);
- $embedFlashViewer.css('max-height', $uiContentBox.height() - 3);
- $embedFlashViewer.css('width', '100%');
- $embedFlashViewer.css('height', '100%');
-
- var $img = $('a > img', $uiContentBox);
-
- if ($img.length > 0) {
- $img.css('max-width', $uiContentBox.width() + 1);
- $img.css('max-height', $uiContentBox.height() + 1);
- $img.css('width', 'auto');
- $img.css('height', 'auto');
- $navigationContainer.css('overflow', 'hidden');
- }
-
- var $EmbedHtml = $('.EmbedHtml', $uiDocumentPreview);
- $EmbedHtml.height(pdfDisplayAreaHeight) // External embedded
-
- // Resize image flick
- $img = $('.uiDocumentPreviewMainWindow > .EmbedHtml > a > img');
- $img.css('max-width', $EmbedHtml.width());
- $img.css('max-height', $EmbedHtml.height());
- }
-
- return documentPreview;
-})($, XSSUtils, editorbuttons);
diff --git a/apps/resources-wcm/src/main/webapp/javascript/eXo/wcm/ECM.js b/apps/resources-wcm/src/main/webapp/javascript/eXo/wcm/ECM.js
deleted file mode 100644
index b460aa8ae73..00000000000
--- a/apps/resources-wcm/src/main/webapp/javascript/eXo/wcm/ECM.js
+++ /dev/null
@@ -1,5 +0,0 @@
-(function() {
- if (!eXo.ecm) {
- eXo.ecm = {};
- }
-})();
\ No newline at end of file
diff --git a/apps/resources-wcm/src/main/webapp/javascript/eXo/wcm/backoffice/private/WCMUtils.js b/apps/resources-wcm/src/main/webapp/javascript/eXo/wcm/backoffice/private/WCMUtils.js
deleted file mode 100644
index bfc7536f2f3..00000000000
--- a/apps/resources-wcm/src/main/webapp/javascript/eXo/wcm/backoffice/private/WCMUtils.js
+++ /dev/null
@@ -1,928 +0,0 @@
-(function(gj, base) {
- // WCMUtils
- function WCMUtils(){
- this.cmdEcmBundle = "/bundle/";
- this.cmdGetBundle = "getBundle?";
- this.cmdSocialPeople = "/social/people/";
- this.cmdGetPeople = "getPeopleInfo/";
-
- this.showRightContent = true;
- }
-
- WCMUtils.prototype.getHostName = function() {
- var hostName;
- if(self == top){
- var parentLocation = window.parent.location;
- hostName = parentLocation.href.substring(0, parentLocation.href.indexOf(parentLocation.pathname));
- } else {
- // If window is iframe, location should be parsing from src property
- var url;
- if (eXo.core.Browser.ie) {
- url = window.frameElement.src;
- } else {
- url = window.src;
- }
- var parser = document.createElement('a');
- parser.href = url;
- hostName = parser.protocol + "//" + parser.hostname + ":" + parser.port;
- }
- return hostName;
- };
-
- WCMUtils.prototype.request = function(url) {
- var xmlHttpRequest = false;
- if (window.XMLHttpRequest) {
- xmlHttpRequest = new window.XMLHttpRequest();
- xmlHttpRequest.open("GET",url,false);
- xmlHttpRequest.send("");
- return xmlHttpRequest.responseXML;
- }
- else if (ActiveXObject("Microsoft.XMLDOM")) { // for IE
- xmlHttpRequest = new ActiveXObject("Microsoft.XMLDOM");
- xmlHttpRequest.async=false;
- xmlHttpRequest.load(urlRequestXML);
- return xmlHttpRequest;
- }
- return null;
- };
-
- WCMUtils.prototype.getCurrentNodes = function(navigations, selectedNodeUri) {
- var currentNodes = new Array();
- var currentNodeUris = new Array();
- currentNodeUris = selectedNodeUri.split("/");
- for (var i in navigations) {
- for (var j in navigations[i].nodes) {
- if(navigations[i].nodes[j].name == currentNodeUris[0]) {
- currentNodes[0] = navigations[i].nodes[j];
- break;
- }
- }
- }
- var parent = currentNodes[0];
- for(var k = 1; k
0) {
- for (var i = 0, len = arr.length; i < len; i++) {
- if (arr[i].clientHeight > arr[i].offsetParent.clientHeight) {
- arr[i].closest('.commentBox').style.height = arr[i].height + 30 + "px";
- }
- }
- }
- };
-
- WCMUtils.prototype.showHideSideBar = function(event) {
- var leftContainer = document.getElementById("LeftContainer");
- var rightContainer = document.getElementById("RightContainer");
- var resizeBar = document.getElementById("ResizeSideBar");
- var seoPopup = document.getElementById("UISEOPopupWindow");
- var formContainer = gj(seoPopup).find("div.FormContainer:first")[0];
- var resizeButton = null;
- if(this.showRightContent)
- resizeButton = gj(resizeBar).find("div.ShowRightContent:first")[0];
- else
- resizeButton = gj(resizeBar).find("div.ResizeButton:first")[0];
- if(rightContainer.style.display == 'none') {
- rightContainer.style.display = 'block';
- resizeButton.className = "ResizeSideBar ShowRightContent";
- seoPopup.style.width = "640px";
- this.showRightContent = true;
- leftContainer.style.marginRight="244px";
- formContainer.style.width = "610px";
- seoPopup.style.left = seoPopup.offsetLeft - 240 + "px";
- } else {
- rightContainer.style.display = 'none';
- seoPopup.style.width = "400px";
- resizeButton.className = "ResizeButton";
- this.showRightContent = false;
- leftContainer.style.marginRight="none";
- formContainer.style.width = "370px";
- seoPopup.style.left = seoPopup.offsetLeft + 240 + "px";
- }
- }
-
- WCMUtils.prototype.setScrollBar = function() {
- try {
- var elementWorkingArea = document.getElementById('UIWorkingArea');
- var parent = document.getElementById('TabContainerParent');
- if(parent!=null) {
- var elements = gj(parent).find("div.UITabContent");
- if(elements!=null) {
- for(i=0;i430) {
- obj.style.height=elementWorkingArea.offsetHeight-50+"px";
- obj.style.overflow="auto";
- }
- }
- }
- }
- }
- }
- catch(err){}
- };
-
- WCMUtils.prototype.hideContextMenu = function(menuItemElem) {
- var contextMenu = gj(menuItemElem).parents(".uiRightClickPopupMenu:first")[0];
- contextMenu.style.display = "none" ;
- };
-
- WCMUtils.prototype.setHeightRightContainer = function() {
- var leftContainer = document.getElementById("LeftContainer");
- var rightContainer = document.getElementById("RightContainer");
- if(gj(leftContainer).height() > 455) rightContainer.style.height = gj(leftContainer).height() + "px";
- var seoPopup = document.getElementById("UISEOPopupWindow");
- var formContainer = gj(seoPopup).find("div.formContainer:first")[0];
- var resizeButton = null;
- rightContainer.style.display = 'block';
- seoPopup.style.width = "640px";
- };
-
- WCMUtils.prototype.showSEOLanguage = function(isShow) {
- var addNewSEO = document.getElementById("addNewSEO");
- var selectSEOLanguage = document.getElementById("selectSEOLanguage");
- if(isShow) {
- addNewSEO.style.display = "none";
- selectSEOLanguage.style.display = "block";
- } else {
- addNewSEO.style.display = "block";
- selectSEOLanguage.style.display = "none";
- }
- };
-
- WCMUtils.prototype.addParamIntoAjaxEventRequest = function(eventReq, extParam) {
- return eventReq.substring(0, eventReq.length - 2) + extParam + "\')";
- }
-
- WCMUtils.prototype.searchNodeTypeOnKeyPress = function() {
- //process Enter press action
- var element = document.getElementById("NodeTypeText");
- if (element == null) return false;
-
- element.onkeypress= function(event) {
- var keynum = false;
- if (window.event) { /* IE */
- keynum = window.event.keyCode;
- event = window.event;
- } else if (event.which) { /* Netscape/Firefox/Opera */
- keynum = event.which;
- }
- if (keynum == 0) {
- keynum = event.keyCode;
- }
- if (keynum == 13) {
- var uiSearchInput = gj(this).parents(".uiSearchInput:first")[0];
- var btnSearch = gj(uiSearchInput).find("a")[0];
- eval(btnSearch.getAttribute("href"));
- return false;
- }
- }
- }
-
- WCMUtils.prototype.addEvent = function(element, eventName, handler) {
- var elementId = typeof element != 'object' ? element : element.id;
- var objElement = document.getElementById(elementId);
- if (eventName.toLowerCase().indexOf("focus") != -1 || eventName.toLowerCase().indexOf("blur") != -1) {
- if (objElement.tabIndex == undefined) {
- objElement.tabIndex = "0";
- }
- }
- if (navigator.userAgent.indexOf("MSIE") >= 0) {
- objElement.attachEvent("on" + eventName, handler);
- } else {
- objElement.addEventListener(eventName, handler, false);
- }
- };
-
- WCMUtils.prototype.changeStyleClass = function(element, newStyleClass) {
- var isFocusOnCKEditor = false;
- try {
- if(CKEDITOR) {
- for(name in CKEDITOR.instances)
- {
- var editor = CKEDITOR.instances[name];
- if(editor.focusManager.hasFocus) isFocusOnCKEditor = true;
- }
- }
- } catch(err) {}
-
- if(!isFocusOnCKEditor) {
- var elementId = typeof element != 'object' ? element : element.id;
- var objElement = document.getElementById(elementId);
- objElement.className = newStyleClass;
- }
- };
-
- WCMUtils.prototype.replaceToIframe = function(txtAreaId) {
- if (!document.getElementById(txtAreaId)) {
- return ;
- }
-
- var txtArea = document.getElementById(txtAreaId) ;
- var ifrm = document.createElement("IFRAME") ;
-
- ifrm.className = 'ECMIframe' ;
- ifrm.src = 'javascript:void(0)' ;
- ifrm.frameBorder = 0 ;
- ifrm.scrolling = "auto" ;
- var strValue = "" + txtArea.value + "
" ;
- txtArea.parentNode.replaceChild(ifrm, txtArea) ;
- try {
- var doc = ifrm.contentWindow.document ;
- doc.open() ;
- doc.write(" ");
- doc.write(strValue) ;
- doc.close() ;
- } catch (ex) {}
- };
-
- WCMUtils.prototype.setZIndex = function(index) {
- eXo.webui.UIPopup.zIndex = index;
- };
-
- WCMUtils.prototype.getBundle = function(key, lang) {
- var command = this.cmdEcmBundle + this.cmdGetBundle + "key=" + key + "&locale=" + lang;
- var url = eXo.ecm.WCMUtils.getRestContext() + command;
- var mXML = this.request(url);
- var message;
- try {
- message = mXML.getElementsByTagName(key)[0];
- return message.getAttribute("value");
- } catch(err) {
- return "";
- }
- };
-
- WCMUtils.prototype.initSearch = function(componentId, searchInputName, searchLabel) {
- var uiComponent = document.getElementById(componentId);
- var input = gj(uiComponent).find("input")[0];
- gj(input).attr('autocomplete', 'off');
- eXo.ecm.WCMUtils.decorateInput(input, searchLabel, true);
- };
-
- WCMUtils.prototype.decorateInput = function(input, defaultValue, defaultCondition) {
- if (gj(input).val() == defaultValue && defaultCondition )
- input.form.onsubmit = function() {
- return false;
- };
- };
-
-
- WCMUtils.prototype.loadAvartar = function (userId, imgTag) {
- var command = this.cmdSocialPeople + this.cmdGetPeople + userId + ".json";
- var restUrl = eXo.ecm.WCMUtils.getRestContext() + command;
- gj.ajax({
- type: "GET",
- url: restUrl,
- complete: function (jqXHR) {
- if (jqXHR.readyState === 4) {
- var userData = gj.parseJSON(jqXHR.responseText);
- gj(imgTag).attr("src", userData.avatarURL);
- }
- }
- });
- };
-
- WCMUtils.prototype.onLoadComments = function() {
- var comments = gj('#UIDocumentWorkspace').find("div.comments:first")[0];
- gj(comments).find("a.avatarMedium").each(function(i) {
- var commentor = gj(this).attr("commentor");
- var img = gj(this).find("img:first")[0];
- eXo.ecm.WCMUtils.loadAvartar(commentor, img);
- });
- };
-
- WCMUtils.prototype.loadFallbackImage = function(image){
- if (image != null) {
- var imageContainer = gj(image).closest(".mediaContent");
- if(imageContainer != null && imageContainer.length > 0) {
- var fallbackImage = imageContainer.find(".fallbackImage");
- if(fallbackImage != null && fallbackImage.length > 0) {
- gj(image).hide();
- fallbackImage.show();
- }
- }
- }
- };
-
- WCMUtils.prototype.getPlacement = function (element) {
- var offset = gj(element).offset();
- var height = gj(document).outerHeight();
- var width = gj(document).outerWidth();
- var vert = 0.5 * height - offset.top;
- var vertPlacement = vert > 0 ? 'bottom' : 'top';
- var horiz = 0.5 * width - offset.left;
- var horizPlacement = horiz > 0 ? 'right' : 'left';
- var placement = Math.abs(horiz) > Math.abs(vert) ? horizPlacement : vertPlacement;
- return placement;
- };
-
- WCMUtils.prototype.showPopover = function (element) {
- gj(element).popover({template: ''});
- gj(element).popover('show');
- };
-
- WCMUtils.prototype.hidePopover = function (element) {
- gj(element).popover('hide');
- };
-
- /**
- * Create a notice
- * @param notice: msg
- * @param closeable: can close
- */
- WCMUtils.prototype.showNotice = function(noticeMsg, closeable, type){
- gj("#_wcm-notice").remove();
- //if(gj("#wcm-notice") === undefined){
- if(noticeMsg===undefined) return;
-
- var classType = "alert-success";
- var iconType = "uiIconSuccess";
- if("error" === type) {
- classType = "alert-warning";
- iconType = "uiIconWarning";
- }
- var noticeHtml = "
";
- var styleStr = "";
-
- //}
- var _noticeElem = gj(noticeHtml);
- if(noticeMsg === null || noticeMsg === '' || noticeMsg === undefined) {
- styleStr = "display:none";
- } else {
- styleStr = "display:block; top:40px; position:fixed;";
- var html = ' ' + noticeMsg;
- if(closeable) html += ' ';
- }
- _noticeElem.html(html);
- gj("body").append(_noticeElem);
- styleStr += "margin-left: -"+Math.ceil(_noticeElem.outerWidth()/2)+"px";
- _noticeElem.attr("style", styleStr);
- setTimeout(function(){ eXo.ecm.WCMUtils.closeNotice(); }, 5000);
- }
-
- WCMUtils.prototype.closeNotice = function(){
- var wcmNotice = document.getElementById("_wcm-notice");
- wcmNotice.style.display = "none";
- }
-
- eXo.ecm.WCMUtils = new WCMUtils();
-
- // Util
- window.wcm = function() {}
- wcm.insertCSSFromTextArea2FCK = function(Instance, ContentCSS) {
- if (!Instance) return;
- var eContentCSS = document.getElementById(ContentCSS);
- var sContentCSSId = ContentCSS + "_Inline";
- var count = 1;
- eContentCSS.onblur = updateStyle;
-
- function updateStyle() {
- var sValue = eContentCSS.value;
- if(!sValue) return;
- var iDoc = CKEDITOR.instances[Instance].EditorWindow.document;
- var eHead = iDoc.getElementsByTagName("head")[0];
- var eStyle = iDoc.getElementById(sContentCSSId);
- if (eStyle) {
- eHead.removeChild(eStyle);
- }
- eStyle = iDoc.createElement("style");
- eStyle.setAttribute("type", "text/css");
- eStyle.setAttribute("id", sContentCSSId);
- if (eXo.core.Browser.isFF()) { //for FF
- eStyle.innerHTML = sValue;
- } else {
- eStyle.styleSheet.cssText = sValue;
- }
- eHead.appendChild(eStyle);
- };
-
- (function checkFCKEditorAPI() {
- if (count <= 5) {
- try {
- updateStyle();
- if (updateStyle.time) {
- clearTimeout(updateStyle.time);
- updateStyle.time = null;
- }
- } catch(e) {
- count++;
- updateStyle.time = setTimeout(checkFCKEditorAPI, 500);
- }
- }
- })();
- }
-
- Utils = function(){
- Utils.prototype.removeQuickeditingBlock = function(portletID, quickEditingBlockId) {
- var presentation = document.getElementById(portletID);
- var pNode = presentation.parentNode;
- var quickEditingBlock = document.getElementById(quickEditingBlockId);
- if(quickEditingBlock != null) {
- pNode.removeChild(quickEditingBlock);
- }
- };
-
- Utils.prototype.insertQuickeditingBlock = function(portletID, quickEditingBlockId) {
- var presentation = document.getElementById(portletID);
- var parentNode = presentation.parentNode;
- //var fistChild = eXo.core.DOMUtil.getChildrenByTagName(parentNode, "div")[0];
- var fistChild = gj(parentNode).children("div")[0];
- if (fistChild.id == quickEditingBlockId) {
- var quickEditingBlock = document.getElementById(quickEditingBlockId);
- quickEditingBlock.parentNode.removeChild(quickEditingBlock);
- }
- var quickEditingBlock = document.getElementById(quickEditingBlockId);
- if(quickEditingBlock != null) {
- if(eXo.core.Browser.browserType == "ie") {
- var portalName = eXo.env.portal.portalName;
- if(portalName != "classic") {
- if(portletID == (portalName+"-signin")) quickEditingBlock.style.left = presentation.offsetWidth + quickEditingBlock.offsetWidth + 'px';
- } else {
- if(portletID == (portalName+"-logo") || portletID == (portalName+"-signin")) {
- quickEditingBlock.style.left = presentation.offsetWidth + quickEditingBlock.offsetWidth + 'px';
- }
- }
- }
- parentNode.insertBefore(quickEditingBlock, presentation);
- }
- };
- }
- eXo.wcm = new Utils();
-
- function showObject(obj) {
- var element = gj(obj).nextAll("div:first")[0];
- if (!element.style.display || element.style.display == 'none') {
- element.style.display = 'block';
- } else {
- element.style.display = 'none';
- }
- }
-
- function getHostName() {
- var parentLocation = window.parent.location;
- return parentLocation.href.substring(0, parentLocation.href.indexOf(parentLocation.pathname));
- }
-
- function getRuntimeContextPath() {
- return getHostName() + eXo.env.portal.context + '/' + eXo.env.portal.portalName + '/';
- }
- /*--------------------------------------SEARCH------------------------------------*/
- function getKeynum(event) {
- var keynum = false ;
- if(window.event) { /* IE */
- keynum = window.event.keyCode;
- event = window.event ;
- } else if(event.which) { /* Netscape/Firefox/Opera */
- keynum = event.which ;
- }
- if(keynum == 0) {
- keynum = event.keyCode ;
- }
- return keynum ;
- }
-
- function quickSearch(resultPageURI) {
- var searchBox = document.getElementById("siteSearchBox");
- var keyWordInput = gj(searchBox).find("input.keyword:first")[0];
- var keyword = encodeURI(keyWordInput.value);
- var resultPageURIDefault = "searchResult";
- var params = "portal=" + eXo.env.portal.portalName + "&keyword=" + keyword;
- var baseURI = getHostName() + eXo.env.portal.context + "/" + eXo.env.portal.portalName;
- if (resultPageURI != undefined) {
- baseURI = baseURI + "/" + resultPageURI;
- } else {
- baseURI = baseURI + "/" + resultPageURIDefault;
- }
- window.location = baseURI + "?" + params;
- }
-
- function quickSearchOnEnter(event, resultPageURI) {
- var keyNum = getKeynum(event);
- if (keyNum == 13) {
- quickSearch(resultPageURI);
- }
- }
-
- function search(comId) {
- var searchForm = document.getElementById(comId);
- var inputKey = gj(searchForm).find("#keywordInput:first")[0];
- searchForm.onsubmit = function() {return false;};
- inputKey.onkeypress = function(event) {
- var keyNum = getKeynum(event);
- if (keyNum == 13) {
- var searchButton = gj(this.form).find("div.SearchButton:first")[0];
- searchButton.onclick();
- }
- }
- }
-
- function keepKeywordOnBoxSearch() {
- var queryRegex = /^portal=[\w%]+&keyword=[\w%]+/;
- var searchBox = document.getElementById("siteSearchBox");
- var keyWordInput = gj(searchBox).find("input.keyword:first")[0];
- var queryString = location.search.substring(1);
- if (!queryString.match(queryRegex)) {return;}
- var portalParam = queryString.split('&')[0];
- var keyword = decodeURI(queryString.substring((portalParam + "keyword=").length +1));
- if (keyword != undefined && keyword.length != 0) {
- keyWordInput.value = unescape(keyword);
- }
- }
-
- eXo.core.Browser.addOnLoadCallback("keepKeywordOnBoxSearch", keepKeywordOnBoxSearch);
-
- /*------------------Overrite method eXo.webui.UIPopup.init to show popup display center-------------------------------*/
- /*uiPopupWindow.UIPopupWindow.init = function(popupId, isShow, isResizable, showCloseButton, isShowMask) {XoWork
- this.superClass = eXo.webui.UIPopup ;
- var popup = document.getElementById(popupId) ;
- var portalApp = document.getElementById("UIPortalApplication") ;
- if(popup == null) return;
- popup.style.visibility = "hidden" ;
- if(!isShowMask) isShowMask = false;
- popup.isShowMask = isShowMask ;
-
- //TODO Lambkin: this statement create a bug in select box component in Firefox
- //this.superClass.init(popup) ;
- var contentBlock = gj(popup).find('div.PopupContent:first')[0];
- if((gj(window).height() - 100 ) < contentBlock.offsetHeight) {
- contentBlock.style.height = (gj(window).height() - 100) + "px";
- }
- var popupBar = gj(popup).find('div.PopupTitle:first')[0];
-
- popupBar.onmousedown = this.initDND;
- popupBar.onkeydown = this.initDND;
-
- if(isShow == false) {
- this.superClass.hide(popup) ;
- if(isShowMask) eXo.webui.UIPopupWindow.showMask(popup, false) ;
- }
-
- if(isResizable) {
- var resizeBtn = gj(popup).find("div.ResizeButton:first")[0];
- resizeBtn.style.display = 'block';
- resizeBtn.onmousedown = this.startResizeEvt;
- resizeBtn.onkeydown = this.startResizeEvt;
- portalApp.onmouseup = this.endResizeEvt;
- }
-
- popup.style.visibility = "hidden" ;
- if(isShow == true) {
- var iframes = gj(popup).find("iframe") ;
- if(iframes.length > 0) {
- setTimeout("eXo.webui.UIPopupWindow.show('" + popupId + "'," + isShowMask + ")", 500) ;
- } else {
- if(popup.offsetHeight == 0){
- setTimeout("eXo.webui.UIPopupWindow.show('" + popupId + "'," + isShowMask + ")", 500) ;
- return ;
- }
- this.show(popup, isShowMask) ;
- }
- }
- } ;
- */
- /*----------------------------------------------End of overrite-------------------------------------------------------*/
- function initCheckedRadio(id) {
- eXo.core.Browser.chkRadioId = id;
- };
-
- function initCondition(formid){
- var formElement = document.getElementById(formid);
- var radioboxes = [];
- for(var i=0; i < formElement.elements.length;i++){
- if(formElement.elements[i].type=="radio") radioboxes.push(formElement.elements[i]);
- }
- var i = radioboxes.length;
- while(i--){
- radioboxes[i].onclick = chooseCondition;
- }
- if(eXo.core.Browser.chkRadioId && eXo.core.Browser.chkRadioId != "null"){
- var selectedRadio = document.getElementById(eXo.core.Browser.chkRadioId);
- } else{
- var selectedRadio = radioboxes[0];
- }
- var itemSelectedContainer = gj(selectedRadio).parents(".ContentSearchForm:first")[0];
- var itemContainers = gj(selectedRadio.form).find("div.ContentSearchForm");
- for(var i=1;i 0)){
- for(var i = 0; i < action.length; i++){
- if(state) {
- action[i].style.visibility = "hidden";
- } else {
- action[i].style.visibility = "";
- }
- }
- }
- var action = gj(itemContainer).find("input");
- if(action && (action.length > 0)){
- for(i = 0; i < action.length; i++){
- if(action[i].type != "radio") action[i].disabled = state;
- }
- }
- var action = gj(itemContainer).find("select");
- if(action && (action.length > 0)){
- for(i = 0; i < action.length; i++){
- action[i].disabled = state;
- }
- }
- };
- function removeCondition() {
-
- };
-
- function setHiddenValue() {
- var inputHidden = document.getElementById("checkedRadioId");
- if(eXo.core.Browser.chkRadioId == "null") {
- inputHidden.value = "name";
- document.getElementById("name").checked = true;
- } else {
- inputHidden.value = eXo.core.Browser.chkRadioId;
- document.getElementById(eXo.core.Browser.chkRadioId).checked = true;
- }
- }
-
- function showHideOrderBy() {
- var formObj = document.getElementById('UIViewerManagementForm');
- var viewerModeObj = formObj['ViewerMode'];
- var orderXXX = gj(formObj).find('tr.OrderBlock');
- viewerModeObj[0].onclick = function() {
- for (var i = 0; i < orderXXX.length; i++) {
- orderXXX[i].style.display = '';
- }
- }
- viewerModeObj[1].onclick = function() {
- for (var i = 0; i < orderXXX.length; i++) {
- orderXXX[i].style.display = 'none';
- }
- }
- }
-
-
- window.showPopupMenu = function (obj) {
- var uiNavi = document.getElementById('UIPresentationContainer');
- var uiACMENavi = document.getElementById('navigation-generator');
- var uiWCMNavigationPortlet = gj(uiACMENavi).find("div.UIWCMNavigationPortlet:first")[0];
-
- var objParent = gj(obj).parents(".UITab:first")[0];
- var menuItemContainer = gj(obj).nextAll("div:first")[0];
-
- var getNodeURL = obj.getAttribute("exo:getNodeURL");
- if (getNodeURL && !menuItemContainer) {
- var jsChilds = ajaxAsyncGetRequest(getNodeURL, false)
- try {
- var data = gj.parseJSON(jsChilds);
- if (isNaN(data.length)) {
- return;
- }
-
- var temp = document.createElement("div");
- temp.innerHTML = generateContainer(data);
- objParent.appendChild(gj(temp).children("div.ECMMenuItemContainer:first")[0]);
- } catch (e) {
- return;
- }
- }
-
- //display popup
- if(obj.Timeout) clearTimeout(obj.Timeout);
- if(menuItemContainer && menuItemContainer.style.display != "block") {
- objParent.style.position="relative";
- menuItemContainer.style.top = obj.offsetHeight + 'px';
- menuItemContainer.style.display = 'block';
- menuItemContainer.onmouseout = function(){
- if(base.Browser.browserType == 'ie') {
- if(uiNavi) uiNavi.style.position = "relative";
- if(uiWCMNavigationPortlet) uiWCMNavigationPortlet.style.position = "relative";
- }
- obj.Timeout = setTimeout(function() {
- menuItemContainer.style.display = 'none';
- menuItemContainer.onmouseover = null;
- menuItemContainer.onmouseout = null;
- },1*10);
- }
- menuItemContainer.onmouseover = function() {
- if(base.Browser.browserType == 'ie') {
- if(uiNavi) uiNavi.style.position = "static";
- if(uiWCMNavigationPortlet) uiWCMNavigationPortlet.style.position = "static";
- }
- if(obj.Timeout) clearTimeout(obj.Timeout);
- obj.Timeout = null;
- }
- obj.onmouseout = menuItemContainer.onmouseout;
- //menuItemContainer.style.width = menuItemContainer.offsetWidth + 'px';
- }
- }
-
- window.showPopupSubMenu = function(obj) {
- var objParent = obj;
- var subMenuItemContainer = false;
- var objParent = gj(obj).parents(".ArrowIcon:first")[0];
- if(objParent) subMenuItemContainer = gj(objParent).nextAll("div:first")[0];
-
- var getNodeURL = obj.getAttribute("exo:getNodeURL");
- if (getNodeURL && !subMenuItemContainer) {
- var jsChilds = ajaxAsyncGetRequest(getNodeURL, false);
- try {
- var data = gj.parseJSON(jsChilds);
- if (isNaN(data.length)) {
- return;
- }
-
- var temp = document.createElement("div");
- temp.innerHTML = generateContainer(data);
- var grandParent = gj(objParent).parents(".MenuItem:first")[0];
- grandParent.appendChild(gj(temp).children("div.ECMMenuItemContainer:first")[0]);
- } catch (e) {
- return;
- }
- }
-
- objParent = gj(obj).parents(".ArrowIcon:first")[0];
- if(objParent) subMenuItemContainer = gj(objParent).nextAll("div:first")[0];
-
- if(obj.Timeout) clearTimeout(obj.Timeout);
- if(subMenuItemContainer && subMenuItemContainer.style.display != "block") {
- subMenuItemContainer.style.display = 'block';
- objParent.className = '';
- subMenuItemContainer.onmouseover = function() {
- objParent.className = '';
- if(objParent.Timeout) clearTimeout(objParent.Timeout);
- objParent.Timeout = null;
- }
-
- subMenuItemContainer.onmouseout = function() {
- objParent.Timeout = setTimeout(function() {
- var subobj = gj(subMenuItemContainer).find("div.ECMMenuItemContainer:first")[0];
- if(subobj) {
- if(subobj.style.display=='block') {
- subobj.style.display = 'none';
- subobj.onmouseover = null;
- subobj.onmouseout = null;
- } else {
- subMenuItemContainer.style.display = 'none';
- objParent.className = 'ArrowIcon';
- subMenuItemContainer.onmouseover = null;
- subMenuItemContainer.onmouseout = null;
- }
- } else {
- subMenuItemContainer.style.display = 'none';
- objParent.className = 'ArrowIcon';
- subMenuItemContainer.onmouseover = null;
- subMenuItemContainer.onmouseout = null;
- }
- }, 1*10);
- }
- obj.onmouseout = subMenuItemContainer.onmouseout;
- subMenuItemContainer.style.width = subMenuItemContainer.offsetWidth + 'px';
- subMenuItemContainer.style.left = objParent.offsetLeft + objParent.offsetWidth + 'px';
- subMenuItemContainer.style.top = base.Browser.findPosYInContainer(objParent,subMenuItemContainer.offsetParent) + 'px';
- }
- };
-
-
- function requestAjax(url) {
- var xmlHttpRequest = false;
- if(window.XMLHttpRequest) {
- try {
- xmlHttpRequest = new XMLHttpRequest();
- } catch(e) {
- xmlHttpRequest = false;
- }
- } else if(window.ActiveXObject) {
- try {
- xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
- } catch(e) {
- try {
- xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
- } catch(e) {
- xmlHttpRequest = false;
- }
- }
- }
- if(xmlHttpRequest) {
- xmlHttpRequest.open("GET", url, false);
- xmlHttpRequest.send();
- return xmlHttpRequest.responseXML;
- }
- }
-
-
-
- return {
- WCMUtils : eXo.ecm.WCMUtils,
- };
-})(gj, base);
-
diff --git a/apps/resources-wcm/src/main/webapp/javascript/eXo/wcm/backoffice/private/bootstrap-typeahead.js b/apps/resources-wcm/src/main/webapp/javascript/eXo/wcm/backoffice/private/bootstrap-typeahead.js
deleted file mode 100644
index 28b7cfe02ca..00000000000
--- a/apps/resources-wcm/src/main/webapp/javascript/eXo/wcm/backoffice/private/bootstrap-typeahead.js
+++ /dev/null
@@ -1,346 +0,0 @@
-/* =============================================================
- * bootstrap-typeahead.js v2.3.1
- * http://twitter.github.com/bootstrap/javascript.html#typeahead
- * =============================================================
- * Copyright 2012 Twitter, Inc.
- *
- * 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.
- * ============================================================ */
-
-
-!function($){
-
- "use strict"; // jshint ;_;
-
-
- /* TYPEAHEAD PUBLIC CLASS DEFINITION
- * ================================= */
-
- var Typeahead = function (element, options) {
- this.$element = $(element)
- this.options = $.extend({}, $.fn.typeahead.defaults, options)
- this.matcher = this.options.matcher || this.matcher
- this.sorter = this.options.sorter || this.sorter
- this.highlighter = this.options.highlighter || this.highlighter
- this.updater = this.options.updater || this.updater
- this.source = this.options.source
- this.$menu = $(this.options.menu)
- this.shown = false
- this.listen()
- }
-
- Typeahead.prototype = {
-
- constructor: Typeahead
-
- , select: function () {
- var val = this.$menu.find('.active').attr('data-value')
- //This block code used for select tag from suggestion popup multi times
- var existingTags = this.$element.val()
- var newTags = val;
- if(existingTags.lastIndexOf(",") > 0)
- {
- newTags = existingTags.substring(0, existingTags.lastIndexOf(",") + 1) + " " + val
- }
- this.$element.val(this.updater(newTags)).change()
- return this.hide()
- }
-
- , updater: function (item) {
- return item
- }
-
- , show: function () {
- var pos = $.extend({}, this.$element.position(), {
- height: this.$element[0].offsetHeight
- })
-
- this.$menu
- .insertAfter(this.$element)
- .css({
- top: pos.top + pos.height
- , left: pos.left
- })
- .show()
-
- this.shown = true
- return this
- }
-
- , hide: function () {
- this.$menu.hide()
- this.shown = false
- return this
- }
-
- , lookup: function (event) {
- var items
- //This lie to get tag name and support empty tag to show all sugesstions
- var tagName = this.$element.val() || ''
- //This line used for separating the keywords for lookup in case user want to add multi tags
- if(tagName.lastIndexOf(",") >= 0) tagName = tagName.substring(tagName.lastIndexOf(",") + 1, tagName.length);
- tagName = tagName.trim();
- this.query = tagName;
- //Remove condition
- if (this.query.length < this.options.minLength) {
- return this.shown ? this.hide() : this
- }
-
- items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
-
- return items ? this.process(items) : this
- }
-
- , process: function (items) {
- var that = this
-
- items = $.grep(items, function (item) {
- return that.matcher(item)
- })
-
- items = this.sorter(items)
-
- if (!items.length) {
- return this.shown ? this.hide() : this
- }
-
- return this.render(items.slice(0, this.options.items)).show()
- }
-
- , matcher: function (item) {
- return ~item.toLowerCase().indexOf(this.query.toLowerCase())
- }
-
- , sorter: function (items) {
- var beginswith = []
- , caseSensitive = []
- , caseInsensitive = []
- , item
-
- while (item = items.shift()) {
- if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
- else if (~item.indexOf(this.query)) caseSensitive.push(item)
- else caseInsensitive.push(item)
- }
-
- return beginswith.concat(caseSensitive, caseInsensitive)
- }
-
- , highlighter: function (item) {
- var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
- return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
- return '' + match + ' '
- })
- }
-
- , render: function (items) {
- var that = this
-
- items = $(items).map(function (i, item) {
- i = $(that.options.item).attr('data-value', item)
- i.find('a').html(that.highlighter(item))
- return i[0]
- })
-
- items.first().addClass('active')
- this.$menu.html(items)
- return this
- }
-
- , next: function (event) {
- var active = this.$menu.find('.active').removeClass('active')
- , next = active.next()
-
- if (!next.length) {
- next = $(this.$menu.find('li')[0])
- }
-
- next.addClass('active')
- }
-
- , prev: function (event) {
- var active = this.$menu.find('.active').removeClass('active')
- , prev = active.prev()
-
- if (!prev.length) {
- prev = this.$menu.find('li').last()
- }
-
- prev.addClass('active')
- }
-
- , listen: function () {
- this.$element
- .on('focus', $.proxy(this.focus, this))
- .on('blur', $.proxy(this.blur, this))
- .on('keypress', $.proxy(this.keypress, this))
- .on('keyup', $.proxy(this.keyup, this))
-
- if (this.eventSupported('keydown')) {
- this.$element.on('keydown', $.proxy(this.keydown, this))
- }
-
- this.$menu
- .on('click', $.proxy(this.click, this))
- .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
- .on('mouseleave', 'li', $.proxy(this.mouseleave, this))
- }
-
- , eventSupported: function(eventName) {
- var isSupported = eventName in this.$element
- if (!isSupported) {
- this.$element.setAttribute(eventName, 'return;')
- isSupported = typeof this.$element[eventName] === 'function'
- }
- return isSupported
- }
-
- , move: function (e) {
- if (!this.shown) return
-
- switch(e.keyCode) {
- case 9: // tab
- case 13: // enter
- case 27: // escape
- e.preventDefault()
- break
-
- case 38: // up arrow
- e.preventDefault()
- this.prev()
- break
-
- case 40: // down arrow
- e.preventDefault()
- this.next()
- break
- }
-
- e.stopPropagation()
- }
-
- , keydown: function (e) {
- this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
- this.move(e)
- }
-
- , keypress: function (e) {
- if (this.suppressKeyPressRepeat) return
- this.move(e)
- }
-
- , keyup: function (e) {
- switch(e.keyCode) {
- case 40: if (!this.shown) this.lookup(e) // down arrow: Support behavior when press down key to have suggestion for all available
- case 38: // up arrow
- case 16: // shift
- case 17: // ctrl
- case 18: // alt
- break
-
- case 9: // tab
- case 13: // enter
- if (!this.shown) return
- this.select()
- break
-
- case 27: // escape
- if (!this.shown) return
- this.hide()
- break
-
- default:
- this.lookup()
- }
-
- e.stopPropagation()
- e.preventDefault()
- }
-
- , focus: function (e) {
- this.focused = true
- }
-
- , blur: function (e) {
- this.focused = false
- if (!this.mousedover && this.shown) this.hide()
- }
-
- , click: function (e) {
- e.stopPropagation()
- e.preventDefault()
- this.select()
- this.$element.focus()
- }
-
- , mouseenter: function (e) {
- this.mousedover = true
- this.$menu.find('.active').removeClass('active')
- $(e.currentTarget).addClass('active')
- }
-
- , mouseleave: function (e) {
- this.mousedover = false
- if (!this.focused && this.shown) this.hide()
- }
-
- }
-
-
- /* TYPEAHEAD PLUGIN DEFINITION
- * =========================== */
-
- var old = $.fn.typeahead
-
- $.fn.typeahead = function (option) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('typeahead')
- , options = typeof option == 'object' && option
- if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.typeahead.defaults = {
- source: []
- , items: 8
- , menu: ''
- , item: ' '
- , minLength: 1
- }
-
- $.fn.typeahead.Constructor = Typeahead
-
-
- /* TYPEAHEAD NO CONFLICT
- * =================== */
-
- $.fn.typeahead.noConflict = function () {
- $.fn.typeahead = old
- return this
- }
-
-
- /* TYPEAHEAD DATA-API
- * ================== */
-
- $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
- var $this = $(this)
- if ($this.data('typeahead')) return
- $this.typeahead($this.data())
- })
-
-}(window.jQuery);
-
-
diff --git a/apps/resources-wcm/src/main/webapp/javascript/eXo/wcm/frontoffice/public/OpenDocumentInOffice.js b/apps/resources-wcm/src/main/webapp/javascript/eXo/wcm/frontoffice/public/OpenDocumentInOffice.js
deleted file mode 100644
index a353e9359e0..00000000000
--- a/apps/resources-wcm/src/main/webapp/javascript/eXo/wcm/frontoffice/public/OpenDocumentInOffice.js
+++ /dev/null
@@ -1,241 +0,0 @@
-/**
- * Created by The eXo Platform SEA
- * Author : eXoPlatform
- * toannh@exoplatform.com
- * On 12/16/14
- * Open document js
- *
- * handle openDocument by ITHIT library
- * handle event click, rightclick on ECMS, AS
- *
- */
-
-(function(gj) {
-
- var portal = eXo.env.portal.context;
- var rest = eXo.env.portal.rest;
-
- var restPrefix = portal+"/"+rest;
-
- var OpenDocumentInOffice = function() {}
- var uiWorkingAreaWidth=0;
- var uiRightContainerWidth=0;
- var uiRightContainerStyle="";
-
- var uisideBarWidth=0;
-
- var resizeBarHeight=0;
- var resizeBarContentWidth="";
-
- var uiActionBarContainer="";
-
- OpenDocumentInOffice.prototype.errorCallback = function (message) {
- var installerFilePath = "/open-document/js/Plugins/" + ITHit.WebDAV.Client.DocManager.GetInstallFileName();
- window.open(installerFilePath);
- }
-
- /**
- * Open document by Office application or desktop apps
- * absolutePath is webdav path of document. webdav server have to support level 2
- * mountPath
- */
- OpenDocumentInOffice.prototype.openDocument = function(filePath, mountPath){
- fitLayout();
- if(eXo.ecm.ECMWebDav !== undefined) { // use ITHIT to an open document
- var webDav = eXo.ecm.ECMWebDav;
- var documentManager = eXo.ecm.ECMWebDav.WebDAV.Client.DocManager;
- //Workaround ECMS-7477 : Open in Office on Chrome for Mac
- if(webDav.DetectOS.OS == "MacOS" && webDav.DetectBrowser.Chrome){
- documentManager.DavProtocolEditDocument(filePath, mountPath, this.errorCallback);
- }else {
- documentManager.EditDocument(filePath, mountPath, this.errorCallback);
- }
- }
- if(uisideBarWidth === 0){ //hide side bar
- gj("#UISideBar").show();
- }
- }
-
- /**
- * Update OpenDocument button's label
- * objId is workspace_name ':' node_path of file
- * activityId is id of activity in home page
- * rightClick update button when right click (context-menu)
- */
- OpenDocumentInOffice.prototype.updateLabel = function(objId, activityId, rightClick){
- var currentDocumentObj = {};
- gj.ajax({
- url: restPrefix+"/office/updateDocumentTitle?objId=" + encodeURIComponent(objId)+"&lang="+eXo.env.portal.language,
- dataType: "text",
- type: "GET",
- async:false,
- cache:false,
- success: function (data) {
- data = gj.parseJSON(data);
- var elClass = "uiIconEcmsOpenDocument";
- var isRightClick="";
-
- if(activityId != null && activityId != "undefined" && activityId != "") elClass +="_"+activityId;
- if(rightClick) {
- isRightClick="#ECMContextMenu";
- openDocument = gj(isRightClick+" ."+elClass).parent();
- }else{
- openDocument = gj("."+elClass).closest("a");
- }
- var html = " \n"+data.title;
- openDocument.html(html);
-
- if (!data.isFile) {
- openDocument.addClass("hidden");
- return;
- }
- if(eXo.ecm.ECMWebDav !== undefined) {
- //showButton
- //console.log("ITHIT detected!");
- gj(openDocument).removeClass("hidden");
- gj(openDocument).closest("li").css("display", "");
- if (data.isLocked) return;//can not edit, just show popup(do not change href)
- defaultEnviromentFilter(openDocument);//only show with support enviroment.
- }else{
- //remove button
- openDocument.addClass("hidden");
- //console.log("ITHIT not detected!");
- defaultEnviromentFilter(openDocument);//only show with support enviroment.
- }
- }
- });
- uiWorkingAreaWidth = gj("#UIWorkingArea").width();
- uiRightContainerWidth = gj(".rightContainer").width();
- uiRightContainerStyle = gj(".rightContainer").attr("style");
-
- uisideBarWidth = gj("#UISideBar").width();
- resizeBarHeight = gj(".resizeBar").attr("style");
- resizeBarContentWidth = gj(".resizeBar").width();
- uiActionBarContainer = gj("#uiActionsBarContainer").html();
- }
-
- OpenDocumentInOffice.prototype.showConfirmBox = function() {
- gj("body").ajaxComplete(function () {
- var asPopup = gj("#UIDocViewerPopup .UIPopupWindow");
- asPopup.css("z-index", "120");
- asPopup.addClass("opendocMask");
- var cancelBtn = asPopup.find(".Cancel");
- asPopup.find(".uiIconClose").removeAttr("onclick");
- asPopup.find(".uiIconClose").one("click", function () {
- cancelBtn.click();
- });
- });
- }
- /**
- * Open Document with ActiveX. This required enviroments:
- * - MSOffice 2010, 2013 or least version Already installed
- * - Enable ActiveX on IE browser or least version (only from IE11)
- * - Return open status
- * - Have to enable "Inittialize and script ActiveX controls not marked as save for scripting"
- * path: Document's dav url.
- */
- OpenDocumentInOffice.prototype.EditDocument = function(path){
- var obj = new ActiveXObject('SharePoint.OpenDocuments.3');
- if(checkMSOfficeVersion()){
- obj.EditDocument(path);
- //console.log("Open Document status: "+openStatus);
- }else{
- //console.log("Open document not support!");
- return false;
- }
- }
-
- function fitLayout(){
- if (navigator.appVersion.indexOf("Mac") === -1) return;
-
- uiRightContainerStyle = gj(".rightContainer").attr("style");
-
- if(uisideBarWidth === 0){ //hide side bar
- gj("#UISideBar").hide();
- gj(".rightContainer").width(uiWorkingAreaWidth);
- gj("#uiActionsBarContainer").html(uiActionBarContainer);
- }else{
- gj(".rightContainer").width(uiRightContainerWidth);
- gj(".resizeBar").width(resizeBarContentWidth);
- gj(".resizeBar").attr("style", resizeBarHeight);
- gj(".resizeBarContent").attr("style", resizeBarHeight);
- gj("#uiActionsBarContainer").html(uiActionBarContainer);
- }
- }
-
- /**
- *To filter OpenXXX button only working with support enviroments
- * -IE 11 or least version,
- * -Window 7, 8
- * -MSOffice 2010, 2013
- * return true if support
- */
- function defaultEnviromentFilter(element){
- var inBrowser = typeof window !== 'undefined';
- var ua = inBrowser && window.navigator.userAgent.toLowerCase();
-
- var OSName="Unknown OS";
- if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
- if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
- if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
- if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";
-
- //check IE 11, Window, Office 2010
- //check OS type
- if (OSName === "Windows" || OSName === "Linux" || OSName === "MacOS") {
- //check IE11, Office
- var isAtLeastIE11 = !!(ua.match(/Trident/) && !ua.match(/MSIE/));
- if(checkMSOfficeVersion() && isAtLeastIE11){
- gj(element).parent().show();
- return true;
- }
-
- var isIOS = (ua && /iphone|ipad|ipod|ios/.test(ua));
- var isAndroid = (ua && ua.indexOf('android') > 0) ;
- // Hide if not enought enviroments support
- if(gj(element).parent().hasClass("detailContainer"))
- gj(element).hide();
- // Hide element if type is android or IOS
- else if (isIOS || isAndroid ){
- gj(element).parent().hide();
- }
- // Show element if not abdroid or IOS or not enought enviroments support
- else
- gj(element).parent().show();
- return false;
- }else{
- //other browser, hide this functional
- gj(element).closest("li").hide();
- gj(element).hide();
- }
-
- // other browser
- return false;
- }
-
- /**
- * Check ActiveX to get MS Office version
- * Return MS Office version is support
- */
- function checkMSOfficeVersion(){
- try{
- var word = new ActiveXObject("Word.Application");
- var version = word.Version;
- word.Quit();
- return version >= "14.0";
- }catch(err){
- //console.log("ActiveX is not support \n"+err);
- return false;
- }
- }
-
- eXo.ecm.OpenDocumentInOffice = new OpenDocumentInOffice();
- return {
- OpenDocumentInOffice : eXo.ecm.OpenDocumentInOffice
- };
-
-})(gj);
diff --git a/apps/resources-wcm/src/main/webapp/skin/less/ecms/portlets/cloudStorage/cloud-storage.less b/apps/resources-wcm/src/main/webapp/skin/less/ecms/portlets/cloudStorage/cloud-storage.less
deleted file mode 100644
index 459e2a1a70c..00000000000
--- a/apps/resources-wcm/src/main/webapp/skin/less/ecms/portlets/cloudStorage/cloud-storage.less
+++ /dev/null
@@ -1,47 +0,0 @@
-@import "../../../variables.less";
-
-#cloudStorageApp {
- .Title {
- color: @darkGrey;
- font-size: 24px;
- height: 23px;
- position: relative;
-
- &:after {
- border-bottom: 1px solid @uiSwitcherBackground;
- height: 11px;
- content: "";
- position: absolute;
- width: 100%;
- margin-left: 10px;
- }
- }
-
- .providersTable {
- border-left: 0;
-
- &Row {
- th,
- td {
- height: 20px;
- padding: 5px 15px;
- }
-
- &:nth-child(even):hover > td,
- &:nth-child(even) > td {
- background: @tableThBackground !important;
- }
-
- &:nth-child(odd):hover > td,
- &:nth-child(odd) > td {
- background: @baseBackground !important;
- }
- }
- }
-
- .providersSwitcher {
- padding: 0;
- margin: 0;
- height: 25px;
- }
-}
\ No newline at end of file
diff --git a/apps/resources-wcm/src/main/webapp/skin/less/ecms/skin/UIDocumentPreview/Style.less b/apps/resources-wcm/src/main/webapp/skin/less/ecms/skin/UIDocumentPreview/Style.less
deleted file mode 100644
index c8d1a9d1cd0..00000000000
--- a/apps/resources-wcm/src/main/webapp/skin/less/ecms/skin/UIDocumentPreview/Style.less
+++ /dev/null
@@ -1,1345 +0,0 @@
-
-.maskLayer {
- width: 100%;
- height: 100%;
- position: fixed;
- left: 0 ~'; /** orientation=lt */ ';
- right: 0 ~'; /** orientation=rt */ ';
- top: 0;
- z-index: 100;
- background: @black;
- color: @textColor;
- .uiDocumentPreview.collapsed {
- #documentPreviewContent, .uiPreviewWebContent, .EmbedHtml, .previewBtn {
- margin-right: 30px ~'; /** orientation=lt */ ';
- margin-left: 30px ~'; /** orientation=rt */ ';
- background : @black;
- }
-
- #documentPreviewContent {
- .detailContainer {
- .editors-placeholder {
- display: none!important;
- }
-
- button, a {
- display: none!important;
- }
- }
- }
- .commentArea {
- display: none;
- }
- .resizeButton {
- right: 5px ~'; /** orientation=lt */ ';
- left: 5px ~'; /** orientation=rt */ ';
- .uiIconMiniArrowLeft {
- display: block;
- }
- .uiIconMiniArrowRight {
- display: none;
- }
- }
- }
- .uiDocumentPreview {
- padding-left: 30px ~'; /** orientation=lt */ ';
- padding-right: 30px ~'; /** orientation=rt */ ';
- background: @black;
-
- .label {
- background-color: #476A9C;
- }
- .exitWindow .uiIconClose {
- position: absolute;
- top: 7px;
- right: 7px ~'; /** orientation=lt */ ';
- left: 7px ~'; /** orientation=rt */ ';
- cursor: pointer;
- &:hover {
- color: @colorIconSecondary!important;
- }
- }
- .uiContentBox {
- padding: 0;
- }
- .comments .commentBar {
- display: none;
- visibility: hidden;
- }
- .commentArea {
- height: ~"calc(100vh - 50px)";
- max-height: ~"calc(100vh - 50px)";
- margin-bottom: 0;
- width: 365px;
- border: 0;
- .avatarMedium img {
- border-radius: 2rem;
- }
- .title {
- font-weight: bold;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- padding: 0px;
- background-color: white;
- border-bottom: 1px solid @greyColor;
- border-radius: initial;
- .docTitle {
- width: 86%;
- float:left ~'; /** orientation=lt */ ';
- float:right ~'; /** orientation=rt */ ';
- border-right: 1px solid @greyColor ~'; /** orientation=lt */ ';
- border-left: 1px solid @greyColor ~'; /** orientation=rt */ ';
- padding-top: 8px;
- padding-bottom: 8px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- cursor: default;
- span {
- margin-left: 15px;
- margin-right: 15px;
- font-weight: bold;
- color: @primaryColor
- }
- }
- .docInfo {
- color: @darkGrey;
- font-size: 14px;
- font-weight: normal;
- margin-left: 15px ~'; /** orientation=lt */ ';
- margin-right: 15px ~'; /** orientation=rt */ ';
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .closeIcon {
- width: 10%;
- float:right ~'; /** orientation=lt */ ';
- float:left ~'; /** orientation=rt */ ';
- .uiIconClose {
- margin-left: 4px ~'; /** orientation=lt */ ';
- margin-right: 4px ~'; /** orientation=rt */ ';
- margin-top: 20px;
- cursor: pointer;
- &:before{
- font-size: 20px;
- }
- }
-
- }
- }
- .focus {
- background-color: @black;
- }
- .uiContentBox {
- padding: 0;
- border-radius: 3px;
- background: @primaryBackgroundLight;
- .highlightBox {
- padding: 10px 10px 0 !important;
- height: 140px;
- max-height: 140px;
- overflow: auto;
- background: @bodyBackground;
- .profile .rightBlock {
- margin-left: 60px ~'; /** orientation=lt */ ';
- margin-right: 60px ~'; /** orientation=rt */ ';
- a {
- font-weight: bold;
- }
- p.dateTime {
- font-size: 11px;
- color: @textLightColor;
- }
- }
- .descript {
- margin-bottom: 0;
- overflow: hidden;
- padding: 10px 0;
- }
- }
- .actionBar {
- padding: 5px 0;
- border-top: 1px solid @borderColor;
- .tooltip-inner {
- white-space: nowrap;
- }
- .tooltip.bottom {
- margin-left: -28px ~'; /** orientation=lt */ ';
- margin-right: -28px ~'; /** orientation=rt */ ';
- }
- .tooltip-arrow {
- margin-left: 10px ~'; /** orientation=lt */ ';
- margin-right: 10px ~'; /** orientation=rt */ ';
- }
- ul > li {
- display: inline-block;
- margin: 0 5px;
- a {
- color: @textColor;
- &:hover {
- color: @linkColorHover;
- }
- }
- }
- }
- .comments {
- padding: 0px;
- .uiLoadingIconSmall {
- margin: 10px auto;
- display: block;
- }
- .commentList {
- overflow: auto;
- background: @bodyBackground;
- padding: 8px 0;
- height: ~"calc(100vh - 316px)";
- max-height: ~"calc(100vh - 316px)";
- &.commentBoxOpen {
- height: ~"calc(100vh - 454px)";
- max-height: ~"calc(100vh - 454px)";
- }
- .subCommentBlock {
- padding: 5px 5px 5px 55px ~'; /** orientation=lt */ ';
- padding: 5px 55px 5px 5px ~'; /** orientation=rt */ ';
- border: 0;
- height: auto;
- }
- .subCommentShowAll {
- cursor: pointer;
- }
- .subCommentShowAllLink {
- cursor: pointer;
- }
- li {
- padding: 8px 10px;
- .close {
- position: absolute;
- right: -19px ~'; /** orientation=lt */ ';
- left: -19px ~'; /** orientation=rt */ ';
- top: 3px;
- display: none;
- }
- &:hover {
- .close {
- display: block;
- }
- }
- }
- .avatarXSmall {
- margin-top: 5px;
- }
- .rightBlock {
- margin-left: 45px ~'; /** orientation=lt */ ';
- margin-right: 15px ~'; /** orientation=lt */ ';
- margin-right: 45px ~'; /** orientation=rt */ ';
- margin-left: 15px ~'; /** orientation=rt */ ';
- position: relative;
- word-wrap: break-word;
- .tit {
- a {
- font-weight: bold;
- color: @linkColor;
- }
- .dateTime {
- color: @textLightColor;
- font-size: 11px;
- }
- }
- .cont {
- word-wrap: break-word;
- margin: 0 ;
- ol {
- li {
- list-style-type: decimal;
- }
- }
- ul {
- li {
- margin-left: 25px ~'; /** orientation=lt */ ';
- margin-right: 25px ~'; /** orientation=rt */ ';
- list-style-type: disc;
- }
- }
- }
- ul.statusAction {
- margin-left: 0px ~'; /** orientation=lt */ ';
- margin-right: 0px ~'; /** orientation=rt */ ';
- list-style: none;
- li {
- padding: 0px;
- display: inline;
- &.separator {
- padding:0 10px;
- }
- }
- .likeCommentCount {
- color: @textLightColor;
- font-weight: bold;
- margin-left: 3px ~'; /** orientation=lt */ ';
- margin-right: 3px ~'; /** orientation=rt */ ';
- }
- .commentLiked {
- color: @primaryColor;
- }
- }
- }
- }
- }
-
- .noComment {
- text-align: center;
- margin: 0 auto;
- padding: 0 0 20px;
- background: @bodyBackground;
- .info {
- background: url("@{base-images-path}/system/no_comment.png") no-repeat center center;
- color: @textLightColor;
- font-size: @fontSizeLarge;
- padding: 80px 0 0;
- }
- .error {
- background: url("@{base-images-path}/system/no_comment.png") no-repeat center center;
- color: @errorColor;
- font-size: @fontSizeLarge;
- padding: 80px 0 0;
- }
- }
- .parentCommentBlock {
- border-top: 1px solid #ccc;
- border-bottom: 1px solid #ccc;
- margin: 0;
- padding: 10px;
- overflow-y: hidden;
- }
- .commentInputBox {
- border-top: 1px solid @borderColor;
- border-bottom: 1px solid @borderColor;
- margin: 0;
- padding: 10px 10px 0 ~'!important; /** orientation=lt */ ';
- padding: 10px 10px 0 10px ~'!important; /** orientation=rt */ ';
- height: 158px;
- overflow-y: auto;
- .commentBox {
- padding-left: 40px ~'; /** orientation=lt */ ';
- padding-right: 40px ~'; /** orientation=rt */ ';
- .cke {
- .cke_contents {
- overflow: hidden !important;
- }
- }
- }
- textarea {
- height: 28px;
- margin: 4px 0 4px 9px ~'!important; /** orientation=lt */ ';
- margin: 4px 9px 4px 0 ~'!important; /** orientation=rt */ ';
- width: 235px;
- resize: none;
- }
- #CancelButton {
- display: none;
- }
- .btn {
- margin-top: 8px;
- }
- #CancelButton {
- margin-left: 4px ~'; /** orientation=lt */ ';
- margin-right: 4px ~'; /** orientation=rt */ ';
- }
- .mask {
- position: relative;
- .replaceTextArea {
- background: none repeat scroll 0 0 @baseBackground;
- border: 1px solid @borderColor;
- border-radius: 4px;
- box-shadow: 0 2px 1px rgba(0, 0, 0, 0.075) inset;
- color: @textColor;
- cursor: text;
- font-size: 13px;
- height: 24px;
- margin: 0 0 0 45px ~'!important; /** orientation=lt */ ';
- margin: 0 45px 0 0 ~'!important; /** orientation=rt */ ';
- overflow-x: hidden;
- overflow-y: auto;
- padding: 5px 8px;
- resize: none;
- width: auto;
- word-wrap: break-word;
- }
- .placeholder {
- left: 55px ~'; /** orientation=lt */ ';
- right: 55px ~'; /** orientation=rt */ ';
- opacity: 0.85;
- position: absolute;
- top: 5px;
- color: @textLightColor;
- }
- }
- }
- }
- }
- .resizeButton {
- cursor: pointer;
- height: 16px;
- right: 371px ~'; /** orientation=lt */ ';
- left: 371px ~'; /** orientation=rt */ ';
- position: absolute;
- top: 50%;
- .uiIconMiniArrowLeft {
- display: none;
- }
- .uiIconMiniArrowRight {
- display: block;
- }
- }
-
- .EmbedHtml {
- margin-right: 335px ~'; /** orientation=lt */ ';
- margin-left: 335px ~'; /** orientation=rt */ ';
- border: none;
- margin-bottom: 0;
- overflow: hidden;
- position: relative;
- background: @baseColor;
- iframe, embed {
- width: 100%;
- left: 50% ~'; /** orientation=lt */ ';
- right: 50% ~'; /** orientation=rt */ ';
- top: 50%;
- border: none !important;
- position: static;
- transform: none;
- -ms-transform: none;
- -webkit-transform: none;
- }
- }
- #documentPreviewContent {
- position: relative;
- margin-right: 390px ~'; /** orientation=lt */ ';
- margin-left: 390px ~'; /** orientation=rt */ ';
- background-color: @black;
- height: ~"calc(100vh - 82px)";
- padding-top: 35px;
-
- div.loading {
- margin: auto 0;
- width: 100%;
- position: absolute;
- height: 100%;
- background: white;
-
- i {
- position: absolute;
- top: 45vh;
- left: 50% ~'; /** orientation=lt */ ';
- right: 50% ~'; /** orientation=rt */ ';
- }
- }
- .EmptyDocumentPreview {
- text-align: center;
- display: table;
- width: 100%;
- box-sizing: border-box;
- padding: 20px;
-
- > .message {
- height: 100%;
- width: 100%;
- box-sizing: border-box;
- text-align: center;
- border: 1px solid #000;
- display: table-cell;
- vertical-align: middle;
- white-space: nowrap;
-
- > .content {
- line-height: 40px;
- }
- }
- }
-
- #NavCommands {
- margin: 0 auto;
- padding: 10px;
- white-space: nowrap;
- width: ~"calc(100% - 20px)";
- max-width: ~"calc(100% - 20px)";
- background: @black;
- display: flex;
-
- .ellipsis {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- max-width: 100%;
- }
- > div {
- display: inline-block;
- vertical-align: middle;
- flex: 1 auto;
- }
-
- > .arrowPrevious,
- > .arrowNext {
- height: 28px;
- margin: auto 10px;
-
- > span{
- width: 28px;
- height: 28px;
- line-height: 28px;
- background: black;
- border-radius: 50%;
- display: inline-block;
- cursor: pointer;
- text-align: center;
- vertical-align: middle;
- }
- }
- .disabled > span {
- background: gray;
- }
- > .arrowPrevious {
- text-align: inherit;
- position: absolute;
- width: 3%;
- top: 50%;
- left: 0%;
- z-index: 1;
- }
- > .arrowNext {
- text-align: end;
- position: absolute;
- width: 3%;
- top: 50%;
- right: -13px;
- z-index: 1;
- }
- > .fileTitle {
- text-align: center;
- overflow: hidden;
- text-overflow: ellipsis;
- box-sizing: border-box;
- width: 100%;
-
- > .fileName {
- width: 100%;
- > * {
- display: inline-block;
- vertical-align: middle;
- }
- .ellipsis {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- max-width: ~"calc(100% - 50px)";
- }
- }
- .fileVersion {
- cursor: pointer;
- &:hover {
- text-decoration: underline;
- }
- }
- .breadCrumb {
- margin: 5px 0;
-
- > * {
- line-height: 20px;
- display: inline;
- font-weight: bold;
- }
-
- a {
- text-decoration: underline;
- }
- }
- }
- > .arrowNext > span:before {
- font-family: "PLF-FONT-ICONS";
- content: "\e903";
- font-size: 2em;
- font-weight: bolder;
- color: white;
- }
- > .arrowPrevious > span:before {
- font-family: "PLF-FONT-ICONS";
- content: "\e901";
- font-size: 2em;
- font-weight: bolder;
- color: white;
- }
- }
- }
- .EmbedHtml > a > img {
- width: auto;
- height: auto;
- left: 50% ~'; /** orientation=lt */ ';
- right: 50% ~'; /** orientation=rt */ ';
- position: absolute;
- top: 50%;
- .translate(-50%, -50%);
- }
- #NavCommands {
- background: white;
- }
- .fileContent {
- width: 100%;
- margin: auto;
- .title {
- display: none;
- visibility: hidden;
- }
- #outerContainer {
- border-radius: 3px;
- overflow-y: auto;
- margin-bottom: 0px;
- height: 580px;
- box-sizing: border-box;
- }
- .navigationContainer {
- border: none;
- margin-bottom: 0;
- overflow: hidden;
- position: relative;
- background: white;
- .title {
- display: none;
- visibility: hidden;
- }
- .content {
- text-align: center;
- background: @black;
- }
- .document-preview-default{
- .center{
- color: @white;
- }
- }
- .uiUnEditable {
- margin: 0px auto;
- .iconContainer {
- text-align: center;
- .nameDoc {
- display: block;
- margin: 15px 0;
- color: @textLightColor;
- }
- }
- .detailContainer {
- text-align: center;
- padding-bottom: 30px;
- h4 {
- color: @baseColorLight;
- margin-top: 0px;
- margin-bottom: 20px;
- text-shadow: none;
- }
- }
- }
- img, object, .uiUnEditable {
- width: 100%;
- left: 50%;
- position: absolute;
- top: 50%;
- .translate(-50%, -50%);
- }
- video {
- width: 100%;
- left: 50% ~'; /** orientation=lt */ ';
- right: 50% ~'; /** orientation=rt */ ';
- top: 50%;
- position: static;
- transform: none;
- -ms-transform: none;
- -webkit-transform: none;
- }
-
- .object-mkv-mpeg {
- position: static;
- transform: none;
- -ms-transform: none;
- -webkit-transform: none;
- }
- &.noPreview {
- background: @baseBackground;
- }
- }
- }
-
- .uiPreviewWebContent {
- background: @baseBackground;
- margin-right: 335px ~'; /** orientation=lt */ ';
- margin-left: 335px ~'; /** orientation=rt */ ';
- border-radius: 3px;
- overflow-y: auto;
- word-wrap: break-word;
-
- .webContentContainer {
- padding: 15px;
- }
- }
- .uiVote {
- float: left ~'; /** orientation=lt */ ';
- float: right ~'; /** orientation=rt */ ';
- height: 20px;
- padding: 5px 0;
- .voteRatingInfo {
- color: @btnPrimaryColor;
- line-height: inherit;
- span {
- color: @btnPrimaryColor;
- }
- }
- .avgRatingImages {
- float: right ~'; /** orientation=lt */ ';
- float: left ~'; /** orientation=rt */ ';
- }
- }
- .hidden-title {
- display: none;
- }
- .fileName {
- text-align: center;
- position: absolute;
- width: 100%;
- height: 0;
-
- .ellipsis {
- display: inline-block;
- color: @white;
- font-weight: bold;
- width: 400px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
-
- .label {
- margin-left: 16px ~'; /** orientation=lt */ ';
- margin-right: 16px ~'; /** orientation=rt */ ';
- }
- }
- .previewBtn {
- bottom: 7px;
- text-align: right ~'; /** orientation=lt */ ';
- text-align: left ~'; /** orientation=rt */ ';
- margin-right: 390px ~'; /** orientation=lt */ ';
- margin-left: 390px ~'; /** orientation=rt */ ';
- .btn-group {
- float: right ~'; /** orientation=lt */ ';
- float: left ~'; /** orientation=rt */ ';
- padding-left: 15px ~'; /** orientation=lt */ ';
- padding-right: 15px ~'; /** orientation=rt */ ';
- .btn {
- background-color: black;
- border: none;
- padding-top: 6px;
- &:focus {
- outline: none!important;
- }
- .uiVerticalDots {
- color: @white;
- font-size: 20px;
- font-style: normal;
- font-weight: normal;
-
- &:before {
- font-family: 'PLF-FONT-ICONS';
- content: "\e79c" !important;
- }
- }
- }
-
- @media (max-width: 1024px) {
- .btn {
- top: 12px;
- right: 40px ~'; /** orientation=lt */ ';
- left: 40px ~'; /** orientation=rt */ ';
- position: fixed;
- }
- .dropdown-menu {
- top: 50px;
- left: 40% ~'; /** orientation=lt */ ';
- right: 40% ~'; /** orientation=rt */ ';
- position: fixed;
- width: fit-content;
- height: fit-content;
- }
- }
-
- @media (min-width: 1024px) {
- .dropdown-menu {
- left: -100px ~'; /** orientation=lt */ ';
- right: -100px ~'; /** orientation=rt */ ';
- }
- }
- .dropdown-menu {
- background: black;
- margin-bottom: 8px;
- }
- }
- .openBtn, .downloadBtn {
- padding: 8px 15px;
- display: flex;
- }
- .openDocBtn, .showComments {
- float: right ~'; /** orientation=lt */ ';
- float: left ~'; /** orientation=rt */ ';
- padding-left: 15px ~'; /** orientation=lt */ ';
- padding-right: 15px ~'; /** orientation=rt */ ';
- }
- .showComments {
- cursor: pointer;
- float: right ~'; /** orientation=lt */ ';
- float: left ~'; /** orientation=rt */ ';
- padding-left: 15px ~'; /** orientation=lt */ ';
- padding-right: 15px ~'; /** orientation=rt */ ';
- .hiddenComment:after {
- position: absolute;
- content: "/";
- color: @white;
- font-weight: 700;
- font-size: 1.7em;
- left: 4px ~'; /** orientation=lt */ ';
- right: 4px ~'; /** orientation=rt */ ';
- top: -8px;
- }
- }
- .breadCrumb {
- float: left ~'; /** orientation=lt */ ';
- float: right ~'; /** orientation=rt */ ';
- height: 30px;
- }
- .showComments {
- display: none;
- }
- a {
- text-overflow: ellipsis !important;
- max-width: 200px;
- width: min-content;
- display: inline-block;
- overflow: hidden;
- white-space: nowrap;
- color: @btnPrimaryColor;
- &:hover i, &:active i, &.active i, {
- color: @colorIconSecondary;
- }
- }
- .ellipsis-reverse-apply {
- direction: unset !important;
- display: contents !important;
- }
- .ellipsis-reverse-apply-content {
- margin-top: 6px !important;
- }
- }
- }
-}
-
-.fileContent .navigationContainer {
- .content {
- height: 100%;
- }
- .document-preview-default {
- height: 100%;
- }
-}
-
-.toolbar .actionIcon.disabled {
- .opacity(50);
- &:hover {
- background: none;
- border: 1px solid transparent;
- box-shadow: none;
- cursor: unset;
- i {
- color: @colorIconDefault;
- }
- }
- &:focus {
- background-color: inherit;
- outline: none;
- border-color: transparent;
- box-shadow: none;
- }
-}
-
-
-.outerCenter .actionIcon {
- text-align: center;
- margin: 0 2px;
-}
-.exit-document-preview {
- display: none;
-}
-
-@media (max-width: 767px) {
- .maskLayer {
- .uiDocumentPreview {
- #documentPreviewContent {
- .EmptyDocumentPreview > .message {
- .content {
- white-space: normal;
- }
- }
- }
- .commentArea {
- height: ~"calc(100vh - 100px)";
- max-height: ~"calc(100vh - 100px)";
- overflow-y: auto;
-
- &.commentBoxOpen {
- height: ~"calc(100vh - 225px)";
- max-height: ~"calc(100vh - 225px)";
- }
- .uiContentBox {
- .parentCommentBlock {
- box-sizing: border-box;
- width: 100%;
- background: #f0f0f0;
- text-align: center;
-
- &.fixedBlock {
- width: ~"calc(100vw - 20px)";
- position: fixed;
- bottom: 5px;
- left: 10px ~'; /** orientation=lt */ ';
- right: 10px ~'; /** orientation=rt */ ';
- }
- }
-
- .commentInputBox {
- .box-shadow(0 0 5px 0 rgba(0,0,0,0.3));
- border-top: solid 1px #ccc;
- position: fixed;
- bottom: 0;
- left: 0 ~'; /** orientation=lt */ ';
- right: 0 ~'; /** orientation=rt */ ';
- background-color: #f0f0f0;
- padding: 0 0 5px 0;
- width: 100%;
- z-index: 1000;
- height: 158px !important;
-
- &.subCommentBlock {
- padding-left: 0 ~'!important; /** orientation=lt */ ';
- padding-right: 0 ~'!important; /** orientation=rt */ ';
- }
-
- > div {
- padding: 10px;
- }
-
- .avatarXSmall {
- display: none;
- &+ .commentBox{
- margin-left: 0px ~'; /** orientation=lt */ ';
- padding-left: 10px ~'; /** orientation=lt */ ';
- margin-right: 0px ~'; /** orientation=rt */ ';
- padding-right: 10px ~'; /** orientation=rt */ ';
- }
- }
- }
- .comments {
- .commentList {
- overflow: hidden !important;
- height: auto !important;
- max-height: none !important;
- }
- }
- }
- }
- }
- }
-}
-
-@media(max-width: 1024px) {
-
- .document-preview-default {
- .dowload-link {
- display: none;
- }
- }
-
- .uiDocumentPreview {
- .fileName {
- bottom: 30px;
- }
- .hidden-title {
- display: block !important;
- position: fixed;
- bottom: 30px;
- }
- .previewBtn {
- position: absolute;
-
- .showComments {
- display: block !important;
- top: 18px;
- right: 100px ~'; /** orientation=lt */ ';
- left: 100px ~'; /** orientation=rt */ ';
- position: fixed;
- .uiIconComment {
- font-size: 20px!important;
- }
- }
- .breadCrumb {
- display: none;
- }
- }
- }
-
- .maskLayer .uiDocumentPreview {
- #documentPreviewContent, .uiPreviewWebContent, .previewBtn {
- margin-right: 0 ~'; /** orientation=lt */ ';
- margin-right: 0 ~'; /** orientation=rt */ ';
- }
- #documentPreviewContent {
- padding-top: 20px!important;
- }
- .commentArea, .resizeButton {
- display: none;
- width: 100%;
- }
- .commentArea {
- .title {
- .docTitle {
- border-right: none ~'!important; /** orientation=lt */ ';
- border-left: none ~'!important; /** orientation=rt */ ';
- }
- .closeIcon {
- display: none!important;
- }
- }
- .uiContentBox {
- .actionBar{
- display: none;
- }
- .highlightBox {
- display: none;
- }
- .commentInputBox {
- #CancelButton {
- display: block;
- }
- }
- }
- }
- }
-
- .maskLayer .uiDocumentPreview.collapsed {
- #documentPreviewContent, .uiPreviewWebContent, .previewBtn {
- margin-right: 0 ~'; /** orientation=lt */ ';
- margin-right: 0 ~'; /** orientation=rt */ ';
- }
- .commentArea {
- display: none;
- width: 100%;
- }
- }
-
- .maskLayer .uiDocumentPreview .fileContent .navigationContainer img,
- .maskLayer .uiDocumentPreview .fileContent .navigationContainer object {
- top: 34px;
- .translate(-50%, 0px);
- }
-
- .maskLayer .uiDocumentPreview .fileContent {
- margin: auto;
- background: white;
- border-radius: 5px;
- }
-
- .maskLayer .uiDocumentPreview {
- padding-left: 20px;
- padding-right: 20px;
- }
-
- #documentPreviewContainer {
- .uiIconResize {
- display: none !important;
- }
- .secondaryToolbar .dropdown-menu li > a:focus > [class^="uiIcon"] {
- background: none;
- }
- .PopupContent {
- height: 100% !important;
- margin-bottom: 0px !important;
- margin-top: 0px !important;
- max-height: none !important;
- padding: 0 !important;
- width: 100%;
- overflow: visible;
- position: absolute !important;
- top: 50px !important; //1.2
- background: none;
- }
- #toolbarContainer {
- .outerCenter {
- display: none;
- }
- }
- .secondaryToolbar {
- top: 42px; //1.2
- }
- #sidebarContainer {
- top: 38px; //1.2
- }
- #sidebarContent {
- background: rgba(240, 240, 240, 0.8);
- border: none;
- //top: 38px;
- width: 132px;
- }
- #toolbarSidebar {
- background: rgba(240, 240, 240, 0.8);
- border: none;
- height: auto;
- width: 132px;
- #viewThumbnail {
- margin-left: 7px ~'; /** orientation=lt */ ';
- margin-right: 7px ~'; /** orientation=rt */ ';
- }
- }
- #toolbarViewer {
- height: 38px; //1.2
- #toolbarViewerLeft {
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- text-align: center;
- width: 60%;
-
- }
- #toolbarViewerRight {
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- width: 40%;
- text-align: right ~'; /** orientation=lt */ ';
- text-align: left ~'; /** orientation=rt */ ';
- & > a {
- float: none;
- }
- }
- }
-
- #outerContainer {
- background: white;
- min-width: 100px;
- }
- #viewerContainer {
- background: white;
- }
- .popupHeader, .maskLayer .uiDocumentPreview .resizeButton {
- display: none;
- }
- }
-
- .maskLayer {
- .fileContent .navigationContainer {
- background: none !important;
- }
- .uiDocumentPreview {
- padding-top: 50px;
-
- .exitWindow .uiIconClose {
- //left: 15px;
- right: 18px ~'; /** orientation=lt */ ';
- left: 18px ~'; /** orientation=rt */ ';
- color: @white;
- cursor: pointer;
- z-index: 10009 !important;
- top: 20px !important;
- position: fixed !important;
- .opacity(100);
- &:before {
- //content: "\e74f";
- font-size: 20px;
- }
- &:hover {
- color: @colorIconPrimary;
- &:before {
- color: @colorIconPrimary;
- }
- }
- }
- }
- }
-
- .uiDocumentPreview {
- #outerContainer.sidebarOpen > #mainContainer {
- left: 0 ~'; /** orientation=lt */ ';
- right: 0 ~'; /** orientation=rt */ ';
- }
- #outerContainer.sidebarOpen > #sidebarContainer {
- left: 0 ~'; /** orientation=lt */ ';
- right: 0 ~'; /** orientation=rt */ ';
- }
- #sidebarContainer {
- z-index: 100;
- }
- .doorHanger:after, .doorHanger:before {
- margin-left: 5px ~'; /** orientation=lt */ ';
- margin-right: 5px ~'; /** orientation=rt */ ';
- }
- .doorHanger:after {
- left: 14px ~'; /** orientation=lt */ ';
- right: 14px ~'; /** orientation=rt */ ';
- }
- }
-
- .uiDocumentPreview, .document-preview-default, .document-preview-content-file {
- .uiContentBox {
- background: white;
- }
- .previewBtn {
- margin-right: 0px ~'; /** orientation=lt */ ';
- margin-right: 0px ~'; /** orientation=rt */ ';
- }
- }
-}
-//end 1024
-@media (min-width: 768px) and (max-width: 1024px) {
- .maskLayer .uiDocumentPreview {
- padding-left: 10px;
- padding-right: 10px;
-
- .findbar {
- left: 40px ~'; /** orientation=lt */ ';
- right: 40px ~'; /** orientation=rt */ ';
- }
- .previewBtn {
- position: absolute;
- .breadCrumb {
- display: none;
- }
- }
-
- }
-}
-
-@media (min-width: 320px) and (max-width: 549px) {
- .maskLayer .uiDocumentPreview {
- #documentPreviewContent #NavCommands {
- > .arrowNext {
- right: 12px;
- }
- > .arrowPrevious{
- left: -6px;
- z-index: 9999;
- }
- }
- }
-}
-@media (min-width: 550px) and (max-width: 650px) {
- .maskLayer .uiDocumentPreview {
- #documentPreviewContent #NavCommands {
- > .arrowPrevious{
- left: 0px ~'; /** orientation=lt */ ';
- right: 0px ~'; /** orientation=rt */ ';
- z-index: 9999;
- }
- }
- }
-}
-
-@media (max-width: 480px) {
- #documentPreviewContainer {
- .uiDocumentPreview {
- padding-left: 10px;
- padding-right: 10px;
-
- .voteRatingInfo {
- display: none;
- }
-
- .previewBtn {
- margin-right: 0px ~'; /** orientation=lt */ ';
- margin-left: 0px ~'; /** orientation=rt */ ';
- font-size: 0;
- position: absolute;
- .breadCrumb {
- display: none;
- }
- }
-
- .fileInfo {
- font-size: 12px;
- }
- }
- }
-}
-
-.FileContent {
- color: #0e396c;
-}
-.FileContent .TopNavContent {
- background: #F8F8F8;
- border: 1px solid #E1E1E1;
-}
-.FileContent .TopTitle {
- color: #4F4F4F;
- font-weight: bold;
- height: 28px;
- line-height: 26px;
- padding-left: 10px;
- width:75%;
- overflow:hidden;
- float:left;
-}
-.FileContent .ActionButton{
- padding: 4px 0 !important;
-}
-.FileContent .ActionButton a{
- background: url("/eXoWCMResources/skin/images/file/DownloadFile.png") no-repeat scroll 4px center transparent;
- border-left: 1px solid #E1E1E1;
- color: #058EE6;
- line-height: 20px;
- padding: 3px 10px 3px 29px;
-}
-.FileContent .ActionTextButton a{
- border-left: 1px solid #E1E1E1;
- color: #058EE6;
- line-height: 20px;
- padding: 3px 10px 3px 2px;
-}
-.FileContent .ECMIframe {
- border: 1px solid #cbcbcb;
- height: 100%;
- overflow: auto;
- width: 93%;
- margin: 5px;
- background: white;
-}
-.FileContent .ECMIframe body {
- font-size: 13px;
-}
-.FileContent .Content {
- white-space: normal;
- padding: 20px 0;
-}
-.FileContent .Content .TextContent {
- overflow: auto;
- height: 100%;
- margin: auto;
- width: 89%;
- padding: 10px;
- border: 1px solid #b7b7b7;
-}
-.FileContent .Content .TextContent pre {
- white-space: normal;
-}
-.FileContent .ContentDetail {
- text-align: center;
- overflow: visible;
- padding: 15px 0px;
-}
-.FileContent p a {
- color: #058EE6;
- text-decoration: underline;
-}
-
-//hack safari document preview
-@media (max-width: 1024px) and (-webkit-min-device-pixel-ratio:0) {
- body #documentPreviewContainer { top: 0px !important;}
-}
diff --git a/apps/resources-wcm/src/main/webapp/skin/less/ecms/skin/ecms-resources-wcmskin.less b/apps/resources-wcm/src/main/webapp/skin/less/ecms/skin/ecms-resources-wcmskin.less
index 12942010847..7d0bf57b828 100644
--- a/apps/resources-wcm/src/main/webapp/skin/less/ecms/skin/ecms-resources-wcmskin.less
+++ b/apps/resources-wcm/src/main/webapp/skin/less/ecms/skin/ecms-resources-wcmskin.less
@@ -1,6 +1,5 @@
@import "../../variables.less";
@import "../../mixins.less";
-@import "UIDocumentPreview/Style.less";
@import "UISelectImage/Style.less";
@import "jqueryui/Style.less";
diff --git a/core/connector/pom.xml b/core/connector/pom.xml
index 0220b00805d..7d8d8ac620b 100644
--- a/core/connector/pom.xml
+++ b/core/connector/pom.xml
@@ -5,7 +5,7 @@
ecms-core
org.exoplatform.ecms
- 7.1.x-SNAPSHOT
+ 7.1.x-meeds-qaui-SNAPSHOT
ecms-core-connector
jar
diff --git a/core/core-configuration/pom.xml b/core/core-configuration/pom.xml
index 9646c578ce7..9ec56abaf73 100644
--- a/core/core-configuration/pom.xml
+++ b/core/core-configuration/pom.xml
@@ -4,7 +4,7 @@
ecms-core
org.exoplatform.ecms
- 7.1.x-SNAPSHOT
+ 7.1.x-meeds-qaui-SNAPSHOT
ecms-core-webapp
war
diff --git a/core/pom.xml b/core/pom.xml
index 0ceeb0f2c80..acd72daf214 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -4,7 +4,7 @@
ecms
org.exoplatform.ecms
- 7.1.x-SNAPSHOT
+ 7.1.x-meeds-qaui-SNAPSHOT
ecms-core
pom
diff --git a/core/search/pom.xml b/core/search/pom.xml
index 56cfa9812bb..7dbfe2509d9 100644
--- a/core/search/pom.xml
+++ b/core/search/pom.xml
@@ -4,7 +4,7 @@
ecms-core
org.exoplatform.ecms
- 7.1.x-SNAPSHOT
+ 7.1.x-meeds-qaui-SNAPSHOT
ecms-core-search
eXo PLF:: WCM Search Service
diff --git a/core/services/pom.xml b/core/services/pom.xml
index 6f854eb1049..bcec2a716fc 100644
--- a/core/services/pom.xml
+++ b/core/services/pom.xml
@@ -4,7 +4,7 @@
ecms-core
org.exoplatform.ecms
- 7.1.x-SNAPSHOT
+ 7.1.x-meeds-qaui-SNAPSHOT
ecms-core-services
eXo PLF:: CMS Service
diff --git a/core/services/src/main/java/org/exoplatform/services/wcm/utils/Utils.java b/core/services/src/main/java/org/exoplatform/services/wcm/utils/Utils.java
index 240d3e41534..adbdfc74c0d 100644
--- a/core/services/src/main/java/org/exoplatform/services/wcm/utils/Utils.java
+++ b/core/services/src/main/java/org/exoplatform/services/wcm/utils/Utils.java
@@ -321,8 +321,6 @@ public class Utils {
final static public String UPLOAD_SIZE_LIMIT_MB = "uploadFileSizeLimitMB";
- final static public String FILE_VIEWER_EXTENSION_TYPE = "org.exoplatform.ecm.dms.FileViewer";
-
final static public String MIME_TYPE = "mimeType";
final static public String REQUESTCONTEXT = "requestcontext";
diff --git a/core/services/src/test/resources/conf/standalone/ecms-core-service-test-configuration.xml b/core/services/src/test/resources/conf/standalone/ecms-core-service-test-configuration.xml
index cdba8513062..87f061fb442 100644
--- a/core/services/src/test/resources/conf/standalone/ecms-core-service-test-configuration.xml
+++ b/core/services/src/test/resources/conf/standalone/ecms-core-service-test-configuration.xml
@@ -107,11 +107,6 @@
-
- org.exoplatform.webui.ext.UIExtensionManager
- org.exoplatform.webui.ext.impl.UIExtensionManagerImpl
-
-
org.gatein.api.Portal
org.exoplatform.services.cms.documents.mock.PortalMock
diff --git a/core/services/src/test/resources/conf/standalone/test-configuration.xml b/core/services/src/test/resources/conf/standalone/test-configuration.xml
index 68dfbbf1eee..ce86184b44d 100644
--- a/core/services/src/test/resources/conf/standalone/test-configuration.xml
+++ b/core/services/src/test/resources/conf/standalone/test-configuration.xml
@@ -15,11 +15,6 @@
org.exoplatform.groovyscript.text.TemplateService
-
-
- org.exoplatform.webui.ext.UIExtensionManager
- org.exoplatform.webui.ext.impl.UIExtensionManagerImpl
-
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator
diff --git a/core/viewer/pom.xml b/core/viewer/pom.xml
index ae90d63a72e..249f00151b6 100644
--- a/core/viewer/pom.xml
+++ b/core/viewer/pom.xml
@@ -4,7 +4,7 @@
ecms-core
org.exoplatform.ecms
- 7.1.x-SNAPSHOT
+ 7.1.x-meeds-qaui-SNAPSHOT
ecms-core-viewer
eXo PLF:: DMS Document Viewer
diff --git a/core/viewer/src/main/java/org/exoplatform/ecm/webui/filters/AbstractCloudDriveNodeFilter.java b/core/viewer/src/main/java/org/exoplatform/ecm/webui/filters/AbstractCloudDriveNodeFilter.java
deleted file mode 100644
index 6821e68c6be..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/ecm/webui/filters/AbstractCloudDriveNodeFilter.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (C) 2003-2018 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.ecm.webui.filters;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import javax.jcr.AccessDeniedException;
-import javax.jcr.ItemNotFoundException;
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.exoplatform.portal.application.PortalRequestContext;
-import org.exoplatform.services.cms.clouddrives.CloudProvider;
-import org.exoplatform.services.jcr.RepositoryService;
-import org.exoplatform.services.jcr.ext.common.SessionProvider;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.services.wcm.utils.WCMCoreUtils;
-//import org.exoplatform.social.webui.activity.UIActivitiesContainer;
-//import org.exoplatform.social.webui.composer.PopupContainer;
-import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.webui.core.UIApplication;
-import org.exoplatform.webui.ext.filter.UIExtensionFilter;
-import org.exoplatform.webui.ext.filter.UIExtensionFilterType;
-
-/**
- * Filter for cloud files.
- *
- * @author Peter Nedonosko
- * @version $Id: CloudDriveFiler.java 00000 Nov 5, 2012 pnedonosko $
- */
-public abstract class AbstractCloudDriveNodeFilter implements UIExtensionFilter {
-
- protected static final Log LOG = ExoLogger.getLogger(AbstractCloudDriveNodeFilter.class);
-
- /** The Constant CONTENTVIEWER_REST_PATH. */
- protected static final String CONTENTVIEWER_REST_PATH = "/contentviewer/";
-
- /** The constant UIJCREXPLORER_CONTEXT_NODE. */
- public static final String UIJCREXPLORER_CONTEXT_NODE = "UIJCRExplorer.contextNode";
-
- /** The min size. */
- protected long minSize;
-
- /** The max size. */
- protected long maxSize;
-
- /** The providers. */
- protected List providers;
-
- /**
- * Instantiates a new abstract cloud drive node filter.
- */
- public AbstractCloudDriveNodeFilter() {
- this(Collections. emptyList());
- }
-
- /**
- * Instantiates a new abstract cloud drive node filter.
- *
- * @param providers the providers
- */
- public AbstractCloudDriveNodeFilter(List providers) {
- this(providers, 0, Long.MAX_VALUE);
- }
-
- /**
- * Instantiates a new abstract cloud drive node filter.
- *
- * @param minSize the min size
- * @param maxSize the max size
- */
- public AbstractCloudDriveNodeFilter(long minSize, long maxSize) {
- this(Collections. emptyList(), minSize, maxSize);
- }
-
- /**
- * Instantiates a new abstract cloud drive node filter.
- *
- * @param providers the providers
- * @param minSize the min size
- * @param maxSize the max size
- */
- public AbstractCloudDriveNodeFilter(List providers, long minSize, long maxSize) {
- this.providers = providers;
- this.minSize = minSize >= 0 ? minSize : 0;
- this.maxSize = maxSize;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean accept(Map context) throws Exception {
- if (context == null) {
- return true;
- } else {
- boolean accepted = false;
- Node contextNode = (Node) context.get(Node.class.getName());
- if (contextNode == null) {
- WebuiRequestContext reqContext = WebuiRequestContext.getCurrentInstance();
- contextNode = (Node) reqContext.getAttribute(UIJCREXPLORER_CONTEXT_NODE);
- // case of file preview in Social activity stream
- if (contextNode == null) {
- contextNode = (Node) reqContext.getAttribute("UIDocumentPreviewNode");
- }
- // case of ContentViewerRESTService (actual for PLF 4.4 and PLF 5.0)
- if (contextNode == null && PortalRequestContext.class.isAssignableFrom(reqContext.getClass())) {
- try {
- PortalRequestContext portalReqContext = PortalRequestContext.class.cast(reqContext);
- String reqPathInfo = portalReqContext.getControllerContext().getRequest().getPathInfo();
- if (reqPathInfo.startsWith(CONTENTVIEWER_REST_PATH)) {
- // It's string of content like:
- // /contentviewer/repository/collaboration/4e6a36fcc0a8016529a3148700beecec
- String[] reqParams = reqPathInfo.substring(CONTENTVIEWER_REST_PATH.length()).split("/");
- if (reqParams.length >= 3) {
- String repository = reqParams[0];
- String workspace = reqParams[1];
- String uuid = reqParams[2];
- RepositoryService repositoryService = WCMCoreUtils.getService(RepositoryService.class);
- SessionProvider sp = WCMCoreUtils.getUserSessionProvider();
- contextNode = sp.getSession(workspace, repositoryService.getRepository(repository)).getNodeByUUID(uuid);
- }
- }
- } catch (AccessDeniedException e) {
- // no access for current user
- } catch (ItemNotFoundException e) {
- // such item not found
- } catch (Throwable e) {
- // ignore and assume we don't have a context node
- if (LOG.isDebugEnabled()) {
- LOG.debug("Cannot find context node in the request: " + e.getMessage());
- }
- }
- }
- }
-
- if (contextNode != null) {
- accepted = accept(contextNode);
- }
- return accepted;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public UIExtensionFilterType getType() {
- return UIExtensionFilterType.MANDATORY;
- }
-
- /**
- * {@inheritDoc}
- */
- public void onDeny(Map context) throws Exception {
- }
-
- // ****************** internals ******************
-
- /**
- * Accept provider.
- *
- * @param provider the provider
- * @return true, if successful
- */
- protected boolean acceptProvider(CloudProvider provider) {
- if (providers.size() > 0) {
- boolean accepted = providers.contains(provider.getId());
- if (accepted) {
- return true;
- } else {
- // TODO compare by class inheritance
- return false;
- }
- } else {
- return true;
- }
- }
-
- /**
- * Accept.
- *
- * @param node the node
- * @return true, if successful
- * @throws RepositoryException the repository exception
- */
- protected abstract boolean accept(Node node) throws RepositoryException;
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/ecm/webui/filters/CloudFileFilter.java b/core/viewer/src/main/java/org/exoplatform/ecm/webui/filters/CloudFileFilter.java
deleted file mode 100644
index fe46c0725c9..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/ecm/webui/filters/CloudFileFilter.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2003-2016 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.ecm.webui.filters;
-
-import java.util.List;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.exoplatform.services.cms.clouddrives.CloudDrive;
-import org.exoplatform.services.cms.clouddrives.CloudDriveService;
-import org.exoplatform.services.cms.clouddrives.CloudFile;
-import org.exoplatform.services.cms.clouddrives.DriveRemovedException;
-import org.exoplatform.services.cms.clouddrives.NotCloudDriveException;
-import org.exoplatform.services.cms.clouddrives.NotCloudFileException;
-import org.exoplatform.services.cms.clouddrives.NotYetCloudFileException;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.services.wcm.utils.WCMCoreUtils;
-import org.exoplatform.webui.application.WebuiRequestContext;
-
-/**
- * Filter for cloud files.
- *
- * @author Peter Nedonosko
- * @version $Id: CloudFileFilter.java 00000 Nov 5, 2012 pnedonosko $
- */
-public class CloudFileFilter extends AbstractCloudDriveNodeFilter {
-
- /** The Constant LOG. */
- protected static final Log LOG = ExoLogger.getLogger(CloudFileFilter.class);
-
- /**
- * Instantiates a new cloud file filter.
- */
- public CloudFileFilter() {
- super();
- }
-
- /**
- * Instantiates a new cloud file filter.
- *
- * @param providers the providers
- */
- public CloudFileFilter(List providers) {
- super(providers);
- }
-
- /**
- * Instantiates a new cloud file filter.
- *
- * @param providers the providers
- * @param minSize the min size
- * @param maxSize the max size
- */
- public CloudFileFilter(List providers, long minSize, long maxSize) {
- super(providers, minSize, maxSize);
- }
-
- /**
- * Instantiates a new cloud file filter.
- *
- * @param minSize the min size
- * @param maxSize the max size
- */
- public CloudFileFilter(long minSize, long maxSize) {
- super(minSize, maxSize);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean accept(Node node) throws RepositoryException {
- if (node != null) {
- CloudDriveService driveService = WCMCoreUtils.getService(CloudDriveService.class);
- CloudDrive drive = driveService.findDrive(node);
- if (drive != null) {
- try {
- if (acceptProvider(drive.getUser().getProvider())) {
- CloudFile file = drive.getFile(node.getPath());
- long size = file.getSize();
- if (size >= minSize && size <= maxSize) {
- // attribute used in CloudFile viewer(s)
- WebuiRequestContext rcontext = WebuiRequestContext.getCurrentInstance();
- rcontext.setAttribute(CloudDrive.class, drive);
- rcontext.setAttribute(CloudFile.class, file);
- return true;
- }
- }
- } catch (DriveRemovedException e) {
- // doesn't accept
- } catch (NotYetCloudFileException e) {
- // doesn't accept
- } catch (NotCloudFileException e) {
- // doesn't accept
- } catch (NotCloudDriveException e) {
- // doesn't accept
- }
- }
- }
- return false;
- }
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/AbstractCloudFileViewer.java b/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/AbstractCloudFileViewer.java
deleted file mode 100644
index 80f755c3795..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/AbstractCloudFileViewer.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (C) 2003-2016 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.ecm.webui.viewer;
-
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import javax.ws.rs.core.MediaType;
-
-import org.exoplatform.ecm.webui.clouddrives.CloudDriveContext;
-import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.services.cms.clouddrives.CloudDrive;
-import org.exoplatform.services.cms.clouddrives.CloudFile;
-import org.exoplatform.services.resources.ResourceBundleService;
-import org.exoplatform.services.wcm.utils.WCMCoreUtils;
-import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.webui.ext.manager.UIAbstractManager;
-import org.exoplatform.webui.ext.manager.UIAbstractManagerComponent;
-
-/**
- * Base class for Cloud Drive file viewers.
- */
-public abstract class AbstractCloudFileViewer extends UIAbstractManagerComponent implements CloudFileViewer {
-
- /** The drive. */
- protected CloudDrive drive;
-
- /** The file. */
- protected CloudFile file;
-
- /** The viewable max size. */
- protected final long viewableMaxSize;
-
- /**
- * Instantiates a new abstract file viewer.
- *
- * @param viewableMaxSize the viewable max size
- */
- protected AbstractCloudFileViewer(long viewableMaxSize) {
- this.viewableMaxSize = viewableMaxSize;
- }
-
- /**
- * Instantiates a new abstract file viewer.
- */
- protected AbstractCloudFileViewer() {
- this(Long.MAX_VALUE);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void processRender(WebuiRequestContext context) throws Exception {
- CloudDriveContext.init(this);
-
- Object obj = context.getAttribute(CloudDrive.class);
- if (obj != null) {
- CloudDrive drive = (CloudDrive) obj;
- obj = context.getAttribute(CloudFile.class);
- if (obj != null) {
- initFile(drive, (CloudFile) obj);
- }
- }
-
- super.processRender(context);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void initFile(CloudDrive drive, CloudFile file) {
- this.drive = drive;
- this.file = file;
- }
-
- /**
- * Gets the drive.
- *
- * @return the drive
- */
- public CloudDrive getDrive() {
- return drive;
- }
-
- /**
- * Gets the file.
- *
- * @return the file
- */
- public CloudFile getFile() {
- return file;
- }
-
- /**
- * Checks if is viewable.
- *
- * @return true, if is viewable
- */
- public boolean isViewable() {
- String mimeType = file.getType();
- return file.getSize() <= viewableMaxSize && !mimeType.startsWith(MediaType.APPLICATION_OCTET_STREAM);
- }
-
- /**
- * Gets the resource bundle.
- *
- * @param key the key
- * @return the resource bundle
- */
- public String appRes(String key) {
- Locale locale = Util.getPortalRequestContext().getLocale();
- ResourceBundleService resourceBundleService = WCMCoreUtils.getService(ResourceBundleService.class);
- ResourceBundle resourceBundle = resourceBundleService.getResourceBundle(
- new String[] { "locale.clouddrive.CloudDrive",
- "locale.ecm.views" },
- locale,
- this.getClass().getClassLoader());
- return resourceBundle.getString(key);
- }
-
- @Override
- public Class extends UIAbstractManager> getUIAbstractManagerClass() {
- return null;
- }
-
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/CloudFileViewer.java b/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/CloudFileViewer.java
deleted file mode 100644
index 053b2c03ce8..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/CloudFileViewer.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2003-2016 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.ecm.webui.viewer;
-
-import org.exoplatform.services.cms.clouddrives.CloudDrive;
-import org.exoplatform.services.cms.clouddrives.CloudFile;
-
-/**
- * Support for file viewers to show Cloud Drive files preview embedded in ECMS
- * Documents.
- * Created by The eXo Platform SAS.
- *
- * @author Peter Nedonosko
- * @version $Id: CloudFileViewer.java 00000 Nov 18, 2014 pnedonosko $
- */
-public interface CloudFileViewer {
-
- /**
- * Initialize UI component to represent the given cloud file.
- *
- * @param drive {@link CloudDrive}
- * @param file {@link CloudFile}
- * @throws Exception the exception
- */
- void initFile(CloudDrive drive, CloudFile file) throws Exception;
-
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/DefaultCloudFileViewer.java b/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/DefaultCloudFileViewer.java
deleted file mode 100644
index 11dfe3f00e3..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/DefaultCloudFileViewer.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2003-2016 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.ecm.webui.viewer;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.exoplatform.ecm.webui.clouddrives.CloudDriveContext;
-import org.exoplatform.ecm.webui.filters.CloudFileFilter;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.web.application.Parameter;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.ext.filter.UIExtensionFilter;
-import org.exoplatform.webui.ext.filter.UIExtensionFilters;
-import org.exoplatform.webui.ext.manager.UIAbstractManager;
-
-/**
- * Default WebUI component for Cloud Drive files. It shows content of remote
- * file by its URL in iframe on file page in eXo Documents.
- * Created by The eXo Platform SAS.
- *
- * @author Peter Nedonosko
- * @version $Id: DefaultFileViewer.java 00000 Nov 1, 2012 pnedonosko $
- */
-@ComponentConfig(template = "classpath:resources/templates/DefaultCloudFileViewer.gtmpl")
-public class DefaultCloudFileViewer extends AbstractCloudFileViewer {
-
- /** The Constant LOG. */
- protected static final Log LOG = ExoLogger.getLogger(DefaultCloudFileViewer.class);
-
- /** The Constant EVENT_NAME. */
- public static final String EVENT_NAME = "ShowCloudFile";
-
- /** The Constant FILTERS. */
- protected static final List FILTERS = Arrays.asList(new UIExtensionFilter[] { new CloudFileFilter() });
-
- /**
- * Instantiates a new default file viewer.
- */
- public DefaultCloudFileViewer() {
- }
-
- /**
- * Instantiates a new default file viewer.
- *
- * @param viewableMaxSize the viewable max size
- */
- protected DefaultCloudFileViewer(long viewableMaxSize) {
- super(viewableMaxSize);
- }
-
- /**
- * Gets the filters.
- *
- * @return the filters
- */
- @UIExtensionFilters
- public List getFilters() {
- return FILTERS;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String renderEventURL(boolean ajax, String name, String beanId, Parameter[] params) throws Exception {
- if (EVENT_NAME.equals(name)) {
- CloudDriveContext.init(this);
- return "javascript:void(0);//objectId";
- }
- return super.renderEventURL(ajax, name, beanId, params);
- }
-
- @Override
- public Class extends UIAbstractManager> getUIAbstractManagerClass() {
- return null;
- }
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/FlashViewer.java b/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/FlashViewer.java
deleted file mode 100644
index d7ff1276867..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/FlashViewer.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2003-2008 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see .
- */
-package org.exoplatform.ecm.webui.viewer;
-
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.core.UIComponent;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Dang Van Minh
- * minh.dang@exoplatform.com
- * Aug 18, 2009
- * 3:49:41 AM
- */
-@ComponentConfig(
- template = "classpath:resources/templates/FlashViewer.gtmpl"
-)
-public class FlashViewer extends UIComponent {
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/HTML5VideoViewer.java b/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/HTML5VideoViewer.java
deleted file mode 100644
index 076ab4ee998..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/HTML5VideoViewer.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2003-2008 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see .
- */
-package org.exoplatform.ecm.webui.viewer;
-
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.core.UIComponent;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Dang Van Minh
- * minh.dang@exoplatform.com
- * Aug 18, 2009
- * 3:49:41 AM
- */
-@ComponentConfig(
- template = "classpath:resources/templates/HTML5VideoViewer.gtmpl"
-)
-public class HTML5VideoViewer extends UIComponent {
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/ImageViewer.java b/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/ImageViewer.java
deleted file mode 100644
index 77959414c02..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/ImageViewer.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2003-2008 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see .
- */
-package org.exoplatform.ecm.webui.viewer;
-
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.core.UIComponent;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Dang Van Minh
- * minh.dang@exoplatform.com
- * Aug 18, 2009
- * 3:49:41 AM
- */
-@ComponentConfig(
- template = "classpath:resources/templates/ImageViewer.gtmpl"
-)
-public class ImageViewer extends UIComponent {
-
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/MpegVideoViewer.java b/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/MpegVideoViewer.java
deleted file mode 100644
index 3559771d0d1..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/MpegVideoViewer.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2003-2008 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see .
- */
-package org.exoplatform.ecm.webui.viewer;
-
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.core.UIComponent;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Dang Van Minh
- * minh.dang@exoplatform.com
- * Aug 18, 2009
- * 3:49:41 AM
- */
-@ComponentConfig(
- template = "classpath:resources/templates/MpegVideoViewer.gtmpl"
-)
-public class MpegVideoViewer extends UIComponent {
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/PDFViewer.java b/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/PDFViewer.java
deleted file mode 100644
index 79a268589bd..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/PDFViewer.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- * Copyright (C) 2003-2008 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see .
- */
-package org.exoplatform.ecm.webui.viewer;
-
-import org.exoplatform.download.DownloadService;
-import org.exoplatform.download.InputStreamDownloadResource;
-import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.portal.webui.workspace.UIPortalApplication;
-import org.exoplatform.services.cms.mimetype.DMSMimeTypeResolver;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.services.pdfviewer.PDFViewerService;
-import org.exoplatform.services.resources.ResourceBundleService;
-import org.exoplatform.services.wcm.utils.WCMCoreUtils;
-import org.exoplatform.web.application.RequireJS;
-import org.exoplatform.webui.application.portlet.PortletRequestContext;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.UIComponent;
-import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
-import org.exoplatform.webui.core.model.SelectItemOption;
-import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.Event.Phase;
-import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.form.UIForm;
-import org.exoplatform.webui.form.UIFormSelectBox;
-import org.exoplatform.webui.form.UIFormStringInput;
-import org.icepdf.core.pobjects.Document;
-import org.icepdf.core.pobjects.PInfo;
-
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.RepositoryException;
-import javax.portlet.PortletRequest;
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Dang Van Minh
- * minh.dang@exoplatform.com
- * Aug 18, 2009
- * 3:49:41 AM
- */
-@ComponentConfig(
- lifecycle = UIFormLifecycle.class,
- template = "classpath:resources/templates/PDFJSViewer.gtmpl",
- events = {
- @EventConfig(listeners = PDFViewer.NextPageActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.PreviousPageActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.GotoPageActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.RotateRightPageActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.RotateLeftPageActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.ScalePageActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.DownloadFileActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.ZoomInPageActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.ZoomOutPageActionListener.class, phase = Phase.DECODE)
- }
-)
-/**
- * PDF Viewer component which will be used to display PDF file on web browser
- */
-public class PDFViewer extends UIForm {
-
- private static final Log LOG = ExoLogger.getExoLogger(PDFViewer.class);
-
- final static private String PAGE_NUMBER = "pageNumber";
- final static private String SCALE_PAGE = "scalePage";
- final private String localeFile = "locale.portlet.viewer.PDFViewer";
- private String sharedResourcesBundleNames[];
- private ResourceBundle sharedResourceBundle=null;
- private static final int MIN_IE_SUPPORTED_BROWSER_VERSION = 9;
- private static final int MIN_FF_SUPPORTED_BROWSER_VERSION = 20;
- private static final int MIN_CHROME_SUPPORTED_BROWSER_VERSION = 20;
-
- private int currentPageNumber_ = 1;
- private int maximumOfPage_ = 0;
- private float currentRotation_ = 0.0f;
- private float currentScale_ = 1.0f;
- private Map metadatas = new HashMap();
-
- public PDFViewer() throws Exception {
- addUIFormInput(new UIFormStringInput(PAGE_NUMBER, PAGE_NUMBER, "1"));
- UIFormSelectBox uiScaleBox = new UIFormSelectBox(SCALE_PAGE, SCALE_PAGE, initScaleOptions());
- uiScaleBox.setOnChange("ScalePage");
- addUIFormInput(uiScaleBox);
- uiScaleBox.setValue("1.0f");
- }
-
- public Method getMethod(UIComponent uiComponent, String name) throws NoSuchMethodException {
- return uiComponent.getClass().getMethod(name, new Class[0]);
- }
-
- public void initDatas() throws Exception {
- UIComponent uiParent = getParent();
-
- Method method = getMethod(uiParent, "getOriginalNode");
- Node originalNode = null;
- if(method != null) originalNode = (Node) method.invoke(uiParent, (Object[]) null);
-
- if(originalNode != null) {
- Document document = getDocument(originalNode);
- if (document != null) {
- maximumOfPage_ = document.getNumberOfPages();
- metadatas.clear();
- putDocumentInfo(document.getInfo());
- document.dispose();
- } else maximumOfPage_ = -1;
- }
- }
-
- public Map getMetadataExtraction() { return metadatas; }
-
- public int getMaximumOfPage() throws Exception {
- if(maximumOfPage_ == 0) {
- initDatas();
- }
- return maximumOfPage_;
- }
-
- public float getCurrentRotation() { return currentRotation_; }
-
- public void setRotation(float rotation) { currentRotation_ = rotation; }
-
- public float getCurrentScale() { return currentScale_; }
-
- public void setScale(float scale) { currentScale_ = scale; }
-
- public int getPageNumber() { return currentPageNumber_; }
-
- public void setPageNumber(int pageNum) { currentPageNumber_ = pageNum; };
-
- public String getResourceBundle(String key) {
- try {
- Locale locale = Util.getPortalRequestContext().getLocale();
- ResourceBundleService resourceBundleService = WCMCoreUtils.getService(ResourceBundleService.class);
- ResourceBundle resourceBundle = resourceBundleService.getResourceBundle(localeFile, locale, this.getClass().getClassLoader());
-
- return resourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- public String getResource(String key) {
- try {
- Locale locale = Util.getPortalRequestContext().getLocale();
- ResourceBundleService resourceBundleService = WCMCoreUtils.getService(ResourceBundleService.class);
- sharedResourcesBundleNames = resourceBundleService.getSharedResourceBundleNames();
- sharedResourceBundle = resourceBundleService.getResourceBundle(sharedResourcesBundleNames, locale);
-
- return sharedResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- private Document getDocument(Node node) throws RepositoryException, Exception {
- PDFViewerService pdfViewerService = getApplicationComponent(PDFViewerService.class);
- String repository = (String) getMethod(this.getParent(), "getRepository").invoke(this.getParent(), (Object[]) null);
- return pdfViewerService.initDocument(node, repository);
- }
-
- private void putDocumentInfo(PInfo documentInfo) {
- if (documentInfo != null) {
- if(documentInfo.getTitle() != null && documentInfo.getTitle().length() > 0) {
- metadatas.put("title", documentInfo.getTitle());
- }
- if(documentInfo.getAuthor() != null && documentInfo.getAuthor().length() > 0) {
- metadatas.put("author", documentInfo.getAuthor());
- }
- if(documentInfo.getSubject() != null && documentInfo.getSubject().length() > 0) {
- metadatas.put("subject", documentInfo.getSubject());
- }
- if(documentInfo.getKeywords() != null && documentInfo.getKeywords().length() > 0) {
- metadatas.put("keyWords", documentInfo.getKeywords());
- }
- if(documentInfo.getCreator() != null && documentInfo.getCreator().length() > 0) {
- metadatas.put("creator", documentInfo.getCreator());
- }
- if(documentInfo.getProducer() != null && documentInfo.getProducer().length() > 0) {
- metadatas.put("producer", documentInfo.getProducer());
- }
- try {
- if(documentInfo.getCreationDate() != null) {
- metadatas.put("creationDate", documentInfo.getCreationDate().toString());
- }
- } catch (Exception e) {
- LOG.debug("Error when getting creation date.", e);
- }
- try {
- if(documentInfo.getModDate() != null) {
- metadatas.put("modDate", documentInfo.getModDate().toString());
- }
- } catch (Exception e) {
- LOG.debug("Exception when getting modification date.", e);
- }
- }
- }
-
- private List> initScaleOptions() {
- List> scaleOptions = new ArrayList>();
- scaleOptions.add(new SelectItemOption("5%", "0.05f"));
- scaleOptions.add(new SelectItemOption("10%", "0.1f"));
- scaleOptions.add(new SelectItemOption("25%", "0.25f"));
- scaleOptions.add(new SelectItemOption("50%", "0.5f"));
- scaleOptions.add(new SelectItemOption("75%", "0.75f"));
- scaleOptions.add(new SelectItemOption("100%", "1.0f"));
- scaleOptions.add(new SelectItemOption("125%", "1.25f"));
- scaleOptions.add(new SelectItemOption("150%", "1.5f"));
- scaleOptions.add(new SelectItemOption("200%", "2.0f"));
- scaleOptions.add(new SelectItemOption("300%", "3.0f"));
- return scaleOptions;
- }
-
-
- /**
- * Check if client has modern browser (IE9+, FF20+, Chrome 20+).
- */
- private boolean isNotModernBrowser() {
- PortletRequestContext requestContext = PortletRequestContext.getCurrentInstance();
- PortletRequest portletRequest = requestContext.getRequest();
- String userAgent = portletRequest.getProperty("user-agent");
- boolean isChrome = (userAgent.indexOf("Chrome/") != -1);
- boolean isMSIE = (userAgent.indexOf("MSIE") != -1);
- boolean isFirefox = (userAgent.indexOf("Firefox/") != -1);
- String version = "1";
- if (isFirefox) {
- // Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0
- version = userAgent.replaceAll("^.*?Firefox/", "").replaceAll("\\.\\d+", "");
- } else if (isChrome) {
- // Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.52 Safari/536.5
- version = userAgent.replaceAll("^.*?Chrome/(\\d+)\\..*$", "$1");
- } else if (isMSIE) {
- // Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
- version = userAgent.replaceAll("^.*?MSIE\\s+(\\d+).*$", "$1");
- }
-
- boolean unsupportedBrowser = (isFirefox && Integer.parseInt(version) < MIN_FF_SUPPORTED_BROWSER_VERSION)
- || (isChrome && Integer.parseInt(version) < MIN_CHROME_SUPPORTED_BROWSER_VERSION)
- || (isMSIE && Integer.parseInt(version) < MIN_IE_SUPPORTED_BROWSER_VERSION);
- return unsupportedBrowser;
- }
-
- static public class PreviousPageActionListener extends EventListener {
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- if(pdfViewer.currentPageNumber_ == 1) {
- pdfViewer.getUIStringInput(PAGE_NUMBER).setValue(
- Integer.toString((pdfViewer.currentPageNumber_)));
- } else {
- pdfViewer.getUIStringInput(PAGE_NUMBER).setValue(
- Integer.toString((pdfViewer.currentPageNumber_ -1)));
- pdfViewer.setPageNumber(pdfViewer.currentPageNumber_ - 1);
- }
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- static public class NextPageActionListener extends EventListener {
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- if(pdfViewer.currentPageNumber_ == pdfViewer.maximumOfPage_) {
- pdfViewer.getUIStringInput(PAGE_NUMBER).setValue(
- Integer.toString((pdfViewer.currentPageNumber_)));
- } else {
- pdfViewer.getUIStringInput(PAGE_NUMBER).setValue(
- Integer.toString((pdfViewer.currentPageNumber_ + 1)));
- pdfViewer.setPageNumber(pdfViewer.currentPageNumber_ + 1);
- }
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- static public class GotoPageActionListener extends EventListener {
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- String pageStr = pdfViewer.getUIStringInput(PAGE_NUMBER).getValue();
- int pageNumber = 1;
- try {
- pageNumber = Integer.parseInt(pageStr);
- } catch(NumberFormatException e) {
- pageNumber = pdfViewer.currentPageNumber_;
- }
- if(pageNumber >= pdfViewer.maximumOfPage_) pageNumber = pdfViewer.maximumOfPage_;
- else if(pageNumber < 1) pageNumber = 1;
- pdfViewer.getUIStringInput(PAGE_NUMBER).setValue(Integer.toString((pageNumber)));
- pdfViewer.setPageNumber(pageNumber);
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- static public class RotateRightPageActionListener extends EventListener {
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- pdfViewer.setRotation(pdfViewer.currentRotation_ + 270.0f);
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- static public class RotateLeftPageActionListener extends EventListener {
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- pdfViewer.setRotation(pdfViewer.currentRotation_ + 90.0f);
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- static public class ScalePageActionListener extends EventListener {
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- String scale = pdfViewer.getUIFormSelectBox(SCALE_PAGE).getValue();
- pdfViewer.setScale(Float.parseFloat(scale));
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- static public class DownloadFileActionListener extends EventListener {
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- UIComponent uiParent = pdfViewer.getParent();
- Method methodGetNode = pdfViewer.getMethod(uiParent, "getNode");
- Node node = (Node)methodGetNode.invoke(uiParent, (Object[]) null);
- node = getFileLangNode(node);
- String repository = (String) pdfViewer.getMethod(uiParent, "getRepository").invoke(uiParent, (Object[]) null);
- PDFViewerService pdfViewerService = pdfViewer.getApplicationComponent(PDFViewerService.class);
- File file = pdfViewerService.getPDFDocumentFile(node, repository);
- String fileName = node.getName();
- int index = fileName.lastIndexOf('.');
- if (index < 0) {
- fileName += ".pdf";
- } else if (index == fileName.length() - 1) {
- fileName += "pdf";
- } else {
- String extension = fileName.substring(index + 1);
- fileName = fileName.replace(extension, "pdf");
- }
- DownloadService dservice = pdfViewer.getApplicationComponent(DownloadService.class) ;
- InputStreamDownloadResource dresource = new InputStreamDownloadResource(
- new BufferedInputStream(new FileInputStream(file)), DMSMimeTypeResolver.getInstance().getMimeType(".pdf"));
- dresource.setDownloadName(fileName) ;
- String downloadLink = dservice.getDownloadLink(dservice.addDownloadResource(dresource)) ;
-
- RequireJS requireJS = event.getRequestContext().getJavascriptManager().getRequireJS();
- requireJS.require("SHARED/ecm-utils", "ecmutil").addScripts("ecmutil.ECMUtils.ajaxRedirect('" + downloadLink + "');");
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- static public class ZoomInPageActionListener extends EventListener {
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- String[] arrValue = {"0.05f", "0.1f", "0.25f", "0.5f", "0.75f", "1.0f",
- "1.25f", "1.5f", "2.0f", "3.0f"};
- String scale = pdfViewer.getUIFormSelectBox(SCALE_PAGE).getValue();
- if(scale.equals(arrValue[arrValue.length - 1])) return;
- for(int i = 0; i < arrValue.length - 1; i++) {
- if(scale.equals(arrValue[i])) {
- pdfViewer.setScale(Float.parseFloat(arrValue[i + 1]));
- pdfViewer.getUIFormSelectBox(SCALE_PAGE).setValue(arrValue[i + 1]);
- break;
- }
- }
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- static public class ZoomOutPageActionListener extends EventListener {
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- String scale = pdfViewer.getUIFormSelectBox(SCALE_PAGE).getValue();
- String[] arrValue = {"0.05f", "0.1f", "0.25f", "0.5f", "0.75f", "1.0f",
- "1.25f", "1.5f", "2.0f", "3.0f"};
- if(scale.equals(arrValue[0])) return;
- for(int i = 0; i < arrValue.length - 1; i++) {
- if(scale.equals(arrValue[i])) {
- pdfViewer.setScale(Float.parseFloat(arrValue[i - 1]));
- pdfViewer.getUIFormSelectBox(SCALE_PAGE).setValue(arrValue[i - 1]);
- break;
- }
- }
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
- static public Node getFileLangNode(Node currentNode) throws Exception {
- if(currentNode.isNodeType("nt:unstructured")) {
- if(currentNode.getNodes().getSize() > 0) {
- NodeIterator nodeIter = currentNode.getNodes() ;
- while(nodeIter.hasNext()) {
- Node ntFile = nodeIter.nextNode() ;
- if(ntFile.isNodeType("nt:file")) {
- return ntFile ;
- }
- }
- return currentNode ;
- }
- }
- return currentNode ;
- }
-
- public String getActionOpenDocInDesktop() {
- UIComponent uiParent = getParent();
- String ret = "";
- try {
- Method method = getMethod(uiParent, "getActionOpenDocInDesktop");
- if(method != null) ret = (String) method.invoke(uiParent, (Object[]) null);
- } catch (NoSuchMethodException| IllegalArgumentException| IllegalAccessException| InvocationTargetException e) {
- ret = "";
- }
- return ret;
- }
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/TextViewer.java b/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/TextViewer.java
deleted file mode 100644
index 12fa0ccda70..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/TextViewer.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2003-2008 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see .
- */
-package org.exoplatform.ecm.webui.viewer;
-
-import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.portal.webui.workspace.UIPortalApplication;
-import org.exoplatform.services.resources.ResourceBundleService;
-import org.exoplatform.services.wcm.utils.WCMCoreUtils;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.core.UIComponent;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Dang Van Minh
- * minh.dang@exoplatform.com
- * Aug 18, 2009
- * 3:49:41 AM
- */
-@ComponentConfig(
- template = "classpath:resources/templates/TextViewer.gtmpl"
-)
-public class TextViewer extends UIComponent {
- private String sharedResourcesBundleNames[];
- private ResourceBundle sharedResourceBundle=null;
-
- public String getResource(String key) {
- try {
- Locale locale = Util.getPortalRequestContext().getLocale();
- ResourceBundleService resourceBundleService = WCMCoreUtils.getService(ResourceBundleService.class);
- sharedResourcesBundleNames = resourceBundleService.getSharedResourceBundleNames();
- sharedResourceBundle = resourceBundleService.getResourceBundle(sharedResourcesBundleNames, locale);
-
- return sharedResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- }
- }
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/VideoAudioViewer.java b/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/VideoAudioViewer.java
deleted file mode 100644
index 4defcf630e8..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/ecm/webui/viewer/VideoAudioViewer.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2003-2009 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see .
- *
- **************************************************************************/
-package org.exoplatform.ecm.webui.viewer;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-
-import org.exoplatform.container.xml.PortalContainerInfo;
-import org.exoplatform.services.cms.impl.Utils;
-import org.exoplatform.services.wcm.core.NodeLocation;
-import org.exoplatform.services.wcm.utils.WCMCoreUtils;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.core.UIComponent;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Hoang Van Hung
- * hunghvit@gmail.com
- * Oct 29, 2009
- */
-
-@ComponentConfig(
- template = "classpath:resources/templates/VideoAudioViewer.gtmpl"
-)
-
-public class VideoAudioViewer extends UIComponent {
-
- private List presentNodes = new ArrayList();
-
- private String repository;
-
- public List getPresentNodes() {
- List result = new ArrayList<>();
- result.addAll(NodeLocation.getNodeListByLocationList(presentNodes));
- return result;
- }
-
- public void setPresentNodes(List presentNodes) {
- this.presentNodes = NodeLocation.getLocationsByNodeList(presentNodes);
- }
-
- public void setRepository(String repository) {
- this.repository = repository;
- }
-
-
- public String getRepository() {
- return repository;
- }
-
- public String getPortalName() {
- PortalContainerInfo containerInfo = WCMCoreUtils.getService(PortalContainerInfo.class) ;
- return containerInfo.getContainerName() ;
- }
-
- public Node getFileLangNode(Node currentNode) throws Exception {
- if(currentNode.isNodeType("nt:unstructured")) {
- if(currentNode.getNodes().getSize() > 0) {
- NodeIterator nodeIter = currentNode.getNodes() ;
- while(nodeIter.hasNext()) {
- Node ntFile = nodeIter.nextNode() ;
- if(ntFile.isNodeType("nt:file")) {
- return ntFile ;
- }
- }
- return currentNode ;
- }
- }
- return currentNode ;
- }
-
- public Node getChildNode(Node parent, String childType) throws Exception {
- return Utils.getChildOfType(parent, childType);
- }
-
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/BaseCloudDriveForm.java b/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/BaseCloudDriveForm.java
deleted file mode 100644
index 15f9085b4bf..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/BaseCloudDriveForm.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2003-2016 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.cms.clouddrives.webui;
-
-import org.exoplatform.ecm.webui.clouddrives.CloudDriveContext;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.webui.core.UIPopupComponent;
-import org.exoplatform.webui.form.UIForm;
-
-/**
- * The Class BaseCloudDriveForm.
- */
-public abstract class BaseCloudDriveForm extends UIForm implements UIPopupComponent {
-
- /** The Constant LOG. */
- protected static final Log LOG = ExoLogger.getLogger(BaseCloudDriveForm.class);
-
- /**
- * Inits the context.
- *
- * @throws Exception the exception
- */
- protected void initContext() throws Exception {
- CloudDriveContext.init(this);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void activate() {
- // nothing
-
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void deActivate() {
- // nothing
- }
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/AbstractFileForm.java b/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/AbstractFileForm.java
deleted file mode 100644
index 946fb8c94b7..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/AbstractFileForm.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2003-2016 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.cms.clouddrives.webui.viewer;
-
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import javax.ws.rs.core.MediaType;
-
-import org.exoplatform.ecm.webui.viewer.CloudFileViewer;
-import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.portal.webui.workspace.UIPortalApplication;
-import org.exoplatform.services.cms.clouddrives.CloudDrive;
-import org.exoplatform.services.cms.clouddrives.CloudFile;
-import org.exoplatform.services.cms.clouddrives.webui.BaseCloudDriveForm;
-import org.exoplatform.services.resources.ResourceBundleService;
-import org.exoplatform.services.wcm.utils.WCMCoreUtils;
-import org.exoplatform.webui.application.WebuiRequestContext;
-
-/**
- * Base support for WebUI forms based on Cloud Drive file.
- */
-public abstract class AbstractFileForm extends BaseCloudDriveForm implements CloudFileViewer {
-
- /** The drive. */
- protected CloudDrive drive;
-
- /** The file. */
- protected CloudFile file;
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void processRender(WebuiRequestContext context) throws Exception {
- initContext();
-
- Object obj = context.getAttribute(CloudDrive.class);
- if (obj != null) {
- CloudDrive drive = (CloudDrive) obj;
- obj = context.getAttribute(CloudFile.class);
- if (obj != null) {
- initFile(drive, (CloudFile) obj);
- }
- }
-
- super.processRender(context);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void initFile(CloudDrive drive, CloudFile file) {
- this.drive = drive;
- this.file = file;
- }
-
- /**
- * Gets the drive.
- *
- * @return the drive
- */
- public CloudDrive getDrive() {
- return drive;
- }
-
- /**
- * Gets the file.
- *
- * @return the file
- */
- public CloudFile getFile() {
- return file;
- }
-
- /**
- * Checks if is viewable.
- *
- * @return true if file can be represented as Web document.
- */
- public boolean isViewable() {
- String mimeType = file.getType();
- return !mimeType.startsWith(MediaType.APPLICATION_OCTET_STREAM);
- }
-
- /**
- * Gets the resource bundle.
- *
- * @param key the key
- * @return the resource bundle
- */
- public String appRes(String key) {
- Locale locale = Util.getPortalRequestContext().getLocale();
- ResourceBundleService resourceBundleService = WCMCoreUtils.getService(ResourceBundleService.class);
- ResourceBundle resourceBundle = resourceBundleService.getResourceBundle(
- new String[] { "locale.clouddrive.CloudDrive",
- "locale.ecm.views", localeFile() },
- locale,
- this.getClass().getClassLoader());
- return resourceBundle.getString(key);
- }
-
- /**
- * Locale file.
- *
- * @return the string
- */
- protected abstract String localeFile();
-
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/FlashViewer.java b/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/FlashViewer.java
deleted file mode 100644
index fc7be4c732a..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/FlashViewer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2003-2016 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.cms.clouddrives.webui.viewer;
-
-import org.exoplatform.ecm.webui.viewer.AbstractCloudFileViewer;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.ext.manager.UIAbstractManager;
-
-/**
- * Flash files viewer for Cloud Drive.
- */
-@ComponentConfig(template = "classpath:groovy/templates/FlashViewer.gtmpl")
-public class FlashViewer extends AbstractCloudFileViewer {
-
- /**
- * Instantiates a new flash viewer.
- *
- * @throws Exception the exception
- */
- public FlashViewer() throws Exception {
- }
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/H264VideoViewer.java b/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/H264VideoViewer.java
deleted file mode 100644
index d3e27d1d0c3..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/H264VideoViewer.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2003-2016 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.cms.clouddrives.webui.viewer;
-
-import org.exoplatform.ecm.webui.viewer.AbstractCloudFileViewer;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-
-/**
- * H.264 media files viewer for Cloud Drive.
- */
-@ComponentConfig(template = "classpath:groovy/templates/H264VideoViewer.gtmpl")
-public class H264VideoViewer extends AbstractCloudFileViewer {
-
- /**
- * Instantiates a new h 264 video viewer.
- *
- * @throws Exception the exception
- */
- public H264VideoViewer() throws Exception {
- }
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/ImageViewer.java b/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/ImageViewer.java
deleted file mode 100644
index f2995d41c93..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/ImageViewer.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2003-2016 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.cms.clouddrives.webui.viewer;
-
-import org.exoplatform.ecm.webui.viewer.AbstractCloudFileViewer;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-
-/**
- * Image files viewer for Cloud Drive.
- */
-@ComponentConfig(template = "classpath:groovy/templates/ImageViewer.gtmpl")
-public class ImageViewer extends AbstractCloudFileViewer {
-
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/MpegVideoViewer.java b/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/MpegVideoViewer.java
deleted file mode 100644
index 234a27eb214..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/MpegVideoViewer.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2003-2016 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.cms.clouddrives.webui.viewer;
-
-import org.exoplatform.ecm.webui.viewer.AbstractCloudFileViewer;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-
-/**
- * MPEG files viewer for Cloud Drive.
- */
-@ComponentConfig(template = "classpath:groovy/templates/MpegVideoViewer.gtmpl")
-public class MpegVideoViewer extends AbstractCloudFileViewer {
-
- /**
- * Instantiates a new mpeg video viewer.
- *
- * @throws Exception the exception
- */
- public MpegVideoViewer() throws Exception {
- }
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/PDFViewer.java b/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/PDFViewer.java
deleted file mode 100644
index 61484dc9fa5..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/PDFViewer.java
+++ /dev/null
@@ -1,502 +0,0 @@
-/*
- * Copyright (C) 2003-2016 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.cms.clouddrives.webui.viewer;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import javax.jcr.RepositoryException;
-
-import org.exoplatform.ecm.connector.clouddrives.ContentService;
-import org.exoplatform.services.cms.clouddrives.CloudDrive;
-import org.exoplatform.services.cms.clouddrives.CloudDriveException;
-import org.exoplatform.services.cms.clouddrives.CloudFile;
-import org.exoplatform.services.cms.clouddrives.DriveRemovedException;
-import org.exoplatform.services.cms.clouddrives.viewer.DocumentNotFoundException;
-import org.exoplatform.services.cms.clouddrives.viewer.ViewerStorage;
-import org.exoplatform.services.cms.clouddrives.viewer.ViewerStorage.ContentFile;
-import org.exoplatform.services.cms.clouddrives.viewer.ViewerStorage.PDFFile;
-import org.exoplatform.services.jcr.RepositoryService;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
-import org.exoplatform.webui.core.model.SelectItemOption;
-import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.Event.Phase;
-import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.form.UIFormSelectBox;
-import org.exoplatform.webui.form.UIFormStringInput;
-
-/**
- * PDF Viewer component which will be used to display PDF and office files from
- * Cloud Drive.
- */
-@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "classpath:groovy/templates/PDFViewer.gtmpl", events = {
- @EventConfig(listeners = PDFViewer.NextPageActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.PreviousPageActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.GotoPageActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.RotateRightPageActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.RotateLeftPageActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.ScalePageActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.ZoomInPageActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = PDFViewer.ZoomOutPageActionListener.class, phase = Phase.DECODE) })
-public class PDFViewer extends AbstractFileForm {
-
- /** The Constant PAGE_NUMBER. */
- private static final String PAGE_NUMBER = "pageNumber";
-
- /** The Constant SCALE_PAGE. */
- private static final String SCALE_PAGE = "scalePage";
-
- /** The Constant localeFile. */
- private static final String localeFile = "locale.portlet.viewer.PDFViewer";
-
- /** The storage. */
- private final ViewerStorage storage;
-
- /** The jcr service. */
- private final RepositoryService jcrService;
-
- /** The pdf file. */
- private PDFFile pdfFile;
-
- /** The pdf link. */
- private String pdfLink;
-
- /** The pdf page link. */
- private String pdfPageLink;
-
- /** The current page number. */
- private int currentPageNumber = 1;
-
- /** The current rotation. */
- private float currentRotation = 0.0f;
-
- /** The current scale. */
- private float currentScale = 1.0f;
-
- /**
- * Instantiates a new PDF viewer.
- *
- * @throws Exception the exception
- */
- public PDFViewer() throws Exception {
- this.storage = (ViewerStorage) getApplicationComponent(ViewerStorage.class);
- this.jcrService = (RepositoryService) getApplicationComponent(RepositoryService.class);
-
- addUIFormInput(new UIFormStringInput(PAGE_NUMBER, PAGE_NUMBER, "1"));
- UIFormSelectBox uiScaleBox = new UIFormSelectBox(SCALE_PAGE, SCALE_PAGE, initScaleOptions());
- uiScaleBox.setOnChange("ScalePage");
- addUIFormInput(uiScaleBox);
- uiScaleBox.setValue("1.0f");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isViewable() {
- return pdfFile != null && super.isViewable();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String localeFile() {
- return localeFile;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void initFile(CloudDrive drive, CloudFile file) {
- this.pdfFile = null;
- this.pdfLink = pdfPageLink = null;
-
- super.initFile(drive, file);
-
- try {
- // init PDF viewer data (aka initDatas())
- String repository = jcrService.getCurrentRepository().getConfiguration().getName();
- String workspace = drive.getWorkspace();
- ContentFile contentFile = storage.createFile(repository, workspace, drive, file);
- if (contentFile.isPDF()) {
- this.pdfFile = contentFile.asPDF();
-
- // FYI preview link can be provider specific, thus we use exactly our
- // Content service
- // String previewLink = file.getPreviewLink();
- String contentLink = ContentService.contentLink(workspace, file.getPath(), file.getId());
- this.pdfLink = ContentService.pdfLink(contentLink);
- this.pdfPageLink = ContentService.pdfPageLink(contentLink);
- } else {
- LOG.warn("Current file view is not of PDF format " + file.getPath());
- }
- } catch (DocumentNotFoundException e) {
- LOG.error("Error preparing PDF viewer", e);
- } catch (RepositoryException e) {
- LOG.error("Error initializing PDF viewer", e);
- } catch (DriveRemovedException e) {
- LOG.warn("Error initializing PDF viewer: " + e.getMessage());
- } catch (CloudDriveException e) {
- LOG.warn("Error initializing PDF viewer: " + e.getMessage());
- } catch (IOException e) {
- LOG.warn("Error initializing PDF viewer: " + e.getMessage());
- }
- }
-
- /**
- * Gets the file metadata.
- *
- * @return the file metadata
- */
- public Map getFileMetadata() {
- if (pdfFile != null) {
- return pdfFile.getMetadata();
- }
- return Collections.emptyMap();
- }
-
- /**
- * Gets the number of pages.
- *
- * @return the number of pages
- */
- public int getNumberOfPages() {
- if (pdfFile != null) {
- return pdfFile.getNumberOfPages();
- }
- return 0;
- }
-
- /**
- * Gets the page image link.
- *
- * @return the pageImageLink
- */
- public String getPageImageLink() {
- if (pdfPageLink != null) {
- StringBuilder link = new StringBuilder();
- link.append(pdfPageLink);
- link.append(pdfPageLink.indexOf('?') > 0 ? '&' : '?');
- link.append("page=");
- link.append(getPageNumber());
- link.append("&rotation=");
- link.append(getCurrentRotation());
- link.append("&scale=");
- link.append(getCurrentScale());
- return link.toString();
- } else {
- return null;
- }
- }
-
- /**
- * Gets the pdf link.
- *
- * @return the PDF link
- */
- public String getPdfLink() {
- return pdfLink;
- }
-
- /**
- * Gets the current rotation.
- *
- * @return the current rotation
- */
- public float getCurrentRotation() {
- return currentRotation;
- }
-
- /**
- * Sets the rotation.
- *
- * @param rotation the new rotation
- */
- public void setRotation(float rotation) {
- currentRotation = rotation;
- }
-
- /**
- * Gets the current scale.
- *
- * @return the current scale
- */
- public float getCurrentScale() {
- return currentScale;
- }
-
- /**
- * Sets the scale.
- *
- * @param scale the new scale
- */
- public void setScale(float scale) {
- currentScale = scale;
- }
-
- /**
- * Gets the page number.
- *
- * @return the page number
- */
- public int getPageNumber() {
- return currentPageNumber;
- }
-
- /**
- * Sets the page number.
- *
- * @param pageNum the new page number
- */
- public void setPageNumber(int pageNum) {
- currentPageNumber = pageNum;
- };
-
- /**
- * Inits the scale options.
- *
- * @return the list
- */
- private List> initScaleOptions() {
- List> scaleOptions = new ArrayList>();
- scaleOptions.add(new SelectItemOption("5%", "0.05f"));
- scaleOptions.add(new SelectItemOption("10%", "0.1f"));
- scaleOptions.add(new SelectItemOption("25%", "0.25f"));
- scaleOptions.add(new SelectItemOption("50%", "0.5f"));
- scaleOptions.add(new SelectItemOption("75%", "0.75f"));
- scaleOptions.add(new SelectItemOption("100%", "1.0f"));
- scaleOptions.add(new SelectItemOption("125%", "1.25f"));
- scaleOptions.add(new SelectItemOption("150%", "1.5f"));
- scaleOptions.add(new SelectItemOption("200%", "2.0f"));
- scaleOptions.add(new SelectItemOption("300%", "3.0f"));
- return scaleOptions;
- }
-
- /**
- * The listener interface for receiving previousPageAction events. The class
- * that is interested in processing a previousPageAction event implements this
- * interface, and the object created with that class is registered with a
- * component using the component's addPreviousPageActionListener
- * method. When the previousPageAction event occurs, that object's appropriate
- * method is invoked.
- */
- public static class PreviousPageActionListener extends EventListener {
-
- /**
- * {@inheritDoc}
- */
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- if (pdfViewer.currentPageNumber == 1) {
- pdfViewer.getUIStringInput(PAGE_NUMBER).setValue(Integer.toString((pdfViewer.currentPageNumber)));
- } else {
- pdfViewer.getUIStringInput(PAGE_NUMBER).setValue(Integer.toString((pdfViewer.currentPageNumber - 1)));
- pdfViewer.setPageNumber(pdfViewer.currentPageNumber - 1);
- }
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- /**
- * The listener interface for receiving nextPageAction events. The class that
- * is interested in processing a nextPageAction event implements this
- * interface, and the object created with that class is registered with a
- * component using the component's addNextPageActionListener
- * method. When the nextPageAction event occurs, that object's appropriate
- * method is invoked.
- */
- static public class NextPageActionListener extends EventListener {
-
- /**
- * {@inheritDoc}
- */
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- if (pdfViewer.currentPageNumber == pdfViewer.getNumberOfPages()) {
- pdfViewer.getUIStringInput(PAGE_NUMBER).setValue(Integer.toString((pdfViewer.currentPageNumber)));
- } else {
- pdfViewer.getUIStringInput(PAGE_NUMBER).setValue(Integer.toString((pdfViewer.currentPageNumber + 1)));
- pdfViewer.setPageNumber(pdfViewer.currentPageNumber + 1);
- }
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- /**
- * The listener interface for receiving gotoPageAction events. The class that
- * is interested in processing a gotoPageAction event implements this
- * interface, and the object created with that class is registered with a
- * component using the component's addGotoPageActionListener
- * method. When the gotoPageAction event occurs, that object's appropriate
- * method is invoked.
- */
- static public class GotoPageActionListener extends EventListener {
-
- /**
- * {@inheritDoc}
- */
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- String pageStr = pdfViewer.getUIStringInput(PAGE_NUMBER).getValue();
- int pageNumber = 1;
- try {
- pageNumber = Integer.parseInt(pageStr);
- } catch (NumberFormatException e) {
- pageNumber = pdfViewer.currentPageNumber;
- }
- if (pageNumber >= pdfViewer.getNumberOfPages())
- pageNumber = pdfViewer.getNumberOfPages();
- else if (pageNumber < 1)
- pageNumber = 1;
- pdfViewer.getUIStringInput(PAGE_NUMBER).setValue(Integer.toString((pageNumber)));
- pdfViewer.setPageNumber(pageNumber);
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- /**
- * The listener interface for receiving rotateRightPageAction events. The
- * class that is interested in processing a rotateRightPageAction event
- * implements this interface, and the object created with that class is
- * registered with a component using the component's
- * addRotateRightPageActionListener method. When the
- * rotateRightPageAction event occurs, that object's appropriate method is
- * invoked.
- */
- static public class RotateRightPageActionListener extends EventListener {
-
- /**
- * {@inheritDoc}
- */
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- pdfViewer.setRotation(pdfViewer.currentRotation + 270.0f);
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- /**
- * The listener interface for receiving rotateLeftPageAction events. The class
- * that is interested in processing a rotateLeftPageAction event implements
- * this interface, and the object created with that class is registered with a
- * component using the component's
- * addRotateLeftPageActionListener method. When the
- * rotateLeftPageAction event occurs, that object's appropriate method is
- * invoked.
- */
- static public class RotateLeftPageActionListener extends EventListener {
-
- /**
- * {@inheritDoc}
- */
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- pdfViewer.setRotation(pdfViewer.currentRotation + 90.0f);
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- /**
- * The listener interface for receiving scalePageAction events. The class that
- * is interested in processing a scalePageAction event implements this
- * interface, and the object created with that class is registered with a
- * component using the component's addScalePageActionListener
- * method. When the scalePageAction event occurs, that object's appropriate
- * method is invoked.
- */
- static public class ScalePageActionListener extends EventListener {
-
- /**
- * {@inheritDoc}
- */
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- String scale = pdfViewer.getUIFormSelectBox(SCALE_PAGE).getValue();
- pdfViewer.setScale(Float.parseFloat(scale));
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- /**
- * The listener interface for receiving zoomInPageAction events. The class
- * that is interested in processing a zoomInPageAction event implements this
- * interface, and the object created with that class is registered with a
- * component using the component's addZoomInPageActionListener
- * method. When the zoomInPageAction event occurs, that object's appropriate
- * method is invoked.
- */
- static public class ZoomInPageActionListener extends EventListener {
-
- /**
- * {@inheritDoc}
- */
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- String[] arrValue = { "0.05f", "0.1f", "0.25f", "0.5f", "0.75f", "1.0f", "1.25f", "1.5f", "2.0f", "3.0f" };
- String scale = pdfViewer.getUIFormSelectBox(SCALE_PAGE).getValue();
- if (scale.equals(arrValue[arrValue.length - 1]))
- return;
- for (int i = 0; i < arrValue.length - 1; i++) {
- if (scale.equals(arrValue[i])) {
- pdfViewer.setScale(Float.parseFloat(arrValue[i + 1]));
- pdfViewer.getUIFormSelectBox(SCALE_PAGE).setValue(arrValue[i + 1]);
- break;
- }
- }
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-
- /**
- * The listener interface for receiving zoomOutPageAction events. The class
- * that is interested in processing a zoomOutPageAction event implements this
- * interface, and the object created with that class is registered with a
- * component using the component's addZoomOutPageActionListener
- * method. When the zoomOutPageAction event occurs, that object's appropriate
- * method is invoked.
- */
- static public class ZoomOutPageActionListener extends EventListener {
-
- /**
- * {@inheritDoc}
- */
- public void execute(Event event) throws Exception {
- PDFViewer pdfViewer = event.getSource();
- String scale = pdfViewer.getUIFormSelectBox(SCALE_PAGE).getValue();
- String[] arrValue = { "0.05f", "0.1f", "0.25f", "0.5f", "0.75f", "1.0f", "1.25f", "1.5f", "2.0f", "3.0f" };
- if (scale.equals(arrValue[0]))
- return;
- for (int i = 0; i < arrValue.length - 1; i++) {
- if (scale.equals(arrValue[i])) {
- pdfViewer.setScale(Float.parseFloat(arrValue[i - 1]));
- pdfViewer.getUIFormSelectBox(SCALE_PAGE).setValue(arrValue[i - 1]);
- break;
- }
- }
- event.getRequestContext().addUIComponentToUpdateByAjax(pdfViewer);
- }
- }
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/TextViewer.java b/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/TextViewer.java
deleted file mode 100644
index fae3dde4c1b..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/TextViewer.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2003-2016 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.cms.clouddrives.webui.viewer;
-
-import org.exoplatform.ecm.webui.viewer.AbstractCloudFileViewer;
-import org.exoplatform.services.cms.clouddrives.CloudDriveStorage;
-import org.exoplatform.services.cms.clouddrives.viewer.ContentReader;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-
-/**
- * Text files viewer for Cloud Drive.
- */
-@ComponentConfig(template = "classpath:groovy/templates/TextViewer.gtmpl")
-public class TextViewer extends AbstractCloudFileViewer {
-
- /** The Constant LOG. */
- protected static final Log LOG = ExoLogger.getLogger(TextViewer.class);
-
- /** The Constant MAX_FILE_SIZE. */
- public static final long MAX_FILE_SIZE = 2 * 1024 * 1024; // 2M
-
- /**
- * Checks if is web document.
- *
- * @return true, if is web document
- */
- public boolean isWebDocument() {
- String mimeType = file.getType();
- return mimeType.startsWith("text/html") || mimeType.startsWith("application/rss+xml")
- || mimeType.startsWith("application/xhtml");
- }
-
- /**
- * Checks if is xml document.
- *
- * @return true, if is xml document
- */
- public boolean isXmlDocument() {
- String mimeType = file.getType();
- return mimeType.startsWith("text/xml") || mimeType.startsWith("application/xml")
- || (mimeType.startsWith("application/") && mimeType.indexOf("+xml") > 0);
- }
-
- /**
- * Checks if is formatted text.
- *
- * @return true, if is formatted text
- */
- public boolean isFormattedText() {
- String mimeType = file.getType();
- // text/x- can be used for various programming languages
- return (mimeType.startsWith("text/") && file.getTypeMode() != null)
- || (mimeType.startsWith("application/") && file.getTypeMode() != null) || mimeType.startsWith("text/x-")
- || mimeType.startsWith("application/x-sh") || mimeType.startsWith("text/javascript")
- || mimeType.startsWith("application/javascript") || mimeType.startsWith("text/json")
- || mimeType.startsWith("application/json");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isViewable() {
- boolean res = super.isViewable();
- if (res) {
- // ensure size OK
- try {
- ContentReader content = ((CloudDriveStorage) drive).getFileContent(file.getId());
- res = content.getLength() <= MAX_FILE_SIZE;
- } catch (Throwable e) {
- LOG.warn("Error getting file content reader for " + file.getId() + " " + file.getPath(), e);
- }
- }
- return res;
- }
-}
diff --git a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/VideoAudioViewer.java b/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/VideoAudioViewer.java
deleted file mode 100644
index fd37f4ec286..00000000000
--- a/core/viewer/src/main/java/org/exoplatform/services/cms/clouddrives/webui/viewer/VideoAudioViewer.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2003-2016 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.cms.clouddrives.webui.viewer;
-
-import org.exoplatform.ecm.webui.viewer.AbstractCloudFileViewer;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-
-/**
- * Flash video/audio/mp3 files viewer for Cloud Drive.
- */
-@ComponentConfig(template = "classpath:groovy/templates/VideoAudioViewer.gtmpl")
-public class VideoAudioViewer extends AbstractCloudFileViewer {
-
- /**
- * Instantiates a new video audio viewer.
- *
- * @throws Exception the exception
- */
- public VideoAudioViewer() throws Exception {
- }
-}
diff --git a/ecm-wcm-extension/pom.xml b/ecm-wcm-extension/pom.xml
index 4c240388b0d..b1ab0e34343 100644
--- a/ecm-wcm-extension/pom.xml
+++ b/ecm-wcm-extension/pom.xml
@@ -4,7 +4,7 @@
ecms
org.exoplatform.ecms
- 7.1.x-SNAPSHOT
+ 7.1.x-meeds-qaui-SNAPSHOT
ecm-wcm-extension
war
diff --git a/ecm-wcm-extension/src/main/webapp/WEB-INF/conf/dms-extension/dms/dms-clouddrives-configuration.xml b/ecm-wcm-extension/src/main/webapp/WEB-INF/conf/dms-extension/dms/dms-clouddrives-configuration.xml
index e628c7a2d7e..8276cea3fe7 100644
--- a/ecm-wcm-extension/src/main/webapp/WEB-INF/conf/dms-extension/dms/dms-clouddrives-configuration.xml
+++ b/ecm-wcm-extension/src/main/webapp/WEB-INF/conf/dms-extension/dms/dms-clouddrives-configuration.xml
@@ -97,37 +97,4 @@
-
-
-
- org.exoplatform.webui.ext.UIExtensionManager
-
- Add CloudDrive Actions
- registerUIExtensionPlugin
- org.exoplatform.webui.ext.UIExtensionPlugin
-
-
-
- ShowCloudFile
-
-
- org.exoplatform.ecm.dms.FileViewer
-
-
- ShowCloudFile
-
-
- org.exoplatform.ecm.webui.viewer.DefaultCloudFileViewer
-
-
- FileViewer
-
-
- 50
-
-
-
-
-
-
diff --git a/ecms-packaging/pom.xml b/ecms-packaging/pom.xml
index 932801a9a8a..4b8d63b7e45 100644
--- a/ecms-packaging/pom.xml
+++ b/ecms-packaging/pom.xml
@@ -24,7 +24,7 @@
org.exoplatform.ecms
ecms
- 7.1.x-SNAPSHOT
+ 7.1.x-meeds-qaui-SNAPSHOT
ecms-packaging
pom
diff --git a/ecms-social-integration/pom.xml b/ecms-social-integration/pom.xml
index 07c7a857bc0..247299f581b 100644
--- a/ecms-social-integration/pom.xml
+++ b/ecms-social-integration/pom.xml
@@ -4,7 +4,7 @@
org.exoplatform.ecms
ecms
- 7.1.x-SNAPSHOT
+ 7.1.x-meeds-qaui-SNAPSHOT
ecms-social-integration
jar
diff --git a/pom.xml b/pom.xml
index ff2553ac02c..ff1c10a97b2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
org.exoplatform.ecms
ecms
- 7.1.x-SNAPSHOT
+ 7.1.x-meeds-qaui-SNAPSHOT
pom
eXo PLF:: ECM Suite
eXo Entreprise Content Management Suite
@@ -39,7 +39,7 @@
- 7.1.x-SNAPSHOT
+ 7.1.x-meeds-qaui-SNAPSHOT
diff --git a/testsuite/pom.xml b/testsuite/pom.xml
index 81f03240c63..9e6b1a33994 100644
--- a/testsuite/pom.xml
+++ b/testsuite/pom.xml
@@ -4,7 +4,7 @@
ecms
org.exoplatform.ecms
- 7.1.x-SNAPSHOT
+ 7.1.x-meeds-qaui-SNAPSHOT
ecms-testsuite
pom
diff --git a/testsuite/test/pom.xml b/testsuite/test/pom.xml
index bdc7c635a68..59096856689 100644
--- a/testsuite/test/pom.xml
+++ b/testsuite/test/pom.xml
@@ -4,7 +4,7 @@
ecms-testsuite
org.exoplatform.ecms
- 7.1.x-SNAPSHOT
+ 7.1.x-meeds-qaui-SNAPSHOT
ecms-testsuite-test
eXo PLF:: ECMS Testing
' + - '
' + - '