<commit_before>/**********************************************************************************
 * $URL$
 * $Id$
 ***********************************************************************************
 *
 * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 Sakai Foundation
 *
 * Licensed under the Educational Community 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.opensource.org/licenses/ECL-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.sakaiproject.site.api;

import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.sakaiproject.entity.api.Entity;
import org.sakaiproject.entity.api.EntityProducer;
import org.sakaiproject.exception.IdInvalidException;
import org.sakaiproject.exception.IdUnusedException;
import org.sakaiproject.exception.IdUsedException;
import org.sakaiproject.exception.InUseException;
import org.sakaiproject.exception.PermissionException;
import org.sakaiproject.javax.PagingPosition;
import org.w3c.dom.Element;

/**
 * <p>
 * SiteService manages Sites.
 * </p>
 */
public interface SiteService extends EntityProducer
{
	/** The type string for this application: should not change over time as it may be stored in various parts of persistent entities. */
	static final String APPLICATION_ID = "sakai:site";

	/** The Entity Reference sub-type for Site references. */
	static final String SITE_SUBTYPE = "site";

	/** The Entity Reference sub-type for Group references. */
	static final String GROUP_SUBTYPE = "group";

	/** The Entity Reference sub-type for Page references. */
	static final String PAGE_SUBTYPE = "page";

	/** The Entity Reference sub-type for Tool references. */
	static final String TOOL_SUBTYPE = "tool";

	/** This string starts the references to resources in this service. */
	static final String REFERENCE_ROOT = Entity.SEPARATOR + SITE_SUBTYPE;

	/** Name for the event of accessing role swap functionality. */
	static final String SITE_ROLE_SWAP = "site.roleswap";
	
	/** Name for the event of visiting a site. */
	static final String SITE_VISIT = "site.visit";

	/** Name for the event of visiting an unpublished site. */
	static final String SITE_VISIT_UNPUBLISHED = "site.visit.unp";

	/** Name for the event of accessing a site. */
	// static final String SECURE_ACCESS_SITE = "site.access";
	/** Name for the event of adding a site. */
	static final String SECURE_ADD_SITE = "site.add";

	/** Name for the event of adding a course site */ 
	static final String SECURE_ADD_COURSE_SITE = "site.add.course";
	
	/** Name for the event of adding a portfolio site */ 
	static final String SECURE_ADD_PORTFOLIO_SITE = "site.add.portfolio";
	
	/** Name for the event of adding a project site */ 
	static final String SECURE_ADD_PROJECT_SITE = "site.add.project";
	
	/** Name for the event of adding a user's My Workspace site. */
	static final String SECURE_ADD_USER_SITE = "site.add.usersite";

	/** Name for the event of removing a site. */
	static final String SECURE_REMOVE_SITE = "site.del";
	
	/** Name for the event of removing a site that has already been softly deleted */
	static final String SECURE_REMOVE_SOFTLY_DELETED_SITE = "site.del.softly.deleted";
	
	/** Name for the event of visiting a softly deleted site. */
	static final String SITE_VISIT_SOFTLY_DELETED = "site.visit.softly.deleted";

	/** Name for the event of updating a site. */
	static final String SECURE_UPDATE_SITE = "site.upd";

	/** Name for the event of updating a site's membership. */
	static final String SECURE_UPDATE_SITE_MEMBERSHIP = "site.upd.site.mbrshp";

	/** Name for the event of updating a site's groups' memberships. */
	static final String SECURE_UPDATE_GROUP_MEMBERSHIP = "site.upd.grp.mbrshp";

	/** Name for the event of viewing project site participants. */
	static final String SECURE_VIEW_ROSTER = "site.viewRoster";

	/** The name of the main container for a resource in a site (channel, calendar, etc.). */
	static final String MAIN_CONTAINER = "main";

	/** The name of a special site that is a template for non-user sites. */
	static final String SITE_TEMPLATE = "!worksite";

	/** The name of a special site that is a template for user sites. */
	static final String USER_SITE_TEMPLATE = "!user";

	/** The name of a special site that is used if the requested site is not available. */
	static final String SITE_ERROR = "!error";

	/** The name of a special site that is used if the requested url is not understood. */
	static final String URL_ERROR = "!urlError";

	/** The property to indicate a parent site's id */
	public static final String PROP_PARENT_ID = "sakai:parent-id";

	/** The property to indicate whether or not subsites are to be added to the tool list */
	public static final String PROP_SHOW_SUBSITES = "sakai:show-subsites";
	
	/** The configuration property for enabling or disabling user-site caching, defaults to true. */
	public static final String PROP_CACHE_USER_SITES = "user.site.cache.enabled";

