Skip to content

LUT-29659: Use RichTextContentService to enable the use of MarkDown r… #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<dependency>
<groupId>fr.paris.lutece</groupId>
<artifactId>lutece-core</artifactId>
<version>[7.1.1-SNAPSHOT,)</version>
<version>[7.1.2-SNAPSHOT,)</version>
<type>lutece-core</type>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@
import fr.paris.lutece.plugins.genericattributes.service.entrytype.AbstractEntryTypeComment;
import fr.paris.lutece.plugins.genericattributes.service.entrytype.EntryTypeServiceManager;
import fr.paris.lutece.plugins.genericattributes.service.entrytype.IEntryTypeService;
import fr.paris.lutece.portal.service.editor.RichTextContentService;
import fr.paris.lutece.portal.service.editor.RichTextParsingException;
import fr.paris.lutece.portal.service.image.ImageResourceManager;
import fr.paris.lutece.portal.service.template.AppTemplateService;
import fr.paris.lutece.portal.service.util.AppLogService;
import fr.paris.lutece.util.html.HtmlTemplate;

/**
Expand Down Expand Up @@ -221,8 +224,15 @@ public String getCompositeHtml( HttpServletRequest request, List<FormQuestionRes
}

_model.put( MARK_FIELDS_LIST_BY_ID_ENTRIES, fieldsList );

strQuestionTemplate = displayService.getEntryTemplateDisplay( request, _question.getEntry( ), locale, _model, displayType );
try
{
strQuestionTemplate = RichTextContentService.getContent( strQuestionTemplate );
}
catch (RichTextParsingException e)
{
AppLogService.error(e.getMessage(), e);
}

_model.put( FormsConstants.MARK_QUESTION_CONTENT, strQuestionTemplate );
_model.put( FormsConstants.MARK_QUESTION, _question );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
import fr.paris.lutece.plugins.forms.util.FormsResponseUtils;
import fr.paris.lutece.plugins.workflowcore.business.action.Action;
import fr.paris.lutece.portal.service.admin.AccessDeniedException;
import fr.paris.lutece.portal.service.editor.RichTextContentService;
import fr.paris.lutece.portal.service.editor.RichTextParsingException;
import fr.paris.lutece.portal.service.i18n.I18nService;
import fr.paris.lutece.portal.service.message.SiteMessage;
import fr.paris.lutece.portal.service.message.SiteMessageException;
Expand Down Expand Up @@ -175,7 +177,11 @@ public XPage getFormFileView( HttpServletRequest request ) throws SiteMessageExc
IEntryDisplayService displayService = EntryServiceManager.getInstance()
.getEntryDisplayService(fqr.getQuestion().getEntry().getEntryType());
if (displayService instanceof EntryTypeFileDisplayService) {
displayService.getEntryTemplateDisplay(request, fqr.getQuestion().getEntry(), locale, model, DisplayType.READONLY_FRONTOFFICE);
try {
RichTextContentService.getContent( displayService.getEntryTemplateDisplay(request, fqr.getQuestion().getEntry(), locale, model, DisplayType.READONLY_FRONTOFFICE) );
} catch (RichTextParsingException e) {
AppLogService.error( e.getMessage(), e );
}
}
});

Expand Down
2 changes: 1 addition & 1 deletion webapp/WEB-INF/plugins/forms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<db-pool-required>1</db-pool-required>

<core-version-dependency>
<min-core-version>6.1.0</min-core-version>
<min-core-version>7.1.2</min-core-version>
<max-core-version/>
</core-version-dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,5 @@
</@box>
</@columns>
</@row>
<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />

Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,4 @@
</@box>
</@columns>
</@row>
<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,4 @@
});
})
</script>
<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,4 @@
</@boxBody>
</@box>
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@initEditor />

</@row>
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,5 @@
</@box>
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@initEditor />

<@initEditor />
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,5 @@
</@box>
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />
<@toDayDate />
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@
</@box>
</@columns>
</@row>
<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />
<script>
<#noparse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@
</@box>
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />
<script>
$(function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,4 @@
});
})
</script>
<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,4 @@
</@box>
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@initEditor />
<@anonymPattern />

<@anonymPattern />
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@
</@boxBody>
</@box>
</@columns>
</@row>
<#include "/admin/util/editor/editor.html" />
<@initEditor />
</@row>
<script>
document.addEventListener('DOMContentLoaded', function () {
const form = document.getElementById('form-number');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,4 @@
</@boxBody>
</@box>
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@initEditor />
</@row>
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,4 @@
</@boxBody>
</@box>
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@initEditor />
</@row>
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,4 @@
</@boxBody>
</@box>
</@columns>
</@row>
<#include "/admin/util/editor/editor.html" />
<@initEditor />
</@row>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />
${breadcrumb_template}
<@row>
<@columns>
Expand Down Expand Up @@ -75,5 +74,4 @@
}
});
});
</script>
<@initEditor />
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,5 @@
</@box>
</@columns>
</@row>
<#include "/admin/util/editor/editor.html" />
<@confirmField />
<@anonymPattern />
<@initEditor />

<@anonymPattern />
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,4 @@
</@columns>
</@row>

<#include "/admin/util/editor/editor.html" />
<@anonymPattern />
<@initEditor />

<@anonymPattern />
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
Expand Down Expand Up @@ -101,5 +100,4 @@
</@columns>
</@tform>
</@row>
<@initEditor />
<@anonymPattern />
<@anonymPattern />
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -95,5 +94,4 @@
${ocr_mapping_template!}
<!-- ---------------------------------------------------------------- -->
</@row>
<@initEditor />
<@anonymPattern />
<@anonymPattern />
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,4 @@
</@box>
</@columns>
</@row>
<#include "/admin/util/editor/editor.html" />
<@anonymPattern />
<@initEditor />
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -116,5 +115,4 @@
}
});
})
</script>
<@initEditor />
</script>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -148,5 +147,4 @@
</#if>
</@box>
</@columns>
</@row>
<@initEditor />
</@row>
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
<@columns>
Expand Down Expand Up @@ -99,5 +97,4 @@
</@columns>
</@row>
<@anonymPattern />
<@initEditor />
<@toDayDate />
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -84,7 +83,6 @@
</@box>
</@columns>
</@row>
<@initEditor />
<@anonymPattern />
<script>
$( function(){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -78,7 +77,6 @@
</@box>
</@columns>
</@row>
<@initEditor />
<@anonymPattern />
<script>
$(function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -128,5 +127,4 @@
}
});
})
</script>
<@initEditor />
</script>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}

Expand Down Expand Up @@ -77,7 +76,6 @@
</@box>
</@columns>
</@row>
<@initEditor />
<script type="text/javascript">
function displayHideIteration( )
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}
<@row>
Expand Down Expand Up @@ -84,5 +83,4 @@
</@box>
</@columns>
</@row>
<@initEditor />
<@anonymPattern />
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<#include "all_entry_commons.html" />
<#include "/admin/util/editor/editor.html" />

${breadcrumb_template}

Expand Down
Loading