<?xml version="1.0" encoding="UTF-8"?>
<!--

    The contents of this file are subject to the license and copyright
    detailed in the LICENSE and NOTICE files at the root of the source
    tree and available online at

    http://www.dspace.org/license/

-->

<!-- 

The administrative aspect is responsible for all the features necessary 
to administer DSpace. 

-->
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
    
    <map:components>

		<map:transformers>
			<map:transformer name="ManageEPeopleMain" src="org.dspace.app.xmlui.aspect.administrative.eperson.ManageEPeopleMain"/>
			<map:transformer name="AddEPersonForm" src="org.dspace.app.xmlui.aspect.administrative.eperson.AddEPersonForm"/>
			<map:transformer name="EditEPersonForm" src="org.dspace.app.xmlui.aspect.administrative.eperson.EditEPersonForm"/>
			<map:transformer name="DeleteEPeopleConfirm" src="org.dspace.app.xmlui.aspect.administrative.eperson.DeleteEPeopleConfirm"/>
			
			<map:transformer name="ManageGroupsMain" src="org.dspace.app.xmlui.aspect.administrative.group.ManageGroupsMain"/>
			<map:transformer name="EditGroupForm" src="org.dspace.app.xmlui.aspect.administrative.group.EditGroupForm"/>
			<map:transformer name="DeleteGroupsConfirm" src="org.dspace.app.xmlui.aspect.administrative.group.DeleteGroupsConfirm"/>
			
			<map:transformer name="MetadataRegistryMain" src="org.dspace.app.xmlui.aspect.administrative.registries.MetadataRegistryMain"/>
			<map:transformer name="EditMetadataSchema" src="org.dspace.app.xmlui.aspect.administrative.registries.EditMetadataSchema"/>
			<map:transformer name="DeleteMetadataSchemaConfirm" src="org.dspace.app.xmlui.aspect.administrative.registries.DeleteMetadataSchemaConfirm"/>
			<map:transformer name="DeleteMetadataFieldsConfirm" src="org.dspace.app.xmlui.aspect.administrative.registries.DeleteMetadataFieldsConfirm"/>
			<map:transformer name="MoveMetadataFields" src="org.dspace.app.xmlui.aspect.administrative.registries.MoveMetadataFields"/>
			
			<map:transformer name="FormatRegistryMain" src="org.dspace.app.xmlui.aspect.administrative.registries.FormatRegistryMain"/>
			<map:transformer name="EditBitstreamFormat" src="org.dspace.app.xmlui.aspect.administrative.registries.EditBitstreamFormat"/>
			<map:transformer name="DeleteBitstreamFormatsConfirm" src="org.dspace.app.xmlui.aspect.administrative.registries.DeleteBitstreamFormatsConfirm"/>
			
			<map:transformer name="FindItemForm" src="org.dspace.app.xmlui.aspect.administrative.item.FindItemForm"/>
			<map:transformer name="EditItemStatusForm" src="org.dspace.app.xmlui.aspect.administrative.item.EditItemStatusForm"/>
			<map:transformer name="ViewItem" src="org.dspace.app.xmlui.aspect.administrative.item.ViewItem"/>
			<map:transformer name="EditItemBitstreamsForm" src="org.dspace.app.xmlui.aspect.administrative.item.EditItemBitstreamsForm"/>
			<map:transformer name="EditItemMetadataForm" src="org.dspace.app.xmlui.aspect.administrative.item.EditItemMetadataForm"/>
			<map:transformer name="ConfirmItemForm" src="org.dspace.app.xmlui.aspect.administrative.item.ConfirmItemForm"/>
			<map:transformer name="AddBitstreamForm" src="org.dspace.app.xmlui.aspect.administrative.item.AddBitstreamForm"/>
			<map:transformer name="EditBitstreamForm" src="org.dspace.app.xmlui.aspect.administrative.item.EditBitstreamForm"/>
			<map:transformer name="DeleteBitstreamsConfirm" src="org.dspace.app.xmlui.aspect.administrative.item.DeleteBitstreamsConfirm"/>
			<map:transformer name="MoveItemForm" src="org.dspace.app.xmlui.aspect.administrative.item.MoveItemForm"/>
                        <map:transformer name="CurateItemForm" src="org.dspace.app.xmlui.aspect.administrative.item.CurateItemForm"/>
			
			<map:transformer name="MapperMain" src="org.dspace.app.xmlui.aspect.administrative.mapper.MapperMain"/>
			<map:transformer name="BrowseItemForm" src="org.dspace.app.xmlui.aspect.administrative.mapper.BrowseItemForm"/>
			<map:transformer name="SearchItemForm" src="org.dspace.app.xmlui.aspect.administrative.mapper.SearchItemForm"/>

                        <map:transformer name="MetadataImportMain" src="org.dspace.app.xmlui.aspect.administrative.metadataimport.MetadataImportMain"/>
                        <map:transformer name="MetadataImportUpload" src="org.dspace.app.xmlui.aspect.administrative.metadataimport.MetadataImportUpload"/>
                        <map:transformer name="MetadataImportConfirm" src="org.dspace.app.xmlui.aspect.administrative.metadataimport.MetadataImportConfirm"/>

            <map:transformer name="BatchImportMain" src="org.dspace.app.xmlui.aspect.administrative.batchimport.BatchImportMain"/>
            <map:transformer name="BatchImportUpload" src="org.dspace.app.xmlui.aspect.administrative.batchimport.BatchImportUpload"/>
            <map:transformer name="BatchImportConfirm" src="org.dspace.app.xmlui.aspect.administrative.batchimport.BatchImportConfirm"/>

			<map:transformer name="EditCollectionMetadataForm" src="org.dspace.app.xmlui.aspect.administrative.collection.EditCollectionMetadataForm"/>
			<map:transformer name="ToggleCollectionHarvestingForm" src="org.dspace.app.xmlui.aspect.administrative.collection.ToggleCollectionHarvestingForm"/>
			<map:transformer name="SetupCollectionHarvestingForm" src="org.dspace.app.xmlui.aspect.administrative.collection.SetupCollectionHarvestingForm"/>
			<map:transformer name="EditCollectionHarvestingForm" src="org.dspace.app.xmlui.aspect.administrative.collection.EditCollectionHarvestingForm"/>
			<map:transformer name="AssignCollectionRoles" src="org.dspace.app.xmlui.aspect.administrative.collection.AssignCollectionRoles"/>
			<map:transformer name="DeleteCollectionRoleConfirm" src="org.dspace.app.xmlui.aspect.administrative.collection.DeleteCollectionRoleConfirm"/>
			<map:transformer name="DeleteCollectionConfirm" src="org.dspace.app.xmlui.aspect.administrative.collection.DeleteCollectionConfirm"/>
			<map:transformer name="CreateCollectionForm" src="org.dspace.app.xmlui.aspect.administrative.collection.CreateCollectionForm"/>
                        <map:transformer name="CurateCollectionForm" src="org.dspace.app.xmlui.aspect.administrative.collection.CurateCollectionForm"/>

			<map:transformer name="EditCommunityMetadataForm" src="org.dspace.app.xmlui.aspect.administrative.community.EditCommunityMetadataForm"/>
                        <map:transformer name="AssignCommunityRoles" src="org.dspace.app.xmlui.aspect.administrative.community.AssignCommunityRoles"/>
			<map:transformer name="DeleteCommunityRoleConfirm" src="org.dspace.app.xmlui.aspect.administrative.community.DeleteCommunityRoleConfirm"/>
			<map:transformer name="DeleteCommunityConfirm" src="org.dspace.app.xmlui.aspect.administrative.community.DeleteCommunityConfirm"/>
			<map:transformer name="CreateCommunityForm" src="org.dspace.app.xmlui.aspect.administrative.community.CreateCommunityForm"/>
			<map:transformer name="CurateCommunityForm" src="org.dspace.app.xmlui.aspect.administrative.community.CurateCommunityForm"/>

			<map:transformer name="AuthorizationMain" src="org.dspace.app.xmlui.aspect.administrative.authorization.AuthorizationMain"/>
			<map:transformer name="EditContainerPolicies" src="org.dspace.app.xmlui.aspect.administrative.authorization.EditContainerPolicies"/>
			<map:transformer name="EditItemPolicies" src="org.dspace.app.xmlui.aspect.administrative.authorization.EditItemPolicies"/>
			<map:transformer name="AdvacedAuthorizationsForm" src="org.dspace.app.xmlui.aspect.administrative.authorization.AdvacedAuthorizationsForm"/>
			<map:transformer name="EditPolicyForm" src="org.dspace.app.xmlui.aspect.administrative.authorization.EditPolicyForm"/>
			<map:transformer name="DeletePoliciesConfirm" src="org.dspace.app.xmlui.aspect.administrative.authorization.DeletePoliciesConfirm"/>

			<map:transformer name="NotAuthorized" src="org.dspace.app.xmlui.aspect.administrative.NotAuthorized"/>			
			<map:transformer name="Navigation" src="org.dspace.app.xmlui.aspect.administrative.Navigation"/>
			<map:transformer name="SystemwideAlerts" src="org.dspace.app.xmlui.aspect.administrative.SystemwideAlerts"/>
			<map:transformer name="ControlPanel" src="org.dspace.app.xmlui.aspect.administrative.ControlPanel" />
                        <map:transformer name="WithdrawnItems" src="org.dspace.app.xmlui.aspect.administrative.WithdrawnItems" />
                        <map:transformer name="ItemExport" src="org.dspace.app.xmlui.aspect.administrative.ItemExport"/>
                        <map:transformer name="CurateForm" src="org.dspace.app.xmlui.aspect.administrative.CurateForm"/>
                        <map:transformer name="ChoiceLookup" src="org.dspace.app.xmlui.aspect.general.ChoiceLookupTransformer"/>
            <map:transformer name="PrivateItems" src="org.dspace.app.xmlui.aspect.administrative.PrivateItems" />
		</map:transformers>
		
		<map:matchers default="wildcard">
			<map:matcher name="requestParameterWild"
				src="org.apache.cocoon.matching.WildcardRequestParameterMatcher"/>
		</map:matchers>
				
		
    	<map:actions>
    		<map:action name="ControlPanelAction" src="org.dspace.app.xmlui.aspect.administrative.ControlPanelAction" />
    		<map:action name="CurrentActivityAction" src="org.dspace.app.xmlui.aspect.administrative.CurrentActivityAction" />
                <map:action name="ClearCacheAction" src="org.apache.cocoon.acting.ClearCacheAction"/>        
    	</map:actions>		
		
		<map:selectors>
    		<map:selector name="AuthenticatedSelector" src="org.dspace.app.xmlui.aspect.general.AuthenticatedSelector"/>
    	</map:selectors>
    	
    </map:components>
    
	<map:flow language="javascript">
		<map:script src="administrative.js"/>
	</map:flow>
    
	<map:pipelines>
		<map:pipeline>
			
			<!-- Flow Entry points -->
			
			<map:select type="AuthenticatedSelector">
				<map:when test="eperson">
					<!--
						This is the general entry / resume point for the 
						management of all epeople.
						-->
					<map:match pattern="admin/epeople">
						<map:match type="request" pattern="administrative-continue">
							<map:call continuation="{1}"/>
						</map:match>
						<map:call function="startManageEPeople"/>
					</map:match>
								
					<!--
						This is the general entry / resume point for the 
						managment of all groups.
						-->
					<map:match pattern="admin/groups">
						<map:match type="request" pattern="administrative-continue">
							<map:call continuation="{1}"/>
						</map:match>
						<map:call function="startManageGroups"/>
					</map:match>
					
					<!--
						This is the general entry / resume point for the 
						management of all metadata fields and schemas. 
						-->
					<map:match pattern="admin/metadata-registry">
						<map:match type="request" pattern="administrative-continue">
							<map:call continuation="{1}"/>
						</map:match>
						<map:call function="startManageMetadataRegistry"/>
					</map:match>
				
					<!--
						This is the general entry / resume point for the
						management of all bitstream formats
						-->
					<map:match pattern="admin/format-registry">
						<map:match type="request" pattern="administrative-continue">
							<map:call continuation="{1}"/>
						</map:match>
						<map:call function="startManageFormatRegistry"/>
					</map:match>
					
					
					<!--
						This is the general entry / resume point for the
						edit item pages
					-->
					<map:match pattern="admin/item">
						<map:match type="request" pattern="administrative-continue">
							<map:call continuation="{1}"/>
						</map:match>
						<map:match type="request" pattern="itemID">
							<map:call function="startEditItem"/>
						</map:match>
						<map:call function="startManageItems"/>
					</map:match>
					
					
					<!--
						This is the general entry / resume point for the
						edit item pages
					-->
					<map:match pattern="admin/mapper">
						<map:match type="request" pattern="administrative-continue">
							<map:call continuation="{1}"/>
						</map:match>
						<map:match type="request" pattern="collectionID">
							<map:call function="startMapItems"/>
						</map:match>
					</map:match>

					<!--
						This is the general entry / resume point for the
						batch metadata editor
					-->
					<map:match pattern="admin/metadataimport">
						<map:match type="request" pattern="administrative-continue">
							<map:call continuation="{1}"/>
						</map:match>
                                                
						<map:call function="startMetadataImport"/>
						
					</map:match>

                    <!--
						This is the general entry / resume point for the
						batch metadata editor
					-->
                    <map:match pattern="admin/batchimport">
                        <map:match type="request" pattern="administrative-continue">
                            <map:call continuation="{1}"/>
                        </map:match>

                        <map:call function="startBatchImport"/>

                    </map:match>



					<!--
						These are the general entry / resume points for the
						editing of communities and collections pages
					-->
					<map:match pattern="admin/collection">
						<map:match type="request" pattern="administrative-continue">
							<map:call continuation="{1}"/>
						</map:match>
						<!-- if arriving here to create a collection -->
						<map:match type="request" pattern="createNew">
							<map:match type="request" pattern="communityID">
								<map:call function="startCreateCollection"/>
							</map:match>
						</map:match>
						<!-- editing a collection -->
						<map:match type="request" pattern="collectionID">
							<map:call function="startEditCollection"/>
						</map:match>
					</map:match>
					
					
					<map:match pattern="admin/community">
						<map:match type="request" pattern="administrative-continue">
							<map:call continuation="{1}"/>
						</map:match>
						<!-- Creating a sub-community if a communityID is given, or a top-level community otherwise -->
						<map:match type="request" pattern="createNew">
							<map:match type="request" pattern="communityID">
								<map:call function="startCreateCommunity"/>
							</map:match>
							<map:call function="startCreateCommunity"/>
						</map:match>
						<!-- editing an existing community -->
						<map:match type="request" pattern="communityID">
							<map:call function="startEditCommunity"/>
						</map:match>
					</map:match>
					
					
		
		
					<!--
						This is the general entry / resume point for the 
						managment of all authorizations.
						-->
					<map:match pattern="admin/authorize">
						<map:match type="request" pattern="administrative-continue">
							<map:call continuation="{1}"/>
						</map:match>
						<map:call function="startManageAuthorizations"/>
					</map:match>

                                        <!--
                                            This is the general entry / resume point for the 
                                            site-wide curation tasks.
                                        -->
					<map:match pattern="admin/curate">
                                            <map:match type="request" pattern="administrative-continue">
                                                <map:call continuation="{1}"/>
                                            </map:match>
                                            <map:call function="startCurate"/>
					</map:match>
				</map:when>
			</map:select>
						
			<map:generate/>
			<map:act type="CurrentActivityAction"/>
			<map:transform type="SystemwideAlerts"/>
			<map:transform type="Navigation"/>
		    
		    <map:select type="AuthenticatedSelector">
		        <map:when test="eperson">
		        	
		        	<!-- Flow pages
		        	
		        		These pages may only be reached through a flow script. While typically all 
		        		the user sees in their url bar is a short url like /admin/epeople or 
		        		/admin/groups, in reality there is another url being used. The flow scripts 
		        		always operate on these simple urls, but once the particular state is determined 
		        		an distinguishing part is appended to the url for the particular state. Below are 
		        		all those url.
		        		-->
		        	<map:match type="WildcardParameterMatcher" pattern="true">
		        		<map:parameter name="parameter-name" value="flow"/>
		        		<map:parameter name="flow" value="{flow-attribute:flow}"/>
		        		
		        		
		        	<!-- General Notices
		        		
		        			Sometimes notices are generated by flow parameters that are not tied to 
		        			the specific state. In this case several flow-attributes are created that 
		        			describe the notice, if they are present then we add them to the DRI document 
		        			before all other flow pages.
		        			-->
                                        <map:match pattern="admin/**">
                                            <map:match type="WildcardParameterMatcher" pattern="true">
                                                    <map:parameter name="parameter-name" value="notice"/>
                                                    <map:parameter name="notice" value="{flow-attribute:notice}"/>
                                                    <map:transform type="notice">
                                                            <map:parameter name="outcome" value="{flow-attribute:outcome}"/>
                                                            <map:parameter name="header" value="{flow-attribute:header}"/>
                                                            <map:parameter name="message" value="{flow-attribute:message}"/>
                                                            <map:parameter name="characters" value="{flow-attribute:characters}"/>
                                                    </map:transform>
                                            </map:match>
		        		</map:match>
		        		
		        		<map:match pattern="admin/not-authorized">
		        			<map:transform type="NotAuthorized"/>
		        	</map:match>
		        		
		        		
		        	<!-- EPeople management pages -->
		        		
		        		
		        		<!-- 
		        			The main eperson page allows for seaching of epeople and selecting 
		        			them for editing or deletion.
		        			-->
		        		<map:match pattern="admin/epeople/main">
		        			<map:transform type="ManageEPeopleMain">
		        				<map:parameter name="query" value="{flow-attribute:query}"/>
		        				<map:parameter name="page" value="{flow-attribute:page}"/>
		        				<map:parameter name="highlightID" value="{flow-attribute:highlightID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			The add eperson page allows the user to enter metadata about 
		        			a yet-to-be-created eperson. Once completed, an eperson is
		        			created.
		        			-->
		        		<map:match pattern="admin/epeople/add">
		        			<map:transform type="AddEPersonForm">
		        				<map:parameter name="errors" value="{flow-attribute:errors}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			The edit eperson page allows for an eperson's metadata to be edited.
		        			-->
		        		<map:match pattern="admin/epeople/edit">
		        			<map:transform type="EditEPersonForm">
		        				<map:parameter name="epersonID" value="{flow-attribute:epersonID}"/>
		        				<map:parameter name="errors" value="{flow-attribute:errors}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			The delete eperson page just lists epeople that are about to be deleted.
		        			-->
		        		<map:match pattern="admin/epeople/delete">
		        			<map:transform type="DeleteEPeopleConfirm">
		        				<map:parameter name="epeopleIDs" value="{flow-attribute:epeopleIDs}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		
		        	<!-- Group management pages -->
		        		
		        		
		        		<!--
		        			The main group management page allows for groups to be searched, browsed, 
		        			and selected for editing or deletion.
		        			-->
		        		<map:match pattern="admin/group/main">
		        			<map:transform type="ManageGroupsMain">
		        				<map:parameter name="query" value="{flow-attribute:query}"/>
		        				<map:parameter name="page" value="{flow-attribute:page}"/>
		        				<map:parameter name="highlightID" value="{flow-attribute:highlightID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			The edit group form shows a group's data and allows the user to
		        			edit the group's membership, edit it's name, search for new epeople/groups
		        			to add as members. It also serves as the new group page unlike epeople where 
		        			there are separate pages.
		        			-->
		        		<map:match pattern="admin/group/edit">
		        			<map:transform type="EditGroupForm">
		        				<map:parameter name="groupID" value="{flow-attribute:groupID}"/>
		        				<map:parameter name="groupName" value="{flow-attribute:groupName}"/>
		        				<map:parameter name="memberEPeopleIDs" value="{flow-attribute:memberEPeopleIDs}"/>
		        				<map:parameter name="memberGroupIDs" value="{flow-attribute:memberGroupIDs}"/>
		        				<map:parameter name="highlightEPersonID" value="{flow-attribute:highlightEPersonID}"/>
		        				<map:parameter name="highlightGroupID" value="{flow-attribute:highlightGroupID}"/>
		        				<map:parameter name="query" value="{flow-attribute:query}"/>
		        				<map:parameter name="page" value="{flow-attribute:page}"/>
		        				<map:parameter name="type" value="{flow-attribute:type}"/>
		        				<map:parameter name="errors" value="{flow-attribute:errors}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			The delete group page lists all the yet-to-be-deleted pages, if the user 
		        			clicks confirm deletion then the groups are removed.
		        			-->
		        		<map:match pattern="admin/group/delete">
		        			<map:transform type="DeleteGroupsConfirm">
		        				<map:parameter name="groupIDs" value="{flow-attribute:groupIDs}"/>
		        			</map:transform>
		        		</map:match>


					<!-- Metadata Registry pages -->
		        		
		        		<!--
		        			The main page for the metadata registry. It lists all available schemas
		        			allowing the user to edit or delete them and also add new ones.
		        			-->
		        		<map:match pattern="admin/metadata-registry/main">
		        			<map:transform type="MetadataRegistryMain">
		        				<map:parameter name="errors" value="{flow-attribute:errors}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			Confirm the deletion of metadata schemas
		        			-->
		        		<map:match pattern="admin/metadata-registry/delete-schemas">
		        			<map:transform type="DeleteMetadataSchemaConfirm">
		        				<map:parameter name="schemaIDs" value="{flow-attribute:schemaIDs}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			Edit a single schema, adding, deleing, or updating metadata fields within
		        			the schema. The user can also select some fields to be moved to other
		        			schemas.
		        			-->
		        		<map:match pattern="admin/metadata-registry/edit-schema">
		        			<map:transform type="EditMetadataSchema">
		        				<map:parameter name="errors" value="{flow-attribute:errors}"/>
		        				<map:parameter name="schemaID" value="{flow-attribute:schemaID}"/>
		        				<map:parameter name="updateID" value="{flow-attribute:updateID}"/>
		        				<map:parameter name="highlightID" value="{flow-attribute:highlightID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			Confirm the deletion of metadata fields
		        			-->
		        		<map:match pattern="admin/metadata-registry/delete-fields">
		        			<map:transform type="DeleteMetadataFieldsConfirm">
		        				<map:parameter name="fieldIDs" value="{flow-attribute:fieldIDs}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			Confirm the move of metadata fields to another schema.
		        			-->
		        		<map:match pattern="admin/metadata-registry/move-fields">
		        			<map:transform type="MoveMetadataFields">
		        				<map:parameter name="fieldIDs" value="{flow-attribute:fieldIDs}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        	<!-- Format Registry pages -->
		        		
		        		<!--
		        			The main entry point for the bitstream format registry. This page lists
		        			all available formats allowing the user to add, delete, or update formats.
		        			-->
		        		<map:match pattern="admin/format-registry/main">
		        			<map:transform type="FormatRegistryMain">
		        				<map:parameter name="highlightID" value="{flow-attribute:highlightID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			Edit a single bitstream format.
		        			-->
		        		<map:match pattern="admin/format-registry/edit">
		        			<map:transform type="EditBitstreamFormat">
		        				<map:parameter name="formatID" value="{flow-attribute:formatID}"/>
		        				<map:parameter name="errors" value="{flow-attribute:errors}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			Confirm the deletion of formats
		        			-->
		        		<map:match pattern="admin/format-registry/delete">
		        			<map:transform type="DeleteBitstreamFormatsConfirm">
		        				<map:parameter name="formatIDs" value="{flow-attribute:formatIDs}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		
		        	<!-- Edit item pages -->
		        		
		        		<!--
		        			Allow the user to find an item by it's handle or internal ID.
		        			-->
		        		<map:match pattern="admin/item/find">
		        			<map:transform type="FindItemForm">
		        				<map:parameter name="identifier" value="{flow-attribute:identifier}"/>
		        				<map:parameter name="errors" value="{flow-attribute:errors}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			
		        			-->
		        		<map:match pattern="admin/item/status">
		        			<map:transform type="EditItemStatusForm">
		        				<map:parameter name="itemID" value="{flow-attribute:itemID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<map:match pattern="admin/item/bitstreams">
                            <!--Add the javascript-->
                            <map:transform type="IncludePageMeta">
                                <map:parameter name="javascript.static#1" value="loadJQuery.js"/>
                                <map:parameter name="javascript.static#2" value="static/js/bitstream-ordering.js"/>
                            </map:transform>

		        			<map:transform type="EditItemBitstreamsForm">
		        				<map:parameter name="itemID" value="{flow-attribute:itemID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<map:match pattern="admin/item/metadata">
		        			<map:transform type="EditItemMetadataForm">
		        				<map:parameter name="itemID" value="{flow-attribute:itemID}"/>
		        				<map:parameter name="templateCollectionID" value="{flow-attribute:templateCollectionID}"/>
		        				<map:parameter name="errors" value="{flow-attribute:errors}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<map:match pattern="admin/item/view_item">
		        			<map:transform type="ViewItem">
		        				<map:parameter name="itemID" value="{flow-attribute:itemID}"/>
		        			</map:transform>
		        		</map:match>

                        <!-- Curation options -->
		        		<map:match pattern="admin/item/curateItem">
                            <map:transform type="CurateItemForm">
                                <map:parameter name="select_curate_group" value="{flow-attribute:select_curate_group}"/>
                                <map:parameter name="itemID" value="{flow-attribute:itemID}"/>
                            </map:transform>
                        </map:match>
		        		
		        		<!--
		        			Upload a new bitstream
		        			-->
		        		<map:match pattern="admin/item/add-bitstream">
		        			<map:transform type="AddBitstreamForm">
		        				<map:parameter name="itemID" value="{flow-attribute:itemID}"/>
		        				<map:parameter name="errors" value="{flow-attribute:errors}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			Edit a bitstream's metadata
		        			-->
		        		<map:match pattern="admin/item/edit-bitstream">
		        			<map:transform type="EditBitstreamForm">
		        				<map:parameter name="itemID" value="{flow-attribute:itemID}"/>
		        				<map:parameter name="bitstreamID" value="{flow-attribute:bitstreamID}"/>
		        				<map:parameter name="errors" value="{flow-attribute:errors}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<map:match pattern="admin/item/delete-bitstreams">
		        			<map:transform type="DeleteBitstreamsConfirm">
		        				<map:parameter name="itemID" value="{flow-attribute:itemID}"/>
		        				<map:parameter name="bitstreamIDs" value="{flow-attribute:bitstreamIDs}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			Confirm the item's deletion
		        			-->
		        		<map:match pattern="admin/item/delete">
		        			<map:transform type="ConfirmItemForm">
		        				<map:parameter name="confirm" value="delete"/>
		        				<map:parameter name="itemID" value="{flow-attribute:itemID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			Confirm the item's withdraw
		        			-->
		        		<map:match pattern="admin/item/withdraw">
		        			<map:transform type="ConfirmItemForm">
		        				<map:parameter name="confirm" value="withdraw"/>
		        				<map:parameter name="itemID" value="{flow-attribute:itemID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!--
		        			Confirm the item's reinstatiation
		        			-->
		        		<map:match pattern="admin/item/reinstate">
		        			<map:transform type="ConfirmItemForm">
		        				<map:parameter name="confirm" value="reinstate"/>
		        				<map:parameter name="itemID" value="{flow-attribute:itemID}"/>
		        			</map:transform>
		        		</map:match>

		        		<map:match pattern="admin/item/private">
                            <map:transform type="ConfirmItemForm">
                                <map:parameter name="confirm" value="private"/>
                                <map:parameter name="itemID" value="{flow-attribute:itemID}"/>
                            </map:transform>
                        </map:match>

                        <map:match pattern="admin/item/public">
                            <map:transform type="ConfirmItemForm">
                                <map:parameter name="confirm" value="public"/>
                                <map:parameter name="itemID" value="{flow-attribute:itemID}"/>
                            </map:transform>
                        </map:match>

		        		
		        		<!--
		        			Move the item to another collection
		        			-->
		        		<map:match pattern="admin/item/move">
		        			<map:transform type="MoveItemForm">
		        				<map:parameter name="itemID" value="{flow-attribute:itemID}"/>
		        				<map:parameter name="collectionID" value="{flow-attribute:collectionID}"/>
                                <map:parameter name="inheritPolicies" value="{flow-attribute:inheritPolicies}"/>                                
		        			</map:transform>
		        		</map:match>

		        	<!-- Item Mapper -->
		        	
		        		<map:match pattern="admin/mapper/main">
		        			<map:transform type="MapperMain">
		        				<map:parameter name="collectionID" value="{flow-attribute:collectionID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<map:match pattern="admin/mapper/search">
		        			<map:transform type="SearchItemForm">
		        				<map:parameter name="collectionID" value="{flow-attribute:collectionID}"/>
		        				<map:parameter name="query" value="{flow-attribute:query}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<map:match pattern="admin/mapper/browse">
		        			<map:transform type="BrowseItemForm">
		        				<map:parameter name="collectionID" value="{flow-attribute:collectionID}"/>
		        			</map:transform>
		        		</map:match>

                               <!-- Batch Metadata Editor -->

		        		<map:match pattern="admin/metadataimport/main">
		        			<map:transform type="MetadataImportMain">
                                                </map:transform>
		        		</map:match>

		        		<map:match pattern="admin/metadataimport/upload">
		        			<map:transform type="MetadataImportUpload">
		        			</map:transform>
		        		</map:match>

                                        <map:match pattern="admin/metadataimport/confirm">
		        			<map:transform type="MetadataImportConfirm">
		        			</map:transform>
		        		</map:match>

                        <!-- Batch Metadata Editor -->

                        <map:match pattern="admin/batchimport/main">
                            <map:transform type="BatchImportMain">
                            </map:transform>
                        </map:match>

                        <map:match pattern="admin/batchimport/upload">
                            <map:transform type="BatchImportUpload">
                            </map:transform>
                        </map:match>

                        <map:match pattern="admin/batchimport/confirm">
                            <map:transform type="BatchImportConfirm">
                            </map:transform>
                        </map:match>
		        		
		        	<!-- Collection edit pages -->
		        		
		        		<!-- Main metadata edit form, accessible by the collection admin -->
		        		<map:match pattern="admin/collection/editMetadata">
		        			<map:transform type="EditCollectionMetadataForm">
		        				<map:parameter name="collectionID" value="{flow-attribute:collectionID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!-- Submissions, workflows, and authorization options, accessible by the global admin -->
		        		<map:match pattern="admin/collection/assignRoles">
		        			<map:transform type="AssignCollectionRoles">
		        				<map:parameter name="collectionID" value="{flow-attribute:collectionID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!-- Harvesting options setup form, used for collections that are being edited or set up 
		        			for the first time -->
		        		<map:match pattern="admin/collection/setupHarvesting">
		        			<map:transform type="SetupCollectionHarvestingForm">
		        				<map:parameter name="collectionID" value="{flow-attribute:collectionID}"/>
		        				<map:parameter name="errors" value="{flow-attribute:errors}"/>
		        				<map:parameter name="oaiProviderValue" value="{flow-attribute:oaiProviderValue}"/>
		        				<map:parameter name="oaiSetAll" value="{flow-attribute:oaiSetAll}"/>
		        				<map:parameter name="oaiSetIdValue" value="{flow-attribute:oaiSetIdValue}"/>
		        				<map:parameter name="metadataFormatValue" value="{flow-attribute:metadataFormatValue}"/>
		        				<map:parameter name="harvestLevelValue" value="{flow-attribute:harvestLevelValue}"/>
		        			</map:transform>
		        		</map:match> 
		        		
		        		<!-- Harvesting options setup form, used for collections that are being edited or set up 
		        			for the first time -->
		        		<map:match pattern="admin/collection/editHarvesting">
		        			<map:transform type="EditCollectionHarvestingForm">
		        				<map:parameter name="collectionID" value="{flow-attribute:collectionID}"/>
		        				<map:parameter name="errors" value="{flow-attribute:errors}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!-- Initial toggle -->
		        		<map:match pattern="admin/collection/toggleHarvesting">
		        			<map:transform type="ToggleCollectionHarvestingForm">
		        				<map:parameter name="collectionID" value="{flow-attribute:collectionID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		 
		        		
		        		<!-- Confirmation screen for deleting one of the standard authorization groups -->
		        		<map:match pattern="admin/collection/deleteRole">
		        			<map:transform type="DeleteCollectionRoleConfirm">
		        				<map:parameter name="collectionID" value="{flow-attribute:collectionID}"/>
		        				<map:parameter name="role" value="{flow-attribute:role}"/>
		        				<map:parameter name="groupID" value="{flow-attribute:groupID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!-- Confirmation screen for deleting a collection -->
		        		<map:match pattern="admin/collection/delete">
		        			<map:transform type="DeleteCollectionConfirm">
		        				<map:parameter name="collectionID" value="{flow-attribute:collectionID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!-- Collection creation form to enter the initial set of metadata -->
		        		<map:match pattern="admin/collection/createCollection">
		        			<map:transform type="CreateCollectionForm">
		        				<map:parameter name="communityID" value="{flow-attribute:communityID}"/>
		        			</map:transform>
		        		</map:match> 		

                        <!-- Curation options -->
		        		<map:match pattern="admin/collection/curateCollection">
                            <map:transform type="CurateCollectionForm">
                                <map:parameter name="select_curate_group" value="{flow-attribute:select_curate_group}"/>
                                <map:parameter name="collectionID" value="{flow-attribute:collectionID}"/>
                            </map:transform>
                        </map:match>
		        		
		        		
		        		

					<!-- Community edit pages -->
						
						<!-- Main metadata edit form, accessible by the community admin -->
                                        <map:match pattern="admin/community/editMetadata">
		        			<map:transform type="EditCommunityMetadataForm">
		        				<map:parameter name="communityID" value="{flow-attribute:communityID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!-- Community Authorization options -->
                                        <map:match pattern="admin/community/assignRoles">
                                            <map:transform type="AssignCommunityRoles">
                                                <map:parameter name="communityID" value="{flow-attribute:communityID}"/>
                                            </map:transform>
                                        </map:match>

		        		<!-- Confirmation screen for deleting one of the standard authorization groups -->
		        		<map:match pattern="admin/community/deleteRole">
		        			<map:transform type="DeleteCommunityRoleConfirm">
		        				<map:parameter name="communityID" value="{flow-attribute:communityID}"/>
		        				<map:parameter name="role" value="{flow-attribute:role}"/>
		        				<map:parameter name="groupID" value="{flow-attribute:groupID}"/>
		        			</map:transform>
		        		</map:match>

		        		<!-- Confirmation screen for deleting a community -->
		        		<map:match pattern="admin/community/delete">
		        			<map:transform type="DeleteCommunityConfirm">
		        				<map:parameter name="communityID" value="{flow-attribute:communityID}"/>
		        			</map:transform>
		        		</map:match>
						
						<!-- Community creation form to enter the initial set of metadata -->
		        		<map:match pattern="admin/community/createCommunity">
		        			<map:transform type="CreateCommunityForm">
		        				<map:parameter name="communityID" value="{flow-attribute:communityID}"/>
		        			</map:transform>
		        		</map:match>
      		
                        <!-- Curation options -->
		        		<map:match pattern="admin/community/curateCommunity">
                            <map:transform type="CurateCommunityForm">
                                <map:parameter name="select_curate_group" value="{flow-attribute:select_curate_group}"/> 
                                <map:parameter name="communityID" value="{flow-attribute:communityID}"/>
                            </map:transform>
                        </map:match>
		        	<!-- Authorization pages -->
		        		
		        		
		        		<!-- 
		        			The main authorizations page allows the user to select a community/collection or
		        			search for an item in order to edit their policies. It also provides a link to 
		        			the advanced/wildcard search page.
		        			-->
		        		<map:match pattern="admin/authorize/main">
		        			<map:transform type="AuthorizationMain">
		        				<map:parameter name="query" value="{flow-attribute:query}"/>
		        				<map:parameter name="errors" value="{flow-attribute:errors}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!-- 
		        			This page presents the user with a list of existing policies for selected community
		        			or collection and provides the options to add, edit, or delete those policies. 
		        			-->
		        		<map:match pattern="admin/authorize/container">
		        			<map:transform type="EditContainerPolicies">
		        				<map:parameter name="containerType" value="{flow-attribute:containerType}"/>
		        				<map:parameter name="containerID" value="{flow-attribute:containerID}"/>
		        				<map:parameter name="highlightID" value="{flow-attribute:highlightID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!-- 
		        			This page presents the user with a list of existing policies for the selected
		        			item, its bundles and bitstreams, and provides the options to add, edit, or 
		        			delete those policies. 
		        			-->
		        		<map:match pattern="admin/authorize/item">
		        			<map:transform type="EditItemPolicies">
		        				<map:parameter name="itemID" value="{flow-attribute:itemID}"/>
		        				<map:parameter name="highlightID" value="{flow-attribute:highlightID}"/>
		        			</map:transform>
		        		</map:match>
		        		
		        		<!-- 
		        			The advanced/wildcard policy tool allows the user to create sets of policies
		        			that give one or more groups at a time permissions to do the specified action
		        			to items or bitstreams or one of more communities.   
		        			-->
		        		<map:match pattern="admin/authorize/advanced">
		        			<map:transform type="AdvacedAuthorizationsForm">
                                <map:parameter name="resource_id" value="{flow-attribute:resource_id}"/>
                                <map:parameter name="action_id" value="{flow-attribute:action_id}"/>
                                <map:parameter name="name" value="{flow-attribute:name}"/>
                                <map:parameter name="description" value="{flow-attribute:description}"/>
                                <map:parameter name="startDate" value="{flow-attribute:startDate}"/>
                                <map:parameter name="endDate" value="{flow-attribute:endDate}"/>
                                <map:parameter name="errors" value="{flow-attribute:errors}"/>
                            </map:transform>
		        		</map:match>
		        		
		        		<!-- 
		        			The page to edit a specified (or newly created) policy, namely what groups it 
		        			applies to and what actions those groups can perform.  
		        			-->
		        		<map:match pattern="admin/authorize/edit">
		        			<map:transform type="EditPolicyForm">
		        				<map:parameter name="objectType" value="{flow-attribute:objectType}"/>
		        				<map:parameter name="objectID" value="{flow-attribute:objectID}"/>
		        				<map:parameter name="policyID" value="{flow-attribute:policyID}"/>
		        				<map:parameter name="groupID" value="{flow-attribute:groupID}"/>
		        				<map:parameter name="actionID" value="{flow-attribute:actionID}"/>
		        				<map:parameter name="query" value="{flow-attribute:query}"/>
		        				<map:parameter name="page" value="{flow-attribute:page}"/>
		        				<map:parameter name="errors" value="{flow-attribute:errors}"/>

                                <map:parameter name="name" value="{flow-attribute:name}"/>
                                <map:parameter name="description" value="{flow-attribute:description}"/>
                                <map:parameter name="startDate" value="{flow-attribute:startDate}"/>
                                <map:parameter name="endDate" value="{flow-attribute:endDate}"/>

		        			</map:transform>
		        		</map:match>
		        		
		        		<!-- 
		        			The page to edit a specific policy, namely what groups it applies to and what
		        			actions those groups can perform.  
		        			-->
		        		<map:match pattern="admin/authorize/delete">
		        			<map:transform type="DeletePoliciesConfirm">
		        				<map:parameter name="policyIDs" value="{flow-attribute:policyIDs}"/>
		        			</map:transform>
		        		</map:match>

                        <!-- Site-Wide Curation page -->
		        		<map:match pattern="admin/curate/main">
                            <map:transform type="CurateForm">
                                <map:parameter name="select_curate_group" value="{flow-attribute:select_curate_group}"/>
                                <map:parameter name="curate_task" value="{flow-attribute:curate_task}"/>
                                <map:parameter name="identifier" value="{flow-attribute:identifier}"/>
                            </map:transform>
		        		</map:match>

		        	</map:match> <!-- if flow -->
            	</map:when>
		    	<map:otherwise>
		    		<map:match pattern="admin/epeople">
		    			<map:act type="StartAuthentication"/>
		    		</map:match>
		    		<map:match pattern="admin/groups">
		    			<map:act type="StartAuthentication"/>
		    		</map:match>
		    		<map:match pattern="admin/metadata-registry">
		    			<map:act type="StartAuthentication"/>
		    		</map:match>
		    		<map:match pattern="admin/format-registry">
		    			<map:act type="StartAuthentication"/>
		    		</map:match>
		    		<map:match pattern="admin/item">
		    			<map:act type="StartAuthentication"/>
		    		</map:match>
		    		<map:match pattern="admin/mapper">
		    			<map:act type="StartAuthentication"/>
		    		</map:match>
                    <map:match pattern="admin/metadataimport">
		    			<map:act type="StartAuthentication"/>
		    		</map:match>
                    <map:match pattern="admin/batchimport">
                        <map:act type="StartAuthentication"/>
                    </map:match>
		    		<map:match pattern="admin/collection">
		    			<map:act type="StartAuthentication"/>
		    		</map:match>
		    		<map:match pattern="admin/community">
		    			<map:act type="StartAuthentication"/>
		    		</map:match>
		    		<map:match pattern="admin/authorize">
		    			<map:act type="StartAuthentication"/>
		    		</map:match>
		    		<map:match pattern="admin/export">
		    			<map:act type="StartAuthentication"/>
		    		</map:match>
                                <map:match pattern="admin/curate">
                                    <map:act type="StartAuthentication"/>
		    		</map:match>
		    		
                </map:otherwise>
            </map:select>
            
            <!-- Access to Control Panel (limited to Administrators) -->
            <map:match pattern="admin/panel">
                <map:transform type="IncludePageMeta">
                    <map:parameter name="javascript#1" value="../../static/js/controlpanel.js"/>
                </map:transform>
                <map:select type="AuthenticatedSelector">
                    <map:when test="administrator">
                        <!-- If the 'clearcache' request parameter is specified, first clear
                             the Cocoon Cache before sending user back to control panel -->
                        <map:match type="request" pattern="clearcache">
                            <map:act type="ClearCacheAction"/>
                        </map:match>    
                        <!-- Perform any control panel actions (if specified via Control panel) -->
                        <map:act type="ControlPanelAction">
                            <map:transform type="SystemwideAlerts"/>
                        </map:act>
                        <!-- Create the Control Panel and serialize-->
                        <map:transform type="ControlPanel" />
                        <map:serialize type="xml"/>
                    </map:when>
                    <map:otherwise>
                        <map:act type="StartAuthentication"/>
                    </map:otherwise>
                </map:select>
            </map:match>
		    
            <map:match pattern="admin/export">
                <map:transform type="ItemExport"/>
            </map:match>
		    
            <map:match pattern="admin/withdrawn">
                <map:select type="AuthenticatedSelector">
                    <map:when test="administrator">
                        <map:act type="ControlPanelAction">
                            <map:transform type="SystemwideAlerts"/>
                        </map:act>
                        <map:transform type="WithdrawnItems" />
                        <map:serialize type="xml"/>
                    </map:when>

                    <map:otherwise>
                        <map:act type="StartAuthentication"/>
                    </map:otherwise>
                </map:select>
            </map:match>

            <map:match pattern="admin/private">
                <map:select type="AuthenticatedSelector">
                    <map:when test="administrator">
                        <map:act type="ControlPanelAction">
                            <map:transform type="SystemwideAlerts"/>
                        </map:act>
                        <map:transform type="PrivateItems" />
                        <map:serialize type="xml"/>
                    </map:when>

                    <map:otherwise>
                        <map:act type="StartAuthentication"/>
                    </map:otherwise>
                </map:select>
            </map:match>

            <!-- choice value lookup popup  -->
            <map:match pattern="admin/lookup">
              <map:transform type="ChoiceLookup">
                <map:parameter name="field" value="{request-param:field}"/>
                <map:parameter name="formID" value="{request-param:formID}"/>
                <map:parameter name="value" value="{request-param:value}"/>
                <map:parameter name="valueInput" value="{request-param:valueInput}"/>
                <map:parameter name="authorityInput" value="{request-param:authorityInput}"/>
                <map:parameter name="isName" value="{request-param:isName}"/>
                <map:parameter name="isRepeating" value="{request-param:isRepeating}"/>
                <map:parameter name="confIndicatorID" value="{request-param:confIndicatorID}"/>
                <map:parameter name="start" value="{request-param:start}"/>
                <map:parameter name="limit" value="{request-param:limit}"/>
                <map:parameter name="collection" value="{request-param:collection}"/>
              </map:transform>
            </map:match>

                  <map:match pattern="admin/**">
                    <map:transform type="IncludePageMeta">
                      <!-- javascript libraries and utils for the choice and authority-control -->
                      <map:parameter name="javascript.static#1" value="static/js/scriptaculous/prototype.js"/>
                      <map:parameter name="javascript.static#2" value="static/js/scriptaculous/effects.js"/>
                      <map:parameter name="javascript.static#3" value="static/js/scriptaculous/builder.js"/>
                      <map:parameter name="javascript.static#4" value="static/js/scriptaculous/controls.js"/>
                      <map:parameter name="javascript.static#5" value="static/js/choice-support.js"/>
                    </map:transform>
                  </map:match>

			<map:serialize type="xml"/>
		</map:pipeline>
	</map:pipelines>
</map:sitemap>