	/**
	 * Event for adding user to site
	 * info logged: user id, site id, role name, active status, provided status
	 */
	static final String EVENT_USER_SITE_MEMBERSHIP_ADD = "user.site.membership.add";
	
	/**
	 * Event for changing user role in site
	 * info logged: user id, site id, old role name, new role name, active status, provided status
	 */
	static final String EVENT_USER_SITE_MEMBERSHIP_UPDATE = "user.site.membership.update";
	
	/**
	 * Event for removing user in site
	 * info logged: user id, site id, role name
	 */
	static final String EVENT_USER_SITE_MEMBERSHIP_REMOVE = "user.site.membership.delete";
	
	/**
	 * Event for adding user to group
	 * info logged: user id, group id, role name, active status, provided status
	 */
	static final String EVENT_USER_GROUP_MEMBERSHIP_ADD = "user.group.membership.add";	
	
	/**
	 * Event for changing user role in group
	 * info logged: user id, site id, old role name, new role name, active status, provided status
	 */
	static final String EVENT_USER_GROUP_MEMBERSHIP_UPDATE = "user.group.membership.update";
	
	/**
	 * Event for removing user in group
	 * info logged: user id, site id, role name
	 */
	static final String EVENT_USER_GROUP_MEMBERSHIP_REMOVE = "user.group.membership.delete";

	/**
	 * Event for recording site visits that are denied based on permissions.
	 * The resource referenced is the Site ID and the User ID will be available.
	 */
	static final String EVENT_SITE_VISIT_DENIED = "site.visit.denied";

	/**
	 * An event to trigger User-Site cache invalidation across the cluster.
	 * The resource referenced is the Site ID.
	 */
	static final String EVENT_SITE_USER_INVALIDATE = "site.usersite.invalidate";

	/**
	 * An event for starting the site import
	 */
	static final String EVENT_SITE_IMPORT_START = "site.import.start";
	
	/**
	 * An event for ending the site import
	 */
	static final String EVENT_SITE_IMPORT_END = "site.import.end";
	
	/**<commit_msg>SAK-23555 - Create new events that differentiate the site.upd and realm.upd events <commit_after>/**********************************************************************************
 * $URL$
 * $Id$
 ***********************************************************************************
 *
 * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 Sakai Foundation
 *
 * Licensed under the Educational Community 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.opensource.org/licenses/ECL-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.sakaiproject.site.api;

import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.sakaiproject.entity.api.Entity;
import org.sakaiproject.entity.api.EntityProducer;
import org.sakaiproject.exception.IdInvalidException;
import org.sakaiproject.exception.IdUnusedException;
import org.sakaiproject.exception.IdUsedException;
import org.sakaiproject.exception.InUseException;
import org.sakaiproject.exception.PermissionException;
import org.sakaiproject.javax.PagingPosition;
import org.w3c.dom.Element;

/**
 * <p>
 * SiteService manages Sites.
 * </p>
 */
public interface SiteService extends EntityProducer
{
	/** The type string for this application: should not change over time as it may be stored in various parts of persistent entities. */
	static final String APPLICATION_ID = "sakai:site";

	/** The Entity Reference sub-type for Site references. */
	static final String SITE_SUBTYPE = "site";

	/** The Entity Reference sub-type for Group references. */
	static final String GROUP_SUBTYPE = "group";

	/** The Entity Reference sub-type for Page references. */
	static final String PAGE_SUBTYPE = "page";

	/** The Entity Reference sub-type for Tool references. */
	static final String TOOL_SUBTYPE = "tool";

	/** This string starts the references to resources in this service. */
	static final String REFERENCE_ROOT = Entity.SEPARATOR + SITE_SUBTYPE;

	/** Name for the event of accessing role swap functionality. */
	static final String SITE_ROLE_SWAP = "site.roleswap";
	
	/** Name for the event of visiting a site. */
	static final String SITE_VISIT = "site.visit";

	/** Name for the event of visiting an unpublished site. */
	static final String SITE_VISIT_UNPUBLISHED = "site.visit.unp";

	/** Name for the event of accessing a site. */
	// static final String SECURE_ACCESS_SITE = "site.access";
	/** Name for the event of adding a site. */
	static final String SECURE_ADD_SITE = "site.add";

	/** Name for the event of adding a course site */ 
	static final String SECURE_ADD_COURSE_SITE = "site.add.course";
	
	/** Name for the event of adding a portfolio site */ 
	static final String SECURE_ADD_PORTFOLIO_SITE = "site.add.portfolio";
	
	/** Name for the event of adding a project site */ 
	static final String SECURE_ADD_PROJECT_SITE = "site.add.project";
	
