Commit 8fd8c82a authored by Tobias Jeger's avatar Tobias Jeger

ESSENTIALS-709: "Rename" the EssentialsDocumentListComponentInfo for better naming consistency.

parent 5cbba6a1
......@@ -46,6 +46,7 @@ components/hst/src/main/java/org/onehippo/cms7/essentials/components/info/Essent
components/hst/src/main/java/org/onehippo/cms7/essentials/components/info/EssentialsGoogleMapsComponentInfo.java -text
components/hst/src/main/java/org/onehippo/cms7/essentials/components/info/EssentialsGoogleMapsComponentInfo.properties -text
components/hst/src/main/java/org/onehippo/cms7/essentials/components/info/EssentialsImageComponentInfo.java -text
components/hst/src/main/java/org/onehippo/cms7/essentials/components/info/EssentialsListComponentInfo.java -text
components/hst/src/main/java/org/onehippo/cms7/essentials/components/info/EssentialsListPickerComponentInfo.java -text
components/hst/src/main/java/org/onehippo/cms7/essentials/components/info/EssentialsMenuComponentInfo.java -text
components/hst/src/main/java/org/onehippo/cms7/essentials/components/info/EssentialsNewsComponentInfo.java -text
......
......@@ -38,7 +38,7 @@ import org.hippoecm.hst.core.component.HstResponse;
import org.hippoecm.hst.core.parameters.ParametersInfo;
import org.hippoecm.hst.core.request.HstRequestContext;
import org.hippoecm.hst.util.ContentBeanUtils;
import org.onehippo.cms7.essentials.components.info.EssentialsDocumentListComponentInfo;
import org.onehippo.cms7.essentials.components.info.EssentialsListComponentInfo;
import org.onehippo.cms7.essentials.components.info.EssentialsPageable;
import org.onehippo.cms7.essentials.components.info.EssentialsSortable;
import org.onehippo.cms7.essentials.components.paging.DefaultPagination;
......@@ -56,7 +56,7 @@ import com.google.common.base.Strings;
*
* @version "$Id$"
*/
@ParametersInfo(type = EssentialsDocumentListComponentInfo.class)
@ParametersInfo(type = EssentialsListComponentInfo.class)
public class EssentialsListComponent extends CommonComponent {
private static Logger log = LoggerFactory.getLogger(EssentialsListComponent.class);
......@@ -65,7 +65,7 @@ public class EssentialsListComponent extends CommonComponent {
@Override
public void doBeforeRender(final HstRequest request, final HstResponse response) {
super.doBeforeRender(request, response);
final EssentialsDocumentListComponentInfo paramInfo = getComponentParametersInfo(request);
final EssentialsListComponentInfo paramInfo = getComponentParametersInfo(request);
final String path = getScopePath(paramInfo);
log.debug("Calling EssentialsListComponent for documents path: [{}]", path);
final HippoBean scope = getSearchScope(request, path);
......@@ -134,7 +134,7 @@ public class EssentialsListComponent extends CommonComponent {
* @param componentInfo instance of EssentialsDocumentListComponentInfo
* @param <T> component info class.
*/
protected <T extends EssentialsDocumentListComponentInfo> void applyOrdering(final HstRequest request, final HstQuery query, final T componentInfo) {
protected <T extends EssentialsListComponentInfo> void applyOrdering(final HstRequest request, final HstQuery query, final T componentInfo) {
final String sortField = componentInfo.getSortField();
if (Strings.isNullOrEmpty(sortField)) {
return;
......@@ -148,7 +148,7 @@ public class EssentialsListComponent extends CommonComponent {
}
protected <T extends EssentialsDocumentListComponentInfo> Pageable<? extends HippoBean> doSearch(final HstRequest request, final T paramInfo, final HippoBean scope) {
protected <T extends EssentialsListComponentInfo> Pageable<? extends HippoBean> doSearch(final HstRequest request, final T paramInfo, final HippoBean scope) {
try {
final HstQuery build = buildQuery(request, paramInfo, scope);
if (build != null) {
......@@ -170,7 +170,7 @@ public class EssentialsListComponent extends CommonComponent {
* @param <T> type of component info interface
* @return pageable search results, or null if search failed.
*/
protected <T extends EssentialsDocumentListComponentInfo>
protected <T extends EssentialsListComponentInfo>
Pageable<HippoBean> doFacetedSearch(final HstRequest request, final T paramInfo, final HippoBean scope) {
Pageable<HippoBean> pageable = DefaultPagination.emptyCollection();
......@@ -202,7 +202,7 @@ public class EssentialsListComponent extends CommonComponent {
* @param scope the scope of the query
* @return the HST query to execute
*/
protected <T extends EssentialsDocumentListComponentInfo> HstQuery buildQuery(final HstRequest request, final T paramInfo, final HippoBean scope) {
protected <T extends EssentialsListComponentInfo> HstQuery buildQuery(final HstRequest request, final T paramInfo, final HippoBean scope) {
final QueryBuilder builder = new HstQueryBuilder(this, request);
final String documentTypes = paramInfo.getDocumentTypes();
final String[] types = SiteUtils.parseCommaSeparatedValue(documentTypes);
......@@ -221,7 +221,7 @@ public class EssentialsListComponent extends CommonComponent {
* @return the pageable result
* @throws QueryException query exception when query fails
*/
protected <T extends EssentialsDocumentListComponentInfo> Pageable<HippoBean> executeQuery(final HstRequest request, final T paramInfo, final HstQuery query) throws QueryException {
protected <T extends EssentialsListComponentInfo> Pageable<HippoBean> executeQuery(final HstRequest request, final T paramInfo, final HstQuery query) throws QueryException {
final int pageSize = getPageSize(request, paramInfo);
final int page = getCurrentPage(request);
query.setLimit(pageSize);
......@@ -238,7 +238,7 @@ public class EssentialsListComponent extends CommonComponent {
page);
}
protected <T extends EssentialsDocumentListComponentInfo> void applyExcludeScopes(final HstRequest request, final HstQuery query, final T paramInfo) {
protected <T extends EssentialsListComponentInfo> void applyExcludeScopes(final HstRequest request, final HstQuery query, final T paramInfo) {
// just an extension point for time being
}
......@@ -361,7 +361,7 @@ public class EssentialsListComponent extends CommonComponent {
* @param paramInfo the settings of the component
* @return the scope of the query
*/
protected String getScopePath(final EssentialsDocumentListComponentInfo paramInfo) {
protected String getScopePath(final EssentialsListComponentInfo paramInfo) {
if (paramInfo == null) {
log.warn("Component parameter was null for: {}", getClass().getName());
return null;
......
/*
* Copyright 2014 Hippo B.V. (http://www.onehippo.com)
* Copyright 2014-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.
......@@ -16,41 +16,12 @@
package org.onehippo.cms7.essentials.components.info;
import org.hippoecm.hst.core.parameters.JcrPath;
import org.hippoecm.hst.core.parameters.Parameter;
/**
* @version "$Id: EssentialsDocumentListComponentInfo.java 164011 2013-05-11 14:05:01Z mmilicevic $"
* @deprecated
* Due to naming inconsistencies, this interface has been deprecated in favor of the
* EssentialsListComponentInfo interface. This interface will be deleted in CMS 11.
*/
/*@FieldGroupList({
@FieldGroup(
titleKey = "group.constraints",
value = {"docType", "tags"}
),
@FieldGroup(
titleKey = "group.display",
value = {"pageSize"}
)
})*/
public interface EssentialsDocumentListComponentInfo extends EssentialsPageable, EssentialsSortable {
@Parameter(name = "path", required = false, displayName = "Documents path")
@JcrPath(
isRelative = true,
pickerConfiguration = "cms-pickers/documents",
pickerSelectableNodeTypes = {"hippostd:folder"}
)
String getPath();
@Parameter(name = "includeSubtypes", required = false, displayName = "Include document subtypes")
Boolean getIncludeSubtypes();
@Parameter(name = "documentTypes", required = false, displayName = "Document types (comma separated)")
String getDocumentTypes();
@Deprecated
public interface EssentialsDocumentListComponentInfo extends EssentialsListComponentInfo {
}
/*
* Copyright 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.onehippo.cms7.essentials.components.info;
import org.hippoecm.hst.core.parameters.JcrPath;
import org.hippoecm.hst.core.parameters.Parameter;
public interface EssentialsListComponentInfo extends EssentialsPageable, EssentialsSortable {
@Parameter(name = "path", required = false, displayName = "Documents path")
@JcrPath(
isRelative = true,
pickerConfiguration = "cms-pickers/documents",
pickerSelectableNodeTypes = {"hippostd:folder"}
)
String getPath();
@Parameter(name = "includeSubtypes", required = false, displayName = "Include document subtypes")
Boolean getIncludeSubtypes();
@Parameter(name = "documentTypes", required = false, displayName = "Document types (comma separated)")
String getDocumentTypes();
}
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