/*
ESUP-portail is a french academic project developed under the GPL (General Public License) augmented according to the following :
A binary or source file developped by ESUP-portail can be used or compiled with products under Apache license.
The official english text of the GPL can be found here : http://www.gnu.org/licenses/gpl.html .
A non official french translation can be found here : http://www.linux-France.org/article/these/gpl.html .
The different kinds of licenses governing the products developed by the Apache foundation can be found here : http://www.apache.org/licenses .
It follows that you can as well as use download contents as well modify and redistribute them provided you respect the GPL terms.
Downloading and using such contents do not provide any guaranty.
Be sure that you have well understood the terms of the license before using the contents it covers.
The ESUP-portail distribution includes the following distributions :
    * UPortal :
      software developed by JA-SIG (Java Architecture - Special Interest Group)
      You can find the license page here : http://mis105.udel.edu/ja-sig/uportal/license.html
    * CAS :
      SSO solution developed by Yale University
      You can find the project page here : http://www.yale.edu/tp/auth
    * Cocoon :
      XML framework distributed by the Apache foundation under Apache license;
      Please find the full text here : http://cocoon.apache.org/2.1/license.html
    * Mod_dav:
      A DAV module for Apache web server
      You can find the project page here : http://www.webdav.org/mod_dav
    * IMP :
      webmail from Horde application framework
      You can find the project page here : http://www.horde.org
    * …. To be completed
*/

package org.esupportail.portal.channels.CStockage.channelAction;

import java.util.ArrayList;
import java.util.Vector;

import org.esupportail.portal.channels.CStockage.config.ChannelConfiguration;
import org.esupportail.portal.channels.CStockage.config.Space;
import org.esupportail.portal.channels.CStockage.exception.ChannelException;
import org.jasig.portal.ChannelRuntimeData;
import org.jasig.portal.ChannelStaticData;
import org.jasig.portal.PortalException;
import org.jasig.portal.utils.XSLT;
import org.xml.sax.ContentHandler;

/**
 * Id: AbstractChannelAction.java,v 1.0 24 sept. 2004
 * Copyright (c) 2004 Esup Portail (www.esup-portail.org)
 * Classes: AbstractChannelAction
 * Original Author: Yohan Colmant
 * 
 */
public abstract class AbstractChannelAction {
	
	/**
	 * the space containing this channel action
	 */
	protected Space currentSpace;
	
	/**
  	 * The config object
  	 */
	protected ChannelConfiguration config;
  	
  	/**
	 * The spaces availables
	 */
	protected ArrayList spaces;
	
	
	/**
	 * Object used to keep the objects used between 2 actions, for example, the clipboard
	 */
	protected BufferAction buffer;
	
	/**
	 * The user login in the portal
	 */
	protected String userPortalLogin;
	
	/**
	 * The groups of the user in the portal
	 */
	protected Vector userGroups;
	
	
	
	
	/**
	 * Init the object used to manage the actions of the channel
	 * @param currentSpace the current space used
	 * @param spaces all the spaces used
	 * @param config the config class
	 * @param buffer the buffer used to get for example the clipboard
	 * @param userPortalLogin The user login in the portal
	 * @param userGroups The groups of the user in the portal
	 * @throws ChannelException
	 */
	public void init(Space currentSpace, ArrayList spaces, ChannelConfiguration config, BufferAction buffer, String userPortalLogin, Vector userGroups) throws ChannelException {
		this.currentSpace = currentSpace;
		this.config = config;
		this.spaces = spaces;
		this.buffer = buffer;
		this.userPortalLogin = userPortalLogin;
		this.userGroups = userGroups;
	}
	
	
	/**
	 * Manage the actions when refreshing the channel
	 * @param staticData the static data channel object
	 * @param runtimeData the runtime data channel object
	 * @param out the contentHandler used in the renderXml
	 * @param xslt the xslt motor object
	 * @param setStaticDataException the excpetion throwed in the setStaticData method
	 * @throws PortalException
	 */
	public abstract void checkCalledAction(ChannelStaticData staticData, ChannelRuntimeData runtimeData, ContentHandler out, XSLT xslt, ChannelException setStaticDataException) throws PortalException;
	
	
	
	
	
	
	
	
	
	
}
