📄 i_cmsresourcebroker.java
字号:
/*
* File : $Source: /usr/local/cvs/opencms/src/com/opencms/file/I_CmsResourceBroker.java,v $
* Date : $Date: 2002/04/30 09:31:33 $
* Version: $Revision: 1.175 $
*
* This library is part of OpenCms -
* the Open Source Content Mananagement System
*
* Copyright (C) 2001 The OpenCms Group
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about OpenCms, please see the
* OpenCms Website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package com.opencms.file;
import javax.servlet.http.*;
import java.util.*;
import source.org.apache.java.io.*;
import source.org.apache.java.util.*;
import com.opencms.core.*;
/**
* This interface describes THE resource broker. All DB-specific access modules must
* implement this interface.
* The interface is local to package. <B>All</B> methods
* get additional parameters (callingUser and currentproject) to check the security-
* police.
*
* @author Michael Emmerich
* @version $Revision: 1.175 $ $Date: 2002/04/30 09:31:33 $
*
*/
public interface I_CmsResourceBroker {
/**
* Accept a task from the Cms.
*
* <B>Security:</B>
* All users are granted.
*
* @param currentUser The user who requested this method.
* @param currentProject The current project of the user.
* @param taskid The Id of the task to accept.
*
* @exception CmsException Throws CmsException if something goes wrong.
*/
public void acceptTask(CmsUser currentUser, CmsProject currentProject, int taskId)
throws CmsException ;
/**
* Checks, if the user may create this resource.
*
* @param currentUser The user who requested this method.
* @param currentProject The current project of the user.
* @param resource The resource to check.
*
* @return wether the user has access, or not.
*/
public boolean accessCreate(CmsUser currentUser, CmsProject currentProject,
String resourceName) throws CmsException;
/**
* Checks, if the user may lock this resource.
*
* @param currentUser The user who requested this method.
* @param currentProject The current project of the user.
* @param resource The resource to check.
*
* @return wether the user may lock this resource, or not.
*/
public boolean accessLock(CmsUser currentUser, CmsProject currentProject,
String resourceName) throws CmsException;
// Methods working with projects
/**
* Tests if the user can access the project.
*
* <B>Security:</B>
* All users are granted.
*
* @param currentUser The user who requested this method.
* @param currentProject The current project of the user.
* @param projectId the id of the project.
* @return true, if the user has access, else returns false.
* @exception CmsException Throws CmsException if something goes wrong.
*/
public boolean accessProject(CmsUser currentUser, CmsProject currentProject,
int projectId)
throws CmsException;
/**
* Checks, if the user may read this resource.
*
* @param currentUser The user who requested this method.
* @param currentProject The current project of the user.
* @param resource The resource to check.
*
* @return wether the user has access, or not.
*/
public boolean accessRead(CmsUser currentUser, CmsProject currentProject,
String resourceName) throws CmsException;
/**
* Checks, if the user may write this resource.
*
* @param currentUser The user who requested this method.
* @param currentProject The current project of the user.
* @param resource The resource to check.
*
* @return wether the user has access, or not.
*/
public boolean accessWrite(CmsUser currentUser, CmsProject currentProject,
String resourceName) throws CmsException;
/**
* adds a file extension to the list of known file extensions
*
* <B>Security:</B>
* Users, which are in the group "administrators" are granted.<BR/>
*
* @param currentUser The user who requested this method.
* @param currentProject The current project of the user.
* @param extension a file extension like 'html'
* @param resTypeName name of the resource type associated to the extension
*/
public void addFileExtension(CmsUser currentUser, CmsProject currentProject,
String extension, String resTypeName)
throws CmsException;
/**
* Add a new group to the Cms.<BR/>
*
* Only the admin can do this.<P/>
*
* <B>Security:</B>
* Only users, which are in the group "administrators" are granted.
*
* @param currentUser The user who requested this method.
* @param currentProject The current project of the user.
* @param name The name of the new group.
* @param description The description for the new group.
* @int flags The flags for the new group.
* @param name The name of the parent group (or null).
*
* @return Group
*
* @exception CmsException Throws CmsException if operation was not succesfull.
*/
public CmsGroup addGroup(CmsUser currentUser, CmsProject currentProject,
String name, String description, int flags, String parent)
throws CmsException;
/**
* Adds a user to the Cms.
*
* Only a adminstrator can add users to the cms.<P/>
*
* <B>Security:</B>
* Only users, which are in the group "administrators" are granted.
*
* @param currentUser The user who requested this method.
* @param currentProject The current project of the user.
* @param name The new name for the user.
* @param password The new password for the user.
* @param group The default groupname for the user.
* @param description The description for the user.
* @param additionalInfos A Hashtable with additional infos for the user. These
* Infos may be stored into the Usertables (depending on the implementation).
* @param flags The flags for a user (e.g. C_FLAG_ENABLED)
*
* @return user The added user will be returned.
*
* @exception CmsException Throws CmsException if operation was not succesfull.
*/
public CmsUser addUser(CmsUser currentUser, CmsProject currentProject,
String name, String password,
String group, String description,
Hashtable additionalInfos, int flags)
throws CmsException;
/**
* Adds a user to the Cms by import.
*
* Only a adminstrator can add users to the cms.<P/>
*
* <B>Security:</B>
* Only users, which are in the group "administrators" are granted.
*
* @param currentUser The user who requested this method.
* @param currentProject The current project of the user.
* @param name The name for the user.
* @param password The password for the user.
* @param recoveryPassword The recoveryPassword for the user.
* @param description The description for the user.
* @param firstname The firstname of the user.
* @param lastname The lastname of the user.
* @param email The email of the user.
* @param flags The flags for a user (e.g. C_FLAG_ENABLED)
* @param additionalInfos A Hashtable with additional infos for the user. These
* Infos may be stored into the Usertables (depending on the implementation).
* @param defaultGroup The default groupname for the user.
* @param address The address of the user
* @param section The section of the user
* @param type The type of the user
*
* @return user The added user will be returned.
*
* @exception CmsException Throws CmsException if operation was not succesfull.
*/
public CmsUser addImportUser(CmsUser currentUser, CmsProject currentProject,
String name, String password, String recoveryPassword, String description,
String firstname, String lastname, String email, int flags, Hashtable additionalInfos,
String defaultGroup, String address, String section, int type)
throws CmsException;
/**
* Adds a user to a group.<BR/>
*
* Only the admin can do this.<P/>
*
* <B>Security:</B>
* Only users, which are in the group "administrators" are granted.
*
* @param currentUser The user who requested this method.
* @param currentProject The current project of the user.
* @param username The name of the user that is to be added to the group.
* @param groupname The name of the group.
* @exception CmsException Throws CmsException if operation was not succesfull.
*/
public void addUserToGroup(CmsUser currentUser, CmsProject currentProject,
String username, String groupname)
throws CmsException;
/**
* Adds a web user to the Cms. <br>
*
* A web user has no access to the workplace but is able to access personalized
* functions controlled by the OpenCms.
*
* @param currentUser The user who requested this method.
* @param currentProject The current project of the user.
* @param name The new name for the user.
* @param password The new password for the user.
* @param group The default groupname for the user.
* @param description The description for the user.
* @param additionalInfos A Hashtable with additional infos for the user. These
* Infos may be stored into the Usertables (depending on the implementation).
* @param flags The flags for a user (e.g. C_FLAG_ENABLED)
*
* @return user The added user will be returned.
*
* @exception CmsException Throws CmsException if operation was not succesfull.
*/
public CmsUser addWebUser(CmsUser currentUser, CmsProject currentProject,
String name, String password,
String group, String description,
Hashtable additionalInfos, int flags)
throws CmsException;
/**
* Adds a web user to the Cms. <br>
*
* A web user has no access to the workplace but is able to access personalized
* functions controlled by the OpenCms.
*
* @param currentUser The user who requested this method.
* @param currentProject The current project of the user.
* @param name The new name for the user.
* @param password The new password for the user.
* @param group The default groupname for the user.
* @param additionalGroup An additional group for the user.
* @param description The description for the user.
* @param additionalInfos A Hashtable with additional infos for the user. These
* Infos may be stored into the Usertables (depending on the implementation).
* @param flags The flags for a user (e.g. C_FLAG_ENABLED)
*
* @return user The added user will be returned.
*
* @exception CmsException Throws CmsException if operation was not succesfull.
*/
public CmsUser addWebUser(CmsUser currentUser, CmsProject currentProject,
String name, String password,
String group, String additionalGroup, String description,
Hashtable additionalInfos, int flags)
throws CmsException;
/**
* Returns the anonymous user object.<P/>
*
* <B>Security:</B>
* All users are granted.
*
* @param currentUser The user who requested this method.
* @param currentProject The current project of the user.
* @return the anonymous user object.
* @exception CmsException Throws CmsException if operation was not succesful
*/
public CmsUser anonymousUser(CmsUser currentUser, CmsProject currentProject)
throws CmsException;
/**
* Changes the group for this resource<br>
*
* Only the group of a resource in an offline project can be changed. The state
* of the resource is set to CHANGED (1).
* If the content of this resource is not exisiting in the offline project already,
* it is read from the online project and written into the offline project.
* The user may change this, if he is admin of the resource. <br>
*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -