001/*
002    Licensed to the Apache Software Foundation (ASF) under one
003    or more contributor license agreements.  See the NOTICE file
004    distributed with this work for additional information
005    regarding copyright ownership.  The ASF licenses this file
006    to you under the Apache License, Version 2.0 (the
007    "License"); you may not use this file except in compliance
008    with the License.  You may obtain a copy of the License at
009
010       http://www.apache.org/licenses/LICENSE-2.0
011
012    Unless required by applicable law or agreed to in writing,
013    software distributed under the License is distributed on an
014    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015    KIND, either express or implied.  See the License for the
016    specific language governing permissions and limitations
017    under the License.
018 */
019package org.apache.wiki.api.core;
020
021
022public enum ContextEnum {
023
024    GROUP_DELETE( "deleteGroup", "%uDeleteGroup.jsp?group=%n", null ),
025    GROUP_EDIT( "editGroup", "%uEditGroup.jsp?group=%n", "EditGroupContent.jsp" ),
026    GROUP_VIEW( "viewGroup", "%uGroup.jsp?group=%n", "GroupContent.jsp" ),
027
028    PAGE_ATTACH( "att", "%uattach/%n", null ),
029    PAGE_COMMENT( "comment", "%uComment.jsp?page=%n", "CommentContent.jsp" ),
030    PAGE_CONFLICT ( "conflict", "%uPageModified.jsp?page=%n", "ConflictContent.jsp" ),
031    PAGE_DELETE( "del", "%uDelete.jsp?page=%n", null ),
032    PAGE_DIFF( "diff", "%uDiff.jsp?page=%n", "DiffContent.jsp" ),
033    PAGE_EDIT( "edit", "%uEdit.jsp?page=%n", "EditContent.jsp" ),
034    PAGE_INFO( "info", "%uPageInfo.jsp?page=%n", "InfoContent.jsp" ),
035    PAGE_NONE( "", "%u%n", null ),
036    PAGE_PREVIEW( "preview", "%uPreview.jsp?page=%n", "PreviewContent.jsp" ),
037    PAGE_RENAME( "rename", "%uRename.jsp?page=%n", "InfoContent.jsp" ),
038    PAGE_RSS( "rss", "%urss.jsp", null ),
039    PAGE_UPLOAD( "upload", "%uUpload.jsp?page=%n", null ),
040    PAGE_VIEW( "view", "%uWiki.jsp?page=%n", "PageContent.jsp" ),
041
042    REDIRECT( "", "%u%n", null ),
043
044    WIKI_ADMIN( "admin", "%uadmin/Admin.jsp", "AdminContent.jsp" ),
045    WIKI_CREATE_GROUP( "createGroup", "%uNewGroup.jsp", "NewGroupContent.jsp" ),
046    WIKI_ERROR( "error", "%uError.jsp", "DisplayMessage.jsp" ),
047    WIKI_FIND( "find", "%uSearch.jsp", "FindContent.jsp" ),
048    WIKI_INSTALL( "install", "%uInstall.jsp", null ),
049    WIKI_LOGIN( "login", "%uLogin.jsp?redirect=%n", "LoginContent.jsp" ),
050    WIKI_LOGOUT( "logout", "%uLogout.jsp", null ),
051    WIKI_MESSAGE( "message", "%uMessage.jsp", "DisplayMessage.jsp" ),
052    WIKI_PREFS( "prefs", "%uUserPreferences.jsp", "PreferencesContent.jsp" ),
053    WIKI_WORKFLOW( "workflow", "%uWorkflow.jsp", "WorkflowContent.jsp" );
054
055    private final String contentTemplate;
056    private final String requestContext;
057    private final String urlPattern;
058
059    ContextEnum( final String requestContext, final String urlPattern, final String contentTemplate ) {
060        this.requestContext = requestContext;
061        this.urlPattern = urlPattern;
062        this.contentTemplate = contentTemplate;
063    }
064
065    public String getContentTemplate() {
066        return contentTemplate;
067    }
068
069    public String getRequestContext() {
070        return requestContext;
071    }
072
073    public String getUrlPattern() {
074        return urlPattern;
075    }
076
077}