Commit de123be5 authored by Bert Leunis's avatar Bert Leunis

CMS-11897 create branch for 11.2; small code updates to match 11.2

Changes:
- bootstrapping by xml not yaml
- log4j was not yet level 2
- some methods in the repository were renamed
parent c78487a4
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2017-2018 Hippo B.V. (http://www.onehippo.com)
Copyright 2017-2019 Hippo B.V. (http://www.onehippo.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......@@ -21,12 +21,12 @@
<parent>
<groupId>org.onehippo.cms7</groupId>
<artifactId>hippo-cms7-project</artifactId>
<version>30.2.0-SNAPSHOT</version>
<version>28.14</version>
</parent>
<name>Hippo CMS7 Services - htmlprocessor</name>
<artifactId>hippo-services-htmlprocessor</artifactId>
<version>13.2.0-SNAPSHOT</version>
<version>11.2.0-SNAPSHOT</version>
<inceptionYear>2017</inceptionYear>
......@@ -35,8 +35,8 @@
<notice.project.name>Hippo CMS7 Services - htmlprocessor</notice.project.name>
<!-- runtime dependencies -->
<hippo.repository.version>13.2.0-SNAPSHOT</hippo.repository.version>
<hippo.services.version>13.2.0-SNAPSHOT</hippo.services.version>
<hippo.repository.version>4.2.15-SNAPSHOT</hippo.repository.version>
<hippo.services.version>3.2.9-SNAPSHOT</hippo.services.version>
<commons-lang.version>2.6</commons-lang.version>
<sf.htmlcleaner.version>2.22</sf.htmlcleaner.version>
......
/*
* Copyright 2017-2018 Hippo B.V. (http://www.onehippo.com)
* Copyright 2017-2019 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -46,13 +46,13 @@ public class HtmlProcessorServiceModule extends AbstractReconfigurableDaemonModu
@Override
protected void doInitialize(final Session session) throws RepositoryException {
service = new HtmlProcessorServiceImpl(config);
HippoServiceRegistry.register(service, HtmlProcessorService.class);
HippoServiceRegistry.registerService(service, HtmlProcessorService.class);
}
@Override
protected void doShutdown() {
if (service != null) {
HippoServiceRegistry.unregister(service, HtmlProcessorService.class);
HippoServiceRegistry.unregisterService(service, HtmlProcessorService.class);
}
}
}
definitions:
config:
/hippo:configuration/hippo:modules/htmlprocessor:
jcr:primaryType: hipposys:module
hipposys:className: org.onehippo.cms7.services.htmlprocessor.HtmlProcessorServiceModule
/hippo:moduleconfig:
jcr:primaryType: hipposys:moduleconfig
/richtext:
jcr:primaryType: hipposys:moduleconfig
charset: UTF-8
filter: true
omitComments: false
/a:
jcr:primaryType: hipposys:moduleconfig
attributes: [accesskey, charset, class, dir, href, id, lang, name, rel,
style, tabindex, target, title, type]
/address:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/b:
jcr:primaryType: hipposys:moduleconfig
/blockquote:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, style]
/br:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/body:
jcr:primaryType: hipposys:moduleconfig
/caption:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/code:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/div:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, id, lang, style, title]
/em:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/embed:
jcr:primaryType: hipposys:moduleconfig
attributes: [allowscriptaccess, height, src, type, width]
/h1:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, id, dir, style]
/h2:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, id, style]
/h3:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, id, style]
/h4:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, id, style]
/h5:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, id, style]
/h6:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, id, style]
/hr:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/html:
jcr:primaryType: hipposys:moduleconfig
/i:
jcr:primaryType: hipposys:moduleconfig
/iframe:
jcr:primaryType: hipposys:moduleconfig
attributes: [align, allow, allowfullscreen, class, frameborder, height, id, longdesc,
name, scrolling, src, style, title, width]
/img:
jcr:primaryType: hipposys:moduleconfig
attributes: [align, alt, border, class, height, hspace, src, style, title,
vspace, width]
/li:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, style]
/object:
jcr:primaryType: hipposys:moduleconfig
attributes: [align, class, data, height, id, style, title, type, width]
/ol:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, start, style]
/option:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, selected, style, value]
/p:
jcr:primaryType: hipposys:moduleconfig
attributes: [align, class, dir, style]
/param:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, name, value, style]
/pre:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/s:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/select:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, multiple, name, size, style]
/span:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, lang, style]
/strong:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/sub:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/sup:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/table:
jcr:primaryType: hipposys:moduleconfig
attributes: [align, border, cellpadding, cellspacing, class, dir, id,
style, summary, width]
/tbody:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/td:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, colspan, dir, rowspan, scope, style, valign, width]
/textarea:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, cols, name, rows, style]
/tfoot:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/th:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, colspan, rowspan, scope, style, valign, width]
/thead:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/tr:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/u:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/ul:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, style]
/formatted:
jcr:primaryType: hipposys:moduleconfig
charset: UTF-8
filter: true
omitComments: false
/address:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/br:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/em:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/h1:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, id, style]
/h2:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, id, style]
/h3:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, id, style]
/h4:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, id, style]
/h5:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, id, style]
/h6:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, dir, id, style]
/p:
jcr:primaryType: hipposys:moduleconfig
attributes: [align, class, dir, style]
/pre:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/strong:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/u:
jcr:primaryType: hipposys:moduleconfig
attributes: [class, style]
/no-filter:
jcr:primaryType: hipposys:moduleconfig
charset: UTF-8
filter: false
omitComments: false
group: hippo-cms
project:
name: hippo-services-htmlprocessor
after: hippo-repository
module: hippo-services-htmlprocessor
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2019 Hippo B.V. (http://www.onehippo.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS"
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" sv:name="hippo:initialize">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>hippo:initializefolder</sv:value>
</sv:property>
<sv:node sv:name="htmlprocessor-module">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>hippo:initializeitem</sv:value>
</sv:property>
<sv:property sv:name="hippo:sequence" sv:type="Double">
<sv:value>10</sv:value>
</sv:property>
<sv:property sv:name="hippo:contentresource" sv:type="String">
<sv:value>htmlprocessor-module.xml</sv:value>
</sv:property>
<sv:property sv:name="hippo:contentroot" sv:type="String">
<sv:value>/hippo:configuration/hippo:modules</sv:value>
</sv:property>
</sv:node>
</sv:node>
\ No newline at end of file
This diff is collapsed.
/*
* Copyright 2017-2018 Hippo B.V. (http://www.onehippo.com)
* Copyright 2017-2019 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -17,7 +17,7 @@ package org.onehippo.cms7.services.htmlprocessor.model;
import java.io.IOException;
import org.apache.logging.log4j.Level;
import org.apache.log4j.Level;
import org.easymock.EasyMock;
import org.junit.Before;
import org.junit.Test;
......
/*
* Copyright 2017 Hippo B.V. (http://www.onehippo.com)
* Copyright 2017-2019 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -18,8 +18,8 @@ package org.onehippo.cms7.services.htmlprocessor.richtext;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.log4j.Level;
import org.apache.log4j.spi.LoggingEvent;
import org.hippoecm.repository.api.HippoNodeType;
import org.onehippo.repository.mock.MockNode;
import org.onehippo.testutils.log4j.Log4jInterceptor;
......@@ -37,8 +37,8 @@ public class TestUtil {
public static void assertLogMessage(final Log4jInterceptor interceptor, final String message, final Level level) {
assertThat("There is a log message", interceptor.getEvents().size(), greaterThan(0));
final LogEvent logEntry = interceptor.getEvents().get(0);
assertThat(logEntry.getLevel(), is(level));
assertThat(logEntry.getMessage().getFormattedMessage(), is(message));
final LoggingEvent loggingEvent = interceptor.getEvents().get(0);
assertThat(loggingEvent.getLevel(), is(level));
assertThat(loggingEvent.getMessage().toString(), is(message));
}
}
/*
* Copyright 2017-2018 Hippo B.V. (http://www.onehippo.com)
* Copyright 2017-2019 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -18,7 +18,7 @@ package org.onehippo.cms7.services.htmlprocessor.richtext.jcr;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import org.apache.logging.log4j.Level;
import org.apache.log4j.Level;
import org.easymock.EasyMock;
import org.junit.Before;
import org.junit.Test;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment