- //
- // methods
-
- /**
- * set is_produced flag for the article
- */
-
- public void setProduced(boolean yesno)
- {
- Connection con=null;Statement stmt=null;
- String value = (yesno) ? "1":"0";
- String sql = "update content set is_produced='" + value + "' where id='" + getId()+"'";
- try {
- con = theStorageObject.getPooledCon();
- /** @todo should be preparedStatement: faster!! */
- stmt = con.createStatement();
- theStorageObject.executeUpdate(stmt,sql);
- } catch (StorageObjectException e) {
- theLog.printDebugInfo(e.toString() + "\n -- set produced failed");
- } catch (SQLException e) {
- theLog.printDebugInfo(e.toString() + "\n -- set produced failed");
- } finally {
- theStorageObject.freeConnection(con,stmt);
- }
- }
-
-
- /**
- * make openposting to newswire
- */
-
- public void newswire()
- {
- String sql = "update content set to_article_type='1', is_produced='0' where id='" + getId()+"'";
- try {
- theStorageObject.executeUpdate(sql);
- } catch (StorageObjectException e) {
- theLog.printError(e.toString() + "newswire failed");
- } catch (SQLException e) {
- theLog.printError(e.toString() + "newswire failed");
- }
- }
-
-
- /**
- * dettach from media
- */
-
- public void dettach()
- {
- String sql = "update content set to_media=null, is_produced='0' where id='" + getId()+"'";
- try {
- theStorageObject.executeUpdate(sql);
- } catch (StorageObjectException e) {
- theLog.printError(e.toString() + "dettach failed");
- } catch (SQLException e) {
- theLog.printError(e.toString() + "dettach failed");
- }
- }
-
- /**
- * attach to media
- */
-
- public void attach(String mid)
- {
- if (mid!=null) {
- String sql = "update content set to_media='" + mid + "', is_produced='0' where id='" + getId()+"'";
- try {
- theStorageObject.executeUpdate(sql);
- } catch (StorageObjectException e) {
- theLog.printError(e.toString() + "attach failed");
- } catch (SQLException e) {
- theLog.printError(e.toString() + "attach failed");
- }
- }
- else
- theLog.printError("EntityContent: attach without mid");
- }
-
- /**
- * overridden method getValues to include formatted date into every
- * entityContent
- */
-
- public HashMap getValues() {
- HashMap returnHash = super.getValues();
- String date=null;