Commit 668fcc87 authored by Ard Schrijvers's avatar Ard Schrijvers

HSTTWO-3257 move the parameter annotations from hst-api to cms7-commons...

HSTTWO-3257 move the parameter annotations from hst-api to cms7-commons because they require a shared classloader to be able to scan parameterinfo methods from a HstComponent class from a different webapp than the current
parent bfdce11a
......@@ -2,6 +2,16 @@
/LICENSE -text
/NOTICE -text
/pom.xml -text
src/main/java/org/hippoecm/hst/core/parameters/Color.java -text
src/main/java/org/hippoecm/hst/core/parameters/DocumentLink.java -text
src/main/java/org/hippoecm/hst/core/parameters/DropDownList.java -text
src/main/java/org/hippoecm/hst/core/parameters/EmptyPropertyEditor.java -text
src/main/java/org/hippoecm/hst/core/parameters/FieldGroup.java -text
src/main/java/org/hippoecm/hst/core/parameters/FieldGroupList.java -text
src/main/java/org/hippoecm/hst/core/parameters/ImageSetPath.java -text
src/main/java/org/hippoecm/hst/core/parameters/JcrPath.java -text
src/main/java/org/hippoecm/hst/core/parameters/Parameter.java -text
src/main/java/org/hippoecm/hst/core/parameters/ParametersInfo.java -text
src/main/java/org/hippoecm/hst/security/AuthenticationProvider.java -text
src/main/java/org/hippoecm/hst/security/Role.java -text
src/main/java/org/hippoecm/hst/security/TransientRole.java -text
......
/*
* Copyright 2011-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.
*/
package org.hippoecm.hst.core.parameters;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface Color {
}
/*
* Copyright 2011-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.
*/
package org.hippoecm.hst.core.parameters;
import java.lang.String;import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface DocumentLink {
/**
* Specifies the node type of the document to be searched for.
* @return the document type String
*/
String docType() default ""; //Document type is only used when a DOCUMENT type is used.
/**
* @return specifies whether to show a link to create a new document of the type as specified by the docType
*/
boolean allowCreation() default false;
/**
* @return the relative path of the folder where the document is created
*/
String docLocation() default "";
}
/*
* Copyright 2011-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.
*/
package org.hippoecm.hst.core.parameters;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Indicates that the value of the annotated method should be selected from a drop-down list. The available options
* in the drop-down list are specified as an array of Strings.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface DropDownList {
/**
* List of options to show in the drop-down list. The selected option value is converted from a
* {@link String} to the return type of the annotated method
*
* @return the options to show in the drop-down list.
*/
String[] value();
}
/*
* Copyright 2011-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.
*/
package org.hippoecm.hst.core.parameters;
import java.beans.PropertyEditor;
/**
* Marker interface for what doesn't support custom property editor
* @version $Id$
*/
public interface EmptyPropertyEditor extends PropertyEditor {
}
/*
* Copyright 2011-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.
*/
package org.hippoecm.hst.core.parameters;
import java.lang.String;import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Indicates that the annotated class contains a set of channel properties that have to be rendered as a group in a
* certain order. This annotation should only be used on interfaces that map to channel information.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface FieldGroup {
/**
* Returns the array of channel property names in this field group. The properties should be rendered as a group
* in the array order.
*
* @return the array of channel property names in this field group.
*/
String[] value();
/**
* Returns the title key of this field group. If the title key is present in the resource bundle of the channel
* properties class, that translated title will be rendered above the properties in this field group. By default,
* the title key of a field group is an empty string.
*
* @return the title key of this field group.
*/
String titleKey() default "";
}
/*
* Copyright 2011-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.
*/
package org.hippoecm.hst.core.parameters;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Indicates that the annotated class contains a set of field groups that have to be rendered in a
* certain order. This annotation should only be used on interfaces that map to channel information.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface FieldGroupList {
/**
* @return the array of {@FieldGroup}s that should be rendered in the array order.
*/
FieldGroup[] value();
}
/*
* Copyright 2011-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.
*/
package org.hippoecm.hst.core.parameters;
import java.lang.String;import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Indicates that the annotated method returns the absolute path to the handle of an image set.
* This annotation should only be used on public getter methods.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface ImageSetPath {
/**
* The variant in the image set to use as the preview image in the CMS (i.e. the CND child node name).
* By default an empty string is returned, which means "use the primary item". If the given variant cannot be
* found, the primary item is used instead.
*
* @return the CND name of the image set variant to use as the preview image in the CMS.
*/
String previewVariant() default "";
/**
* The root path of the CMS configuration to use for the image picker dialog, relative to
* '/hippo:configuration/hippo:frontend/cms'. The default picker configuration is 'cms-pickers/images'.
*
* @return the root path of the CMS configuration to use for the image picker dialog, relative to
* '/hippo:configuration/hippo:frontend/cms'.
*
*/
String pickerConfiguration() default "cms-pickers/images";
/**
* The initial path to use in the CMS image picker if nothing has been selected yet. Use the path to a folder
* to initially open the image picker dialog in that folder. Use the path to the handle of an image set to
* preselect that image set.
*
* @return the initial path to use in the CMS image picker, or an empty string if the default initial path of
* the image picker should be used.
*/
String pickerInitialPath() default "";
/**
* Whether the image picker remembers the last visited folder and image. The default is 'true'.
*
* @return whether the image picker remembers the last visited folder and image.
*/
boolean pickerRemembersLastVisited() default true;
/**
* Types of nodes to be able to select in the CMS image picker. The default node type is 'hippogallery:imageset'.
*
* @return the node types to be able to select in the CMS image picker.
*/
String[] pickerSelectableNodeTypes() default { "hippogallery:imageset" };
}
/*
* Copyright 2011-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.
*/
package org.hippoecm.hst.core.parameters;
import java.lang.String;import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Indicates that the annotated method returns a JCR path that can be selected via a 'picker'. The path can be absolute,
* or relative to the canonical content root of the channel in which this annotation is used (see {@link #isRelative()}).
*
* This annotation should only be used on public getter methods.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface JcrPath {
/**
* The root path of the CMS configuration to use for the picker, relative to
* '/hippo:configuration/hippo:frontend/cms'. The default picker configuration is 'cms-pickers/documents'.
*
* @return the root path of the CMS configuration to use for the picker, relative to
* '/hippo:configuration/hippo:frontend/cms'.
*
*/
String pickerConfiguration() default "cms-pickers/documents";
/**
* The initial path to use in the picker if nothing has been selected yet. Use the path to a folder
* to initially open the picker in that folder. Use the path to the handle of a document to
* preselect that document.
*
* @return the initial path to use in the picker, or an empty string if the default initial path of
* the picker should be used.
*/
String pickerInitialPath() default "";
/**
* Whether the picker remembers the last visited path. The default is 'true'.
*
* @return whether the picker remembers the last visited path.
*/
boolean pickerRemembersLastVisited() default true;
/**
* Types of nodes to be able to select in the picker. The default list is empty, resulting in the default
* behavior of the picker.
*
* @return the node types to be able to select in the picker.
*/
String[] pickerSelectableNodeTypes() default {};
/**
* Whether this path is relative to the canonical content root path of the channel in which this annotation is
* used. The default is 'false', i.e. the path is absolute.
*
* @return whether this path is relative to the canonical content root path of the channel in which this annotation
* is used.
*/
boolean isRelative() default false;
}
/*
* Copyright 2011-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.
*/
package org.hippoecm.hst.core.parameters;
import java.beans.PropertyEditor;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Annotation indicating that a getter method returns the value of an HST parameter.
*
* @see {@link ParametersInfo}
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface Parameter {
/**
* @return the name of the parameter used, also see org.hippoecm.hst.configuration.components.HstComponentConfiguration#getParameter( String ). This element is mandatory.
*/
String name();
/**
* @return <code>true</code> if this is a required parameter for the org.hippoecm.hst.core.component.HstComponent to work
*/
boolean required() default false;
/**
* @return the default value of this parameter when it is not present in the backing org.hippoecm.hst.configuration.components.HstComponentConfiguration#getParameters(). If there is
* no defaultValue defined, it is an empty String <code>""</code>
*/
String defaultValue() default "";
/**
* @return the displayName of this parameter. This can be the 'pretty' name for {@link #name()}. If missing, implementations can do
* a fallback to {@link #name()}
*/
String displayName() default "";
/**
* @return the description for this {@link org.hippoecm.hst.core.parameters.Parameter}
*/
String description() default "";
/**
* @return <code>true</code> if the parameter should not be shown in the channel manager UI
*/
boolean hideInChannelManager() default false;
/**
* This is still experimental.
* @return a PropertyEditor
*/
Class<? extends PropertyEditor> customEditor() default EmptyPropertyEditor.class;
}
/*
* Copyright 2010-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.
*/
package org.hippoecm.hst.core.parameters;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* <p>
* This is an annotation to be used for org.hippoecm.hst.core.component.HstComponent's. This way, an org.hippoecm.hst.core.component.HstComponent's parameters can be <i>bridged</i> to
* the actual parameters to be expected in the org.hippoecm.hst.configuration.components.HstComponentConfiguration. Also, this annotation can be used to inform YUI tools about
* which parameters can be configured for the org.hippoecm.hst.core.component.HstComponent that has this annotation.
* </p>
* <p>
* For example you can write your org.hippoecm.hst.core.component.HstComponent for a search as follows:
* <blockquote>
* <pre>
* {@code
* @ParametersInfo(type = SearchInfo.class)
* public class Search extends BaseHstComponent {
* public static final Logger log = LoggerFactory.getLogger(SearchNoParameterInfo.class);
* @Override
* public void doBeforeRender(HstRequest request, HstResponse response) throws HstComponentException {
* SearchInfo info = getParametersInfo(request);
* }
* </pre>
* </blockquote>
* </p>
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface ParametersInfo {
Class<?> type();
}
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