{
SimpleHash mergeData = new SimpleHash();
boolean setMedia=false;
+ boolean setTopic = false;
try {
WebdbMultipartRequest mp = new WebdbMultipartRequest(req);
theLog.printDebugInfo("id: "+cid);
//insert was not successfull
if(cid==null){
- //How do we know that it was not succesful cause of a
+ //How do we know that it was not succesful cause of a
//dupe, what if it failed cause of "No space left on device"?
//Or is there something I am missing? Wouldn't it be better
//to have an explicit dupe check and then insert? I have no
}
String[] to_topicsArr = mp.getParameterValues("to_topic");
- if (to_topicsArr != null && to_topicsArr.length > 0) {
+
+ if (to_topicsArr != null && to_topicsArr.length > 0) {
try{
DatabaseContentToTopics.getInstance().setTopics(cid,to_topicsArr);
- theLog.printError("setting content_x_topic success");
+ setTopic = true;
+ theLog.printError("setting content_x_topic success");
} catch (Exception e) {
theLog.printError("setting content_x_topic failed");
contentModule.deleteById(cid);
//if the client browser sent us unknown (text/plain is default)
//or if we got application/octet-stream, it's possible that
//the browser is in error, better check against the file extension
- if (contentType.equals("text/plain") ||
+ if (contentType.equals("text/plain") ||
contentType.equals("application/octet-stream")) {
- /**
+ /**
* This is just a temporary way to get the content-type via
* the .extension , we could maybe use a magic method, by looking
* at the header (first few bytes) of the file. (like the file(1)
* command).
- * The Oreilly method relies on the content-type that the client
+ * The Oreilly method relies on the content-type that the client
* browser sends and that sometimes is application-octet stream with
* broken/mis-configured browsers.
- *
- * The map file should be Mir/content-types.properties, it's the
- * default Sun Java file with some additional entries that it did
- * not have. So if you support a new media type you have to make
+ *
+ * The map file should be Mir/content-types.properties, it's the
+ * default Sun Java file with some additional entries that it did
+ * not have. So if you support a new media type you have to make
* sure that it is in this file -mh
*/
contentType = FileUtil.guessContentTypeFromName(fileName);
theLog.printError("CONTENT TYPE IS: "+contentType);
- if (contentType.equals("text/plain") ||
+ if (contentType.equals("text/plain") ||
contentType.equals("application/octet-stream")) {
throw new ServletModuleUserException("One or more files of unrecognized types");
}
//the where clause to find the media_type entry
//from the content-type.
- //we use the media type entry to lookup the
+ //we use the media type entry to lookup the
//media Handler/Storage classes
String wc = " mime_type='"+contentType+"'";
//if direct op producing startpage
if (directOp.equals("yes")) new ProducerStartPage().handle(null,null);
+ //produce the topicPages if set
+ //should be more intelligent
+ //if(setTopic==true) new ProducerTopics().handle(null,null);
+
// sync the server
//should be configureable
int exitValue = Helper.rsync();