	/** Name for the event of adding a user's My Workspace site. */
	static final String SECURE_ADD_USER_SITE = "site.add.usersite";

	/** Name for the event of removing a site. */
	static final String SECURE_REMOVE_SITE = "site.del";
	
	/** Name for the event of removing a site that has already been softly deleted */
	static final String SECURE_REMOVE_SOFTLY_DELETED_SITE = "site.del.softly.deleted";
	
	/** Name for the event of visiting a softly deleted site. */
	static final String SITE_VISIT_SOFTLY_DELETED = "site.visit.softly.deleted";

	/** Name for the event of updating a site. */
	static final String SECURE_UPDATE_SITE = "site.upd";

	/** Name for the event of updating a site's membership. */
	static final String SECURE_UPDATE_SITE_MEMBERSHIP = "site.upd.site.mbrshp";

	/** Name for the event of updating a site's groups' memberships. */
	static final String SECURE_UPDATE_GROUP_MEMBERSHIP = "site.upd.grp.mbrshp";

	/** Name for the event of viewing project site participants. */
	static final String SECURE_VIEW_ROSTER = "site.viewRoster";

	/** The name of the main container for a resource in a site (channel, calendar, etc.). */
	static final String MAIN_CONTAINER = "main";

	/** The name of a special site that is a template for non-user sites. */
	static final String SITE_TEMPLATE = "!worksite";

	/** The name of a special site that is a template for user sites. */
	static final String USER_SITE_TEMPLATE = "!user";

	/** The name of a special site that is used if the requested site is not available. */
	static final String SITE_ERROR = "!error";

	/** The name of a special site that is used if the requested url is not understood. */
	static final String URL_ERROR = "!urlError";

	/** The property to indicate a parent site's id */
	public static final String PROP_PARENT_ID = "sakai:parent-id";

	/** The property to indicate whether or not subsites are to be added to the tool list */
	public static final String PROP_SHOW_SUBSITES = "sakai:show-subsites";
	
	/** The configuration property for enabling or disabling user-site caching, defaults to true. */
	public static final String PROP_CACHE_USER_SITES = "user.site.cache.enabled";

	/**
	 * Event for adding user to site
	 * info logged: user id, site id, role name, active status, provided status
	 */
	static final String EVENT_USER_SITE_MEMBERSHIP_ADD = "user.site.membership.add";
	
	/**
	 * Event for changing user role in site
	 * info logged: user id, site id, old role name, new role name, active status, provided status
	 */
	static final String EVENT_USER_SITE_MEMBERSHIP_UPDATE = "user.site.membership.update";
	
	/**
	 * Event for removing user in site
	 * info logged: user id, site id, role name
	 */
	static final String EVENT_USER_SITE_MEMBERSHIP_REMOVE = "user.site.membership.delete";
	
	/**
	 * Event for adding user to group
	 * info logged: user id, group id, role name, active status, provided status
	 */
	static final String EVENT_USER_GROUP_MEMBERSHIP_ADD = "user.group.membership.add";	
	
	/**
	 * Event for changing user role in group
	 * info logged: user id, site id, old role name, new role name, active status, provided status
	 */
	static final String EVENT_USER_GROUP_MEMBERSHIP_UPDATE = "user.group.membership.update";
	
	/**
	 * Event for removing user in group
	 * info logged: user id, site id, role name
	 */
	static final String EVENT_USER_GROUP_MEMBERSHIP_REMOVE = "user.group.membership.delete";

	/**
	 * Event for recording site visits that are denied based on permissions.
	 * The resource referenced is the Site ID and the User ID will be available.
	 */
	static final String EVENT_SITE_VISIT_DENIED = "site.visit.denied";

	/**
	 * An event to trigger User-Site cache invalidation across the cluster.
	 * The resource referenced is the Site ID.
	 */
	static final String EVENT_SITE_USER_INVALIDATE = "site.usersite.invalidate";

	/**
	 * An event for starting the site import
	 */
	static final String EVENT_SITE_IMPORT_START = "site.import.start";
	
	/**
	 * An event for ending the site import
	 */
	static final String EVENT_SITE_IMPORT_END = "site.import.end";

	/**
	 * An event tracking roster add
	 */
	static final String EVENT_SITE_ROSTER_ADD = "site.roster.add";
	
	/**
	 * An event for tracking roster remove
	 */
	static final String EVENT_SITE_ROSTER_REMOVE = "site.roster.remove";



	
	/**
{'fraction_non_alphanumeric': 0.12081870570311982, 'fraction_numerical': 0.0041730145061932835, 'mean_word_length': 4.090357383681726, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5217797', 'n_tokens_mistral': 4552, 'n_tokens_neox': 4245, 'n_words': 1666}