001/** 002 * Copyright 2015 Tampere University of Technology, Pori Department 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package service.tut.pori.contentsuggest.reference; 017 018import service.tut.pori.contentsuggest.Definitions; 019import core.tut.pori.http.Response; 020import core.tut.pori.http.annotations.HTTPMethodParameter; 021import core.tut.pori.http.annotations.HTTPService; 022import core.tut.pori.http.annotations.HTTPServiceMethod; 023import core.tut.pori.http.parameters.Limits; 024 025/** 026 * Generates example XML output 027 * 028 */ 029@HTTPService(name = service.tut.pori.contentsuggest.reference.Definitions.SERVICE_CS_REFERENCE_EXAMPLE) 030public class ExampleService { 031 /** 032 * Generates example autocomplete result 033 * 034 * @param limits paging limits 035 * @return AutoCompleteResult 036 * @see service.tut.pori.contentsuggest.AutoCompleteResult 037 */ 038 @HTTPServiceMethod(name = Definitions.ELEMENT_AUTOCOMPLETE_RESULTS) 039 public Response autoCompleteResult( 040 @HTTPMethodParameter(name = Limits.PARAMETER_DEFAULT_NAME, required=false, defaultValue="0-0") Limits limits 041 ) 042 { 043 Example example = new Example(); 044 example.setAutoCompleteResult(ContentSuggestReferenceCore.generateAutoCompleteResult(limits)); 045 return new Response(example); 046 } 047}