***********************
** FILE NAME : message.cpp
** SYSTEM NAME : Gnucomo - Gnu Computer Monitoring
-** VERSION NUMBER : $Revision: 1.16 $
+** VERSION NUMBER : $Revision: 1.17 $
**
** DESCRIPTION : Implementation of the message handling classes
**
/*****************************
$Log: message.cpp,v $
- Revision 1.16 2003-12-04 10:38:09 arjen
+ Revision 1.17 2005-05-31 05:51:41 arjen
+ Textual changes in parameter notifications
+
+ Revision 1.16 2003/12/04 10:38:09 arjen
Major redesign. All input is handled through XML. Raw input data is first
transformed into an XML document for further processing.
A collection of polymorphic classes handle the transformation of various
*****************************/
-static const char *RCSID = "$Id: message.cpp,v 1.16 2003-12-04 10:38:09 arjen Exp $";
+static const char *RCSID = "$Id: message.cpp,v 1.17 2005-05-31 05:51:41 arjen Exp $";
#include <algorithm>
#include <libxml/xpath.h>
double uncertainty;
+#ifdef DEBUG
+ *Log << "Checking for a mail header.\n";
+#endif
+
/* First, check if the message has a mail header. */
if (input >> line && line == re_uxmail_from)
* out what the content of the message is.
*/
+#ifdef DEBUG
+ *Log << "Classifying message.\n";
+#endif
+
uncertainty = 1.0;
classification = COOKER_OBJECT;
}
}
+
+ //TODO: If uncertainty is still too great, pick the least uncertain.
+
input.rewind();
certainty = 1.0 - uncertainty;
bool initial_entry = false;
String param_class((const char *)xmlGetProp(node, (const xmlChar *)"class"));
+#ifdef DEBUG
+ *Log << "Entering a list of " << param_class << " parameters.\n";
+#endif
pathcontext->node = node;
// If we don;t have any parameters of this class, this will be
{
String param_name((const char *)xmlGetProp(node, (const xmlChar *)"name"));
+#ifdef DEBUG
+ *Log << "Parameter with name " << param_name << "\n";
+#endif
std::list<param_property> properties;
param_property prop;
xmlNodePtr item;
{
if (change_notification == "")
{
- remark = "Gnucomo detected a different version for package parameter(s) ";
+ remark = "Gnucomo detected a different property for parameter(s) ";
change_notification = database.new_notification(objectid,
"property modified", remark);
}
{
if (create_notification == "")
{
- remark = "Gnucomo detected new parameter(s) of class package";
+ remark = "Gnucomo detected new parameter(s) of class " + param_class;
create_notification = database.new_notification(objectid,
"parameter created", remark);
}
{
// The parameter is in the database but not in the report
+#ifdef DEBUG
+ *Log << "Could not find " << XPath << " in XML tree.\n";
+#endif
paramid = database.Field(parameter_set, i, "paramid");
qry ="select change_nature from history where paramid='";
qry += paramid + "' order by modified desc";
if (remove_notification == "")
{
- remark = "Gnucomo detected that package(s) have disappeared ";
+ remark = "Gnucomo detected that " + param_class
+ + " parameters(s) have disappeared ";
remove_notification = database.new_notification(objectid,
"parameter removed", remark);
}