- Field "description" removed from all object classes (it was on nodes, containers...
authorVictor Kirhenshtein <victor@netxms.org>
Thu, 4 Jan 2007 16:35:40 +0000 (16:35 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Thu, 4 Jan 2007 16:35:40 +0000 (16:35 +0000)
- Other minor changes and fixes

24 files changed:
.gitattributes
doc/internal/coding_style.txt [new file with mode: 0644]
doc/internal/db_format_change.txt
images/Makefile.am
images/cluster.ico [new file with mode: 0644]
images/cluster.png [new file with mode: 0644]
include/nms_cscp.h
include/nxclapi.h
include/nximage.h
sql/images.in
sql/schema.in
src/console/win32/nxcon.clw
src/console/win32/nxcon.cpp
src/console/win32/nxcon.rc
src/libnxcl/libnxcl.h
src/libnxcl/objects.cpp
src/server/core/container.cpp
src/server/core/node.cpp
src/server/core/objects.cpp
src/server/core/session.cpp
src/server/core/template.cpp
src/server/core/zone.cpp
src/server/include/nms_objects.h
src/server/libnxsrv/messages.mc

index 10ae03a..85e1284 100644 (file)
@@ -144,6 +144,7 @@ contrib/startup/redhat/netxmsd -text
 contrib/startup/redhat/nxagentd -text
 doc/Makefile.am -text
 doc/internal/Makefile.am -text
+doc/internal/coding_style.txt -text
 doc/internal/db_format_change.txt -text
 doc/internal/event_code_ranges.txt -text
 doc/internal/internals.rtf -text
@@ -160,6 +161,8 @@ doc/misc/Makefile.am -text
 doc/misc/ping_subagent.txt -text
 doc/misc/upgrade.txt -text
 images/Makefile.am -text
+images/cluster.ico -text
+images/cluster.png -text
 images/condition.ico -text
 images/condition.png -text
 images/generic_printer.ico -text
diff --git a/doc/internal/coding_style.txt b/doc/internal/coding_style.txt
new file mode 100644 (file)
index 0000000..5582541
--- /dev/null
@@ -0,0 +1,61 @@
+1. Each word in function name should start with capital letter. No underscores.
+   For exaple: CreateNewUser. Underscores allowed in parameter handlers,
+   which can start with "H_" prefix, like this: H_FreeDiskSpace.
+
+2. Indentation offset: 3
+
+3. Opening { should be placed on next line without indentation, like below:
+
+   if (a < b)
+   {
+      something();
+   }
+
+4. Operators and operands should be separated by spaces, like below:
+
+   a = x + 20 / (y - z);
+5. Function arguments should be separated by spaces, like below:
+   z = function(p1, p2, p3);
+6. One-line comments should be placed with the same indentation level as code,
+   like this:
+   c = xxx();
+   if (a)
+   {
+      // comment
+      func();
+   }
+7. Brackets after for and while operators may or may not be separated by
+   spaces (I prefer not to separate them, but it's not a big problem IMHO).
+8. Variable names preferrably should start with type specifier. For example,
+   DWORD variable "index" should be called "dwIndex". Below is a common type
+   prefixes:
+   dw - DWORD
+   i - int
+   n - long
+   qw - QWORD
+   d - double
+   tm - time_t
+   sz - String (TCHAR [])
+   psz - Pointer to string (TCHAR *)
+   p - Generic pointer
+   p<data type> - Pointer to variable of type <data type> (like DWORD *pdwIndex;)
+   If variable is of custom type, it can have no prefix, and it's name should
+   start with small letter. For example:
+   struct stat fileStat;
+9. It is recommended to use typedefs as a replacement for some system
+   data types:
+      WORD  - unsigned short (16 bit unsigned integer)
+      LONG - instead of system's 32 signed integer
+      DWORD - unsigned long (32 bit unsigned integer)
+      INT64 - instead of system's 64 bit signed integer
+      QWORD - instread of system's 64 bit unsigned integer
index e26cd89..5c8c0e8 100644 (file)
@@ -2,6 +2,16 @@
 * 54 ==> 55 *
 *************
 
+- Column "description" removed from table "nodes"
+- Column "description" removed from table "containers"
+- Column "description" removed from table "zones"
+- Column "description" removed from table "templates"
+- New object image:
+       INSERT INTO images (image_id,name,file_name_png,file_hash_png,file_name_ico,file_hash_ico)
+               VALUES (IMG_CLUSTER,'Obj.Cluster','cluster.png','<invalid_hash>',
+                       'cluster.ico','<invalid_hash>');
+       INSERT INTO default_images (object_class,image_id)
+               VALUES (14, IMG_CLUSTER);
 - New OID to type mappings:
        INSERT INTO oid_to_type (pair_id,snmp_oid,node_type,node_flags)
           VALUES (10,'.1.3.6.1.4.1.45.3.46.*',NODE_TYPE_NORTEL_BAYSTACK,0);
index 3693645..b66d1dd 100644 (file)
@@ -11,6 +11,7 @@
 imagesdir=$(pkgdatadir)/images
 
 images_DATA = \
+    cluster.ico cluster.png \
     condition.ico condition.png \
     generic_printer.ico generic_printer.png \
     interface.ico interface.png \
diff --git a/images/cluster.ico b/images/cluster.ico
new file mode 100644 (file)
index 0000000..8334799
Binary files /dev/null and b/images/cluster.ico differ
diff --git a/images/cluster.png b/images/cluster.png
new file mode 100644 (file)
index 0000000..1e01e1c
Binary files /dev/null and b/images/cluster.png differ
index d99fdc3..a77495e 100644 (file)
@@ -701,6 +701,9 @@ typedef struct
 #define VID_ERROR_TEXT              ((DWORD)259)
 #define VID_COMPONENT               ((DWORD)260)
 #define VID_CONSOLE_UPGRADE_URL                ((DWORD)261)
+#define VID_CLUSTER_TYPE                               ((DWORD)262)
+#define VID_NUM_SYNC_SUBNETS                   ((DWORD)263)
+#define VID_SYNC_SUBNETS                               ((DWORD)264)
 
 // Variable ranges for object's ACL
 #define VID_ACL_USER_BASE           ((DWORD)0x00001000)
index 0ec5241..0c3dd95 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: nxclapi.h,v 1.249 2007-01-02 09:56:16 victor Exp $ */
+/* $Id: nxclapi.h,v 1.250 2007-01-04 16:35:26 victor Exp $ */
 /* 
 ** NetXMS - Network Management System
 ** Client Library API
@@ -406,7 +406,7 @@ enum
 #define OBJ_UPDATE_SNMP_COMMUNITY   ((DWORD)0x00000020)
 #define OBJ_UPDATE_ACL              ((DWORD)0x00000040)
 #define OBJ_UPDATE_IMAGE            ((DWORD)0x00000080)
-#define OBJ_UPDATE_DESCRIPTION      ((DWORD)0x00000100)
+//#define OBJ_UPDATE_DESCRIPTION      ((DWORD)0x00000100)
 #define OBJ_UPDATE_SERVICE_TYPE     ((DWORD)0x00000200)
 #define OBJ_UPDATE_IP_PROTO         ((DWORD)0x00000400)
 #define OBJ_UPDATE_IP_PORT          ((DWORD)0x00000800)
@@ -427,9 +427,6 @@ enum
 #define OBJ_UPDATE_DCI_LIST         ((DWORD)0x04000000)
 #define OBJ_UPDATE_SCRIPT           ((DWORD)0x08000000)
 
-#define OBJ_UPDATE_NODE_ALL         ((DWORD)0x001C41FF)
-#define OBJ_UPDATE_NETSRV_ALL       ((DWORD)0x0004FEC1)
-
 
 //
 // Global user rights
@@ -874,7 +871,6 @@ struct __nxc_object_node
    TCHAR szObjectId[MAX_OID_LENGTH];
    WORD wAgentPort;     // Listening TCP port for native agent
    WORD wAuthMethod;    // Native agent's authentication method
-   TCHAR *pszDescription;
    TCHAR szAgentVersion[MAX_AGENT_VERSION_LEN];
    TCHAR szPlatformName[MAX_PLATFORM_NAME_LEN];
    WORD wSNMPVersion;
@@ -889,13 +885,11 @@ struct __nxc_object_subnet
 struct __nxc_object_container
 {
    DWORD dwCategory;
-   TCHAR *pszDescription;
 };
 
 struct __nxc_object_dct
 {
    DWORD dwVersion;
-   TCHAR *pszDescription;
 };
 
 struct __nxc_object_netsrv
@@ -914,7 +908,6 @@ struct __nxc_object_zone
    DWORD dwControllerIpAddr;
    DWORD dwAddrListSize;
    DWORD *pdwAddrList;
-   TCHAR *pszDescription;
    WORD wZoneType;
 };
 
@@ -987,7 +980,6 @@ typedef struct
    DWORD dwObjectId;
    DWORD dwFlags;
    TCHAR *pszName;
-   TCHAR *pszDescription;
    int iAgentPort;
    int iAuthType;
    TCHAR *pszSecret;
@@ -1213,6 +1205,7 @@ typedef struct
    int iClass;
    DWORD dwParentId;
    TCHAR *pszName;
+       TCHAR *pszComments;
    union
    {
       struct
@@ -1225,13 +1218,8 @@ typedef struct
       struct
       {
          DWORD dwCategory;
-         TCHAR *pszDescription;
       } container;
       struct
-      {
-         TCHAR *pszDescription;
-      } templateGroup;
-      struct
       {
          int iServiceType;
          WORD wProto;
index af3e7ad..6434b79 100644 (file)
@@ -44,5 +44,6 @@
 #define IMG_ZONE                    13
 #define IMG_VPN_CONNECTOR           14
 #define IMG_CONDITION               15
+#define IMG_CLUSTER                                            16
 
 #endif
index f517c5a..4366005 100644 (file)
@@ -46,6 +46,9 @@ INSERT INTO images (image_id,name,file_name_png,file_hash_png,file_name_ico,file
 INSERT INTO images (image_id,name,file_name_png,file_hash_png,file_name_ico,file_hash_ico)
        VALUES (IMG_CONDITION,'Obj.Condition','condition.png','<invalid_hash>',
                 'condition.ico','<invalid_hash>');
+INSERT INTO images (image_id,name,file_name_png,file_hash_png,file_name_ico,file_hash_ico)
+       VALUES (IMG_CLUSTER,'Obj.Cluster','cluster.png','<invalid_hash>',
+                'cluster.ico','<invalid_hash>');
 
 
 /*
@@ -78,3 +81,5 @@ INSERT INTO default_images (object_class,image_id)
        VALUES (12, IMG_VPN_CONNECTOR);
 INSERT INTO default_images (object_class,image_id)
        VALUES (13, IMG_CONDITION);
+INSERT INTO default_images (object_class,image_id)
+       VALUES (14, IMG_CLUSTER);
index bcf1896..23416ee 100644 (file)
@@ -134,7 +134,6 @@ CREATE TABLE zones
        zone_guid integer not null,     // Globally unique ID for zone
        zone_type integer not null,     // Active or passive zone
        controller_ip varchar(15) not null,
-       description SQL_TEXT,
        PRIMARY KEY(id)
 ) TABLE_TYPE;
 
@@ -167,7 +166,6 @@ CREATE TABLE nodes
        secret varchar(64),
        agent_port integer,
        status_poll_type integer,
-       description SQL_TEXT,
        node_type integer,
        agent_version varchar(63),
        platform_name varchar(63),
@@ -209,8 +207,9 @@ CREATE TABLE cluster_members
 CREATE TABLE cluster_sync_subnets
 (
        cluster_id integer not null,
-       subnet_addr varchar(15),
-       subnet_mask varchar(15)
+       subnet_addr varchar(15) not null,
+       subnet_mask varchar(15) not null,
+       PRIMARY KEY(cluster_id,subnet_addr)
 ) TABLE_TYPE;
 
 
@@ -299,7 +298,6 @@ CREATE TABLE containers
 (
        id integer not null,
        category integer not null,
-       description SQL_TEXT not null,
        object_class integer not null,
        PRIMARY KEY(id)
 ) TABLE_TYPE;
@@ -345,7 +343,6 @@ CREATE TABLE templates
 (
        id integer not null,
        version integer,
-       description SQL_TEXT,
        PRIMARY KEY(id)
 ) TABLE_TYPE;
 
index 1d8bd64..529cc8e 100644 (file)
@@ -17,20 +17,20 @@ Class9=CMapView
 
 ResourceCount=188
 Resource1=IDD_CP_GENERAL (English (U.S.))
-Resource2=IDD_DCI_SCHEDULE
+Resource2=IDD_DISCOVERY_GENERAL
 Resource3=IDD_DCI_DATA_EXPORT (English (U.S.))
-Resource4=IDD_ADDR_ENTRY
-Resource5=IDD_SUBMAP_BKGND
+Resource4=IDA_OBJECT_TOOLS_EDITOR
+Resource5=IDA_OBJECT_BROWSER
 Class2=CChildView
 Class5=CAboutDlg
 Class6=CControlPanel
 Class8=CMapFrame
 Class10=CLoginDialog
-Resource6=IDD_CREATE_NODE
+Resource6=IDD_EDIT_VARIABLE
 Class11=CProgressDialog
-Resource7=IDD_DCI_COLLECTION
+Resource7=IDD_DATA_QUERY
 Class12=CAddrEntryDlg
-Resource8=IDD_SAVE_AGENT_CFG
+Resource8=IDD_EDIT_RULE_SCRIPT
 Class13=CObjectPropDlg
 Resource9=IDD_THRESHOLD (English (U.S.))
 Resource10=IDD_SELECT_OBJECT (English (U.S.))
@@ -46,45 +46,45 @@ Resource17=IDD_NEW_USER (English (U.S.))
 Class16=CDebugFrame
 Resource18=IDD_NEW_ACTION (English (U.S.))
 Resource19=IDD_OBJECT_PROPERTIES (English (U.S.))
-Resource20=IDD_NEW_OBJECT_TOOL
+Resource20=IDD_ADDR_ENTRY
 Class17=CObjectPreview
 Resource21=IDA_OBJECT_BROWSER (English (U.S.))
 Class18=CToolBox
 Class19=CObjectInfoBox
 Class20=CObjectSearchBox
-Resource22=IDA_ALARM_BROWSER
+Resource22=IDD_REQUEST_PROCESSING
 Class21=CEditBox
 Class22=COPGeneral
 Class23=CNodePropsGeneral
 Resource23=IDD_GRAPH_PROPERTIES (English (U.S.))
 Class24=CObjectPropCaps
 Class25=CObjectPropSheet
-Resource24=IDD_NEW_ACTION
+Resource24=IDD_GRAPH_PROP_SETTINGS
 Class26=CRequestProcessingDlg
 Resource25=IDD_SELECT_USER (English (U.S.))
 Resource26=IDD_PROGRESS (English (U.S.))
-Resource27=IDA_EPP
+Resource27=IDD_OBJECT_CAPS
 Resource28=IDD_DCI_COLLECTION (English (U.S.))
 Class27=CObjectPropsGeneral
 Resource29=IDR_MAINFRAME (English (U.S.))
 Class28=CObjectPropsSecurity
 Resource30=IDD_SAVE_AGENT_CFG (English (U.S.))
-Resource31=IDD_REQUEST_PROCESSING
-Resource32=IDD_SELECT_MP
+Resource31=IDD_NEW_ACTION
+Resource32=IDA_DATA_VIEW
 Class29=CUserSelectDlg
-Resource33=IDD_AGENT_CONFIG
+Resource33=IDA_PACKAGE_MGR
 Class30=CUserEditor
 Resource34=IDD_DCI_PROPERTIES
 Class31=CNewUserDlg
-Resource35=IDD_REMOVE_TEMPLATE
-Resource36=IDA_MDI_DEFAULT
+Resource35=IDD_SELECT_TRAP
+Resource36=IDD_EDIT_EVENT
 Class32=CUserPropDlg
 Resource37=IDD_EDIT_VARIABLE (English (U.S.))
-Resource38=IDR_MAINFRAME
+Resource38=IDD_DCI_DATA_EXPORT
 Class33=CGroupPropDlg
-Resource39=IDA_SERVER_CFG_EDITOR
-Resource40=IDD_MIB_BROWSER
-Resource41=IDA_DATA_VIEW
+Resource39=IDD_DCI_COLLECTION
+Resource40=IDD_SELECT_INTERNAL_ITEM
+Resource41=IDD_EDIT_RULE_COMMENT
 Resource42=IDA_ACTION_EDITOR (English (U.S.))
 Class34=CPasswordChangeDlg
 Class35=CNodeSummary
@@ -100,55 +100,55 @@ Class41=CGraphFrame
 Class42=CDCIThresholdsPage
 Resource46=IDA_OBJECT_TOOLS_EDITOR (English (U.S.))
 Resource47=IDM_CONTEXT (English (U.S.))
-Resource48=IDD_OBJECT_COND_DATA
+Resource48=IDA_ACTION_EDITOR
 Class43=CThresholdDlg
 Resource49=IDD_DESKTOP_SAVE_AS (English (U.S.))
-Resource50=IDD_CREATE_TG
+Resource50=IDD_OBJECT_VPNC_GENERAL
 Class44=CMIBBrowserDlg
 Class45=CEventPolicyEditor
 Class46=CRuleList
 Class47=CRuleHeader
 Resource51=IDD_SELECT_AGENT_PARAM (English (U.S.))
-Resource52=IDD_OBJTOOL_COLUMNS
+Resource52=IDR_MAINFRAME
 Class48=CObjectSelDlg
-Resource53=IDD_ADD_DCI
-Resource54=IDD_OBJECT_NODE_POLL
+Resource53=IDA_TRAP_EDITOR
+Resource54=IDD_OBJTOOL_COLUMNS
 Class49=CRuleCommentDlg
-Resource55=IDD_EDIT_EVENT
+Resource55=IDD_EDIT_RULE_SEVERITY
 Class50=CEventSelDlg
-Resource56=IDD_GRAPH_PROP_DATA
+Resource56=IDD_CREATE_CONDITION
 Resource57=IDA_EPP (English (U.S.))
-Resource58=IDD_CREATE_TEMPLATE
+Resource58=IDD_EDIT_IP_SUBNET
 Resource59=IDA_PACKAGE_MGR (English (U.S.))
 Resource60=IDD_OBJTOOL_GENERAL (English (U.S.))
 Class51=CObjectPropsPresentation
 Resource61=IDD_CREATE_TEMPLATE (English (U.S.))
-Resource62=IDD_DISCOVERY_GENERAL
+Resource62=IDA_SERVER_CFG_EDITOR
 Class52=CRuleSeverityDlg
-Resource63=IDA_LAST_VALUES
+Resource63=IDD_SET_PASSWORD
 Class53=CRuleAlarmDlg
 Class54=CAlarmBrowser
 Resource64=IDA_MDI_DEFAULT (English (U.S.))
-Resource65=IDD_CREATE_CONTAINER
+Resource65=IDD_ABOUTBOX
 Resource66=IDD_EDIT_IP_SUBNET (English (U.S.))
 Resource67=IDD_EDIT_RULE_SEVERITY (English (U.S.))
 Resource68=IDD_ACTION_PROPERTIES (English (U.S.))
 Class55=CConsolePropsGeneral
 Class56=CActionEditor
-Resource69=IDD_OBJECT_COND_SCRIPT
-Resource70=IDD_EDIT_TRAP_ARG
+Resource69=IDD_SELECT_AGENT_PARAM
+Resource70=IDD_OBJECT_STATUS
 Class57=CNewActionDlg
-Resource71=IDD_CHANGE_IP
+Resource71=IDD_SELECT_MP
 Class58=CEditActionDlg
-Resource72=IDD_GRAPH_PROP_SETTINGS
+Resource72=IDD_CHANGE_PASSWORD
 Class59=CActionSelDlg
-Resource73=IDD_DCI_TRANSFORM
+Resource73=IDD_OBJECT_NODE_GENERAL
 Resource74=IDD_EDIT_TRAP (English (U.S.))
 Resource75=IDD_USER_PROPERTIES (English (U.S.))
-Resource76=IDD_CP_GENERAL
+Resource76=IDD_DESKTOP_SAVE_AS
 Class60=CCreateObjectDlg
 Class61=CCreateContainerDlg
-Resource77=IDD_EDIT_RULE_SCRIPT
+Resource77=IDA_LAST_VALUES
 Class62=CCreateNodeDlg
 Resource78=IDD_OBJECT_NODE_GENERAL (English (U.S.))
 Resource79=IDT_MAP (English (U.S.))
@@ -158,31 +158,31 @@ Resource81=IDD_LASTVAL_PROP (English (U.S.))
 Class64=CPollNodeDlg
 Resource82=IDD_POLL_NODE (English (U.S.))
 Class65=CNodePoller
-Resource83=IDA_PACKAGE_MGR
-Resource84=IDD_SELECT_ACTION
+Resource83=IDD_GROUP_PROPERTIES
+Resource84=IDD_LASTVAL_PROP
 Class66=CCreateTemplateDlg
 Class67=CCreateTGDlg
-Resource85=IDD_EDIT_TRAP
-Resource86=IDD_ABOUTBOX
+Resource85=IDD_DCI_SCHEDULE
+Resource86=IDD_OBJECT_PRESENTATION
 Class68=CTrapEditor
-Resource87=IDD_OBJECT_STATUS
-Resource88=IDD_CREATE_VPNC
-Resource89=IDD_OBJECT_RELATIONS
+Resource87=IDD_DISCOVERY_TARGETS
+Resource88=IDD_ADD_DCI
+Resource89=IDD_SNMP_WALK
 Class69=CDataQueryDlg
-Resource90=IDD_DESKTOP_SAVE_AS
+Resource90=IDD_SUBMAP_BKGND
 Class70=CTrapEditDlg
 Resource91=IDM_VIEW_SPECIFIC (English (U.S.))
 Class71=CTrapParamDlg
-Resource92=IDD_OBJECT_NETSRV_GENERAL
-Resource93=IDD_EDIT_RULE_SEVERITY
+Resource92=IDD_REMOVE_TEMPLATE
+Resource93=IDD_OBJECT_NODE_POLL
 Class72=CGraphPropDlg
 Class73=CColorSelector
 Class74=CPackageMgr
-Resource94=IDD_OBJECT_VPNC_GENERAL
+Resource94=IDD_COND_DCI_PROP
 Resource95=IDA_SCRIPT_MANAGER (English (U.S.))
 Resource96=IDD_SET_PASSWORD (English (U.S.))
 Resource97=IDD_DCI_TRANSFORM (English (U.S.))
-Resource98=IDD_OBJECT_GENERAL
+Resource98=IDD_ACTION_PROPERTIES
 Resource99=IDD_OBJECT_NETSRV_GENERAL (English (U.S.))
 Resource100=IDD_OBJTOOL_OPTIONS (English (U.S.))
 Resource101=IDA_LAST_VALUES (English (U.S.))
@@ -244,7 +244,7 @@ Class102=CWaitView
 Class103=CWebBrowser
 Class104=CSyslogBrowser
 Class105=CLPPList
-Resource129=IDD_OBJTOOL_GENERAL
+Resource129=IDD_DISCOVERY_RANGES
 Class106=CDCISchedulePage
 Resource130=IDD_OBJECT_CAPS (English (U.S.))
 Class107=CObjectPropsStatus
@@ -270,78 +270,78 @@ Class119=CMapControlBox
 Resource138=IDD_OBJECT_GENERAL (English (U.S.))
 Class120=CSubmapBkgndDlg
 Resource139=IDD_SUBMAP_BKGND (English (U.S.))
-Resource140=IDD_THRESHOLD
-Resource141=IDD_OBJECT_NODE_GENERAL
-Resource142=IDD_OBJECT_COND_GENERAL
-Resource143=IDM_CONTEXT
-Resource144=IDA_EVENT_EDITOR
-Resource145=IDD_SELECT_TRAP
-Resource146=IDD_EDIT_RULE_COMMENT
-Resource147=IDD_EDIT_RULE_ALARM
-Resource148=IDD_EDIT_IP_SUBNET
-Resource149=IDD_OBJECT_PRESENTATION
-Resource150=IDD_NEW_USER
-Resource151=IDD_GROUP_PROPERTIES
-Resource152=IDD_ACTION_PROPERTIES
-Resource153=IDD_COND_DCI_PROP
-Resource154=IDD_INPUT_BOX
-Resource155=IDD_SNMP_WALK
-Resource156=IDA_OBJECT_TOOLS_EDITOR
-Resource157=IDD_SELECT_EVENT
-Resource158=IDD_OBJECT_SECURITY
-Resource159=IDM_VIEW_SPECIFIC
-Resource160=IDD_CREATE_CONDITION
-Resource161=IDD_SELECT_INTERNAL_ITEM
-Resource162=IDD_USER_PROPERTIES
-Resource163=IDD_LASTVAL_PROP
-Resource164=IDA_GRAPH
-Resource165=IDA_TRAP_EDITOR
-Resource166=IDA_DC_EDITOR
-Resource167=IDD_DCI_DATA_EXPORT
-Resource168=IDD_OBJECT_CAPS
-Resource169=IDD_DCI_THRESHOLDS
-Resource170=IDD_DATA_QUERY
-Resource171=IDD_SELECT_OBJECT
+Resource140=IDD_EDIT_TRAP_ARG
+Resource141=IDD_EDIT_RULE_ALARM
+Resource142=IDA_NETMAP
+Resource143=IDM_VIEW_SPECIFIC
+Resource144=IDD_OBJECT_SECURITY
+Resource145=IDA_AGENT_CONFIG_MANAGER
+Resource146=IDD_INPUT_BOX
+Resource147=IDD_OBJECT_RELATIONS
+Resource148=IDD_AGENT_CONFIG
+Resource149=IDD_OBJECT_NETSRV_GENERAL
+Resource150=IDD_CREATE_NODE
+Resource151=IDD_CREATE_TG
+Resource152=IDD_GRAPH_PROP_DATA
+Resource153=IDA_GRAPH
+Resource154=IDD_OBJTOOL_OPTIONS
+Resource155=IDA_MDI_DEFAULT
+Resource156=IDD_MIB_BROWSER
+Resource157=IDD_CREATE_NETSRV
+Resource158=IDD_SELECT_ACTION
+Resource159=IDM_CONTEXT
+Resource160=IDA_ALARM_BROWSER
+Resource161=IDD_OBJTOOL_GENERAL
+Resource162=IDD_DCI_TRANSFORM
+Resource163=IDD_OBJECT_COND_GENERAL
+Resource164=IDD_USER_PROPERTIES
+Resource165=IDD_NEW_USER
+Resource166=IDD_THRESHOLD
+Resource167=IDD_OBJECT_COND_SCRIPT
+Resource168=IDD_CP_GENERAL
+Resource169=IDD_EDIT_TRAP
+Resource170=IDD_SAVE_AGENT_CFG
+Resource171=IDA_EVENT_EDITOR
 Class121=CModuleManager
 Class122=CDesktopManager
-Resource172=IDD_SELECT_AGENT_PARAM
-Resource173=IDA_AGENT_CONFIG_MANAGER
+Resource172=IDD_NEW_OBJECT_TOOL
+Resource173=IDD_SELECT_EVENT
 Class123=CCreateCondDlg
 Class124=CCondPropsGeneral
 Class125=CCondPropsScript
 Class126=CCondPropsData
-Resource174=IDD_DISCOVERY_TARGETS
+Resource174=IDA_AGENT_CFG_EDITOR
 Class127=CAddDCIDlg
-Resource175=IDD_SET_PASSWORD
+Resource175=IDD_CREATE_TEMPLATE
 Class128=CCondDCIPropDlg
-Resource176=IDD_SELECT_USER
+Resource176=IDD_CREATE_CONTAINER
 Class129=CAgentConfigMgr
-Resource177=IDD_OBJTOOL_OPTIONS
-Resource178=IDA_ACTION_EDITOR
+Resource177=IDD_CREATE_MP
+Resource178=IDD_SELECT_USER
 Class130=CAgentCfgDlg
 Class131=CObjectCommentsEditor
-Resource179=IDA_NETMAP
+Resource179=IDD_OBJECT_GENERAL
 Class132=CRuleScriptDlg
 Class133=CDetailsView
-Resource180=IDA_SCRIPT_MANAGER
+Resource180=IDD_SELECT_OBJECT
 Class134=CDiscoveryPropGeneral
-Resource181=IDD_CHANGE_PASSWORD
+Resource181=IDA_EPP
 Class135=CDiscoveryPropTargets
-Resource182=IDA_AGENT_CFG_EDITOR
+Resource182=IDD_DCI_THRESHOLDS
 Class136=CDiscoveryPropAddrList
-Resource183=IDD_CREATE_NETSRV
+Resource183=IDD_CHANGE_IP
 Class138=CObjectView
 Class139=CObjectOverview
 Class140=CAlarmView
 Class141=CObjectDepView
-Resource184=IDD_EDIT_VARIABLE
+Resource184=IDD_OBJECT_COND_DATA
 Class137=CObjectBrowser
 Class142=CCreateMPDlg
-Resource185=IDD_CREATE_MP
+Resource185=IDA_SCRIPT_MANAGER
 Class143=CSelectMPDlg
-Resource186=IDD_DISCOVERY_RANGES
+Resource186=IDA_DC_EDITOR
 Class144=CTrapSelDlg
-Resource187=IDA_OBJECT_BROWSER
+Resource187=IDD_CREATE_VPNC
 Class145=CConsoleUpgradeDlg
 Resource188=IDD_UPGRADE
 
index 34ebba2..15a6bb2 100644 (file)
@@ -2081,8 +2081,8 @@ void CConsoleApp::CreateContainer(DWORD dwParent)
       ci.dwParentId = (dlg.m_pParentObject != NULL) ? dlg.m_pParentObject->dwId : 0;
       ci.iClass = OBJECT_CONTAINER;
       ci.pszName = (TCHAR *)((LPCTSTR)dlg.m_strObjectName);
+               ci.pszComments = (TCHAR *)((LPCTSTR)dlg.m_strDescription);
       ci.cs.container.dwCategory = 1;
-      ci.cs.container.pszDescription = (TCHAR *)((LPCTSTR)dlg.m_strDescription);
       CreateObject(&ci);
    }
 }
@@ -2107,6 +2107,7 @@ void CConsoleApp::CreateCondition(DWORD dwParent)
       ci.dwParentId = (dlg.m_pParentObject != NULL) ? dlg.m_pParentObject->dwId : 0;
       ci.iClass = OBJECT_CONDITION;
       ci.pszName = (TCHAR *)((LPCTSTR)dlg.m_strObjectName);
+               ci.pszComments = NULL;
       CreateObject(&ci);
    }
 }
@@ -2131,6 +2132,7 @@ void CConsoleApp::CreateNode(DWORD dwParent)
       ci.dwParentId = (dlg.m_pParentObject != NULL) ? dlg.m_pParentObject->dwId : 0;
       ci.iClass = OBJECT_NODE;
       ci.pszName = (TCHAR *)((LPCTSTR)dlg.m_strObjectName);
+               ci.pszComments = NULL;
       ci.cs.node.dwIpAddr = dlg.m_dwIpAddr;
       ci.cs.node.dwNetMask = 0;
       ci.cs.node.dwProxyNode = dlg.m_dwProxyNode;
@@ -2170,6 +2172,7 @@ void CConsoleApp::CreateNetworkService(DWORD dwParent)
       ci.dwParentId = (dlg.m_pParentObject != NULL) ? dlg.m_pParentObject->dwId : 0;
       ci.iClass = OBJECT_NETWORKSERVICE;
       ci.pszName = (TCHAR *)((LPCTSTR)dlg.m_strObjectName);
+               ci.pszComments = NULL;
       ci.cs.netsrv.iServiceType = dlg.m_iServiceType;
       ci.cs.netsrv.wPort = (WORD)dlg.m_iPort;
       ci.cs.netsrv.wProto = (WORD)dlg.m_iProtocolNumber;
@@ -2200,6 +2203,7 @@ void CConsoleApp::CreateTemplate(DWORD dwParent)
       ci.dwParentId = (dlg.m_pParentObject != NULL) ? dlg.m_pParentObject->dwId : 0;
       ci.iClass = OBJECT_TEMPLATE;
       ci.pszName = (TCHAR *)((LPCTSTR)dlg.m_strObjectName);
+               ci.pszComments = NULL;
       CreateObject(&ci);
    }
 }
@@ -2225,7 +2229,7 @@ void CConsoleApp::CreateTemplateGroup(DWORD dwParent)
       ci.dwParentId = (dlg.m_pParentObject != NULL) ? dlg.m_pParentObject->dwId : 0;
       ci.iClass = OBJECT_TEMPLATEGROUP;
       ci.pszName = (TCHAR *)((LPCTSTR)dlg.m_strObjectName);
-      ci.cs.templateGroup.pszDescription = (TCHAR *)((LPCTSTR)dlg.m_strDescription);
+               ci.pszComments = (TCHAR *)((LPCTSTR)dlg.m_strDescription);
       CreateObject(&ci);
    }
 }
@@ -2250,6 +2254,7 @@ void CConsoleApp::CreateVPNConnector(DWORD dwParent)
       ci.dwParentId = (dlg.m_pParentObject != NULL) ? dlg.m_pParentObject->dwId : 0;
       ci.iClass = OBJECT_VPNCONNECTOR;
       ci.pszName = (TCHAR *)((LPCTSTR)dlg.m_strObjectName);
+               ci.pszComments = NULL;
       CreateObject(&ci);
    }
 }
index e4f4e26..f07319a 100644 (file)
@@ -1741,7 +1741,7 @@ BEGIN
     ICON            "",IDC_ICON_PARENT,14,117,20,20
     LTEXT           "ID:",IDC_STATIC_ID,43,117,54,8
     LTEXT           "Name",IDC_STATIC_NAME,44,131,112,9
-    LTEXT           "Description",IDC_STATIC,13,71,36,8
+    LTEXT           "Comments",IDC_STATIC,13,71,34,8
 END
 
 IDD_CREATE_NODE DIALOG DISCARDABLE  0, 0, 240, 220
@@ -1809,10 +1809,10 @@ BEGIN
     GROUPBOX        "New object",IDC_STATIC,7,7,158,66
     LTEXT           "Name",IDC_STATIC,13,17,20,8
     GROUPBOX        "Parent object",IDC_STATIC,7,77,158,42
-    ICON            "",IDC_ICON_PARENT,14,90,21,20
+    ICON            "",IDC_ICON_PARENT,14,90,20,20
     LTEXT           "ID:",IDC_STATIC_ID,43,90,54,8
     LTEXT           "Name",IDC_STATIC_NAME,44,104,112,9
-    LTEXT           "Description",IDC_STATIC,13,44,36,8
+    LTEXT           "Comments",IDC_STATIC,13,44,34,8
 END
 
 IDD_CREATE_TEMPLATE DIALOG DISCARDABLE  0, 0, 229, 100
index c4afeca..8d12d84 100644 (file)
@@ -38,7 +38,7 @@
 // Constants
 //
 
-#define OBJECT_CACHE_MAGIC 0x8899DEBC
+#define OBJECT_CACHE_MAGIC 0x2007DEBC
 
 #define MAX_SERVER_NAME    64
 #define MAX_LOGIN_NAME     64
index ce63c51..d16bbc4 100644 (file)
@@ -33,21 +33,11 @@ void DestroyObject(NXC_OBJECT *pObject)
    DebugPrintf(_T("DestroyObject(id:%d, name:\"%s\")"), pObject->dwId, pObject->szName);
    switch(pObject->iClass)
    {
-      case OBJECT_CONTAINER:
-         safe_free(pObject->container.pszDescription);
-         break;
-      case OBJECT_NODE:
-         safe_free(pObject->node.pszDescription);
-         break;
-      case OBJECT_TEMPLATE:
-         safe_free(pObject->dct.pszDescription);
-         break;
       case OBJECT_NETWORKSERVICE:
          safe_free(pObject->netsrv.pszRequest);
          safe_free(pObject->netsrv.pszResponse);
          break;
       case OBJECT_ZONE:
-         safe_free(pObject->zone.pszDescription);
          safe_free(pObject->zone.pdwAddrList);
          break;
       case OBJECT_VPNCONNECTOR:
@@ -142,21 +132,11 @@ static void ReplaceObject(NXC_OBJECT *pObject, NXC_OBJECT *pNewObject)
    DebugPrintf(_T("ReplaceObject(id:%d, name:\"%s\")"), pObject->dwId, pObject->szName);
    switch(pObject->iClass)
    {
-      case OBJECT_CONTAINER:
-         safe_free(pObject->container.pszDescription);
-         break;
-      case OBJECT_NODE:
-         safe_free(pObject->node.pszDescription);
-         break;
-      case OBJECT_TEMPLATE:
-         safe_free(pObject->dct.pszDescription);
-         break;
       case OBJECT_NETWORKSERVICE:
          safe_free(pObject->netsrv.pszRequest);
          safe_free(pObject->netsrv.pszResponse);
          break;
       case OBJECT_ZONE:
-         safe_free(pObject->zone.pszDescription);
          safe_free(pObject->zone.pdwAddrList);
          break;
       case OBJECT_VPNCONNECTOR:
@@ -256,7 +236,6 @@ static NXC_OBJECT *NewObjectFromMsg(CSCPMessage *pMsg)
          pMsg->GetVariableStr(VID_SHARED_SECRET, pObject->node.szSharedSecret, MAX_SECRET_LENGTH);
          pMsg->GetVariableStr(VID_COMMUNITY_STRING, pObject->node.szCommunityString, MAX_COMMUNITY_LENGTH);
          pMsg->GetVariableStr(VID_SNMP_OID, pObject->node.szObjectId, MAX_OID_LENGTH);
-         pObject->node.pszDescription = pMsg->GetVariableStr(VID_DESCRIPTION);
          pObject->node.wSNMPVersion = pMsg->GetVariableShort(VID_SNMP_VERSION);
          pMsg->GetVariableStr(VID_AGENT_VERSION, pObject->node.szAgentVersion, MAX_AGENT_VERSION_LEN);
          pMsg->GetVariableStr(VID_PLATFORM_NAME, pObject->node.szPlatformName, MAX_PLATFORM_NAME_LEN);
@@ -267,11 +246,9 @@ static NXC_OBJECT *NewObjectFromMsg(CSCPMessage *pMsg)
          break;
       case OBJECT_CONTAINER:
          pObject->container.dwCategory = pMsg->GetVariableLong(VID_CATEGORY);
-         pObject->container.pszDescription = pMsg->GetVariableStr(VID_DESCRIPTION);
          break;
       case OBJECT_TEMPLATE:
          pObject->dct.dwVersion = pMsg->GetVariableLong(VID_TEMPLATE_VERSION);
-         pObject->dct.pszDescription = pMsg->GetVariableStr(VID_DESCRIPTION);
          break;
       case OBJECT_NETWORKSERVICE:
          pObject->netsrv.iServiceType = (int)pMsg->GetVariableShort(VID_SERVICE_TYPE);
@@ -283,7 +260,6 @@ static NXC_OBJECT *NewObjectFromMsg(CSCPMessage *pMsg)
          break;
       case OBJECT_ZONE:
          pObject->zone.dwZoneGUID = pMsg->GetVariableLong(VID_ZONE_GUID);
-         pObject->zone.pszDescription = pMsg->GetVariableStr(VID_DESCRIPTION);
          pObject->zone.wZoneType = pMsg->GetVariableShort(VID_ZONE_TYPE);
          pObject->zone.dwControllerIpAddr = pMsg->GetVariableLong(VID_CONTROLLER_IP_ADDR);
          pObject->zone.dwAddrListSize = pMsg->GetVariableLong(VID_ADDR_LIST_SIZE);
@@ -647,8 +623,6 @@ DWORD LIBNXCL_EXPORTABLE NXCModifyObject(NXC_SESSION hSession, NXC_OBJECT_UPDATE
       msg.SetVariable(VID_IMAGE_ID, pUpdate->dwImage);
    if (pUpdate->dwFlags & OBJ_UPDATE_SNMP_VERSION)
       msg.SetVariable(VID_SNMP_VERSION, pUpdate->wSNMPVersion);
-   if (pUpdate->dwFlags & OBJ_UPDATE_DESCRIPTION)
-      msg.SetVariable(VID_DESCRIPTION, pUpdate->pszDescription);
    if (pUpdate->dwFlags & OBJ_UPDATE_CHECK_REQUEST)
       msg.SetVariable(VID_SERVICE_REQUEST, pUpdate->pszRequest);
    if (pUpdate->dwFlags & OBJ_UPDATE_CHECK_RESPONSE)
@@ -789,6 +763,8 @@ DWORD LIBNXCL_EXPORTABLE NXCCreateObject(NXC_SESSION hSession,
    msg.SetVariable(VID_PARENT_ID, pCreateInfo->dwParentId);
    msg.SetVariable(VID_OBJECT_CLASS, (WORD)pCreateInfo->iClass);
    msg.SetVariable(VID_OBJECT_NAME, pCreateInfo->pszName);
+       if (pCreateInfo->pszComments != NULL)
+          msg.SetVariable(VID_COMMENTS, pCreateInfo->pszComments);
    switch(pCreateInfo->iClass)
    {
       case OBJECT_NODE:
@@ -799,10 +775,6 @@ DWORD LIBNXCL_EXPORTABLE NXCCreateObject(NXC_SESSION hSession,
          break;
       case OBJECT_CONTAINER:
          msg.SetVariable(VID_CATEGORY, pCreateInfo->cs.container.dwCategory);
-         msg.SetVariable(VID_DESCRIPTION, pCreateInfo->cs.container.pszDescription);
-         break;
-      case OBJECT_TEMPLATEGROUP:
-         msg.SetVariable(VID_DESCRIPTION, pCreateInfo->cs.templateGroup.pszDescription);
          break;
       case OBJECT_NETWORKSERVICE:
          msg.SetVariable(VID_SERVICE_TYPE, (WORD)pCreateInfo->cs.netsrv.iServiceType);
@@ -1216,23 +1188,13 @@ DWORD LIBNXCL_EXPORTABLE NXCSaveObjectCache(NXC_SESSION hSession, TCHAR *pszFile
                 sizeof(DWORD) * pList[i].pObject->dwNumParents, hFile);
          fwrite(pList[i].pObject->pAccessList, 1, 
                 sizeof(NXC_ACL_ENTRY) * pList[i].pObject->dwAclSize, hFile);
+         
+                       dwSize = _tcslen(pList[i].pObject->pszComments) * sizeof(TCHAR);
+         fwrite(&dwSize, 1, sizeof(DWORD), hFile);
+         fwrite(pList[i].pObject->pszComments, 1, dwSize, hFile);
+
          switch(pList[i].pObject->iClass)
          {
-            case OBJECT_NODE:
-               dwSize = _tcslen(pList[i].pObject->node.pszDescription) * sizeof(TCHAR);
-               fwrite(&dwSize, 1, sizeof(DWORD), hFile);
-               fwrite(pList[i].pObject->node.pszDescription, 1, dwSize, hFile);
-               break;
-            case OBJECT_CONTAINER:
-               dwSize = _tcslen(pList[i].pObject->container.pszDescription) * sizeof(TCHAR);
-               fwrite(&dwSize, 1, sizeof(DWORD), hFile);
-               fwrite(pList[i].pObject->container.pszDescription, 1, dwSize, hFile);
-               break;
-            case OBJECT_TEMPLATE:
-               dwSize = _tcslen(pList[i].pObject->dct.pszDescription) * sizeof(TCHAR);
-               fwrite(&dwSize, 1, sizeof(DWORD), hFile);
-               fwrite(pList[i].pObject->dct.pszDescription, 1, dwSize, hFile);
-               break;
             case OBJECT_NETWORKSERVICE:
                dwSize = _tcslen(pList[i].pObject->netsrv.pszRequest) * sizeof(TCHAR);
                fwrite(&dwSize, 1, sizeof(DWORD), hFile);
@@ -1243,10 +1205,6 @@ DWORD LIBNXCL_EXPORTABLE NXCSaveObjectCache(NXC_SESSION hSession, TCHAR *pszFile
                fwrite(pList[i].pObject->netsrv.pszResponse, 1, dwSize, hFile);
                break;
             case OBJECT_ZONE:
-               dwSize = _tcslen(pList[i].pObject->zone.pszDescription) * sizeof(TCHAR);
-               fwrite(&dwSize, 1, sizeof(DWORD), hFile);
-               fwrite(pList[i].pObject->zone.pszDescription, 1, dwSize, hFile);
-
                if (pList[i].pObject->zone.dwAddrListSize > 0)
                   fwrite(pList[i].pObject->zone.pdwAddrList, sizeof(DWORD),
                          pList[i].pObject->zone.dwAddrListSize, hFile);
@@ -1320,26 +1278,13 @@ void NXCL_Session::LoadObjectsFromCache(TCHAR *pszFile)
                   object.pAccessList = (NXC_ACL_ENTRY *)malloc(sizeof(NXC_ACL_ENTRY) * object.dwAclSize);
                   fread(object.pAccessList, 1, sizeof(NXC_ACL_ENTRY) * object.dwAclSize, hFile);
 
+                  fread(&dwSize, 1, sizeof(DWORD), hFile);
+                  object.pszComments = (TCHAR *)malloc(dwSize + sizeof(TCHAR));
+                  fread(object.pszComments, 1, dwSize, hFile);
+                  object.pszComments[dwSize / sizeof(TCHAR)] = 0;
+
                   switch(object.iClass)
                   {
-                     case OBJECT_NODE:
-                        fread(&dwSize, 1, sizeof(DWORD), hFile);
-                        object.node.pszDescription = (TCHAR *)malloc(dwSize + sizeof(TCHAR));
-                        fread(object.node.pszDescription, 1, dwSize, hFile);
-                        object.node.pszDescription[dwSize / sizeof(TCHAR)] = 0;
-                        break;
-                     case OBJECT_CONTAINER:
-                        fread(&dwSize, 1, sizeof(DWORD), hFile);
-                        object.container.pszDescription = (TCHAR *)malloc(dwSize + sizeof(TCHAR));
-                        fread(object.container.pszDescription, 1, dwSize, hFile);
-                        object.container.pszDescription[dwSize / sizeof(TCHAR)] = 0;
-                        break;
-                     case OBJECT_TEMPLATE:
-                        fread(&dwSize, 1, sizeof(DWORD), hFile);
-                        object.dct.pszDescription = (TCHAR *)malloc(dwSize + sizeof(TCHAR));
-                        fread(object.dct.pszDescription, 1, dwSize, hFile);
-                        object.dct.pszDescription[dwSize / sizeof(TCHAR)] = 0;
-                        break;
                      case OBJECT_NETWORKSERVICE:
                         fread(&dwSize, 1, sizeof(DWORD), hFile);
                         object.netsrv.pszRequest = (TCHAR *)malloc(dwSize + sizeof(TCHAR));
@@ -1352,11 +1297,6 @@ void NXCL_Session::LoadObjectsFromCache(TCHAR *pszFile)
                         object.netsrv.pszResponse[dwSize / sizeof(TCHAR)] = 0;
                         break;
                      case OBJECT_ZONE:
-                        fread(&dwSize, 1, sizeof(DWORD), hFile);
-                        object.zone.pszDescription = (TCHAR *)malloc(dwSize + sizeof(TCHAR));
-                        fread(object.zone.pszDescription, 1, dwSize, hFile);
-                        object.zone.pszDescription[dwSize / sizeof(TCHAR)] = 0;
-
                         if (object.zone.dwAddrListSize > 0)
                         {
                            object.zone.pdwAddrList = (DWORD *)malloc(object.zone.dwAddrListSize * sizeof(DWORD));
index 0747779..2a53f19 100644 (file)
@@ -1,6 +1,7 @@
+/* $Id: container.cpp,v 1.18 2007-01-04 16:35:38 victor Exp $ */
 /* 
 ** NetXMS - Network Management System
-** Copyright (C) 2003, 2004 Victor Kirhenshtein
+** Copyright (C) 2003, 2004, 2005, 2006 Victor Kirhenshtein
 **
 ** This program is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU General Public License as published by
@@ -16,7 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 **
-** $module: container.cpp
+** File: container.cpp
 **
 **/
 
@@ -45,7 +46,6 @@ CONTAINER_CATEGORY NXCORE_EXPORTABLE *FindContainerCategory(DWORD dwId)
 Container::Container()
           :NetObj()
 {
-   m_pszDescription = NULL;
    m_pdwChildIdList = NULL;
    m_dwChildIdListSize = 0;
    m_dwCategory = 1;
@@ -56,11 +56,10 @@ Container::Container()
 // "Normal" container class constructor
 //
 
-Container::Container(char *pszName, DWORD dwCategory, char *pszDescription)
+Container::Container(TCHAR *pszName, DWORD dwCategory)
           :NetObj()
 {
    nx_strncpy(m_szName, pszName, MAX_OBJECT_NAME);
-   m_pszDescription = strdup(pszDescription);
    m_pdwChildIdList = NULL;
    m_dwChildIdListSize = 0;
    m_dwCategory = dwCategory;
@@ -74,7 +73,6 @@ Container::Container(char *pszName, DWORD dwCategory, char *pszDescription)
 
 Container::~Container()
 {
-   safe_free(m_pszDescription);
    safe_free(m_pdwChildIdList);
 }
 
@@ -94,7 +92,7 @@ BOOL Container::CreateFromDB(DWORD dwId)
    if (!LoadCommonProperties())
       return FALSE;
 
-   sprintf(szQuery, "SELECT category,description FROM containers WHERE id=%d", dwId);
+   sprintf(szQuery, "SELECT category FROM containers WHERE id=%d", dwId);
    hResult = DBSelect(g_hCoreDB, szQuery);
    if (hResult == NULL)
       return FALSE;     // Query failed
@@ -107,8 +105,6 @@ BOOL Container::CreateFromDB(DWORD dwId)
    }
 
    m_dwCategory = DBGetFieldULong(hResult, 0, 0);
-   m_pszDescription = DBGetField(hResult, 0, 1, NULL, 0);
-
    DBFreeResult(hResult);
 
    // Load access list
@@ -164,13 +160,11 @@ BOOL Container::SaveToDB(DB_HANDLE hdb)
 
    // Form and execute INSERT or UPDATE query
    if (bNewObject)
-      sprintf(szQuery, "INSERT INTO containers (id,category,"
-                       "description,object_class) VALUES (%d,%d,'%s',%d)",
-              m_dwId, m_dwCategory, CHECK_NULL(m_pszDescription), Type());
+      sprintf(szQuery, "INSERT INTO containers (id,category,object_class) VALUES (%d,%d,%d)",
+              m_dwId, m_dwCategory, Type());
    else
-      sprintf(szQuery, "UPDATE containers SET category=%d,"
-                       "description='%s',object_class=%d WHERE id=%d",
-              m_dwCategory, CHECK_NULL(m_pszDescription), Type(), m_dwId);
+      sprintf(szQuery, "UPDATE containers SET category=%d,object_class=%d WHERE id=%d",
+              m_dwCategory, Type(), m_dwId);
    DBQuery(hdb, szQuery);
 
    // Update members list
@@ -254,5 +248,4 @@ void Container::CreateMessage(CSCPMessage *pMsg)
 {
    NetObj::CreateMessage(pMsg);
    pMsg->SetVariable(VID_CATEGORY, m_dwCategory);
-   pMsg->SetVariable(VID_DESCRIPTION, CHECK_NULL(m_pszDescription));
 }
index 009354b..e0b5cb6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: node.cpp,v 1.163 2007-01-02 09:56:18 victor Exp $ */
+/* $Id: node.cpp,v 1.164 2007-01-04 16:35:38 victor Exp $ */
 /* 
 ** NetXMS - Network Management System
 ** Copyright (C) 2003, 2004, 2005, 2006 Victor Kirhenshtein
@@ -149,7 +149,7 @@ BOOL Node::CreateFromDB(DWORD dwId)
    _sntprintf(szQuery, 512, "SELECT primary_ip,node_flags,"
                             "snmp_version,auth_method,secret,"
                             "agent_port,status_poll_type,community,snmp_oid,"
-                            "description,node_type,agent_version,"
+                            "node_type,agent_version,"
                             "platform_name,poller_node_id,zone_guid,"
                             "proxy_node FROM nodes WHERE id=%d", dwId);
    hResult = DBSelect(g_hCoreDB, szQuery);
@@ -174,16 +174,14 @@ BOOL Node::CreateFromDB(DWORD dwId)
    DBGetField(hResult, 0, 7, m_szCommunityString, MAX_COMMUNITY_LENGTH);
    DecodeSQLString(m_szCommunityString);
    DBGetField(hResult, 0, 8, m_szObjectId, MAX_OID_LEN * 4);
-   m_pszDescription = DBGetField(hResult, 0, 9, NULL, 0);
-   DecodeSQLString(m_pszDescription);
-   m_dwNodeType = DBGetFieldULong(hResult, 0, 10);
-   DBGetField(hResult, 0, 11, m_szAgentVersion, MAX_AGENT_VERSION_LEN);
+   m_dwNodeType = DBGetFieldULong(hResult, 0, 9);
+   DBGetField(hResult, 0, 10, m_szAgentVersion, MAX_AGENT_VERSION_LEN);
    DecodeSQLString(m_szAgentVersion);
-   DBGetField(hResult, 0, 12, m_szPlatformName, MAX_PLATFORM_NAME_LEN);
+   DBGetField(hResult, 0, 11, m_szPlatformName, MAX_PLATFORM_NAME_LEN);
    DecodeSQLString(m_szPlatformName);
-   m_dwPollerNode = DBGetFieldULong(hResult, 0, 13);
-   m_dwZoneGUID = DBGetFieldULong(hResult, 0, 14);
-   m_dwProxyNode = DBGetFieldULong(hResult, 0, 15);
+   m_dwPollerNode = DBGetFieldULong(hResult, 0, 12);
+   m_dwZoneGUID = DBGetFieldULong(hResult, 0, 13);
+   m_dwProxyNode = DBGetFieldULong(hResult, 0, 14);
 
    DBFreeResult(hResult);
 
@@ -253,7 +251,7 @@ BOOL Node::CreateFromDB(DWORD dwId)
 
 BOOL Node::SaveToDB(DB_HANDLE hdb)
 {
-   TCHAR *pszEscDescr, *pszEscVersion, *pszEscPlatform, *pszEscSecret;
+   TCHAR *pszEscVersion, *pszEscPlatform, *pszEscSecret;
    TCHAR *pszEscCommunity, szQuery[4096], szIpAddr[16];
    DB_RESULT hResult;
    BOOL bNewObject = TRUE;
@@ -275,7 +273,6 @@ BOOL Node::SaveToDB(DB_HANDLE hdb)
    }
 
    // Form and execute INSERT or UPDATE query
-   pszEscDescr = EncodeSQLString(CHECK_NULL_EX(m_pszDescription));
    pszEscVersion = EncodeSQLString(m_szAgentVersion);
    pszEscPlatform = EncodeSQLString(m_szPlatformName);
    pszEscSecret = EncodeSQLString(m_szSharedSecret);
@@ -285,30 +282,29 @@ BOOL Node::SaveToDB(DB_HANDLE hdb)
                "INSERT INTO nodes (id,primary_ip,"
                "node_flags,snmp_version,community,status_poll_type,"
                "agent_port,auth_method,secret,snmp_oid,proxy_node,"
-               "description,node_type,agent_version,platform_name,"
+               "node_type,agent_version,platform_name,"
                "poller_node_id,zone_guid) VALUES (%d,'%s',%d,%d,'%s',%d,%d,%d,"
-               "'%s','%s',%d,'%s',%d,'%s','%s',%d,%d)",
+               "'%s','%s',%d,%d,'%s','%s',%d,%d)",
                m_dwId, IpToStr(m_dwIpAddr, szIpAddr), m_dwFlags,
                m_iSNMPVersion, pszEscCommunity, m_iStatusPollType,
                m_wAgentPort, m_wAuthMethod, pszEscSecret, m_szObjectId,
-               m_dwProxyNode, pszEscDescr, m_dwNodeType, pszEscVersion,
+               m_dwProxyNode, m_dwNodeType, pszEscVersion,
                pszEscPlatform, m_dwPollerNode, m_dwZoneGUID);
    else
       snprintf(szQuery, 4096,
                "UPDATE nodes SET primary_ip='%s',"
                "node_flags=%d,snmp_version=%d,community='%s',"
                "status_poll_type=%d,agent_port=%d,auth_method=%d,secret='%s',"
-               "snmp_oid='%s',description='%s',node_type=%d,"
+               "snmp_oid='%s',node_type=%d,"
                "agent_version='%s',platform_name='%s',poller_node_id=%d,"
                "zone_guid=%d,proxy_node=%d WHERE id=%d",
                IpToStr(m_dwIpAddr, szIpAddr), 
                m_dwFlags, m_iSNMPVersion, pszEscCommunity,
                m_iStatusPollType, m_wAgentPort, m_wAuthMethod, pszEscSecret, 
-               m_szObjectId, pszEscDescr, m_dwNodeType, 
+               m_szObjectId, m_dwNodeType, 
                pszEscVersion, pszEscPlatform, m_dwPollerNode, m_dwZoneGUID,
                m_dwProxyNode, m_dwId);
    bResult = DBQuery(hdb, szQuery);
-   free(pszEscDescr);
    free(pszEscVersion);
    free(pszEscPlatform);
    free(pszEscSecret);
index af664e2..2840624 100644 (file)
@@ -335,6 +335,7 @@ void NetObjInsert(NetObj *pObject, BOOL bNewObject)
          case OBJECT_TEMPLATE:
          case OBJECT_TEMPLATEGROUP:
          case OBJECT_TEMPLATEROOT:
+                       case OBJECT_CLUSTER:
             break;
          case OBJECT_SUBNET:
             if (pObject->IpAddr() != 0)
@@ -399,6 +400,7 @@ void NetObjDeleteFromIndexes(NetObj *pObject)
       case OBJECT_TEMPLATE:
       case OBJECT_TEMPLATEGROUP:
       case OBJECT_TEMPLATEROOT:
+               case OBJECT_CLUSTER:
          break;
       case OBJECT_SUBNET:
          if (pObject->IpAddr() != 0)
@@ -858,6 +860,31 @@ BOOL LoadObjects(void)
       DBFreeResult(hResult);
    }
 
+   // Load clusters
+   DbgPrintf(AF_DEBUG_MISC, "Loading clusters...");
+   hResult = DBSelect(g_hCoreDB, "SELECT id FROM clusters");
+   if (hResult != NULL)
+   {
+      Cluster *pCluster;
+
+      dwNumRows = DBGetNumRows(hResult);
+      for(i = 0; i < dwNumRows; i++)
+      {
+         dwId = DBGetFieldULong(hResult, i, 0);
+         pCluster = new Cluster;
+         if (pCluster->CreateFromDB(dwId))
+         {
+            NetObjInsert(pCluster, FALSE);  // Insert into indexes
+         }
+         else     // Object load failed
+         {
+            delete pCluster;
+            WriteLog(MSG_CLUSTER_LOAD_FAILED, EVENTLOG_ERROR_TYPE, "d", dwId);
+         }
+      }
+      DBFreeResult(hResult);
+   }
+
    // Load templates
    DbgPrintf(AF_DEBUG_MISC, "Loading templates...");
    hResult = DBSelect(g_hCoreDB, "SELECT id FROM templates");
@@ -1021,14 +1048,12 @@ void DumpObjects(CONSOLE_CTX pCtx)
             break;
          case OBJECT_CONTAINER:
             pCat = FindContainerCategory(((Container *)g_pIndexById[i].pObject)->Category());
-            ConsolePrintf(pCtx, "   Category: %s\n   Description: %s\n", pCat ? pCat->szName : "<unknown>",
-                          ((Container *)g_pIndexById[i].pObject)->Description());
+            ConsolePrintf(pCtx, "   Category: %s\n", pCat ? pCat->szName : "<unknown>");
             break;
          case OBJECT_TEMPLATE:
-            ConsolePrintf(pCtx, "   Version: %d.%d\n   Description: %s\n", 
+            ConsolePrintf(pCtx, "   Version: %d.%d\n", 
                           ((Template *)(g_pIndexById[i].pObject))->VersionMajor(),
-                          ((Template *)(g_pIndexById[i].pObject))->VersionMinor(),
-                          ((Template *)(g_pIndexById[i].pObject))->Description());
+                          ((Template *)(g_pIndexById[i].pObject))->VersionMinor());
             break;
       }
    }
@@ -1039,7 +1064,7 @@ void DumpObjects(CONSOLE_CTX pCtx)
 
 //
 // Check is given object class is a valid parent class for other object
-// This function is used to check manually created bindings, so i won't
+// This function is used to check manually created bindings, so it won't
 // return TRUE for node -- subnet for example
 //
 
@@ -1051,6 +1076,7 @@ BOOL IsValidParentClass(int iChildClass, int iParentClass)
       case OBJECT_CONTAINER:
          if ((iChildClass == OBJECT_CONTAINER) || 
              (iChildClass == OBJECT_NODE) ||
+             (iChildClass == OBJECT_CLUSTER) ||
              (iChildClass == OBJECT_CONDITION))
             return TRUE;
          break;
index 2a266b5..200b9eb 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: session.cpp,v 1.254 2006-12-29 12:45:29 victor Exp $ */
+/* $Id: session.cpp,v 1.255 2007-01-04 16:35:39 victor Exp $ */
 /* 
 ** NetXMS - Network Management System
 ** Copyright (C) 2003, 2004, 2005, 2006 Victor Kirhenshtein
@@ -3114,8 +3114,8 @@ void ClientSession::CreateObject(CSCPMessage *pRequest)
    CSCPMessage msg;
    NetObj *pObject, *pParent;
    int iClass, iServiceType;
-   TCHAR *pDescription, szObjectName[MAX_OBJECT_NAME];
-   TCHAR *pszRequest, *pszResponse;
+   TCHAR szObjectName[MAX_OBJECT_NAME];
+   TCHAR *pszRequest, *pszResponse, *pszComments;
    DWORD dwIpAddr;
    WORD wIpProto, wIpPort;
    BOOL bParentAlwaysValid = FALSE;
@@ -3161,23 +3161,22 @@ void ClientSession::CreateObject(CSCPMessage *pRequest)
                                            pRequest->GetVariableLong(VID_PROXY_NODE));
                      break;
                   case OBJECT_CONTAINER:
-                     pDescription = pRequest->GetVariableStr(VID_DESCRIPTION);
                      pObject = new Container(szObjectName, 
-                                             pRequest->GetVariableLong(VID_CATEGORY),
-                                             pDescription);
-                     safe_free(pDescription);
+                                             pRequest->GetVariableLong(VID_CATEGORY));
                      NetObjInsert(pObject, TRUE);
                      break;
                   case OBJECT_TEMPLATEGROUP:
-                     pDescription = pRequest->GetVariableStr(VID_DESCRIPTION);
-                     pObject = new TemplateGroup(szObjectName, pDescription);
-                     safe_free(pDescription);
+                     pObject = new TemplateGroup(szObjectName);
                      NetObjInsert(pObject, TRUE);
                      break;
                   case OBJECT_TEMPLATE:
                      pObject = new Template(szObjectName);
                      NetObjInsert(pObject, TRUE);
                      break;
+                  case OBJECT_CLUSTER:
+                     pObject = new Cluster(szObjectName);
+                     NetObjInsert(pObject, TRUE);
+                     break;
                   case OBJECT_NETWORKSERVICE:
                      iServiceType = (int)pRequest->GetVariableShort(VID_SERVICE_TYPE);
                      wIpProto = pRequest->GetVariableShort(VID_IP_PROTO);
@@ -3203,7 +3202,7 @@ void ClientSession::CreateObject(CSCPMessage *pRequest)
                      break;
                }
 
-               // If creation was successful do binding
+               // If creation was successful do binding and set comments if needed
                if (pObject != NULL)
                {
                   if (pParent != NULL)    // parent can be NULL for nodes
@@ -3212,6 +3211,11 @@ void ClientSession::CreateObject(CSCPMessage *pRequest)
                      pObject->AddParent(pParent);
                      pParent->CalculateCompoundStatus();
                   }
+                                               
+                                               pszComments = pRequest->GetVariableStr(VID_COMMENTS);
+                                               if (pszComments != NULL)
+                                                       pObject->SetComments(pszComments);
+
                   pObject->Unhide();
                   msg.SetVariable(VID_RCC, RCC_SUCCESS);
                   msg.SetVariable(VID_OBJECT_ID, pObject->Id());
index 0e585fc..9ce812a 100644 (file)
@@ -33,7 +33,6 @@ Template::Template()
    m_dwNumItems = 0;
    m_ppItems = NULL;
    m_dwDCILockStatus = INVALID_INDEX;
-   m_pszDescription = NULL;
    m_dwVersion = 0x00010000;  // Initial version is 1.0
 }
 
@@ -49,7 +48,6 @@ Template::Template(TCHAR *pszName)
    m_dwNumItems = 0;
    m_ppItems = NULL;
    m_dwDCILockStatus = INVALID_INDEX;
-   m_pszDescription = NULL;
    m_dwVersion = 0x00010000;  // Initial version is 1.0
    m_bIsHidden = TRUE;
 }
@@ -62,7 +60,6 @@ Template::Template(TCHAR *pszName)
 Template::~Template()
 {
    DestroyItems();
-   safe_free(m_pszDescription);
 }
 
 
@@ -99,7 +96,7 @@ BOOL Template::CreateFromDB(DWORD dwId)
    if (!LoadCommonProperties())
       return FALSE;
 
-   _stprintf(szQuery, _T("SELECT version,description FROM templates WHERE id=%d"), dwId);
+   _stprintf(szQuery, _T("SELECT version FROM templates WHERE id=%d"), dwId);
    hResult = DBSelect(g_hCoreDB, szQuery);
    if (hResult == NULL)
       return FALSE;     // Query failed
@@ -112,11 +109,6 @@ BOOL Template::CreateFromDB(DWORD dwId)
    }
 
    m_dwVersion = DBGetFieldULong(hResult, 0, 0);
-   m_pszDescription = DBGetField(hResult, 0, 1, NULL, 0);
-   if (m_pszDescription == NULL)
-      m_pszDescription = _tcsdup(_T(""));
-   DecodeSQLString(m_pszDescription);
-
    DBFreeResult(hResult);
 
    // Load DCI and access list
@@ -169,7 +161,7 @@ BOOL Template::CreateFromDB(DWORD dwId)
 
 BOOL Template::SaveToDB(DB_HANDLE hdb)
 {
-   TCHAR *pszEscDescr, szQuery[1024];
+   TCHAR szQuery[1024];
    DB_RESULT hResult;
    DWORD i;
    BOOL bNewObject = TRUE;
@@ -190,16 +182,13 @@ BOOL Template::SaveToDB(DB_HANDLE hdb)
    }
 
    // Form and execute INSERT or UPDATE query
-   pszEscDescr = EncodeSQLString(CHECK_NULL_EX(m_pszDescription));
    if (bNewObject)
-      sprintf(szQuery, "INSERT INTO templates (id,version,"
-                       "description) VALUES (%d,%d,'%s')",
-              m_dwId, m_dwVersion, pszEscDescr);
+      sprintf(szQuery, "INSERT INTO templates (id,version) VALUES (%d,%d)",
+              m_dwId, m_dwVersion);
    else
-      sprintf(szQuery, "UPDATE templates SET version=%d,description='%s' WHERE id=%d",
-              m_dwVersion, pszEscDescr, m_dwId);
+      sprintf(szQuery, "UPDATE templates SET version=%d WHERE id=%d",
+              m_dwVersion, m_dwId);
    DBQuery(hdb, szQuery);
-   free(pszEscDescr);
 
    // Update members list
    sprintf(szQuery, "DELETE FROM dct_node_map WHERE template_id=%d", m_dwId);
@@ -600,7 +589,6 @@ void Template::CreateMessage(CSCPMessage *pMsg)
 {
    NetObj::CreateMessage(pMsg);
    pMsg->SetVariable(VID_TEMPLATE_VERSION, m_dwVersion);
-   pMsg->SetVariable(VID_DESCRIPTION, CHECK_NULL_EX(m_pszDescription));
 }
 
 
@@ -617,13 +605,6 @@ DWORD Template::ModifyFromMessage(CSCPMessage *pRequest, BOOL bAlreadyLocked)
    if (pRequest->IsVariableExist(VID_TEMPLATE_VERSION))
       m_dwVersion = pRequest->GetVariableLong(VID_TEMPLATE_VERSION);
 
-   // Change description
-   if (pRequest->IsVariableExist(VID_DESCRIPTION))
-   {
-      safe_free(m_pszDescription);
-      m_pszDescription = pRequest->GetVariableStr(VID_DESCRIPTION);
-   }
-
    return NetObj::ModifyFromMessage(pRequest, TRUE);
 }
 
index 9f26aad..370102a 100644 (file)
@@ -34,7 +34,6 @@ Zone::Zone()
    m_dwZoneGUID = 0;
    m_dwControllerIpAddr = 0;
    _tcscpy(m_szName, _T("Zone 0"));
-   m_pszDescription = _tcsdup(_T(""));
    m_dwAddrListSize = 0;
    m_pdwIpAddrList = NULL;
    m_iZoneType = ZONE_TYPE_ACTIVE;
@@ -47,7 +46,6 @@ Zone::Zone()
 
 Zone::~Zone()
 {
-   safe_free(m_pszDescription);
    safe_free(m_pdwIpAddrList);
 }
 
@@ -67,8 +65,7 @@ BOOL Zone::CreateFromDB(DWORD dwId)
    if (!LoadCommonProperties())
       return FALSE;
 
-   _stprintf(szQuery, _T("SELECT zone_guid,zone_type,controller_ip,"
-                         "description FROM zones WHERE id=%d"), dwId);
+   _stprintf(szQuery, _T("SELECT zone_guid,zone_type,controller_ip FROM zones WHERE id=%d"), dwId);
    hResult = DBSelect(g_hCoreDB, szQuery);
    if (hResult == NULL)
       return FALSE;     // Query failed
@@ -80,8 +77,6 @@ BOOL Zone::CreateFromDB(DWORD dwId)
       {
          m_dwZoneGUID = 0;
          m_iZoneType = ZONE_TYPE_ACTIVE;
-         safe_free(m_pszDescription);
-         m_pszDescription = _tcsdup(_T("Built-in default zone object"));
          return TRUE;
       }
       else
@@ -90,13 +85,9 @@ BOOL Zone::CreateFromDB(DWORD dwId)
       }
    }
 
-   safe_free(m_pszDescription);
-
    m_dwZoneGUID = DBGetFieldULong(hResult, 0, 0);
    m_iZoneType = DBGetFieldLong(hResult, 0, 1);
    m_dwControllerIpAddr = DBGetFieldIPAddr(hResult, 0, 2);
-   m_pszDescription = DBGetField(hResult, 0, 3, NULL, 0);
-   DecodeSQLString(m_pszDescription);
 
    DBFreeResult(hResult);
 
@@ -129,7 +120,7 @@ BOOL Zone::CreateFromDB(DWORD dwId)
 BOOL Zone::SaveToDB(DB_HANDLE hdb)
 {
    BOOL bNewObject = TRUE;
-   TCHAR *pszEscDescr, szIpAddr[16], szQuery[8192];
+   TCHAR szIpAddr[16], szQuery[8192];
    DB_RESULT hResult;
    DWORD i;
 
@@ -148,18 +139,16 @@ BOOL Zone::SaveToDB(DB_HANDLE hdb)
    }
 
    // Form and execute INSERT or UPDATE query
-   pszEscDescr = EncodeSQLString(m_pszDescription);
    if (bNewObject)
-      _sntprintf(szQuery, 8192, "INSERT INTO zones (id,zone_guid,zone_type,controller_ip,"
-                          "description) VALUES (%d,%d,%d,'%s','%s')",
+      _sntprintf(szQuery, 8192, "INSERT INTO zones (id,zone_guid,zone_type,controller_ip)"
+                          " VALUES (%d,%d,%d,'%s')",
                  m_dwId, m_dwZoneGUID, m_iZoneType,
-                 IpToStr(m_dwControllerIpAddr, szIpAddr), pszEscDescr);
+                 IpToStr(m_dwControllerIpAddr, szIpAddr));
    else
       _sntprintf(szQuery, 8192, "UPDATE zones SET zone_guid=%d,zone_type=%d,"
-                                "controller_ip='%s',description='%s' WHERE id=%d",
+                                "controller_ip='%s' WHERE id=%d",
                  m_dwZoneGUID, m_iZoneType,
-                 IpToStr(m_dwControllerIpAddr, szIpAddr), pszEscDescr, m_dwId);
-   free(pszEscDescr);
+                 IpToStr(m_dwControllerIpAddr, szIpAddr), m_dwId);
    DBQuery(hdb, szQuery);
 
    // Save ip address list
@@ -217,7 +206,6 @@ void Zone::CreateMessage(CSCPMessage *pMsg)
    pMsg->SetVariable(VID_CONTROLLER_IP_ADDR, m_dwControllerIpAddr);
    pMsg->SetVariable(VID_ADDR_LIST_SIZE, m_dwAddrListSize);
    pMsg->SetVariableToInt32Array(VID_IP_ADDR_LIST, m_dwAddrListSize, m_pdwIpAddrList);
-   pMsg->SetVariable(VID_DESCRIPTION, m_pszDescription);
 }
 
 
@@ -230,12 +218,5 @@ DWORD Zone::ModifyFromMessage(CSCPMessage *pRequest, BOOL bAlreadyLocked)
    if (!bAlreadyLocked)
       LockData();
 
-   // Change description
-   if (pRequest->IsVariableExist(VID_DESCRIPTION))
-   {
-      safe_free(m_pszDescription);
-      m_pszDescription = pRequest->GetVariableStr(VID_DESCRIPTION);
-   }
-
    return NetObj::ModifyFromMessage(pRequest, TRUE);
 }
index 92855c3..87339e2 100644 (file)
@@ -312,7 +312,6 @@ protected:
    DCItem **m_ppItems;     // Data collection items
    DWORD m_dwDCILockStatus;
    DWORD m_dwVersion;
-   TCHAR *m_pszDescription;
    BOOL m_bDCIListModified;
    TCHAR m_szCurrDCIOwner[MAX_SESSION_NAME];
 
@@ -337,7 +336,6 @@ public:
 
    int VersionMajor(void) { return m_dwVersion >> 16; }
    int VersionMinor(void) { return m_dwVersion & 0xFFFF; }
-   const TCHAR *Description(void) { return CHECK_NULL(m_pszDescription); }
 
    DWORD GetItemCount(void) { return m_dwNumItems; }
    BOOL AddItem(DCItem *pItem, BOOL bLocked = FALSE);
@@ -377,12 +375,16 @@ protected:
 
 public:
        Cluster();
+   Cluster(TCHAR *pszName);
        virtual ~Cluster();
 
    virtual int Type(void) { return OBJECT_CLUSTER; }
    virtual BOOL SaveToDB(DB_HANDLE hdb);
    virtual BOOL DeleteFromDB(void);
    virtual BOOL CreateFromDB(DWORD dwId);
+
+   virtual void CreateMessage(CSCPMessage *pMsg);
+   virtual DWORD ModifyFromMessage(CSCPMessage *pRequest, BOOL bAlreadyLocked = FALSE);
 };
 
 
@@ -838,11 +840,10 @@ private:
 
 protected:
    DWORD m_dwCategory;
-   char *m_pszDescription;
 
 public:
    Container();
-   Container(char *pszName, DWORD dwCategory, char *pszDescription);
+   Container(TCHAR *pszName, DWORD dwCategory);
    virtual ~Container();
 
    virtual int Type(void) { return OBJECT_CONTAINER; }
@@ -854,7 +855,6 @@ public:
    virtual void CreateMessage(CSCPMessage *pMsg);
 
    DWORD Category(void) { return m_dwCategory; }
-   const TCHAR *Description(void) { return CHECK_NULL(m_pszDescription); }
 
    void LinkChildObjects(void);
    void LinkObject(NetObj *pObject) { AddChild(pObject); pObject->AddParent(this); }
@@ -869,7 +869,7 @@ class NXCORE_EXPORTABLE TemplateGroup : public Container
 {
 public:
    TemplateGroup() : Container() { }
-   TemplateGroup(char *pszName, char *pszDescription) : Container(pszName, 0, pszDescription) { }
+   TemplateGroup(TCHAR *pszName) : Container(pszName, 0) { }
    virtual ~TemplateGroup() { }
 
    virtual int Type(void) { return OBJECT_TEMPLATEGROUP; }
@@ -888,7 +888,6 @@ protected:
    DWORD m_dwControllerIpAddr;
    DWORD m_dwAddrListSize;
    DWORD *m_pdwIpAddrList;
-   TCHAR *m_pszDescription;
 
 public:
    Zone();
index f188553..f559800 100644 (file)
@@ -596,4 +596,22 @@ Language=English
 NetXMS server cannot create node object for itself - probably because platform subagent cannot be loaded (check above error messages, if any)
 .
 
+MessageId=
+SymbolicName=MSG_INVALID_CLUSTER_MEMBER
+Language=English
+Inconsistent database: cluster object %1 has reference to non-existing node object %2
+.
+
+MessageId=
+SymbolicName=MSG_CLUSTER_MEMBER_NOT_NODE
+Language=English
+Inconsistent database: cluster object %1 has reference to child object %2 which is not a node object
+.
+
+MessageId=
+SymbolicName=MSG_CLUSTER_LOAD_FAILED
+Language=English
+Failed to load cluster object with id %1 from database
+.
+
 ;#endif