comment.url=url\r
comment.creator=autor\r
comment.article=del artículo\r
+comment.html=HTML?
+comment.status=Status # needs translation
\r
commentlist.htmltitle=lista de comentarios\r
commentlist.published=publicado\r
########## admin ##########
# language: deutsch / german
-# $Id: admin_de.properties,v 1.19 2002/12/13 18:00:23 zapata Exp $
+# $Id: admin_de.properties,v 1.20 2002/12/13 21:00:03 zapata Exp $
# general
yes=ja
comment.url=Url
comment.creator=Uhrheber
comment.article=zu artikel
+comment.html=HTML?
+comment.status=Status # needs translation
+comment.language=Sprache
commentlist.htmltitle=commentlist
commentlist.published=publiziert
########## admin ##########
# language: english
-# $Id: admin_en.properties,v 1.27 2002/12/13 18:00:23 zapata Exp $
+# $Id: admin_en.properties,v 1.28 2002/12/13 21:00:03 zapata Exp $
# general
yes=yes
breakinglist.htmltitle=Breaking news overview
# comment
-comment.htmltitle=comment
-comment.date=date
-comment.title=title
-comment.published=published
-comment.text=comment text
-comment.address=address
-comment.phone=phone
-comment.email=email
-comment.url=url
-comment.creator=author
-comment.article=for article
+comment.htmltitle=Comment
+comment.date=Date
+comment.title=Title
+comment.published=Published
+comment.text=Comment text
+comment.address=Address
+comment.phone=Phone
+comment.email=Email
+comment.url=Url
+comment.creator=Author
+comment.article=For article
+comment.html=HTML?
+comment.status=Status
+comment.language=Language
commentlist.htmltitle=Comments
commentlist.published=published
########## admin ##########
# language: espanol / spanish
-# $Id: admin_es.properties,v 1.11 2002/12/13 18:00:23 zapata Exp $
+# $Id: admin_es.properties,v 1.12 2002/12/13 21:00:03 zapata Exp $
# general
yes=sí
comment.url=url
comment.creator=autor
comment.article=del artículo
+comment.html=es HTML?
+comment.status=Status # needs translation
+comment.language=Lengua
commentlist.htmltitle=lista de comentarios
commentlist.published=publicado
comment.url=url
comment.creator=autor
comment.article=del artículo
+comment.html=es HTML?
+comment.status=Status # needs translation
+comment.language=Lengua
commentlist.htmltitle=lista de comentarios
commentlist.published=publicado
comment.url=url
comment.creator=autor
comment.article=del artículo
+comment.html=es HTML?
+comment.status=Status # needs translation
+comment.language=Lengua
commentlist.htmltitle=lista de comentarios
commentlist.published=publicado
--- /dev/null
+INSERT INTO "comment_status" ("id", "name")
+VALUES (1,'normal');
}
public boolean isEmpty() {
- throw new UnsupportedOperationException("EntityAdapter.isEmpty()");
+ return false;
}
public Set keySet() {
-/*
- * Copyright (C) 2001, 2002 The Mir-coders group
- *
- * This file is part of Mir.
- *
- * Mir is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Mir 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Mir; if not, write to the Free Software
- * 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.
- */
-/*
- * Implementiert Interface für die Speicherschicht.
- * Bislang gibt es in der Bibliothek nur die Möglichkeit
- * in einer Datenbank zu speichern.
- */
-
-package mir.storage;
-
-import java.lang.*;
-import java.util.*;
-import java.sql.*;
-import freemarker.template.*;
-import mir.entity.*;
-
-
-/**
- * Implementiert Interface für die Speicherschicht.
- * Bislang gibt es in der Bibliothek nur die Möglichkeit
- * in einer Datenbank zu speichern.
- * @author RK
- * @version 29.6.1999
- */
-public interface StorageObject {
-
- /**
- * Dokumentation siehe Database.java
- * @param id
- * @return Entity
- * @exception StorageObjectException
- */
- abstract public Entity selectById (String id) throws StorageObjectException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @param aField
- * @param aValue
- * @return EntityList
- * @exception StorageObjectException
- */
- abstract public EntityList selectByFieldValue (String aField, String aValue) throws StorageObjectException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @param whereClause
- * @return EntityList
- * @exception StorageObjectException
- */
- abstract public EntityList selectByWhereClause (String whereClause) throws StorageObjectException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @param whereClause
- * @param offset
- * @return EntityList
- * @exception StorageObjectException
- */
- abstract public EntityList selectByWhereClause (String whereClause, int offset) throws StorageObjectException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @param whereClause
- * @param orderBy
- * @param offset
- * @return EntityList
- * @exception StorageObjectException
- */
- abstract public EntityList selectByWhereClause (String whereClause, String orderBy,
- int offset) throws StorageObjectException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @param whereClause
- * @param orderBy
- * @param offset
- * @param limit
- * @return EntityList
- * @exception StorageObjectException
- */
- abstract public EntityList selectByWhereClause (String whereClause, String orderBy,
- int offset, int limit) throws StorageObjectException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @param id
- * @return boolen
- * @exception StorageObjectException
- */
- abstract public boolean delete (String id) throws StorageObjectException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @return ArrayList
- * @exception StorageObjectException
- */
- abstract public ArrayList getFields () throws StorageObjectException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @return int[]
- * @exception StorageObjectException
- */
- abstract public int[] getTypes () throws StorageObjectException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @return ArrayList
- * @exception StorageObjectException
- */
- abstract public ArrayList getLabels () throws StorageObjectException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @param a
- * @exception StorageObjectException
- */
- abstract public void update (Entity a) throws StorageObjectException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @param a
- * @return String id
- * @exception StorageObjectException
- */
- abstract public String insert (Entity a) throws StorageObjectException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @return Class Klasse der Entity
- */
- abstract public Class getEntityClass();
-
-
-
- /**
- * put your documentation comment here
- * @return
- */
- abstract public String getIdName();
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @return String
- */
- abstract public String getTableName();
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @return SimpleHash
- */
- abstract public SimpleHash getHashData();
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @return Connection
- * @exception StorageObjectException
- */
- abstract public Connection getPooledCon () throws StorageObjectException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @param a
- * @param sql
- * @return ResultSet
- * @exception StorageObjectException, SQLException
- */
- abstract public ResultSet executeSql (Statement a, String sql) throws StorageObjectException,
- SQLException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @param con
- * @param stmt
- */
- abstract public void freeConnection(Connection con, Statement stmt)
- throws StorageObjectException;
-
-
-
- /**
- * Dokumentation siehe Database.java
- * @return
- */
- abstract public SimpleList getPopupData () throws StorageObjectException;
-
- abstract public int executeUpdate(Statement a, String sql) throws StorageObjectException, SQLException ;
- abstract public int executeUpdate(String sql) throws StorageObjectException, SQLException ;
- abstract public int getSize(String where) throws SQLException,StorageObjectException;
-
-}
-
-
-
+/*\r
+ * Copyright (C) 2001, 2002 The Mir-coders group\r
+ *\r
+ * This file is part of Mir.\r
+ *\r
+ * Mir is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Mir is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with Mir; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ *\r
+ * In addition, as a special exception, The Mir-coders gives permission to link\r
+ * the code of this program with the com.oreilly.servlet library, any library\r
+ * licensed under the Apache Software License, The Sun (tm) Java Advanced\r
+ * Imaging library (JAI), The Sun JIMI library (or with modified versions of\r
+ * the above that use the same license as the above), and distribute linked\r
+ * combinations including the two. You must obey the GNU General Public\r
+ * License in all respects for all of the code used other than the above\r
+ * mentioned libraries. If you modify this file, you may extend this exception\r
+ * to your version of the file, but you are not obligated to do so. If you do\r
+ * not wish to do so, delete this exception statement from your version.\r
+ */\r
+/*\r
+ * Implementiert Interface für die Speicherschicht.\r
+ * Bislang gibt es in der Bibliothek nur die Möglichkeit\r
+ * in einer Datenbank zu speichern.\r
+ */\r
+\r
+package mir.storage;\r
+\r
+import java.lang.*;\r
+import java.util.*;\r
+import java.sql.*;\r
+import freemarker.template.*;\r
+import mir.entity.*;\r
+\r
+\r
+/**\r
+ * Implementiert Interface für die Speicherschicht.\r
+ * Bislang gibt es in der Bibliothek nur die Möglichkeit\r
+ * in einer Datenbank zu speichern.\r
+ * @author RK\r
+ * @version 29.6.1999\r
+ */\r
+public interface StorageObject {\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @param id\r
+ * @return Entity\r
+ * @exception StorageObjectException\r
+ */\r
+ abstract public Entity selectById(String id) throws StorageObjectException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @param aField\r
+ * @param aValue\r
+ * @return EntityList\r
+ * @exception StorageObjectException\r
+ */\r
+ abstract public EntityList selectByFieldValue(String aField, String aValue) throws\r
+ StorageObjectException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @param whereClause\r
+ * @return EntityList\r
+ * @exception StorageObjectException\r
+ */\r
+ abstract public EntityList selectByWhereClause(String whereClause) throws\r
+ StorageObjectException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @param whereClause\r
+ * @param offset\r
+ * @return EntityList\r
+ * @exception StorageObjectException\r
+ */\r
+ abstract public EntityList selectByWhereClause(String whereClause, int offset) throws\r
+ StorageObjectException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @param whereClause\r
+ * @param orderBy\r
+ * @param offset\r
+ * @return EntityList\r
+ * @exception StorageObjectException\r
+ */\r
+ abstract public EntityList selectByWhereClause(String whereClause,\r
+ String orderBy,\r
+ int offset) throws\r
+ StorageObjectException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @param whereClause\r
+ * @param orderBy\r
+ * @param offset\r
+ * @param limit\r
+ * @return EntityList\r
+ * @exception StorageObjectException\r
+ */\r
+ abstract public EntityList selectByWhereClause(String whereClause,\r
+ String orderBy,\r
+ int offset, int limit) throws\r
+ StorageObjectException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @param id\r
+ * @return boolen\r
+ * @exception StorageObjectException\r
+ */\r
+ abstract public boolean delete(String id) throws StorageObjectException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @return ArrayList\r
+ * @exception StorageObjectException\r
+ */\r
+ abstract public ArrayList getFields() throws StorageObjectException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @return int[]\r
+ * @exception StorageObjectException\r
+ */\r
+ abstract public int[] getTypes() throws StorageObjectException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @return ArrayList\r
+ * @exception StorageObjectException\r
+ */\r
+ abstract public ArrayList getLabels() throws StorageObjectException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @param a\r
+ * @exception StorageObjectException\r
+ */\r
+ abstract public void update(Entity a) throws StorageObjectException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @param a\r
+ * @return String id\r
+ * @exception StorageObjectException\r
+ */\r
+ abstract public String insert(Entity a) throws StorageObjectException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @return Class Klasse der Entity\r
+ */\r
+ abstract public Class getEntityClass();\r
+\r
+ /**\r
+ * put your documentation comment here\r
+ * @return\r
+ */\r
+ abstract public String getIdName();\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @return String\r
+ */\r
+ abstract public String getTableName();\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @return SimpleHash\r
+ */\r
+ abstract public SimpleHash getHashData();\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @return Connection\r
+ * @exception StorageObjectException\r
+ */\r
+ abstract public Connection getPooledCon() throws StorageObjectException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @param a\r
+ * @param sql\r
+ * @return ResultSet\r
+ * @exception StorageObjectException, SQLException\r
+ */\r
+ abstract public ResultSet executeSql(Statement a, String sql) throws\r
+ StorageObjectException,\r
+ SQLException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @param con\r
+ * @param stmt\r
+ */\r
+ abstract public void freeConnection(Connection con, Statement stmt) throws\r
+ StorageObjectException;\r
+\r
+ /**\r
+ * Dokumentation siehe Database.java\r
+ * @return\r
+ */\r
+ abstract public SimpleList getPopupData() throws StorageObjectException;\r
+\r
+ abstract public int executeUpdate(Statement a, String sql) throws\r
+ StorageObjectException, SQLException;\r
+\r
+ abstract public int executeUpdate(String sql) throws StorageObjectException,\r
+ SQLException;\r
+\r
+ abstract public int getSize(String where) throws SQLException,\r
+ StorageObjectException;\r
+}\r
+\r
+\r
+\r
try {\r
anEntityAdapterDefinition.addDBDateField("creationdate", "webdb_create");\r
anEntityAdapterDefinition.addCalculatedField("to_content", new CommentToContentField());\r
+ anEntityAdapterDefinition.addCalculatedField("status", new CommentToStatusField());\r
\r
anEntityAdapterDefinition.addCalculatedField("description_parsed", new FilteredField("description"));\r
anEntityAdapterDefinition.addCalculatedField("operations",\r
result.addMapping( "comment", DatabaseComment.getInstance(), definition);\r
\r
result.addMapping( "articleType", DatabaseArticleType.getInstance(), new EntityAdapterDefinition());\r
+ result.addMapping( "commentStatus", DatabaseCommentStatus.getInstance(), new EntityAdapterDefinition());\r
\r
definition = new EntityAdapterDefinition();\r
definition.addDBDateField("creationdate", "webdb_create");\r
}\r
}\r
\r
+ protected class CommentToStatusField implements EntityAdapterDefinition.CalculatedField {\r
+ public Object getValue(EntityAdapter anEntityAdapter) {\r
+ try {\r
+ return anEntityAdapter.getToOneRelation(\r
+ "id="+anEntityAdapter.get("to_comment_status"),\r
+ "id",\r
+ "commentStatus" );\r
+ }\r
+ catch (Throwable t) {\r
+ throw new RuntimeException(t.getMessage());\r
+ }\r
+ }\r
+ }\r
+\r
protected class EntityToSimpleOperationsField implements EntityAdapterDefinition.CalculatedField {\r
private List operations;\r
\r
}
}
catch (Throwable t) {
- logger.printError("initializeGenerationValueSet: Exception "+t.getMessage());
+ logger.printError("initializeGenerationValueSet: Exception while collecting article types "+t.getMessage());
}
-
aValueSet.put("articletype", articleTypeMap);
+
+ Map commentStatusMap = new HashMap();
+ try {
+ i = new EntityIteratorAdapter( "", "", 20, MirGlobal.localizer().dataModel().adapterModel(), "commentStatus" );
+
+ while (i.hasNext()) {
+ EntityAdapter commentStatus = (EntityAdapter) i.next();
+
+ commentStatusMap.put(commentStatus.get("name"), commentStatus.get("id"));
+ }
+ }
+ catch (Throwable t) {
+ logger.printError("initializeGenerationValueSet: Exception while collecting comment statuses"+t.getMessage());
+ }
+ aValueSet.put("commentstatus", articleTypeMap);
+
};
public String filterText(String aText) {
}
}
+ public void edit(HttpServletRequest req, HttpServletResponse res) throws ServletModuleException
+ {
+ String idParam = req.getParameter("id");
+
+ if (idParam == null)
+ throw new ServletModuleException("Invalid call: id not supplied ");
+
+ showComment(idParam, req, res);
+ }
+
+ public void showComment(String anId, HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleException {
+ try {
+ SimpleHash extraInfo = new SimpleHash();
+ TemplateModelRoot data;
+
+ data = (TemplateModelRoot) mainModule.getById(anId);
+
+ extraInfo.put("languages", DatabaseLanguage.getInstance().getPopupData());
+ extraInfo.put("comment_status_values", DatabaseCommentStatus.getInstance().getPopupData());
+
+ deliver(aRequest, aResponse, data, extraInfo, templateObjektString);
+ }
+ catch (Exception e) {
+ throw new ServletModuleException(e.toString());
+ }
+ }
+
+
public void list(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleException
{
HTTPRequestParser requestParser = new HTTPRequestParser(aRequest);
String where = requestParser.getParameter("where");
- String order = requestParser.getParameter("order");
+ String order = requestParser.getParameterWithDefault("order", "webdb_create desc");
int offset = requestParser.getIntegerWithDefault("offset", 0);
returnCommentList(aRequest, aResponse, where, order, offset);
* ServletModuleContent -
* deliver html for the article admin form.
*
- * @version $Id: ServletModuleContent.java,v 1.27 2002/12/13 17:57:31 zapata Exp $
+ * @version $Id: ServletModuleContent.java,v 1.28 2002/12/13 20:59:42 zapata Exp $
* @author rk, mir-coders
*
*/
public void edit(HttpServletRequest req, HttpServletResponse res) throws ServletModuleException
{
String idParam = req.getParameter("id");
- if (idParam == null) throw new ServletModuleException("Falscher Aufruf: (id) nicht angegeben");
+ if (idParam == null) throw new ServletModuleException("Invalid call: id not supplied ");
_showObject(idParam, req, res);
}
SimpleHash extraInfo = new SimpleHash();
try {
TemplateModelRoot entContent;
+
if (id != null) {
entContent = (TemplateModelRoot)mainModule.getById(id);
- } else {
+ }
+ else {
SimpleHash withValues = new SimpleHash();
withValues.put("new", "1");
withValues.put("is_published", "0");
}
extraInfo.put("themenPopupData", themenModule.getTopicsAsSimpleList());
- try {
- extraInfo.put("articletypePopupData", DatabaseArticleType.getInstance().getPopupData());
- }
- catch (Exception e) {
- logger.error("articletype could not be fetched.");
- }
- try {
- extraInfo.put("languagePopupData", DatabaseLanguage.getInstance().getPopupData());
- }
- catch (Exception e) {
- logger.error("language-popup could not be fetched.");
- }
-
- extraInfo.put("schwerpunktPopupData", schwerpunktModule.getSchwerpunktAsSimpleList());
+ extraInfo.put("articletypePopupData", DatabaseArticleType.getInstance().getPopupData());
+ extraInfo.put("languagePopupData", DatabaseLanguage.getInstance().getPopupData());
// code to be able to return to the list:
String offsetParam, whereParam, orderParam;
}
}
+ public void batchedarticleoperation(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleException {
+ String articleIdString = aRequest.getParameter("articleid");
+ String operationString = aRequest.getParameter("operation");
+ String returnUrlString = aRequest.getParameter("returnurl");
+
+ MirAdminInterfaceLocalizer.MirSimpleEntityOperation operation;
+ EntityAdapter article;
+ EntityContent entity;
+
+ try {
+ entity = (EntityContent) contentModule.getById(articleIdString);
+
+ if (entity!=null) {
+ article = MirGlobal.localizer().dataModel().adapterModel().makeEntityAdapter("content", entity);
+ operation = MirGlobal.localizer().adminInterface().simpleArticleOperationForName(operationString);
+ operation.perform(article);
+ }
+
+ redirect(aResponse, returnUrlString);
+ }
+ catch (Throwable e) {
+ e.printStackTrace(System.out);
+ throw new ServletModuleException(e.getMessage());
+ }
+ }
}
\ No newline at end of file
-/*
- * Copyright (C) 2001, 2002 The Mir-coders group
- *
- * This file is part of Mir.
- *
- * Mir is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Mir 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Mir; if not, write to the Free Software
- * 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.
- */
-
-package mircoders.storage;
-
-/**
- * Title:
- * Description:
- * Copyright: Copyright (c) 2001
- * Company: Indymedia
- * @author
- * @version 1.0
- */
-
-import java.lang.*;
-import java.sql.*;
-import java.io.*;
-import java.util.*;
-
-import freemarker.template.*;
-
-import mir.storage.*;
-import mir.entity.*;
-import mir.misc.*;
-
-
-public class DatabaseArticleType extends Database implements StorageObject{
-
- private static DatabaseArticleType instance;
- private static SimpleList articletypePopupData;
-
- // the following *has* to be sychronized cause this static method
- // could get preemted and we could end up with 2 instances of DatabaseFoo..
- // see the "Singletons with needles and thread" article at JavaWorld -mh
- public synchronized static DatabaseArticleType getInstance()
- throws StorageObjectException
- {
- if (instance == null) {
- instance = new DatabaseArticleType();
- instance.myselfDatabase = instance;
- }
- return instance;
- }
-
- private DatabaseArticleType() throws StorageObjectException
- {
- super();
- this.hasTimestamp = false;
- this.theTable="article_type";
- }
-
- public SimpleList getPopupData()
- throws StorageObjectException { return getPopupData("name",false); }
-
-
-}
+/*\r
+ * Copyright (C) 2001, 2002 The Mir-coders group\r
+ *\r
+ * This file is part of Mir.\r
+ *\r
+ * Mir is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Mir is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with Mir; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ *\r
+ * In addition, as a special exception, The Mir-coders gives permission to link\r
+ * the code of this program with the com.oreilly.servlet library, any library\r
+ * licensed under the Apache Software License, The Sun (tm) Java Advanced\r
+ * Imaging library (JAI), The Sun JIMI library (or with modified versions of\r
+ * the above that use the same license as the above), and distribute linked\r
+ * combinations including the two. You must obey the GNU General Public\r
+ * License in all respects for all of the code used other than the above\r
+ * mentioned libraries. If you modify this file, you may extend this exception\r
+ * to your version of the file, but you are not obligated to do so. If you do\r
+ * not wish to do so, delete this exception statement from your version.\r
+ */\r
+\r
+package mircoders.storage;\r
+\r
+/**\r
+ * Title:\r
+ * Description:\r
+ * Copyright: Copyright (c) 2001\r
+ * Company: Indymedia\r
+ * @author\r
+ * @version 1.0\r
+ */\r
+\r
+import java.lang.*;\r
+import java.sql.*;\r
+import java.io.*;\r
+import java.util.*;\r
+\r
+import freemarker.template.*;\r
+\r
+import mir.storage.*;\r
+import mir.entity.*;\r
+import mir.misc.*;\r
+\r
+\r
+public class DatabaseArticleType extends Database implements StorageObject{\r
+\r
+ private static DatabaseArticleType instance;\r
+ private static SimpleList articletypePopupData;\r
+\r
+ // the following *has* to be sychronized cause this static method\r
+ // could get preemted and we could end up with 2 instances of DatabaseFoo..\r
+ // see the "Singletons with needles and thread" article at JavaWorld -mh\r
+ public synchronized static DatabaseArticleType getInstance() throws\r
+ StorageObjectException {\r
+ if (instance == null) {\r
+ instance = new DatabaseArticleType();\r
+ instance.myselfDatabase = instance;\r
+ }\r
+ return instance;\r
+ }\r
+\r
+ private DatabaseArticleType() throws StorageObjectException {\r
+ super();\r
+ this.hasTimestamp = false;\r
+ this.theTable = "article_type";\r
+ }\r
+\r
+ public SimpleList getPopupData() throws StorageObjectException {\r
+ return getPopupData("name", false);\r
+ }\r
+\r
+\r
+}\r
this.hasTimestamp = false;\r
this.theTable = "comment_status";\r
}\r
+\r
+ public SimpleList getPopupData() throws StorageObjectException {\r
+ return getPopupData("name", false);\r
+ }\r
}
\ No newline at end of file
-/*
- * Copyright (C) 2001, 2002 The Mir-coders group
- *
- * This file is part of Mir.
- *
- * Mir is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Mir 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Mir; if not, write to the Free Software
- * 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.
- */
-
-package mircoders.storage;
-
-/**
- * Title: DatabaseLanguage
- * Description:
- * Copyright: Copyright (c) 2001
- * Company: Indymedia
- * @author
- * @version 1.0
- */
-
-import java.lang.*;
-import java.sql.*;
-import java.io.*;
-import java.util.*;
-
-import freemarker.template.*;
-
-import mir.storage.*;
-import mir.entity.*;
-import mir.misc.*;
-
-
-public class DatabaseLanguage extends Database implements StorageObject{
-
- private static DatabaseLanguage instance;
- private static SimpleList languagePopupData;
-
- // the following *has* to be sychronized cause this static method
- // could get preemted and we could end up with 2 instances of DatabaseFoo..
- // see the "Singletons with needles and thread" article at JavaWorld -mh
- public synchronized static DatabaseLanguage getInstance()
- throws StorageObjectException
- {
- if (instance == null) {
- instance = new DatabaseLanguage();
- instance.myselfDatabase = instance;
- }
- return instance;
- }
-
- private DatabaseLanguage() throws StorageObjectException
- {
- super();
- this.hasTimestamp = false;
- this.theTable="language";
- }
-
- public SimpleList getPopupData() throws StorageObjectException {
- SimpleList pData = null;
- try {
- pData = getPopupData("name",false);
- } catch (StorageObjectException e) {System.err.println("FF");}
- return pData;
- }
-
-
-}
+/*\r
+ * Copyright (C) 2001, 2002 The Mir-coders group\r
+ *\r
+ * This file is part of Mir.\r
+ *\r
+ * Mir is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Mir is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with Mir; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ *\r
+ * In addition, as a special exception, The Mir-coders gives permission to link\r
+ * the code of this program with the com.oreilly.servlet library, any library\r
+ * licensed under the Apache Software License, The Sun (tm) Java Advanced\r
+ * Imaging library (JAI), The Sun JIMI library (or with modified versions of\r
+ * the above that use the same license as the above), and distribute linked\r
+ * combinations including the two. You must obey the GNU General Public\r
+ * License in all respects for all of the code used other than the above\r
+ * mentioned libraries. If you modify this file, you may extend this exception\r
+ * to your version of the file, but you are not obligated to do so. If you do\r
+ * not wish to do so, delete this exception statement from your version.\r
+ */\r
+\r
+package mircoders.storage;\r
+\r
+/**\r
+ * Title: DatabaseLanguage\r
+ * Description:\r
+ * Copyright: Copyright (c) 2001\r
+ * Company: Indymedia\r
+ * @author\r
+ * @version 1.0\r
+ */\r
+\r
+import java.lang.*;\r
+import java.sql.*;\r
+import java.io.*;\r
+import java.util.*;\r
+\r
+import freemarker.template.*;\r
+\r
+import mir.storage.*;\r
+import mir.entity.*;\r
+import mir.misc.*;\r
+\r
+\r
+public class DatabaseLanguage extends Database implements StorageObject{\r
+\r
+ private static DatabaseLanguage instance;\r
+ private static SimpleList languagePopupData;\r
+\r
+ // the following *has* to be sychronized cause this static method\r
+ // could get preemted and we could end up with 2 instances of DatabaseFoo..\r
+ // see the "Singletons with needles and thread" article at JavaWorld -mh\r
+ public synchronized static DatabaseLanguage getInstance() throws\r
+ StorageObjectException {\r
+ if (instance == null) {\r
+ instance = new DatabaseLanguage();\r
+ instance.myselfDatabase = instance;\r
+ }\r
+ return instance;\r
+ }\r
+\r
+ private DatabaseLanguage() throws StorageObjectException {\r
+ super();\r
+ this.hasTimestamp = false;\r
+ this.theTable = "language";\r
+ }\r
+\r
+ public SimpleList getPopupData() throws StorageObjectException {\r
+ SimpleList pData = null;\r
+ try {\r
+ pData = getPopupData("name", false);\r
+ }\r
+ catch (StorageObjectException e) {\r
+ System.err.println("FF");\r
+ }\r
+ return pData;\r
+ }\r
+}\r
<link rel="stylesheet" type="text/css" href="${config.docRoot}/style/admin.css">
<head>
-<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
+ <body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
-<include "templates/admin/head.template">
-
-<form method="post" action="${config.actionRoot}">
- <input type="hidden" name="module" value="Comment">
- <input type="hidden" name="id" value="${utility.encodeHTML(data.id)}">
- <input type="hidden" name="date" value="${utility.encodeHTML(data.date)}">
- <input type="hidden" name="to_media" value="${utility.encodeHTML(data.to_media)}">
- <if new>
- <input type="hidden" name="do" value="insert">
- <else>
- <input type="hidden" name="do" value="update">
- </if>
-
- <table border="0">
-
- <tr>
- <td align="right" class="darkgrey"><span class="witesmall">
- <B>${lang("comment.date")}:</B></span></td>
- <td>${utility.encodeHTML(utility.encodeHTML(data.webdb_create))}</td>
- </tr>
-
- <tr>
- <td align="right" class="darkgrey"><span class="witesmall">
- <B>${lang("comment.title")}:</B></span></td>
- <td><input type="text" size="40" maxlength="255" name="title" value="${utility.encodeHTML(data.title)}"></td>
- </tr>
-
- <tr>
- <td align="right" class="darkgrey"><span class="witesmall">
- <B>${lang("comment.creator")}:</B></span></td>
- <td><input type="text" size="40" maxlength="80" name="creator" value="${utility.encodeHTML(data.creator)}"></td>
- </tr>
-
- <tr>
- <td align="right" class="darkgrey"><span class="witesmall">
- <B>${lang("comment.url")}:</B></span></td>
- <td><input type="text" size="40" maxlength="255" name="main_url" value="${utility.encodeHTML(data.main_url)}"></td>
- </tr>
-
- <tr>
- <td align="right" class="darkgrey"><span class="witesmall">
- <B>${lang("comment.email")}:</B></span></td>
- <td><input type="text" size="40" maxlength="80" name="email" value="${utility.encodeHTML(data.email)}"></td>
- </tr>
-
- <tr>
- <td align="right" class="darkgrey"><span class="witesmall">
- <B>${lang("comment.phone")}:</B></span></td>
- <td><input type="text" size="40" maxlength="80" name="phone" value="${utility.encodeHTML(data.phone)}"></td>
- </tr>
-
- <tr>
- <td align="right" class="darkgrey"><span class="witesmall">
- <B>${lang("comment.address")}:</B></span></td>
- <td><input type="text" size="40" maxlength="80" name="address" value="${utility.encodeHTML(data.address)}"></td>
- </tr>
-
- <tr>
- <td align="right" class="darkgrey"><span class="witesmall">
- <B>${lang("comment.text")}:</B></span></td>
- <td><textarea cols="40" rows="10" name="description" wrap="virtual">${utility.encodeHTML(data.description)}</textarea></td>
- </tr>
-
- <td colspan="2" align="right"> <span class="text">
- ${lang("comment.published")} <input type="checkbox" name="is_published" value="1" <if data.is_published=="1"> checked</if>>
- <if new>
- <input type="submit" name="save" value="${lang("insert")}">
- <else>
- <input type="submit" name="save" value="${lang("save")}">
- </if> </span></form></span>
- </td>
-</table>
-
-<include "templates/admin/foot.template">
-</body>
+ <include "templates/admin/head.template">
+
+ <form method="post" action="${config.actionRoot}">
+ <input type="hidden" name="module" value="Comment">
+ <input type="hidden" name="id" value="${utility.encodeHTML(data.id)}">
+ <input type="hidden" name="date" value="${utility.encodeHTML(data.date)}">
+ <input type="hidden" name="to_media" value="${utility.encodeHTML(data.to_media)}">
+ <if new>
+ <input type="hidden" name="do" value="insert">
+ <else>
+ <input type="hidden" name="do" value="update">
+ </if>
+
+ <table border="0">
+ <tr>
+ <td align="right" class="editfieldname">
+ ${lang("comment.date")}
+ </td>
+ <td>
+ ${utility.encodeHTML(utility.encodeHTML(data.webdb_create))}
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" class="editfieldname">
+ ${lang("comment.status")}
+ </td>
+ <td>
+ <select name="to_comment_status">
+ <list extra.comment_status_values as a>
+ <option value="${a.key}" <if (a.key == data.to_comment_status)>selected</if>>${a.value}</option>
+ </list>
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" class="editfieldname">
+ ${lang("comment.title")}
+ </td>
+
+ <td>
+ <input type="text" size="40" maxlength="255" name="title" value="${utility.encodeHTML(data.title)}">
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" class="editfieldname">
+ ${lang("comment.creator")}
+ </td>
+ <td>
+ <input type="text" size="40" maxlength="80" name="creator" value="${utility.encodeHTML(data.creator)}">
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" class="editfieldname">
+ ${lang("comment.url")}
+ </td>
+ <td>
+ <input type="text" size="40" maxlength="255" name="main_url" value="${utility.encodeHTML(data.main_url)}">
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" class="editfieldname">
+ ${lang("comment.email")}
+ </td>
+ <td>
+ <input type="text" size="40" maxlength="80" name="email" value="${utility.encodeHTML(data.email)}">
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" class="editfieldname">
+ ${lang("comment.phone")}
+ </td>
+ <td>
+ <input type="text" size="40" maxlength="80" name="phone" value="${utility.encodeHTML(data.phone)}">
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" class="editfieldname">
+ ${lang("comment.address")}
+ </td>
+ <td>
+ <input type="text" size="40" maxlength="80" name="address" value="${utility.encodeHTML(data.address)}">
+ </td>
+ </tr>
+ <tr>
+ <td align="right" class="editfieldname">
+ ${lang("comment.language")}
+ </td>
+ <td>
+ <select name="to_language">
+ <list extra.languages as l>
+ <option value="${l.key}" <if (l.key == data.to_language)>selected</if>>${l.value}</option>
+ </list>
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" class="editfieldname" valign="top">
+ ${lang("comment.text")}<br>
+ ${lang("comment.html")}<input type="checkbox" name="is_html" value="1"<if data.is_html=="1"> checked</if>>
+ </td>
+ <td>
+ <textarea cols="60" rows="10" name="description" wrap="virtual">${utility.encodeHTML(data.description)}</textarea>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" align="right">
+ <span class="text">
+ ${lang("comment.published")} <input type="checkbox" name="is_published" value="1" <if data.is_published=="1"> checked</if>>
+ <if new>
+ <input type="submit" name="save" value="${lang("insert")}">
+ <else>
+ <input type="submit" name="save" value="${lang("save")}">
+ </if>
+ </span>
+ </td>
+ </tr>
+ </table>
+ </form>
+ <include "templates/admin/foot.template">
+ </body>
</html>
</a>
<br>
<a name="${entry.id}"></a>
- <if entry.title><b>${entry.title}</b><br></if>
+ <if entry.status>${entry.status.name} - </if> <b>${entry.title}</b><br>
<if entry.creator>${lang("comment.creator")}: ${entry.creator}<br></if>
<span class="small">${entry.description}</span>
<table border="0" width="80%" align="middle">
<tr>
<td colspan="1"> </td>
- <td class="minorcommand" colspan="2"><a href="${config.actionRoot}?module=Comment&do=articlecomments&articleid=${data.id}">${lang("content.comments")}</a></td>
+ <td class="minorcommand" colspan="2">
+ <if !data.new>
+ <a href="${config.actionRoot}?module=Comment&do=articlecomments&articleid=${data.id}">${lang("content.comments")}</a>
+ </if>
+ </td>
<td colspan="2" align="right" valign="top">
${lang("content.published")} <a href="${config.docRoot}/help/content.html"><img src="${config.docRoot}/img/help.gif" border="0" align="absmiddle"></a>:
<input type="checkbox" name="is_published" value="1"<if data.is_published!="0" && data.is_published!=""> checked</if>>
<list entry.operations as op>
[<a href="${config.actionRoot}?module=Localizer&do=articleoperation&operation=${op}&articleid=${entry.id}&returnurl=${utility.encodeURI(thisurl)}">${op}</a>]
</list>
-<comment>
- <if entry.to_article_type=="0"> | <a href="${config.actionRoot}?module=Content&do=newswire&id=${entry.id}&returnurl=${utility.encodeURI(thisurl)}">newswire</a></if>
-</comment>
-
</span>
</td>
<td width="20%" <if grey=="1">class="list3"<else>class="list4"</if> valign="top"><span class="x-small">