001/* 002 * This library is part of OpenCms - 003 * the Open Source Content Management System 004 * 005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com) 006 * 007 * This library is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * This library is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * For further information about Alkacon Software, please see the 018 * company website: http://www.alkacon.com 019 * 020 * For further information about OpenCms, please see the 021 * project website: http://www.opencms.org 022 * 023 * You should have received a copy of the GNU Lesser General Public 024 * License along with this library; if not, write to the Free Software 025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 026 */ 027 028package org.opencms.gwt.shared; 029 030import org.opencms.util.CmsUUID; 031 032import com.google.gwt.user.client.rpc.IsSerializable; 033 034/** 035 * Parameters used by the quick launch provider.<p> 036 */ 037public class CmsQuickLaunchParams implements IsSerializable { 038 039 /** Context (sitmap or page editor). */ 040 private String m_context; 041 042 /** Page id. */ 043 private CmsUUID m_pageId; 044 045 /** Detail content id. */ 046 private CmsUUID m_detailId; 047 048 /** Return code. */ 049 private String m_returnCode; 050 051 /** Path. */ 052 private String m_path; 053 054 /** 055 * Creates a new instance.<p> 056 * 057 * @param context the quick launch context 058 * @param pageId the page id 059 * @param detailId the detail content id 060 * @param returnCode the return code 061 * @param path the path 062 */ 063 public CmsQuickLaunchParams(String context, CmsUUID pageId, CmsUUID detailId, String returnCode, String path) { 064 m_context = context; 065 m_pageId = pageId; 066 m_detailId = detailId; 067 m_returnCode = returnCode; 068 m_path = path; 069 } 070 071 /** 072 * Default constructor for serialization.<p> 073 */ 074 protected CmsQuickLaunchParams() { 075 // do nothing 076 } 077 078 /** 079 * Returns the context.<p> 080 * 081 * @return the context 082 */ 083 public String getContext() { 084 085 return m_context; 086 } 087 088 /** 089 * Returns the detailId.<p> 090 * 091 * @return the detailId 092 */ 093 public CmsUUID getDetailId() { 094 095 return m_detailId; 096 } 097 098 /** 099 * Returns the pageId.<p> 100 * 101 * @return the pageId 102 */ 103 public CmsUUID getPageId() { 104 105 return m_pageId; 106 } 107 108 /** 109 * Gets the path.<p> 110 * 111 * @return the path 112 */ 113 public String getPath() { 114 115 return m_path; 116 } 117 118 /** 119 * Returns the returnCode.<p> 120 * 121 * @return the returnCode 122 */ 123 public String getReturnCode() { 124 125 return m_returnCode; 126 } 127 128 /** 129 * Returns true if the quick launcher is called from the page editor.<p> 130 * 131 * @return true if the quick launcher was called from the page editor 132 */ 133 public boolean isPageContext() { 134 135 return CmsGwtConstants.QuickLaunch.CONTEXT_PAGE.equals(m_context); 136 } 137 138 /** 139 * Returns true if the quick launcher is called from the sitemap editor.<p> 140 * 141 * @return true if the quick launcher was called from the sitemap editor 142 */ 143 public boolean isSitemapContext() { 144 145 return CmsGwtConstants.QuickLaunch.CONTEXT_SITEMAP.equals(m_context); 146 } 147 148}