⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jetspeedlink.java

📁 jetspeed源代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/*
 * Copyright 2000-2001,2004 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.jetspeed.util.template;

// Jetspeed
import org.apache.jetspeed.portal.Portlet;
import org.apache.jetspeed.om.profile.Entry;
import org.apache.jetspeed.om.profile.Portlets;

// Turbine
import org.apache.turbine.util.DynamicURI;
import org.apache.turbine.util.RunData;

/**
 * <p>A customized version of the TemplateLink which can handle portlet
 * references.</p>
 *
 * <p>It is inserted into the template context by Turbine, via request tools.</p>
 *
 * <p>Each portlet must call setPortlet(this) on it before entering the template
 * rendering code. This is done currently in VelocityPortlet.</p>
 *
 * @author <a href="mailto:paulsp@apache.org">Paul Spencer</a>
 * @version $Id: JetspeedLink.java,v 1.15 2004/03/11 03:08:53 paulsp Exp $
 */
public interface JetspeedLink {
    
    public static int CURRENT = 101;
    public static int DEFAULT = 102;
    public static int GROUP = 201;
    public static int ROLE = 202;
    public static int USER = 203;
    public static int PANE_ID = 301;
    public static int PANE_NAME = 302;
    public static int PORTLET_ID = 303;
    public static int PORTLET_NAME = 304;
    public static int PORTLET_ID_QUERY = 305;
    
    
    /**
     * Adds a name=value pair to the path_info string.
     *
     * @param name A String with the name to add.
     * @param value An Object with the value to add.
     * @return DynamicURI that to the desired page
     */
    public DynamicURI addPathInfo(String name, Object value);
    
    /**
     * Adds a name=value pair to the query string.
     *
     * @param name A String with the name to add.
     * @param value An Object with the value to add.
     * @return DynamicURI that to the desired page
     */
    public DynamicURI addQueryData(String name, Object value);
    
    /**
     * Return the action key.  Used by velocity templates, i.e. $jlink.ActionKey
     *
     * @return the action parameter name
     */
    public String getActionKey();
    
    /**
     * Return link to the home page without user,
     * page, group, role, template, action, media type, language, or country
     * in link.
     * @return DynamicURI to the home page
     */
    public DynamicURI getHomePage();
    
    /**
     * This will initialise a JetspeedLink object that was
     * constructed with the default constructor
     *
     * @param rundata to be a RunData object
     */
    public void init(RunData rundata);
    
    /**
     * Return a link that includes the template
     * from rundata
     *
     * @return DynamicURI to template
     */
    public DynamicURI getTemplate();
    
    /**
     * Is the PSML for the anonymous user?
     *
     * @return True = PSML is for the anonymous user
     */
    public boolean getAnonymous();
    
    /**
     * Return country of the PSML file
     *
     * @return Country of PSML, or null if no country
     */
    public String getCountry();
    
    /**
     * Return Group name of the PSML file
     *
     * @return Group name of PSML, or null if no Group name
     */
    public String getGroupName();
    
    /**
     * Return Language of the PSML file
     *
     * @return Language of PSML, or null if no Language
     */
    public String getLanguage();
    
    /**
     * Return Media Type of the PSML file
     *
     * @return Media Type of PSML, or null if no Media Type
     */
    public String getMediaType();
    
    /**
     * Return Page name of the PSML file
     *
     * @return Page name of PSML, or null if no Page name
     */
    public String getPageName();
    
    /**
     * Return Role name of the PSML file
     *
     * @return Role name of PSML, or null if no Role name
     */
    public String getRoleName();
    
    /**
     * Return User name of the PSML file
     *
     * @return User name of PSML, or null if no User name
     */
    public String getUserName();
    
    /**
     * Return a link that includes an action
     *
     * @param action action
     * @return DynamicURI that includes the desire action
     */
    public DynamicURI getAction(String action);
    
    /**
     * Return a link that includes an action to a specific portlet, as defined
     * by an entry
     *
     * @param action Desired action
     * @param entry to receive the action
     * @return DynamicURI that includes the desire action
     */
    public DynamicURI getAction(String action, Entry entry);
    
    /**
     * Return a link that includes an action to a specific portlet, as defined
     * by a portlet
     *
     * @param action Desired action
     * @param portlet to receive the action
     * @return DynamicURI that includes the desire action
     */
    public DynamicURI getAction(String action, Portlet portlet);
    
    /**
     * Return a link that includes an action to a specific portlet, as defined
     * by a portlets
     *
     * @param action Desired action
     * @param portlet to receive the action
     * @return DynamicURI that includes the desire action
     */
    public DynamicURI getAction(String action, Portlets portlet);
    
    /**
     * Return a link that includes an action to a specific portlet, as defined
     * by a PEID
     *
     * @param action Desired action
     * @param peid Id of portlet to receive the action
     * @return DynamicURI that includes the desire action
     */
    public DynamicURI getAction(String action, String peid);

    /**
     * Return a link to a default page for the group
     *
     * @param group Desired group
     * @return DynamicURI that to the desired page
     */
    public DynamicURI getGroup(String group);
    
    /**
     * Return a link to a desired page for the group
     *
     * @param page Desired page
     * @param group Desired group
     * @return DynamicURI that to the desired page
     */
    public DynamicURI getGroup(String group, String page);
    
    /**
     * Return a link to a default page for the
     * current user, group, or role.
     *
     * @return DynamicURI that to the desired page
     */
    public DynamicURI getPage();
    
    /**
     * Return a link to a desired page for the
     * current user, group, or role.
     *
     * @param page Desired page
     * @return DynamicURI that to the desired page
     */
    public DynamicURI getPage(String page);
    
    /**
     * Return a link to a desired page and pane for the
     * current user, group, or role.
     *
     * @param page Desired page
     * @param paneName Name of desired pane
     * @return DynamicURI that to the desired page
     */
    public DynamicURI getPage(String page, String paneName);
    
    /**
     * Return an link to a specific portlet using the portet's id
     *
     * @param peid of the portlet
     * @return DynamicURI to specific portlet
     *
     */
    public DynamicURI getPortletById(String peid);
    
    /**
     * Add a portlet reference in the link.
     *
     * Note: This must be used with caution, since a portlet may exist may times
     * in a PSML.  setPortletById() is the perfered method.
     *
     * @param portletName the name of the portlet to link to
     * @return a DynamicURI referencing the named portlet for easy link construction in template
     *
     * @deprecated Use getPortletById()     
     */
    public DynamicURI getPortletByName(String portletName);
    
    /**
     * Return a link to a default page for the role
     *
     * @param role Desired role
     * @return DynamicURI that to the desired page
     */
    public DynamicURI getRole(String role);
    
    /**
     * Return a link to a desired page for the role
     *
     * @param role Desired role
     * @param page Desired page
     * @return DynamicURI that to the desired page
     */
    public DynamicURI getRole(String role, String page);
    
    /**
     * Return a link to the template.
     *
     * @param template to add to link
     * @return DynamicURI to specific portlet
     */
    public DynamicURI getTemplate(String template);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -