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.examples.rest; 018 019import org.apache.juneau.examples.rest.dto.*; 020import org.apache.juneau.html.annotation.*; 021import org.apache.juneau.microservice.resources.*; 022import org.apache.juneau.rest.annotation.*; 023import org.apache.juneau.rest.servlet.*; 024import org.apache.juneau.rest.widget.*; 025import org.apache.juneau.serializer.annotation.*; 026 027/** 028 * Sample REST resource showing how to implement a "router" resource page. 029 * 030 * <h5 class='section'>See Also:</h5><ul> 031 032 * </ul> 033 * 034 * @serial exclude 035 */ 036@Rest( 037 title="Root resources", 038 description="Example of a router resource page.", 039 children={ 040 HelloWorldResource.class, 041 DtoExamples.class, 042 UtilityBeansResource.class, 043 HtmlBeansResource.class, 044 ConfigResource.class, 045 LogsResource.class, 046 ShutdownResource.class 047 } 048) 049@HtmlDocConfig( 050 widgets={ 051 ContentTypeMenuItem.class 052 }, 053 navlinks={ 054 "api: servlet:/api", 055 "stats: servlet:/stats", 056 "$W{ContentTypeMenuItem}", 057 "source: $C{Source/gitHub}/org/apache/juneau/examples/rest/RootResources.java" 058 }, 059 aside={ 060 "<div class='text'>", 061 " <p>This is an example of a 'router' page that serves as a jumping-off point to child resources.</p>", 062 " <p>Resources can be nested arbitrarily deep through router pages.</p>", 063 " <p>Note the <span class='link'>API</span> link provided that lets you see the generated swagger doc for this page.</p>", 064 " <p>Also note the <span class='link'>STATS</span> link to view runtime statistics on this page.</p>", 065 " <p>Also note the <span class='link'>SOURCE</span> link to view the source code for the page.</p>", 066 " <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>", 067 " <p>Other features (such as this aside) are added through annotations.</p>", 068 "</div>" 069 }, 070 asideFloat="RIGHT" 071) 072@SerializerConfig( 073 // For testing purposes, we want to use single quotes in all the serializers so it's easier to do simple 074 // String comparisons. 075 // You can apply any of the Serializer/Parser/BeanContext settings this way. 076 quoteChar="'" 077) 078public class RootResources extends BasicRestServletGroup { 079 // IMPORTANT! If you don't need RDF support, change the parent interface to BasicUniversalConfig. 080 // It allows you to remove the Jena prerequisite. 081 082 private static final long serialVersionUID = 1L; 083}