001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.microservice.springboot.template; 018 019import org.apache.juneau.html.annotation.*; 020import org.apache.juneau.microservice.resources.*; 021import org.apache.juneau.rest.annotation.*; 022import org.apache.juneau.rest.springboot.*; 023import org.apache.juneau.rest.widget.*; 024import org.apache.juneau.serializer.annotation.*; 025 026/** 027 * Sample REST resource showing how to implement a "router" resource page. 028 * 029 * <h5 class='section'>See Also:</h5><ul> 030 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/MySpringBootMicroserviceBasics">My SpringBoot Microservice Basics</a> 031 * </ul> 032 * 033 * @serial exclude 034 */ 035@Rest( 036 path="/*", 037 title="Root resources", 038 description="Example of a router resource page.", 039 children={ 040 HelloWorldResource.class, 041 ConfigResource.class 042 } 043) 044@HtmlDocConfig( 045 widgets={ 046 ContentTypeMenuItem.class, 047 ThemeMenuItem.class 048 }, 049 navlinks={ 050 "api: servlet:/api", 051 "stats: servlet:/stats", 052 "$W{ContentTypeMenuItem}", 053 "$W{ThemeMenuItem}", 054 "source: $C{Source/gitHub}/org/apache/juneau/examples/rest/$R{servletClassSimple}.java" 055 }, 056 aside={ 057 "<div class='text'>", 058 " <p>This is an example of a 'router' page that serves as a jumping-off point to child resources.</p>", 059 " <p>Resources can be nested arbitrarily deep through router pages.</p>", 060 " <p>Note the <span class='link'>options</span> link provided that lets you see the generated swagger doc for this page.</p>", 061 " <p>Also note the <span class='link'>sources</span> link on these pages to view the source code for the page.</p>", 062 " <p>All content on pages in the UI are serialized POJOs. In this case, it's a serialized array of beans with 2 properties, 'name' and 'description'.</p>", 063 " <p>Other features (such as this aside) are added through annotations.</p>", 064 "</div>" 065 }, 066 asideFloat="RIGHT" 067) 068@SerializerConfig( 069 // For testing purposes, we want to use single quotes in all the serializers so it's easier to do simple 070 // String comparisons. 071 // You can apply any of the Serializer/Parser/BeanContext settings this way. 072 quoteChar="'" 073) 074public class RootResources extends BasicSpringRestServletGroup { 075 private static final long serialVersionUID = 1L; 076}