/*
- * Copyright (C) 2001, 2002 The Mir-coders group
+ * Copyright (C) 2001, 2002 The Mir-coders group
*
* This file is part of Mir.
*
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, The Mir-coders gives permission to link
- * the code of this program with the com.oreilly.servlet library, any library
- * licensed under the Apache Software License, The Sun (tm) Java Advanced
- * Imaging library (JAI), The Sun JIMI library (or with modified versions of
- * the above that use the same license as the above), and distribute linked
- * combinations including the two. You must obey the GNU General Public
- * License in all respects for all of the code used other than the above
- * mentioned libraries. If you modify this file, you may extend this exception
- * to your version of the file, but you are not obligated to do so. If you do
- * not wish to do so, delete this exception statement from your version.
+ * the code of this program with any library licensed under the Apache Software License,
+ * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
+ * (or with modified versions of the above that use the same license as the above),
+ * and distribute linked combinations including the two. You must obey the
+ * GNU General Public License in all respects for all of the code used other than
+ * the above mentioned libraries. If you modify this file, you may extend this
+ * exception to your version of the file, but you are not obligated to do so.
+ * If you do not wish to do so, delete this exception statement from your version.
*/
-
package mircoders.localizer;
-import java.util.*;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import mir.entity.adapter.EntityAdapter;
+import mir.generator.Generator;
-import mir.entity.*;
-import mir.entity.adapter.*;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Interface to allow for localized changed to the workings of the admin system
+ *
+ * @author Zapata
+ */
public interface MirAdminInterfaceLocalizer {
- public Map simpleCommentOperations();
- public Map simpleArticleOperations();
+ /**
+ * Every time an article gets made inside the admin system, this function is called. It is
+ * possible to set different initial values for the article here.
+ *
+ * @param anArticle The map that can be changed. For example, to set a default author, do
+ * <p>
+ * <code>anArticle.put("creator", "editorial team");</code>
+ */
+ public void initializeArticle(Map anArticle);
+
+ /**
+ * Allows passwords to be stored encrypted in the database. Just implement this
+ * function and return a digest of the supplied password. This function should always
+ * return the same digest for the same password.
+ *
+ * @param aPassword The password to be digested
+ * @return The digested password
+ */
+ public String makePasswordDigest(String aPassword);
+
+ /**
+ * Allows different "generators" (templates) to be used for certain pages
+ *
+ * @param aPage The identifier of the page
+ * @param aUser the user (can be used to allow different users to see different pages
+ * @param aDefault The default generator
+ * @return
+ */
+ public String getAdminPageGenerator(String aPage, Map aTemplateData, EntityAdapter aUser, String aDefault) throws MirLocalizerExc;
+
+ /**
+ * Prepares an article preview
+ *
+ * @param aPreviewPage there may be different preview pages for a single article.
+ * (i.e. the same article may lead to different pages) this parameter selects one
+ * of those versions. See also {@link #getPreviewPages}.
+ * @param anArticle the article to be previewed
+ * @param aContext the context to be supplied to the generator
+ * @return the generator to be used to generate the preview
+ */
+ public Generator prepareArticlePreview(String aPreviewPage, EntityAdapter anArticle, Map aContext)
+ throws MirLocalizerExc, MirLocalizerFailure;
+
+ /**
+ * Return the available preview variations of one article
+ */
+ public List getPreviewPages(EntityAdapter anArticle) throws MirLocalizerExc, MirLocalizerFailure;
+
+ /**
+ * Get the {@link List} of {@link MirSimpleEntityOperation}s available for comments
+ */
+ public List simpleCommentOperations();
+
+ /**
+ * Get the {@link List} of {@link MirSimpleEntityOperation}s available for articles
+ */
+ public List simpleArticleOperations();
public interface MirSimpleEntityOperation {
- public boolean isAvailable(EntityAdapter anEntity);
- public void perform(EntityAdapter anEntity);
+ public String getName();
+ public boolean isAvailable(EntityAdapter anEntity) throws MirLocalizerExc, MirLocalizerFailure;
+ public void perform(EntityAdapter aUser, EntityAdapter anEntity) throws MirLocalizerExc, MirLocalizerFailure;
}
}
\ No newline at end of file