Commit 943fe08d authored by Unico Hommes's avatar Unico Hommes

HIPPLUG-1200 merge master changes into feature/translations-psp1

parents e0a95e9e d2702029
* text=auto !eol
/LICENSE -text
/NOTICE -text
addon-cms/pom.xml svneol=native#text/plain
addon-repository/pom.xml svneol=native#text/plain
addon-repository/src/main/resources/documentvaluelistprovider.xml svneol=native#text/plain
addon-repository/src/main/resources/hide-selection-namespace.xml svneol=native#text/plain
addon-repository/src/main/resources/hippoecm-extension.xml svneol=native#text/plain
addon-repository/src/main/resources/selection-namespace-BooleanRadioGroup.xml svneol=native#text/plain
addon-repository/src/main/resources/selection-namespace-RadioGroup.xml svneol=native#text/plain
addon-repository/src/main/resources/selection-namespace-listitem.xml svneol=native#text/plain
addon-repository/src/main/resources/selection-namespace-valuelist.xml svneol=native#text/plain
addon-repository/src/main/resources/selection-namespace.xml svneol=native#text/plain
addon-repository/src/main/resources/selection-types.cnd -text
addon-repository/src/main/resources/system-DynamicDropdown.xml svneol=native#text/plain
addon-repository/src/main/resources/system-StaticDropdown.xml svneol=native#text/plain
addon-repository/src/main/resources/type-translations.json -text
hst/pom.xml svneol=native#text/plain
/pom.xml svneol=native#text/plain
/.idea/
*.iml
target/
\ No newline at end of file
# Selections Plugin
This is the Selections plugin for Hippo CMS. Documentation on how to use this
plugin in your Hippo project can be found at:
http://www.onehippo.org/library/concepts/plugins/selections/about.html
## Plugin Demo
A demo project is provided to see the plugin in action.
### Requirements
* Java 8 JDK
* Maven 3
### Download, Build and Run the Demo Project
1. Download the plugin's source code from https://code.onehippo.org/cms-community/hippo-plugin-selections
* Alternatively you can clone the git repository on your local machine.
* Use the latest stable branch named "release/x" (or "demo/x" in case the
demo is tagged seperately) where "x" is the version number.
* If you want to build the master branch demo you must configure the Hippo
Maven snapshot repository. See
http://www.onehippo.org/library/development/build-hippo-cms-from-scratch.html
for instructions.
2. Extract the archive on your local file system.
3. Use Maven to build and run the demo project:
```bash
cd hippo-plugin-selections/demo
mvn verify
mvn -P cargo.run
```
4. Hippo CMS will be available at http://localhost:8080/cms/ (login using
credentials `admin`/`admin`).
The demo website will be available at http://localhost:8080/site/.
### Development Branches
To build and run the demo from a development branch you may need to configure
access to the Hippo Maven snapshots repository. For more information see the
following documentation page:
http://www.onehippo.org/library/development/build-hippo-cms-from-scratch.html
This diff is collapsed.
Hippo Plugin Selections Demo
Copyright 2009-2016 Hippo B.V. (http://www.onehippo.com)
This product includes software developed by:
Hippo B.V., Amsterdam, The Netherlands (http://www.onehippo.com/);
The Apache Software Foundation (http://www.apache.org/).
NOTICE: Only our own original work is licensed under the terms of the
Apache License Version 2.0. The licenses of some libraries might impose
different redistribution or general licensing terms than those stated in the
Apache License. Users and redistributors are hereby requested to verify these
conditions and agree upon them.
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2009-2015 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onehippo.cms7</groupId>
<artifactId>hippo-plugin-selections-demo</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
<name>Hippo Plugin Selections Demo Project CMS</name>
<description>Hippo Plugin Selections Demo Project CMS</description>
<artifactId>hippo-plugin-selections-demo-cms</artifactId>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.onehippo.cms7</groupId>
<artifactId>hippo-package-cms-dependencies</artifactId>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.onehippo.cms7.hst.dependencies</groupId>
<artifactId>hst-repository-dependencies</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.onehippo.cms7.hst.dependencies</groupId>
<artifactId>hst-cms-dependencies</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.onehippo.cms7</groupId>
<artifactId>hippo-package-cms-dependencies</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.onehippo.cms7</groupId>
<artifactId>hippo-addon-channel-manager-frontend</artifactId>
</dependency>
<dependency>
<groupId>org.onehippo.cms7</groupId>
<artifactId>hippo-addon-channel-manager-repository</artifactId>
</dependency>
<!-- Gallery picker dependency -->
<dependency>
<groupId>org.onehippo.cms7</groupId>
<artifactId>hippo-plugin-gallerypicker</artifactId>
</dependency>
<!-- demo content -->
<dependency>
<groupId>org.onehippo.cms7</groupId>
<artifactId>hippo-plugin-selections-demo-content</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<!-- selections plugins -->
<dependency>
<groupId>org.onehippo.cms7</groupId>
<artifactId>hippo-plugin-selections-addon-repository</artifactId>
</dependency>
<dependency>
<groupId>org.onehippo.cms7</groupId>
<artifactId>hippo-plugin-selections-addon-cms</artifactId>
</dependency>
</dependencies>
<build>
<defaultGoal>package</defaultGoal>
<finalName>cms</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<configuration>
<type>runtime</type>
</configuration>
<container>
<type>remote</type>
</container>
</configuration>
</plugin>
</plugins>
</build>
</project>
/*
* Copyright 2010-2016 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.
*/
package org.onehippo.forge.selectiondemo.provider;
import java.util.List;
import java.util.ArrayList;
import java.util.Locale;
import org.hippoecm.frontend.plugin.IPluginContext;
import org.hippoecm.frontend.plugin.Plugin;
import org.hippoecm.frontend.plugin.config.IPluginConfig;
import org.onehippo.forge.selection.frontend.model.ListItem;
import org.onehippo.forge.selection.frontend.model.ValueList;
import org.onehippo.forge.selection.frontend.provider.IValueListProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Example {@link org.onehippo.forge.selection.frontend.provider.IValueListProvider} showing the use of grouped list items. Grouped
* list items can be used inside a dropdown. Grouped items will be rendered as &lt;option&gt; elements inside an &lt;optgroup&gt; element.
*
* @author Dennis Dam
*/
public class CarsValueListProvider extends Plugin implements IValueListProvider {
static final Logger log = LoggerFactory.getLogger(CarsValueListProvider.class);
public CarsValueListProvider(IPluginContext context, IPluginConfig config) {
super(context, config);
context.registerService(this, config.getString(IValueListProvider.SERVICE));
if (log.isDebugEnabled()) {
log.debug(this.getClass().getName() + " registered under " + IValueListProvider.SERVICE);
}
}
public ValueList getValueList(IPluginConfig config) {
return getValueList("values");
}
public ValueList getValueList(String name) {
return getValueList(name, null/*locale*/);
}
public ValueList getValueList(String name, Locale locale) {
ValueList valuelist = new ValueList();
// NB locale is unused in this example
// 3 Cars from Ford : group them under the Ford header
valuelist.add(new ListItem("fordfiesta", "Ford Fiesta", "Ford"));
valuelist.add(new ListItem("fordtaurus", "Ford Taurus", "Ford"));
valuelist.add(new ListItem("fordfusion", "Ford Fusion", "Ford"));
// 1 Car from Porsche: don't use a group since it is only one item
valuelist.add(new ListItem("porschecarrera", "Porsche Carrera"));
// 3 Cars from Volkswagen : group them under the Volkswagen header
valuelist.add(new ListItem("vwgolf", "Volkswagen Golf", "Volkswagen"));
valuelist.add(new ListItem("vwbeetle", "Volkswagen Beetle", "Volkswagen"));
valuelist.add(new ListItem("vwtouareg", "Volkswagen Touareg", "Volkswagen"));
return valuelist;
}
public List<String> getValueListNames() {
ArrayList<String> list = new ArrayList<>();
list.add("values");
return list;
}
}
/*
* Copyright 2010-2016 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.
*/
package org.onehippo.forge.selectiondemo.provider;
import java.util.List;
import java.util.ArrayList;
import java.util.Locale;
import org.hippoecm.frontend.plugin.Plugin;
import org.hippoecm.frontend.plugin.IPluginContext;
import org.hippoecm.frontend.plugin.config.IPluginConfig;
import org.onehippo.forge.selection.frontend.model.ListItem;
import org.onehippo.forge.selection.frontend.model.ValueList;
import org.onehippo.forge.selection.frontend.provider.IValueListProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CustomValueListProvider extends Plugin implements IValueListProvider {
static final Logger log = LoggerFactory.getLogger(CustomValueListProvider.class);
public CustomValueListProvider(IPluginContext context, IPluginConfig config) {
super(context, config);
context.registerService(this, config.getString(IValueListProvider.SERVICE));
if (log.isDebugEnabled()) {
log.debug(this.getClass().getName() + " registered under " + IValueListProvider.SERVICE);
}
}
public ValueList getValueList(IPluginConfig config) {
return getValueList(config.getString("source", "values"));
}
public ValueList getValueList(String name) {
return getValueList(name, null/*locale*/);
}
public ValueList getValueList(String name, Locale locale) {
if (!"values".equals(name)) {
log.warn("unknown value list name " + name + " was requested, using 'values'");
}
ValueList valuelist = new ValueList();
if ((locale != null) && "nl".equals(locale.getLanguage())) {
valuelist.add(new ListItem("custom1", "Custom Waarde 1"));
valuelist.add(new ListItem("custom2", "Custom Waarde 2"));
valuelist.add(new ListItem("custom3", "Custom Waarde 3"));
} else {
valuelist.add(new ListItem("custom1", "Custom Value 1"));
valuelist.add(new ListItem("custom2", "Custom Value 2"));
valuelist.add(new ListItem("custom3", "Custom Value 3"));
}
return valuelist;
}
public List<String> getValueListNames() {
ArrayList<String> list = new ArrayList<>(1);
list.add("values");
return list;
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Authors: Chris Taylor, Ceki Gulcu. -->
<!-- Version: 1.2 -->
<!-- A configuration element consists of optional renderer
elements,appender elements, categories and an optional root
element. -->
<!ELEMENT log4j:configuration (renderer*, appender*,(category|logger)*,root?,
categoryFactory?)>
<!-- The "threshold" attribute takes a level value such that all -->
<!-- logging statements with a level equal or below this value are -->
<!-- disabled. -->
<!-- Setting the "debug" enable the printing of internal log4j logging -->
<!-- statements. -->
<!-- By default, debug attribute is "null", meaning that we not do touch -->
<!-- internal log4j logging settings. The "null" value for the threshold -->
<!-- attribute can be misleading. The threshold field of a repository -->
<!-- cannot be set to null. The "null" value for the threshold attribute -->
<!-- simply means don't touch the threshold field, the threshold field -->
<!-- keeps its old value. -->
<!ATTLIST log4j:configuration
xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/"
threshold (all|debug|info|warn|error|fatal|off|null) "null"
debug (true|false|null) "null"
>
<!-- renderer elements allow the user to customize the conversion of -->
<!-- message objects to String. -->
<!ELEMENT renderer EMPTY>
<!ATTLIST renderer
renderedClass CDATA #REQUIRED
renderingClass CDATA #REQUIRED
>
<!-- Appenders must have a name and a class. -->
<!-- Appenders may contain an error handler, a layout, optional parameters -->
<!-- and filters. They may also reference (or include) other appenders. -->
<!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)>
<!ATTLIST appender
name ID #REQUIRED
class CDATA #REQUIRED
>
<!ELEMENT layout (param*)>
<!ATTLIST layout
class CDATA #REQUIRED
>
<!ELEMENT filter (param*)>
<!ATTLIST filter
class CDATA #REQUIRED
>
<!-- ErrorHandlers can be of any class. They can admit any number of -->
<!-- parameters. -->
<!ELEMENT errorHandler (param*, root-ref?, logger-ref*, appender-ref?)>
<!ATTLIST errorHandler
class CDATA #REQUIRED
>
<!ELEMENT root-ref EMPTY>
<!ELEMENT logger-ref EMPTY>
<!ATTLIST logger-ref
ref IDREF #REQUIRED
>
<!ELEMENT param EMPTY>
<!ATTLIST param
name CDATA #REQUIRED
value CDATA #REQUIRED
>
<!-- The priority class is org.apache.log4j.Level by default -->
<!ELEMENT priority (param*)>
<!ATTLIST priority
class CDATA #IMPLIED
value CDATA #REQUIRED
>
<!-- The level class is org.apache.log4j.Level by default -->
<!ELEMENT level (param*)>
<!ATTLIST level
class CDATA #IMPLIED
value CDATA #REQUIRED
>
<!-- If no level element is specified, then the configurator MUST not -->
<!-- touch the level of the named category. -->
<!ELEMENT category (param*,(priority|level)?,appender-ref*)>
<!ATTLIST category
class CDATA #IMPLIED
name CDATA #REQUIRED
additivity (true|false) "true"
>
<!-- If no level element is specified, then the configurator MUST not -->
<!-- touch the level of the named logger. -->
<!ELEMENT logger (level?,appender-ref*)>
<!ATTLIST logger
name ID #REQUIRED
additivity (true|false) "true"
>
<!ELEMENT categoryFactory (param*)>
<!ATTLIST categoryFactory
class CDATA #REQUIRED>
<!ELEMENT appender-ref EMPTY>
<!ATTLIST appender-ref
ref IDREF #REQUIRED
>
<!-- If no priority element is specified, then the configurator MUST not -->
<!-- touch the priority of root. -->
<!-- The root category always exists and cannot be subclassed. -->
<!ELEMENT root (param*, (priority|level)?, appender-ref*)>
<!-- ==================================================================== -->
<!-- A logging event -->
<!-- ==================================================================== -->
<!ELEMENT log4j:eventSet (log4j:event*)>
<!ATTLIST log4j:eventSet
xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/"
version (1.1|1.2) "1.2"
includesLocationInfo (true|false) "true"
>
<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?,
log4j:locationInfo?) >
<!-- The timestamp format is application dependent. -->
<!ATTLIST log4j:event
logger CDATA #REQUIRED
level CDATA #REQUIRED
thread CDATA #REQUIRED
timestamp CDATA #REQUIRED
>
<!ELEMENT log4j:message (#PCDATA)>
<!ELEMENT log4j:NDC (#PCDATA)>
<!ELEMENT log4j:throwable (#PCDATA)>
<!ELEMENT log4j:locationInfo EMPTY>
<!ATTLIST log4j:locationInfo
class CDATA #REQUIRED
method CDATA #REQUIRED
file CDATA #REQUIRED
line CDATA #REQUIRED
>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright 2009-2014 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.
-->
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<!-- ====================================================================== -->
<!-- A P P E N D E R S -->
<!-- ====================================================================== -->
<!-- console -->
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} %-5p [%C.%M():%L] %m%n"/>
</layout>
</appender>
<!-- log4j.log -->
<appender name="root" class="org.apache.log4j.FileAppender">
<param name="File" value="target/log4j.log"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} %-5p [%C.%M():%L] %m%n"/>
</layout>
</appender>
<!-- ====================================================================== -->
<!-- L O G G E R S -->
<!-- ====================================================================== -->
<category additivity="false" name="org.apache.jackrabbit.core">
<level value="warn"/>
<appender-ref ref="root"/>
</category>
<category name="org.apache.jackrabbit.extractor">
<level value="error"/>
<appender-ref ref="root"/>
</category>
<category additivity="false" name="org.jpox.util">
<level value="error"/>
<appender-ref ref="root"/>
</category>
<category additivity="false" name="org.jpox">
<level value="error"/>
<appender-ref ref="root"/>
</category>
<category additivity="false" name="JPOX.Plugin">
<level value="error"/>
<appender-ref ref="root"/>
</category>
<category additivity="false" name="org.apache.wicket">
<level value="error"/>
<appender-ref ref="console"/>
</category>
<category additivity="false" name="org.hippoecm.repository.ocm.FieldManagerImpl">
<level value="warn"/>
<appender-ref ref="console"/>
</category>
<category additivity="false" name="org.hippoecm.repository.ocm.StoreManagerImpl">
<level value="warn"/>
<appender-ref ref="console"/>
</category>
<category additivity="false" name="org.hippoecm.repository.ocm">
<level value="warn"/>
<appender-ref ref="console"/>
</category>
<category additivity="false" name="org.hippoecm.repository.LocalHippoRepository">
<level value="warn"/>
<appender-ref ref="console"/>
</category>
<category additivity="false" name="org.hippoecm.repository.DerivedDataEngine">
<level value="warn"/>
<appender-ref ref="console"/>
</category>
<category additivity="false" name="org.hippoecm.repository.updater">
<level value="debug"/>
<appender-ref ref="root"/>
</category>
<category name="org.hippoecm.repository.jackrabbit.xml">
<level value="error"/>
<appender-ref ref="console"/>
</category>
<root>
<level value="warn"/>
<appender-ref ref="console"/>
<appender-ref ref="root"/>
</root>
</log4j:configuration>
<!doctype html>
<%--
Copyright 2009-2014 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.
--%>
<%@ page isErrorPage="true" %>
<% response.setStatus(500); %>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>500 error</title>
</head>
<body>
<h1>Server error</h1>
<% out.println("<!-- An unexcepted error occurred. The name of the exception is:"); %>
<%= exception %>
<% out.println("-->"); %>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2009-2014 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.