public void setProduced(boolean yesno) throws StorageObjectException
{
- Connection con=null;Statement stmt=null;
String value = (yesno) ? "1":"0";
- String sql = "update content set is_produced='" + value + "' where id='" + getId()+"'";
+ if (value.equals( getValue("is_produced") )) return;
+
+ Connection con=null;Statement stmt=null;
+ String sql = "update content set is_produced='" + value + "' where id='" + getId()+"'";
try {
con = theStorageObject.getPooledCon();
/** @todo should be preparedStatement: faster!! */
}
else if (key.equals("to_topics")) {
try {
- HTMLTemplateProcessor.makeSimpleList(DatabaseContentToTopics.getInstance().getTopics(this));
+ DatabaseContentToTopics.getInstance().getTopics(this);
}
catch (Exception ex) {
theLog.printWarning("-- getTopics: could not fetch data " + ex.toString());
*
* @return freemarker.template.SimpleList
*/
- private SimpleList getComments() throws StorageObjectException {
+ private EntityList getComments() throws StorageObjectException {
return ((DatabaseContent)theStorageObject).getComments(this);
}
//######## @todo all of the following getBlahForContent should have
// and optimized version where LIMIT=1 sql for list view.
- private SimpleList getImagesForContent()
+ private EntityList getImagesForContent()
throws StorageObjectException, TemplateModelException
{
- return HTMLTemplateProcessor.makeSimpleList(
- DatabaseContentToMedia.getInstance().getImages(this) );
+ return DatabaseContentToMedia.getInstance().getImages(this);
}
- private SimpleList getAudioForContent()
+ private EntityList getAudioForContent()
throws StorageObjectException, TemplateModelException
{
- return HTMLTemplateProcessor.makeSimpleList(
- DatabaseContentToMedia.getInstance().getAudio(this) );
+ return DatabaseContentToMedia.getInstance().getAudio(this) ;
}
- private SimpleList getVideoForContent()
+ private EntityList getVideoForContent()
throws StorageObjectException, TemplateModelException
{
- return HTMLTemplateProcessor.makeSimpleList(
- DatabaseContentToMedia.getInstance().getVideo(this) );
+ return DatabaseContentToMedia.getInstance().getVideo(this) ;
}
- private SimpleList getOtherMediaForContent()
+ private EntityList getOtherMediaForContent()
throws StorageObjectException, TemplateModelException
{
- return HTMLTemplateProcessor.makeSimpleList(
- DatabaseContentToMedia.getInstance().getOther(this) );
+ return DatabaseContentToMedia.getInstance().getOther(this);
}
}