/* * #%L * wcm.io * %% * Copyright (C) 2014 wcm.io * %% * 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. * #L% */ package io.wcm.wcm.ui.extjs.provider.impl.servlets; import javax.servlet.Servlet; import org.apache.sling.api.servlets.HttpConstants; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.ReferenceCardinality; import com.day.cq.commons.predicate.PredicateProvider; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.wcm.wcm.commons.contenttype.FileExtension; import io.wcm.wcm.ui.extjs.provider.AbstractPageListProvider; /** * Exports the list of child pages of the addressed resource in JSON format to the response. * This can be used by the <code>io.wcm.wcm.ui.form.Selection</code> widget. */ @Component(service = Servlet.class, immediate = true, property = { "sling.servlet.extensions=" + FileExtension.JSON, "sling.servlet.selectors=" + PageListProvider.SELECTOR, "sling.servlet.resourceTypes=sling/servlet/default", "sling.servlet.methods=" + HttpConstants.METHOD_GET }) @SuppressFBWarnings("SE_BAD_FIELD") public final class PageListProvider extends AbstractPageListProvider { private static final long serialVersionUID = 1L; static final String SELECTOR = "wcm-io-wcm-ui-extjs-pagelist"; @Reference(cardinality = ReferenceCardinality.OPTIONAL) private PredicateProvider predicateProvider; @Override protected PredicateProvider getPredicateProvider() { return predicateProvider; } }