Skip to content
Permalink
Browse files

fixes for file upload issues, jar not found and content and page edit…

…or issues
  • Loading branch information
carlosbpf committed Sep 28, 2019
1 parent 0d25ee6 commit 164ff6e1eb0894b17baeaa7264555b92416ac623
14 pom.xml
@@ -51,6 +51,8 @@
<javax.json-api.version>1.1.2</javax.json-api.version>
<javax.json.version>1.1.2</javax.json.version>

<!-- XML processing -->
<javax-jaxb-api>2.3.1</javax-jaxb-api>
<!-- Modeling-->
<roma-client.version>1.4</roma-client.version>

@@ -219,6 +221,12 @@
<artifactId>simple-java-mail</artifactId>
<version>${simple-java-mail.version}</version>
</dependency>

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${javax-jaxb-api}</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
@@ -296,11 +304,7 @@
<artifactId>sentry-spring</artifactId>
<version>${sentry.version}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>

</dependencies>
</dependencyManagement>

@@ -2,6 +2,7 @@

import org.apache.catalina.Context;
import org.apache.catalina.webresources.StandardRoot;
import org.apache.tomcat.util.scan.StandardJarScanner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -125,6 +126,9 @@ public ServletWebServerFactory servletContainer() {
@Override
protected void postProcessContext(Context context) {

((StandardJarScanner) context.getJarScanner()).setScanManifest(false);
log.info("Disabling jar scan manifest");

final File webappDir = new File(LOCAL_WEBAPP_DIR_LOCATION);
if (webappDir.exists()) {
log.info("Configuring webapp dir at {}", webappDir.getAbsolutePath());
@@ -98,19 +98,22 @@ public void saveContentArticleVersion(HttpServletRequest request, HttpServletRes

if (menuArticleId != 0) {
contentPage.setMenuArticleId(menuArticleId);
} else {
contentPage.setMenuArticleId(null);
}

if (metaDescription != null) {
contentPage.setMetaDescription(metaDescription);
}

if (pageId == 0) {
contentClient.createContentPage(contentPage);
contentPage = contentClient.createContentPage(contentPage);
} else {
contentClient.updateContentPage(contentPage);
}

defaultOperationReturnMessage(true, "Content page created successfully", "", response);
defaultOperationReturnMessage(true, "Content page created successfully",
contentPage.getId() + "", response);
}

private Map<String, String> getArticles(Long folderId, String path, Map<String, String> map) {
@@ -127,7 +130,7 @@ public void saveContentArticleVersion(HttpServletRequest request, HttpServletRes
contentClient.getContentFolderArticleVersions(folderId);
if (contentArticles != null) {
for (IContentArticleVersion ca : contentArticles) {
map.put(path + "/" + ca.getTitle(), ca.getArticleId().toString());
map.put("#"+ca.getArticleId() + " - " + path + "/" + ca.getTitle(), ca.getArticleId().toString());
}
}
return map;
@@ -137,7 +140,11 @@ public void saveContentArticleVersion(HttpServletRequest request, HttpServletRes
@ResponseBody
public IContentPage contentEditorListFolder(HttpServletRequest request,
@RequestParam Long pageId) throws ContentNotFoundException {
return contentClient.getContentPage(pageId);
IContentPage page = contentClient.getContentPage(pageId);
if(page.getMenuArticleId()==null){
page.setMenuArticleId(0l);
}
return page;
}

@GetMapping("/content-editor/pageEditorListFolder")
@@ -48,7 +48,7 @@ contests.proposal.header.creationlimit.reached=You can only submit {0} {1} per {
contests.proposal.header.byteam=by {0}
contests.proposal.help=Please complete your {0} based on the template below. If you have input on the template, please send it in a <a href="/feedback" target="_blank">feedback message</a>. To save your {0}, you must agree to the <a href="{1}" target="_blank">{2}</a> and <a href="/wiki/Terms+of+use" target="_blank">Terms of use</a>.
contests.proposal.help.lostworkwarning=In the past, users have occasionally lost work while inputting text into this form. To prevent this, we recommend that you either (a) prepare your text offline before copying and pasting it into the form or (b) use the SAVE button right after you begin and save frequently. The system will log you out automatically after 2 hours, causing loss of any inputs not previously saved.
contests.proposal.help.savereminder=Don''t forget to save your work!
contests.proposal.help.savereminder=Don't forget to save your work!
contests.proposal.tabs.description=Description
contests.proposal.tabs.impact=Impact
contests.proposal.tabs.contributors=Contributors
@@ -2,6 +2,7 @@
$.fn.modal.Constructor.prototype.enforceFocus = function() {
modal_this = this;
$(document).on('focusin.modal', function (e) {
console.log("Modal window opened.")
if (modal_this.$element[0] !== e.target && !modal_this.$element.has(e.target).length
&& !$(e.target.parentNode).hasClass('cke_dialog_ui_input_select')
&& $(e.target.parentNode).hasClass('cke_contents cke_reset')
@@ -4,7 +4,7 @@ CKEDITOR.editorConfig = function( config ) {

config.extraPlugins = 'justify,colorbutton,uploadimage,copyformatting,font,indentblock';
config.uploadUrl = '/image/uploadCkEditor';
config.filebrowserImageUploadUrl = '/image/uploadCkEditor';
config.filebrowserImageUploadUrl = '/image/uploadCkEditor?' + _csrf.parameterName + '=' + _csrf.token ;
config.toolbar = 'custom';
config.toolbar_custom = [
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ,'-','CopyFormatting'] },
@@ -102,24 +102,7 @@

<c:set var="createArticleFolderURL" value="/content-editor/createArticleFolder"/>

<c:if test="${not empty param.articleId}">
<script>

<![CDATA[
jQuery(function () {

loadArticleVersionContent(THRESHOLD_TO_AVOID_NODE_COLISION + ${param.articleId},
"");

window.setTimeout(function () {
$("#article-view").unmask()
}, 2000);

});

]]>
</script>
</c:if>
<script>
<![CDATA[

@@ -189,7 +172,7 @@
}//<small>
},
onCanMoveTo: function (moved_node, target_node, position) {
console.log("target_node " + target_node.id + " - " + target_node.kind);
//console.log("target_node " + target_node.id + " - " + target_node.kind);
return target_node.kind == "folder";
},
onCanMove: function (node) {
@@ -258,6 +241,12 @@
}
}
);
$treeView.on(
'tree.loading_data',
function(e) {
console.log(e.isLoading, e.node, e.$el);
}
);
$treeView.bind(
'tree.move',
function (event) {
@@ -375,7 +364,7 @@
if (lang) {
parameters = {articleId: id, encoding: lang};
}

//console.log("Retrieving the data from server ajax call at " + new Date());
$.get(url, parameters, loadContentArticleResponse);

}
@@ -449,9 +438,12 @@
} else {
$("#articleURL").html('');
}

ckEditor.setReadOnly(false);
if(ckEditor === undefined) {
ckEditor.setReadOnly(false);
}
$("#article-view").unmask()
console.log("Should have unmasked this")


}

@@ -531,6 +523,25 @@

]]>
</script>
<c:if test="${not empty param.articleId}">
<script>

<![CDATA[
jQuery(function () {

loadArticleVersionContent(THRESHOLD_TO_AVOID_NODE_COLISION + ${param.articleId},
"");

/*window.setTimeout(function () {
console.log("Timed out ")
$("#article-view").unmask()
}, 2000);*/

});

]]>
</script>
</c:if>
<div class="contentEditor">
<div class="contentBody">
<ul class="nav nav-tabs">
@@ -270,9 +270,9 @@

$('#mainContent').val(mainContentArticleId);

if (menuArticleId != 0) {
//if (menuArticleId != 0) {
$('#leftMenu').val(menuArticleId);
}
//}

$("#createdAtDate").html("Created at: " + formatDate(data.createdAt));

@@ -322,8 +322,8 @@
noty({text: 'Page saved successfully', type: 'success'});
$("#article-view").unmask();
$('#tree-view').tree('reload');
var id = articleId + THRESHOLD_TO_AVOID_NODE_COLISION;
loadPageContent(id, folderName);
//var id = response.articleVersionId + THRESHOLD_TO_AVOID_NODE_COLISION;
//loadPageContent(id, "");
});
}

0 comments on commit 164ff6e

Please sign in to comment.
You can’t perform that action at this time.