001/* 
002    Licensed to the Apache Software Foundation (ASF) under one
003    or more contributor license agreements.  See the NOTICE file
004    distributed with this work for additional information
005    regarding copyright ownership.  The ASF licenses this file
006    to you under the Apache License, Version 2.0 (the
007    "License"); you may not use this file except in compliance
008    with the License.  You may obtain a copy of the License at
009
010       http://www.apache.org/licenses/LICENSE-2.0
011
012    Unless required by applicable law or agreed to in writing,
013    software distributed under the License is distributed on an
014    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015    KIND, either express or implied.  See the License for the
016    specific language governing permissions and limitations
017    under the License.  
018 */
019package org.apache.wiki.tasks;
020
021import org.apache.wiki.workflow.Step;
022
023import java.security.Principal;
024import java.util.Locale;
025
026/**
027 * Manager responsible of creation of the different JSPWiki {@link Step}s.
028 * 
029 * Instances of classes generated by this TasksManager are assumed to have been added to an approval workflow via 
030 * {@link org.apache.wiki.workflow.WorkflowBuilder#buildApprovalWorkflow(Principal, String, Step, String, org.apache.wiki.workflow.Fact[], Step, String)};
031 * they will not function correctly otherwise.
032 */
033public interface TasksManager {
034
035    /** The message key for storing the text for the presave task.  Value is <tt>{@value}</tt>. */
036    String WIKIPAGE_PRESAVE_TASK_MESSAGE_KEY = "task.preSaveWikiPage";
037    /** The message key of the text to finally approve a page save.  Value is <tt>{@value}</tt>. */
038    String WIKIPAGE_SAVE_TASK_MESSAGE_KEY = "task.saveWikiPage";
039    /** The message key of the text to finally approve a user profile save.  Value is <tt>{@value}</tt>. */
040    String USER_PROFILE_SAVE_TASK_MESSAGE_KEY = "task.createUserProfile";
041    
042    /**
043     * Builds a pre-save WikiPage task.
044     * 
045     * @param proposedText text proposed to be saved on the wiki page.
046     * @return a pre-save WikiPage task.
047     */
048    Step buildPreSaveWikiPageTask( String proposedText );
049    
050    /**
051     * Builds a save WikiPage task.
052     *
053     * @return a save WikiPage task.
054     */
055    Step buildSaveWikiPageTask();
056    
057    /**
058     * Builds a save user profile task.
059     * 
060     * @param loc text proposed to be saved on the wiki page.
061     * @return a save user profile task.
062     */
063    Step buildSaveUserProfileTask( Locale loc );
064    
065}