Merge branch 'master' into fis
authorVictor Kirhenshtein <victor@netxms.org>
Thu, 20 Feb 2014 18:12:32 +0000 (20:12 +0200)
committerVictor Kirhenshtein <victor@netxms.org>
Thu, 20 Feb 2014 18:12:32 +0000 (20:12 +0200)
218 files changed:
.gitignore
ChangeLog
android/src/agent/.classpath
android/src/agent/res/values/build_number.xml
android/src/console/.classpath
android/src/console/res/values/build_number.xml
android/src/console/src/org/netxms/ui/android/service/ClientConnectorService.java
build/build_number
doc/misc/embedded_nxcp.c
include/build.h
include/netxmsdb.h
include/nms_cscp.h
include/nms_util.h
include/nxclapi.h
include/nxdbapi.h
include/nxevent.h
netxms.sln
packages/linux/debian/README
packages/linux/debian/build.sh
packages/linux/debian/clean.sh
packages/linux/debian/netxms-server-oracle.control [copied from packages/linux/debian/netxms-server.control with 54% similarity]
packages/linux/debian/netxms-server.control
packages/linux/debian/populate.sh
sql/events.in
sql/setup.in
src/agent/core/actions.cpp
src/agent/core/nxagentd.cpp
src/agent/core/register.cpp
src/agent/install/nxagent-x64.iss
src/agent/install/nxagent.iss
src/agent/subagents/aix/cpu.cpp
src/agent/subagents/ecs/ecs.cpp
src/agent/subagents/netsvc/Makefile.am
src/agent/subagents/netsvc/main.cpp
src/agent/subagents/netsvc/netsvc.h
src/agent/subagents/netsvc/netsvc.vcproj [new file with mode: 0644]
src/agent/subagents/oracle/main.cpp
src/agent/subagents/sunos/system.cpp
src/client/install/nxcon.iss
src/db/dbdrv/pgsql/pgsql.cpp
src/db/libnxdb/dbcp.cpp
src/db/libnxdb/session.cpp
src/install/files
src/install/windows/netxms-minimal.iss
src/install/windows/netxms-x64-minimal.iss
src/install/windows/netxms-x64.iss
src/install/windows/netxms.iss
src/install/windows/setup-webui.iss
src/install/windows/setup.iss
src/install/windows/webui-x64.iss
src/install/windows/webui.iss
src/java/build/pack.cmd
src/java/build/set_build_number.cmd
src/java/certificate-manager/pom.xml
src/java/mobile-agent/pom.xml
src/java/netxms-base/pom.xml
src/java/netxms-base/src/main/java/org/netxms/base/BuildNumber.java
src/java/netxms-base/src/main/java/org/netxms/base/NXCPCodes.java
src/java/netxms-base/src/main/java/org/netxms/base/NXCommon.java
src/java/netxms-client-api/pom.xml
src/java/netxms-client-api/src/main/java/org/netxms/api/client/constants/UserAccessRights.java
src/java/netxms-client/pom.xml
src/java/netxms-client/src/main/java/org/netxms/client/NXCNotification.java
src/java/netxms-client/src/main/java/org/netxms/client/NXCSession.java
src/java/netxms-client/src/main/java/org/netxms/client/ServerFile.java
src/java/netxms-client/src/main/java/org/netxms/client/log/Log.java
src/java/netxms-client/src/main/java/org/netxms/client/objects/AbstractObject.java
src/java/netxms-eclipse/ActionManager/META-INF/MANIFEST.MF
src/java/netxms-eclipse/ActionManager/OSGI-INF/l10n/bundle_es.properties
src/java/netxms-eclipse/ActionManager/OSGI-INF/l10n/bundle_ru.properties
src/java/netxms-eclipse/ActionManager/OSGI-INF/l10n/bundle_zh_CN.properties
src/java/netxms-eclipse/ActionManager/src/org/netxms/ui/eclipse/actionmanager/Messages.java
src/java/netxms-eclipse/ActionManager/src/org/netxms/ui/eclipse/actionmanager/messages.properties
src/java/netxms-eclipse/ActionManager/src/org/netxms/ui/eclipse/actionmanager/messages_cs.properties
src/java/netxms-eclipse/ActionManager/src/org/netxms/ui/eclipse/actionmanager/messages_es.properties
src/java/netxms-eclipse/ActionManager/src/org/netxms/ui/eclipse/actionmanager/messages_ru.properties
src/java/netxms-eclipse/ActionManager/src/org/netxms/ui/eclipse/actionmanager/messages_zh_CN.properties
src/java/netxms-eclipse/ActionManager/src/org/netxms/ui/eclipse/actionmanager/views/helpers/ActionLabelProvider.java
src/java/netxms-eclipse/Charts/src/org/netxms/ui/eclipse/charts/api/DataChart.java
src/java/netxms-eclipse/Charts/src/org/netxms/ui/eclipse/charts/widgets/LineChart.java
src/java/netxms-eclipse/Core/.classpath
src/java/netxms-eclipse/Core/META-INF/MANIFEST.MF
src/java/netxms-eclipse/Core/build.properties
src/java/netxms-eclipse/Core/nxmc.product
src/java/netxms-eclipse/Core/plugin.xml
src/java/netxms-eclipse/Core/src/org/netxms/ui/eclipse/console/SplashHandler.java
src/java/netxms-eclipse/Dashboard/src/org/netxms/ui/eclipse/dashboard/views/DashboardView.java
src/java/netxms-eclipse/FileManager/OSGI-INF/l10n/bundle.properties
src/java/netxms-eclipse/FileManager/OSGI-INF/l10n/bundle_cs.properties
src/java/netxms-eclipse/FileManager/OSGI-INF/l10n/bundle_es.properties
src/java/netxms-eclipse/FileManager/OSGI-INF/l10n/bundle_ru.properties
src/java/netxms-eclipse/FileManager/OSGI-INF/l10n/bundle_zh_CN.properties
src/java/netxms-eclipse/FileManager/plugin.xml
src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/Messages.java
src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/actions/GetServerFileList.java [new file with mode: 0644]
src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/messages.properties
src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/messages_cs.properties
src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/messages_es.properties
src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/messages_ru.properties
src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/messages_zh_CN.properties
src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/views/ViewServerFile.java [new file with mode: 0644]
src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/views/helpers/ServerFileComparator.java [new file with mode: 0644]
src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/views/helpers/ServerFileFilter.java [new file with mode: 0644]
src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/views/helpers/ServerFileLabelProvider.java [new file with mode: 0644]
src/java/netxms-eclipse/ImageLibrary/src/org/netxms/ui/eclipse/imagelibrary/views/ImageLibrary.java
src/java/netxms-eclipse/NetworkMaps/src/org/netxms/ui/eclipse/networkmaps/views/helpers/ObjectFigureLargeLabel.java
src/java/netxms-eclipse/ObjectBrowser/META-INF/MANIFEST.MF
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/widgets/ObjectTree.java
src/java/netxms-eclipse/ObjectTools/META-INF/MANIFEST.MF
src/java/netxms-eclipse/ObjectTools/src/org/netxms/ui/eclipse/objecttools/ObjectToolsDynamicMenu.java
src/java/netxms-eclipse/SNMP/META-INF/MANIFEST.MF
src/java/netxms-eclipse/SNMP/src/org/netxms/ui/eclipse/snmp/shared/MibCache.java
src/java/netxms-eclipse/Topology/src/org/netxms/ui/eclipse/topology/actions/ShowVlans.java
src/java/netxms-eclipse/UserManager/src/org/netxms/ui/eclipse/usermanager/Messages.java
src/java/netxms-eclipse/UserManager/src/org/netxms/ui/eclipse/usermanager/messages.properties
src/java/netxms-eclipse/UserManager/src/org/netxms/ui/eclipse/usermanager/messages_cs.properties
src/java/netxms-eclipse/UserManager/src/org/netxms/ui/eclipse/usermanager/messages_es.properties
src/java/netxms-eclipse/UserManager/src/org/netxms/ui/eclipse/usermanager/messages_ru.properties
src/java/netxms-eclipse/UserManager/src/org/netxms/ui/eclipse/usermanager/messages_zh_CN.properties
src/java/nxshell/pom.xml
src/java/pom.xml
src/libnetxms/nxcp.cpp
src/libnetxms/strset.cpp
src/libnetxms/unicode.cpp
src/libnxsl/functions.cpp
src/libstrophe/conn.c
src/server/core/actions.cpp
src/server/core/alarm.cpp
src/server/core/dc_nxsl.cpp
src/server/core/dcitem.cpp
src/server/core/dcobject.cpp
src/server/core/dctable.cpp
src/server/core/dctarget.cpp
src/server/core/dctthreshold.cpp
src/server/core/events.cpp
src/server/core/graph.cpp
src/server/core/interface.cpp
src/server/core/loghandle.cpp
src/server/core/logs.cpp
src/server/core/main.cpp
src/server/core/mdsession.cpp
src/server/core/netobj.cpp
src/server/core/node.cpp
src/server/core/np.cpp
src/server/core/nxsl_classes.cpp
src/server/core/objects.cpp
src/server/core/poll.cpp
src/server/core/report_job.cpp
src/server/core/session.cpp
src/server/core/sms.cpp
src/server/core/snmp.cpp
src/server/core/svccontainer.cpp
src/server/core/template.cpp
src/server/drivers/at/at.cpp
src/server/drivers/at/at.h
src/server/include/nms_core.h
src/server/include/nms_dcoll.h
src/server/include/nms_objects.h
src/server/include/nxcore_logs.h
src/server/libnxsrv/iflist.cpp
src/server/libnxsrv/ndd.cpp
src/server/libnxsrv/vlan.cpp
src/server/netxmsd/netxmsd.cpp
src/server/tools/nxdbmgr/upgrade.cpp
src/tools/nxencpasswd/nxencpasswd.cpp
webui/webapp/ActionManager/META-INF/MANIFEST.MF
webui/webapp/ActionManager/OSGI-INF/l10n/bundle_es.properties
webui/webapp/ActionManager/OSGI-INF/l10n/bundle_ru.properties
webui/webapp/ActionManager/OSGI-INF/l10n/bundle_zh_CN.properties
webui/webapp/ActionManager/src/org/netxms/ui/eclipse/actionmanager/Messages.java
webui/webapp/ActionManager/src/org/netxms/ui/eclipse/actionmanager/messages.properties
webui/webapp/ActionManager/src/org/netxms/ui/eclipse/actionmanager/messages_cs.properties
webui/webapp/ActionManager/src/org/netxms/ui/eclipse/actionmanager/messages_es.properties
webui/webapp/ActionManager/src/org/netxms/ui/eclipse/actionmanager/messages_ru.properties
webui/webapp/ActionManager/src/org/netxms/ui/eclipse/actionmanager/messages_zh_CN.properties
webui/webapp/ActionManager/src/org/netxms/ui/eclipse/actionmanager/views/helpers/ActionLabelProvider.java
webui/webapp/Charts/src/org/netxms/ui/eclipse/charts/api/DataChart.java
webui/webapp/Charts/src/org/netxms/ui/eclipse/charts/widgets/LineChart.java
webui/webapp/Core/.classpath
webui/webapp/Core/META-INF/MANIFEST.MF
webui/webapp/Core/build.properties
webui/webapp/Core/nxmc.warproduct
webui/webapp/Dashboard/src/org/netxms/ui/eclipse/dashboard/views/DashboardView.java
webui/webapp/FileManager/OSGI-INF/l10n/bundle.properties
webui/webapp/FileManager/OSGI-INF/l10n/bundle_cs.properties
webui/webapp/FileManager/OSGI-INF/l10n/bundle_es.properties
webui/webapp/FileManager/OSGI-INF/l10n/bundle_ru.properties
webui/webapp/FileManager/OSGI-INF/l10n/bundle_zh_CN.properties
webui/webapp/FileManager/plugin.xml
webui/webapp/FileManager/src/org/netxms/ui/eclipse/filemanager/Messages.java
webui/webapp/FileManager/src/org/netxms/ui/eclipse/filemanager/actions/GetServerFileList.java [new file with mode: 0644]
webui/webapp/FileManager/src/org/netxms/ui/eclipse/filemanager/messages.properties
webui/webapp/FileManager/src/org/netxms/ui/eclipse/filemanager/messages_cs.properties
webui/webapp/FileManager/src/org/netxms/ui/eclipse/filemanager/messages_es.properties
webui/webapp/FileManager/src/org/netxms/ui/eclipse/filemanager/messages_ru.properties
webui/webapp/FileManager/src/org/netxms/ui/eclipse/filemanager/messages_zh_CN.properties
webui/webapp/FileManager/src/org/netxms/ui/eclipse/filemanager/views/ViewServerFile.java [new file with mode: 0644]
webui/webapp/FileManager/src/org/netxms/ui/eclipse/filemanager/views/helpers/ServerFileComparator.java [new file with mode: 0644]
webui/webapp/FileManager/src/org/netxms/ui/eclipse/filemanager/views/helpers/ServerFileFilter.java [new file with mode: 0644]
webui/webapp/FileManager/src/org/netxms/ui/eclipse/filemanager/views/helpers/ServerFileLabelProvider.java [new file with mode: 0644]
webui/webapp/ImageLibrary/src/org/netxms/ui/eclipse/imagelibrary/views/ImageLibrary.java
webui/webapp/NXSL/src/org/netxms/ui/eclipse/nxsl/widgets/ScriptEditor.java
webui/webapp/NetworkMaps/META-INF/MANIFEST.MF
webui/webapp/NetworkMaps/src/org/netxms/ui/eclipse/networkmaps/views/helpers/MapLabelProvider.java
webui/webapp/NetworkMaps/src/org/netxms/ui/eclipse/networkmaps/views/helpers/ObjectFigureLargeLabel.java
webui/webapp/ObjectBrowser/META-INF/MANIFEST.MF
webui/webapp/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/widgets/ObjectTree.java
webui/webapp/ObjectTools/META-INF/MANIFEST.MF
webui/webapp/ObjectTools/src/org/netxms/ui/eclipse/objecttools/ObjectToolsDynamicMenu.java
webui/webapp/SNMP/META-INF/MANIFEST.MF
webui/webapp/SNMP/src/org/netxms/ui/eclipse/snmp/shared/MibCache.java
webui/webapp/Topology/src/org/netxms/ui/eclipse/topology/actions/ShowVlans.java
webui/webapp/UserManager/src/org/netxms/ui/eclipse/usermanager/Messages.java
webui/webapp/UserManager/src/org/netxms/ui/eclipse/usermanager/messages.properties
webui/webapp/UserManager/src/org/netxms/ui/eclipse/usermanager/messages_cs.properties
webui/webapp/UserManager/src/org/netxms/ui/eclipse/usermanager/messages_es.properties
webui/webapp/UserManager/src/org/netxms/ui/eclipse/usermanager/messages_ru.properties
webui/webapp/UserManager/src/org/netxms/ui/eclipse/usermanager/messages_zh_CN.properties

index 1016066..a773ea9 100644 (file)
@@ -77,6 +77,7 @@ target
 /packages/linux/debian/netxms-server
 /packages/linux/debian/netxms-server-mysql
 /packages/linux/debian/netxms-server-odbc
+/packages/linux/debian/netxms-server-oracle
 /packages/linux/debian/netxms-server-pgsql
 /packages/linux/debian/output
 /packages/osx/*.dmg
index aaa18a9..1b3186c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,12 +6,21 @@
 - Timed (temporary) alarm acknowledgement
 - New subagent DBQuery - replacement for ODBCQuery 
 - DCI access functions in NXSL works correctly with table DCIs
+- Fixed bugs with instance discovery DCIs created from templates
+- New property "runtimeFlags" in NXSL class "Node"
+- New event SYS_IF_PEER_CHANGED (sent when peer change detected in interface)
+- New system permission: Manage Image Library
+- Object level access control can be enabled for logs
+- New NXSL function FindAllDCIs
+- Driver for Allied Telesis switches improved
 - Management console:
    - Fixed bug with red zone display in "last value" dashboard element
    - Edit and delete for alarm comments are working now
    - Fixed Y axis range can be set for line and bar charts
    - In alarm menue are not shown incompatible for selected alarm statuses.
-   - Alarm status flow can be changed to strict(terminate status can be set only after alarm is resolved). To change flow set "StrictAlarmStatusFlow" parameter to 1.
+   - Alarm status flow can be changed to strict (terminate status can be set only 
+     after alarm is resolved). To change flow set "StrictAlarmStatusFlow" parameter to 1.
+   - SNMP MIB loaded into memory on first access
 - Android Agent:
        - Implemented "Connection notification" in status bar (feature #481)
        - Fix bug in resetting switch preference (settings) 
@@ -19,7 +28,8 @@
        - Fix bug in resetting switch preference (settings) 
        - Implemented "Entire network" root (feature #482)
        - Manage last alarm from status bar: acknowledge, resolve, terminate (only for Android >= 4.1)
-- Fixed issues: #79, #88, #393, #481, #482, #483, #486, #487, #490
+- Fixed issues: #79, #88, #280, #285, #393, #415, #470, #475, #481, #482, #483,
+                #484, #486, #487, #490, #497, #500, #502, #504
 
 
 *
@@ -67,8 +77,8 @@
        - "Nodes" tab in object details view for subnets and containers
        - "Address Map" tab in object details view for subnets
        - Czech and Russian localization
-- Fixed issues: #150, #226, #307, #330, #362, #363, #364, #366, #367, #373, #378, 
-                #384, #387, #390, $401, #410, #414, #416, #419, #439, #440
+- Fixed issues: #95, #150, #226, #307, #330, #362, #363, #364, #366, #367, #373,
+                #378, #384, #387, #390, $401, #410, #414, #416, #419, #439, #440
 
 
 *
index 8806b3e..6e51386 100644 (file)
@@ -6,8 +6,8 @@
        <classpathentry kind="lib" path="libs/acra-4.4.0.jar"/>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="src" path="gen"/>
-       <classpathentry kind="lib" path="libs/netxms-base-1.2.11.jar"/>
-       <classpathentry kind="lib" path="libs/netxms-mobile-agent-1.2.11.jar"/>
        <classpathentry kind="lib" path="libs/android-support-v4.jar"/>
+       <classpathentry kind="lib" path="libs/netxms-base-1.2.12.jar"/>
+       <classpathentry kind="lib" path="libs/netxms-mobile-agent-1.2.12.jar"/>
        <classpathentry kind="output" path="bin/classes"/>
 </classpath>
index fbcbe03..af9f39b 100644 (file)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-       <string name="build_number">7858</string>
+       <string name="build_number">7861</string>
 </resources>
index f5d1899..ba9be6f 100644 (file)
@@ -9,9 +9,9 @@
        <classpathentry kind="lib" path="libs/acra-4.4.0.jar"/>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="src" path="gen"/>
-       <classpathentry kind="lib" path="libs/certificate-manager-1.2.11.jar"/>
-       <classpathentry kind="lib" path="libs/netxms-base-1.2.11.jar"/>
-       <classpathentry kind="lib" path="libs/netxms-client-1.2.11.jar"/>
-       <classpathentry kind="lib" path="libs/netxms-client-api-1.2.11.jar"/>
+       <classpathentry kind="lib" path="libs/certificate-manager-1.2.12.jar"/>
+       <classpathentry kind="lib" path="libs/netxms-base-1.2.12.jar"/>
+       <classpathentry kind="lib" path="libs/netxms-client-1.2.12.jar"/>
+       <classpathentry kind="lib" path="libs/netxms-client-api-1.2.12.jar"/>
        <classpathentry kind="output" path="bin/classes"/>
 </classpath>
index fbcbe03..af9f39b 100644 (file)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-       <string name="build_number">7858</string>
+       <string name="build_number">7861</string>
 </resources>
index 438bc9b..0fca6ff 100644 (file)
@@ -987,7 +987,7 @@ public class ClientConnectorService extends Service implements SessionListener
        {
                try
                {
-                       session.acknowledgeAlarm(id, sticky);
+                       session.acknowledgeAlarm(id, sticky, 0);
                }
                catch (Exception e)
                {
index e771ae7..2f93e94 100644 (file)
@@ -1 +1 @@
-7858
+7861
index aaf2747..1f785ae 100644 (file)
@@ -165,7 +165,7 @@ void nxcp_add_string(uint32_t id, const char *value)
    NXCP_DF *df = (NXCP_DF *)curr;
    df->id = htonl(id);
    df->type = CSCP_DT_STRING;
-   for(l = 0, p = value, curr += 12; *p != 0; l++, p++)
+   for(l = 0, p = value, curr += 12; *p != 0; l += 2, p++)
    {
       *(curr++) = 0;
       *(curr++) = *p;
index 5084f12..e8a046e 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef __build_h
 #define __build_h
-#define NETXMS_VERSION_BUILD 7858
-#define NETXMS_VERSION_BUILD_STRING _T("7858")
+#define NETXMS_VERSION_BUILD 7861
+#define NETXMS_VERSION_BUILD_STRING _T("7861")
 #endif
index 92fc85a..8524c36 100644 (file)
@@ -23,6 +23,6 @@
 #ifndef _netxmsdb_h
 #define _netxmsdb_h
 
-#define DB_FORMAT_VERSION   304
+#define DB_FORMAT_VERSION   306
 
 #endif
index bd9da75..61c1937 100644 (file)
@@ -487,6 +487,7 @@ typedef struct
 #define CMD_CHANGE_OBJECT_TOOL_STATUS  0x011F
 #define CMD_SET_ALARM_STATUS_FLOW      0x0120
 #define CMD_DELETE_ALARM_NOTE          0x0121
+#define CMD_GET_EFFECTIVE_RIGHTS       0x0122
 
 #define CMD_RS_LIST_REPORTS            0x1100
 #define CMD_RS_GET_REPORT              0x1101
@@ -960,6 +961,7 @@ typedef struct
 #define VID_FILE_DATA               ((UINT32)460)
 #define VID_ALARM_STATUS_FLOW_STATE ((UINT32)461)
 #define VID_GROUPS                  ((UINT32)462)
+#define VID_EFFECTIVE_RIGHTS        ((UINT32)463)
 
 // Base variabe for single threshold in message
 #define VID_THRESHOLD_BASE          ((UINT32)0x00800000)
index 130e879..992a2ea 100644 (file)
@@ -363,6 +363,11 @@ public:
  */
 struct StringSetEntry;
 
+/**
+ * NXCP message
+ */
+class CSCPMessage;
+
 /**
  * String set class
  */
@@ -376,14 +381,21 @@ public:
    ~StringSet();
 
    void add(const TCHAR *str);
+   void addPreallocated(TCHAR *str);
    void remove(const TCHAR *str);
    void clear();
 
    int size();
-   bool exist(const TCHAR *str);
+   bool contains(const TCHAR *str);
 
    void addAll(StringSet *src);
+   void addAll(TCHAR **strings, int count);
    void forEach(bool (*cb)(const TCHAR *, void *), void *userData);
+
+   void fillMessage(CSCPMessage *msg, UINT32 baseId, UINT32 countId);
+   void addAllFromMessage(CSCPMessage *msg, UINT32 baseId, UINT32 countId, bool clearBeforeAdd, bool toUppercase);
+
+   String getAll(const TCHAR *separator);
 };
 
 /**
@@ -1140,7 +1152,7 @@ extern "C"
        int wsystem(const WCHAR *_cmd);
 #endif
 #if !HAVE_WMKSTEMP
-       int wmkstemp(const WCHAR *_template);
+       int wmkstemp(WCHAR *_template);
 #endif
 #if !HAVE_WACCESS
        int waccess(const WCHAR *_path, int mode);
index 38089bf..91d967a 100644 (file)
@@ -425,6 +425,7 @@ enum
 #define NX_NOTIFY_DCISUMTBL_DELETED          22
 #define NX_NOTIFY_CERTIFICATE_CHANGED        23
 #define NX_NOTIFY_ALARM_STATUS_FLOW_CHANGED  24
+#define NX_NOTIFY_FILE_LIST_CHANGED          25
 
 /**
  * Request completion codes
@@ -624,6 +625,7 @@ enum
 #define SYSTEM_ACCESS_MANAGE_SUMMARY_TBLS 0x01000000
 #define SYSTEM_ACCESS_REPORTING_SERVER    0x02000000
 #define SYSTEM_ACCESS_XMPP_COMMANDS       0x04000000
+#define SYSTEM_ACCESS_MANAGE_IMAGE_LIB    0x08000000
 
 #define SYSTEM_ACCESS_FULL                0x07FFFFFF
 
index 13978d1..3154090 100644 (file)
@@ -59,7 +59,6 @@
 /**
  * Database syntax codes
  */
-
 #define DB_SYNTAX_MYSQL    0
 #define DB_SYNTAX_PGSQL    1
 #define DB_SYNTAX_MSSQL    2
 #define DB_SYNTAX_INFORMIX 6
 #define DB_SYNTAX_UNKNOWN      -1
 
-
-//
-// Database connection structures
-//
-
+/**
+ * Database connection structures
+ */
 struct db_driver_t;
 typedef db_driver_t * DB_DRIVER;
 
@@ -89,11 +86,22 @@ typedef db_result_t * DB_RESULT;
 struct db_async_result_t;
 typedef db_async_result_t * DB_ASYNC_RESULT;
 
+/**
+ * Pool connection information
+ */
+struct PoolConnectionInfo
+{
+   DB_HANDLE handle;
+   bool inUse;
+   time_t lastAccessTime;
+   time_t connectTime;
+   char srcFile[128];
+   int srcLine;
+};
 
-//
-// Functions
-//
-
+/**
+ * Functions
+ */
 bool LIBNXDB_EXPORTABLE DBInit(DWORD logMsgCode, DWORD sqlErrorMsgCode);
 DB_DRIVER LIBNXDB_EXPORTABLE DBLoadDriver(const TCHAR *module, const TCHAR *initParameters,
                                                                                                                bool dumpSQL, void (* fpEventHandler)(DWORD, const WCHAR *, const WCHAR *, void *),
@@ -184,11 +192,13 @@ bool LIBNXDB_EXPORTABLE DBConnectionPoolStartup(DB_DRIVER driver, const TCHAR *s
                                                                                                                                int basePoolSize, int maxPoolSize, int cooldownTime,
                                                                                                                                int connTTL, DB_HANDLE fallback);
 void LIBNXDB_EXPORTABLE DBConnectionPoolShutdown();
-DB_HANDLE LIBNXDB_EXPORTABLE DBConnectionPoolAcquireConnection();
+DB_HANDLE LIBNXDB_EXPORTABLE __DBConnectionPoolAcquireConnection(const char *srcFile, int srcLine);
+#define DBConnectionPoolAcquireConnection() __DBConnectionPoolAcquireConnection(__FILE__, __LINE__)
 void LIBNXDB_EXPORTABLE DBConnectionPoolReleaseConnection(DB_HANDLE connection);
 int LIBNXDB_EXPORTABLE DBConnectionPoolGetSize();
 int LIBNXDB_EXPORTABLE DBConnectionPoolGetAcquiredCount();
 
 void LIBNXDB_EXPORTABLE DBSetDebugPrintCallback(void (*cb)(int, const TCHAR *, va_list));
+ObjectArray<PoolConnectionInfo> LIBNXDB_EXPORTABLE *DBConnectionPoolGetConnectionList();
 
 #endif   /* _nxsrvapi_h_ */
index 8a40ce7..2ee47f2 100644 (file)
 #define EVENT_NODE_UNREACHABLE            68
 #define EVENT_TABLE_THRESHOLD_ACTIVATED   69
 #define EVENT_TABLE_THRESHOLD_DEACTIVATED 70
+#define EVENT_IF_PEER_CHANGED             71
 
 #define EVENT_SNMP_UNMATCHED_TRAP         500
 #define EVENT_SNMP_COLD_START             501
index 48e139b..6fb1be0 100644 (file)
@@ -569,6 +569,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libstrophe", "src\libstroph
                {6A88EF62-C4F2-4295-A833-549DAE4DF5ED} = {6A88EF62-C4F2-4295-A833-549DAE4DF5ED}
        EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netsvc", "src\agent\subagents\netsvc\netsvc.vcproj", "{17C5C5F3-3F13-47F4-8606-1EC9B5416DB2}"
+       ProjectSection(ProjectDependencies) = postProject
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {406AE5C7-343D-4C88-B8F3-84E46255B830} = {406AE5C7-343D-4C88-B8F3-84E46255B830}
+       EndProjectSection
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -1313,6 +1319,14 @@ Global
                {F4169894-5C48-4E11-A82E-1055F9572EEF}.Release|Win32.Build.0 = Release|Win32
                {F4169894-5C48-4E11-A82E-1055F9572EEF}.Release|x64.ActiveCfg = Release|x64
                {F4169894-5C48-4E11-A82E-1055F9572EEF}.Release|x64.Build.0 = Release|x64
+               {17C5C5F3-3F13-47F4-8606-1EC9B5416DB2}.Debug|Win32.ActiveCfg = Debug|Win32
+               {17C5C5F3-3F13-47F4-8606-1EC9B5416DB2}.Debug|Win32.Build.0 = Debug|Win32
+               {17C5C5F3-3F13-47F4-8606-1EC9B5416DB2}.Debug|x64.ActiveCfg = Debug|x64
+               {17C5C5F3-3F13-47F4-8606-1EC9B5416DB2}.Debug|x64.Build.0 = Debug|x64
+               {17C5C5F3-3F13-47F4-8606-1EC9B5416DB2}.Release|Win32.ActiveCfg = Release|Win32
+               {17C5C5F3-3F13-47F4-8606-1EC9B5416DB2}.Release|Win32.Build.0 = Release|Win32
+               {17C5C5F3-3F13-47F4-8606-1EC9B5416DB2}.Release|x64.ActiveCfg = Release|x64
+               {17C5C5F3-3F13-47F4-8606-1EC9B5416DB2}.Release|x64.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
@@ -1347,6 +1361,7 @@ Global
                {90B762AB-B7BA-42D6-9819-C687AB3F59D0} = {451F583D-C2DB-4414-870C-7FA0189BE7DD}
                {784D1668-124C-46D9-B985-51276FFA282A} = {451F583D-C2DB-4414-870C-7FA0189BE7DD}
                {4967B29B-4272-4D7B-9CF6-8ABFF9D21348} = {451F583D-C2DB-4414-870C-7FA0189BE7DD}
+               {17C5C5F3-3F13-47F4-8606-1EC9B5416DB2} = {451F583D-C2DB-4414-870C-7FA0189BE7DD}
                {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {B93920F5-65F4-4531-B87E-A5B357AF2476}
                {3B172035-5EEC-45A3-8471-2C390B7ED683} = {B93920F5-65F4-4531-B87E-A5B357AF2476}
                {E417A0C4-41F1-4F87-8C33-8526ECB1F8AF} = {B93920F5-65F4-4531-B87E-A5B357AF2476}
index 0531a3f..f8cc03c 100644 (file)
@@ -1,11 +1,12 @@
 Building binary packages for Debian:
 
 0. Prerequisites:
-       Packages libssl-dev, libexpat1-dev, libreadline5-dev, and libsensors4-dev must be installed
+       Packages: libssl-dev libexpat1-dev libreadline6-dev libsensors4-dev unixodbc-dev libpq-dev libmysqlclient-dev
+       Oracle Instant Client 11.2 unpacked into /opt/instantclient_11_2
 
 1. Configure and build NetXMS as following:
 
-       ./configure --prefix=/usr --enable-unicode --with-server --with-odbc --with-sqlite --with-pgsql --with-mysql --with-client
+       ./configure --prefix=/usr --enable-unicode --with-server --with-odbc --with-sqlite --with-pgsql --with-mysql --with-oracle=/opt/instantclient_11_2 --with-client
        make clean
        make
        make install
@@ -22,10 +23,10 @@ Building binary packages for Debian:
 Updating package files on web server:
 
 1. Put .deb files into appropriate binary directory:
-       <webroot>/data/apt/dists/squeeze/main/binary-i386
-       <webroot>/data/apt/dists/squeeze/main/binary-amd64
+       <webroot>/data/apt/dists/wheezy/main/binary-i386
+       <webroot>/data/apt/dists/wheezy/main/binary-amd64
 
 2. Run commands from <webroot>/data/apt:
 
-       dpkg-scanpackages dists/squeeze/main/binary-i386 | gzip -9c > dists/squeeze/main/binary-i386/Packages.gz
-       dpkg-scanpackages dists/squeeze/main/binary-amd64 | gzip -9c > dists/squeeze/main/binary-amd64/Packages.gz
+       dpkg-scanpackages dists/wheezy/main/binary-i386 | gzip -9c > dists/wheezy/main/binary-i386/Packages.gz
+       dpkg-scanpackages dists/wheezy/main/binary-amd64 | gzip -9c > dists/wheezy/main/binary-amd64/Packages.gz
index 4044fac..5a31aca 100755 (executable)
@@ -1,9 +1,12 @@
 #!/bin/sh
 
+mkdir -p output
+
 dpkg-deb --build netxms-base output &&
 dpkg-deb --build netxms-agent output &&
 dpkg-deb --build netxms-server output &&
 dpkg-deb --build netxms-server-mysql output &&
+dpkg-deb --build netxms-server-oracle output &&
 dpkg-deb --build netxms-server-pgsql output &&
 dpkg-deb --build netxms-server-odbc output &&
 echo "Done."
index b324480..b934af8 100755 (executable)
@@ -4,6 +4,7 @@ rm -rf netxms-base
 rm -rf netxms-agent
 rm -rf netxms-server
 rm -rf netxms-server-mysql
+rm -rf netxms-server-oracle
 rm -rf netxms-server-pgsql
 rm -rf netxms-server-odbc
 rm -rf output/*
@@ -1,9 +1,9 @@
-Package: netxms-server
+Package: netxms-server-oracle
 Version: @version@
 Section: net
 Priority: optional
 Architecture: @arch@
 Essential: no
-Depends: netxms-agent (= @version@), libreadline5
+Depends: netxms-server (= @version@)
 Maintainer: Victor Kirhenshtein <victor@netxms.org>
-Description: NetXMS server
+Description: Oracle backend for NetXMS server
index df128d4..150f4bd 100644 (file)
@@ -4,6 +4,6 @@ Section: net
 Priority: optional
 Architecture: @arch@
 Essential: no
-Depends: netxms-agent (= @version@), libreadline5
+Depends: netxms-agent (= @version@), libreadline6
 Maintainer: Victor Kirhenshtein <victor@netxms.org>
 Description: NetXMS server
index fb0d1d1..b474f86 100755 (executable)
@@ -99,6 +99,7 @@ cp -P /usr/lib/libnxsms_nxagent.so* netxms-server/usr/lib/
 cp -P /usr/lib/libnxsms_portech.so* netxms-server/usr/lib/
 cp -P /usr/lib/libnxsnmp.so* netxms-server/usr/lib/
 cp -P /usr/lib/libnxsrv.so* netxms-server/usr/lib/
+cp -P /usr/lib/libstrophe.so* netxms-server/usr/lib/
 cp /usr/share/netxms/mibs/*.txt netxms-server/usr/share/netxms/mibs/
 cp /usr/share/netxms/sql/* netxms-server/usr/share/netxms/sql/
 cp ../../../contrib/startup/debian/netxmsd netxms-server/etc/init.d/
@@ -126,6 +127,17 @@ cat netxms-server-mysql.control | sed "s/@arch@/$ARCH/" | sed "s/@version@/$VERS
 cp /usr/lib/netxms/dbdrv/mysql.ddr netxms-server-mysql/usr/lib/netxms/dbdrv/
 cp -P /usr/lib/libnxddr_mysql.so* netxms-server-mysql/usr/lib/
 
+# netxms-server-oracle
+mkdir netxms-server-oracle
+mkdir netxms-server-oracle/DEBIAN
+mkdir netxms-server-oracle/usr
+mkdir netxms-server-oracle/usr/lib
+mkdir netxms-server-oracle/usr/lib/netxms
+mkdir netxms-server-oracle/usr/lib/netxms/dbdrv
+cat netxms-server-oracle.control | sed "s/@arch@/$ARCH/" | sed "s/@version@/$VERSION/" > netxms-server-oracle/DEBIAN/control
+cp /usr/lib/netxms/dbdrv/oracle.ddr netxms-server-oracle/usr/lib/netxms/dbdrv/
+cp -P /usr/lib/libnxddr_oracle.so* netxms-server-oracle/usr/lib/
+
 # netxms-server-odbc
 mkdir netxms-server-odbc
 mkdir netxms-server-odbc/DEBIAN
index 0c72dc0..cb25f5c 100644 (file)
@@ -800,6 +800,26 @@ INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description)
                '   4) Table row' CONCAT CRLF CONCAT
                '   5) Instance'
        );
+INSERT INTO event_cfg (event_code,event_name,severity,flags,message,description) VALUES
+       (
+               EVENT_IF_PEER_CHANGED, 'SYS_IF_PEER_CHANGED',
+               EVENT_SEVERITY_NORMAL, 1,
+               'New peer for interface %3 is %7 interface %10 (%12)',
+               'Generated when peer information for interface changes.' CONCAT CRLF CONCAT
+               'Parameters:' CONCAT CRLF CONCAT
+               '    1) Local interface object ID' CONCAT CRLF CONCAT
+               '    2) Local interface index' CONCAT CRLF CONCAT
+               '    3) Local interface name' CONCAT CRLF CONCAT
+               '    4) Local interface IP address' CONCAT CRLF CONCAT
+               '    5) Local interface MAC address' CONCAT CRLF CONCAT
+               '    6) Peer node object ID' CONCAT CRLF CONCAT
+               '    7) Peer node name' CONCAT CRLF CONCAT
+               '    8) Peer interface object ID' CONCAT CRLF CONCAT
+               '    9) Peer interface index' CONCAT CRLF CONCAT
+               '   10) Peer interface name' CONCAT CRLF CONCAT
+               '   11) Peer interface IP address' CONCAT CRLF CONCAT
+               '   12) Peer interface MAC address'
+       );
 
 /*
 ** SNMP traps
index 119eb07..5490cd4 100644 (file)
@@ -49,6 +49,7 @@ INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EnableAdminInterface','1',1,1);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EnableAgentRegistration','1',1,0);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EnableAuditLog','1',1,1);
+INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EnableCheckPointSNMP','0',1,1);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EnableEventStormDetection','0',1,1);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EnableISCListener','0',1,1);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EnableMultipleDBConnections','1',1,1);
@@ -56,11 +57,13 @@ INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EnableObjectTransactions','0',1,1);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EnableSNMPTraps','1',1,1);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EnableSyslogDaemon','0',1,1);
+INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EnableTimedAlarmAck','1',1,1);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EnableXMPPConnector','0',1,1);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EnableZoning','0',1,1);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EventLogRetentionTime','90',1,0);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EventStormDuration','15',1,1);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('EventStormEventsPerSecond','100',1,1);
+INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('ExtendedLogQueryAccessControl','0',1,0);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('ExternalAuditFacility','13',1,1);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('ExternalAuditPort','514',1,1);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart) VALUES ('ExternalAuditServer','none',1,1);
index c54ee67..b82042a 100644 (file)
 static ACTION *m_pActionList = NULL;
 static UINT32 m_dwNumActions = 0;
 
-
-//
-// Add action
-// 
-
+/**
+ * Add action
+ */ 
 BOOL AddAction(const TCHAR *pszName, int iType, const TCHAR *pArg, 
                LONG (*fpHandler)(const TCHAR *, StringList *, const TCHAR *),
                const TCHAR *pszSubAgent, const TCHAR *pszDescription)
@@ -44,37 +42,60 @@ BOOL AddAction(const TCHAR *pszName, int iType, const TCHAR *pArg,
    // Check if action with given name already registered
    for(i = 0; i < m_dwNumActions; i++)
       if (!_tcsicmp(m_pActionList[i].szName, pszName))
-         return FALSE;
+         break;
 
-   // Create new entry in action list
-   m_dwNumActions++;
-   m_pActionList = (ACTION *)realloc(m_pActionList, sizeof(ACTION) * m_dwNumActions);
-   nx_strncpy(m_pActionList[i].szName, pszName, MAX_PARAM_NAME);
-   m_pActionList[i].iType = iType;
-   nx_strncpy(m_pActionList[i].szDescription, pszDescription, MAX_DB_STRING);
-   switch(iType)
+   if (i == m_dwNumActions)
    {
-      case AGENT_ACTION_EXEC:
-      case AGENT_ACTION_SHELLEXEC:
-         m_pActionList[i].handler.pszCmdLine = _tcsdup(pArg);
-         break;
-      case AGENT_ACTION_SUBAGENT:
-         m_pActionList[i].handler.sa.fpHandler = fpHandler;
-         m_pActionList[i].handler.sa.pArg = pArg;
-         nx_strncpy(m_pActionList[i].handler.sa.szSubagentName, pszSubAgent,MAX_PATH);
-         break;
-      default:
-         break;
+      // Create new entry in action list
+      m_dwNumActions++;
+      m_pActionList = (ACTION *)realloc(m_pActionList, sizeof(ACTION) * m_dwNumActions);
+      nx_strncpy(m_pActionList[i].szName, pszName, MAX_PARAM_NAME);
+      m_pActionList[i].iType = iType;
+      nx_strncpy(m_pActionList[i].szDescription, pszDescription, MAX_DB_STRING);
+      switch(iType)
+      {
+         case AGENT_ACTION_EXEC:
+         case AGENT_ACTION_SHELLEXEC:
+            m_pActionList[i].handler.pszCmdLine = _tcsdup(pArg);
+            break;
+         case AGENT_ACTION_SUBAGENT:
+            m_pActionList[i].handler.sa.fpHandler = fpHandler;
+            m_pActionList[i].handler.sa.pArg = pArg;
+            nx_strncpy(m_pActionList[i].handler.sa.szSubagentName, pszSubAgent,MAX_PATH);
+            break;
+         default:
+            break;
+      }
+   }
+   else
+   {
+      // Update existing entry in action list
+      nx_strncpy(m_pActionList[i].szDescription, pszDescription, MAX_DB_STRING);
+      if ((m_pActionList[i].iType == AGENT_ACTION_EXEC) || (m_pActionList[i].iType == AGENT_ACTION_SHELLEXEC))
+         safe_free(m_pActionList[i].handler.pszCmdLine);
+      m_pActionList[i].iType = iType;
+      switch(iType)
+      {
+         case AGENT_ACTION_EXEC:
+         case AGENT_ACTION_SHELLEXEC:
+            m_pActionList[i].handler.pszCmdLine = _tcsdup(pArg);
+            break;
+         case AGENT_ACTION_SUBAGENT:
+            m_pActionList[i].handler.sa.fpHandler = fpHandler;
+            m_pActionList[i].handler.sa.pArg = pArg;
+            nx_strncpy(m_pActionList[i].handler.sa.szSubagentName, pszSubAgent,MAX_PATH);
+            break;
+         default:
+            break;
+      }
    }
    return TRUE;
 }
 
-
-//
-// Add action from config record
-// Accepts string of format <action_name>:<command_line>
-// 
-
+/**
+ * Add action from config record
+ * Accepts string of format <action_name>:<command_line>
+ */ 
 BOOL AddActionFromConfig(TCHAR *pszLine, BOOL bShellExec) //to be TCHAR
 {
    TCHAR *pCmdLine;
index 99cbce8..10df0ce 100644 (file)
@@ -60,6 +60,8 @@ int WatchdogMain(DWORD pid);
 
 void InitSessionList();
 
+BOOL RegisterOnServer(const TCHAR *pszServer);
+
 #if !defined(_WIN32)
 void InitStaticSubagents();
 #endif
@@ -108,6 +110,7 @@ extern const TCHAR *g_szMessages[];
  */
 UINT32 g_dwFlags = AF_ENABLE_ACTIONS | AF_ENABLE_AUTOLOAD;
 TCHAR g_szLogFile[MAX_PATH] = AGENT_DEFAULT_LOG;
+TCHAR g_szEncryptedSharedSecret[MAX_SECRET_LENGTH] = _T("");
 TCHAR g_szSharedSecret[MAX_SECRET_LENGTH] = _T("admin");
 TCHAR g_szConfigFile[MAX_PATH] = AGENT_DEFAULT_CONFIG;
 TCHAR g_szFileStore[MAX_PATH] = AGENT_DEFAULT_FILE_STORE;
@@ -221,6 +224,7 @@ static NX_CFG_TEMPLATE m_cfgTemplate[] =
    { _T("RequireEncryption"), CT_BOOLEAN, 0, 0, AF_REQUIRE_ENCRYPTION, 0, &g_dwFlags, NULL },
    { _T("Servers"), CT_STRING_LIST, ',', 0, 0, 0, &m_pszServerList, NULL },
    { _T("SessionIdleTimeout"), CT_LONG, 0, 0, 0, 0, &g_dwIdleTimeout, NULL },
+   { _T("EncryptedSharedSecret"), CT_STRING, 0, 0, MAX_SECRET_LENGTH, 0, g_szEncryptedSharedSecret, NULL },
    { _T("SharedSecret"), CT_STRING, 0, 0, MAX_SECRET_LENGTH, 0, g_szSharedSecret, NULL },
        { _T("SNMPTimeout"), CT_LONG, 0, 0, 0, 0, &g_dwSNMPTimeout, NULL },
    { _T("StartupDelay"), CT_LONG, 0, 0, 0, 0, &g_dwStartupDelay, NULL },
@@ -910,7 +914,12 @@ BOOL Initialize()
           {
          StartControlConnector();
       }
-       }
+
+       if (g_dwFlags & AF_REGISTER)
+      {
+         RegisterOnServer(g_szRegistrar);
+      }
+   }
 
 #if defined(_WIN32)
    m_hCondShutdown = ConditionCreate(TRUE);
@@ -1427,6 +1436,11 @@ int main(int argc, char *argv[])
                                g_config->loadConfigDirectory(g_szConfigIncludeDir, _T("agent"));
                                if (g_config->parseTemplate(_T("agent"), m_cfgTemplate))
                                {
+               if (g_szEncryptedSharedSecret[0] != 0)
+               {
+                  DecryptPassword(_T("netxms"), g_szEncryptedSharedSecret, g_szSharedSecret);
+               }
+
                // try to guess executable path
 #ifdef _WIN32
                GetModuleFileName(GetModuleHandle(NULL), s_executableName, MAX_PATH);
index 24fb3cb..1af1856 100644 (file)
@@ -48,16 +48,6 @@ BOOL RegisterOnServer(const TCHAR *pszServer)
    NXCPEncryptionContext *pDummyCtx = NULL;
    int nLen;
 
-#ifdef _WIN32
-   WSADATA wsaData;
-
-   if (WSAStartup(0x0202, &wsaData) != 0)
-   {
-      _tprintf(_T("ERROR: Unable to initialize Windows Sockets\n"));
-      return FALSE;
-   }
-#endif
-
    dwAddr = ResolveHostName(pszServer);
    if (dwAddr == INADDR_NONE)
    {
@@ -127,8 +117,5 @@ BOOL RegisterOnServer(const TCHAR *pszServer)
       closesocket(hSocket);
    }
 
-#ifdef _WIN32
-   WSACleanup();
-#endif
    return bRet;
 }
index 412f519..a50a826 100644 (file)
@@ -13,18 +13,20 @@ Source: "..\..\..\x64\release\appagent.dll"; DestDir: "{app}\bin"; Flags: ignore
 Source: "..\..\..\x64\release\libnxlp.dll"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\x64\release\libnxdb.dll"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\x64\release\nxagentd.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\x64\release\winnt.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\x64\release\winperf.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\x64\release\wmi.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\x64\release\dbquery.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\x64\release\ecs.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\x64\Release\informix.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\x64\release\logwatch.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\x64\release\netsvc.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\x64\release\odbcquery.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\x64\Release\oracle.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\x64\release\ping.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\x64\release\portcheck.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\x64\release\logwatch.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\x64\release\sms.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\x64\release\ups.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\x64\release\ecs.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\x64\release\odbcquery.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\x64\Release\informix.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\x64\Release\oracle.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\x64\release\winnt.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\x64\release\winperf.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\x64\release\wmi.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\x64\Release\informix.ddr"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\x64\Release\mssql.ddr"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\x64\Release\mysql.ddr"; DestDir: "{app}\bin"; Flags: ignoreversion
@@ -34,6 +36,7 @@ Source: "..\..\..\contrib\nxagentd.conf-dist"; DestDir: "{app}\etc"; Flags: igno
 Source: "..\..\..\x64\release\libexpat.dll"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\x64\release\libtre.dll"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\install\files\windows\x64\libeay32.dll"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\install\files\windows\x64\libcurl.dll"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\install\files\windows\x64\Microsoft.VC80.CRT\*"; DestDir: "{app}\bin\Microsoft.VC80.CRT"; Flags: ignoreversion
 ; Command-line tools
 Source: "..\..\..\x64\release\nxappget.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
index c866c23..fdae07f 100644 (file)
@@ -11,18 +11,20 @@ Source: "..\..\..\Release\libnxlp.dll"; DestDir: "{app}\bin"; Flags: ignoreversi
 Source: "..\..\..\Release\libnxdb.dll"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\Release\appagent.dll"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\Release\nxagentd.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\Release\winnt.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\Release\winperf.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\Release\wmi.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\Release\ping.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\Release\portcheck.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\Release\dbquery.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\Release\ecs.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\Release\informix.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\Release\logwatch.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\Release\netsvc.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\Release\odbcquery.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\Release\oracle.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\Release\ping.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\Release\portcheck.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\Release\sms.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\Release\ups.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\Release\informix.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
-Source: "..\..\..\Release\oracle.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\Release\winnt.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\Release\winperf.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\..\Release\wmi.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\Release\informix.ddr"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\Release\mssql.ddr"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\Release\mysql.ddr"; DestDir: "{app}\bin"; Flags: ignoreversion
@@ -32,6 +34,7 @@ Source: "..\..\..\contrib\nxagentd.conf-dist"; DestDir: "{app}\etc"; Flags: igno
 Source: "..\..\..\release\libexpat.dll"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\..\release\libtre.dll"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\install\files\windows\x86\libeay32.dll"; DestDir: "{app}\bin"; Flags: ignoreversion
+Source: "..\..\install\files\windows\x86\libcurl.dll"; DestDir: "{app}\bin"; Flags: ignoreversion
 Source: "..\..\install\files\windows\x86\Microsoft.VC80.CRT\*"; DestDir: "{app}\bin\Microsoft.VC80.CRT"; Flags: ignoreversion
 ; Command-line tools
 Source: "..\..\..\Release\nxappget.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
index 71331f7..a20c6eb 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ** NetXMS subagent for AIX
-** Copyright (C) 2004-2011 Victor Kirhenshtein
+** Copyright (C) 2004-2014 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
@@ -28,7 +28,7 @@
 //
 
 #define CPU_USAGE_SLOTS                        900             /* 60 sec * 15 min => 900 sec */
-#define MAX_CPU                                        (64 + 1)        /* 64 + 1 for overall */
+#define MAX_CPU                                        (4096 + 1)      /* + 1 for overall */
 
 static THREAD m_cpuUsageCollector = INVALID_THREAD_HANDLE;
 static MUTEX m_cpuUsageMutex = INVALID_MUTEX_HANDLE;
@@ -56,11 +56,9 @@ static double *m_cpuPhysicalUsageIoWait;
 static int m_currentSlot = 0;
 static int m_maxCPU = 0;
 
-
-//
-// Stats collector
-//
-
+/**
+ * Stats collector
+ */
 static void CpuUsageCollector()
 {
        uint64_t user = 0, system = 0, idle = 0, iowait = 0;
@@ -191,11 +189,9 @@ static void CpuUsageCollector()
        MutexUnlock(m_cpuUsageMutex);
 }
 
-
-//
-// Collector thread
-//
-
+/**
+ * Collector thread
+ */
 static THREAD_RESULT THREAD_CALL CpuUsageCollectorThread(void *arg)
 {
        AgentWriteDebugLog(1, "CPU usage collector thread started");
@@ -208,11 +204,9 @@ static THREAD_RESULT THREAD_CALL CpuUsageCollectorThread(void *arg)
        return THREAD_OK;
 }
 
-
-//
-// Start CPU usage collector
-//
-
+/**
+ * Start CPU usage collector
+ */
 void StartCpuUsageCollector()
 {
        int i, j;
index b74646d..24d4d8d 100644 (file)
@@ -258,24 +258,20 @@ static NETXMS_SUBAGENT_INFO m_info =
        0, NULL         // push parameters
 };
 
-
-//
-// Entry point for NetXMS agent
-//
-
+/**
+ * Entry point for NetXMS agent
+ */
 DECLARE_SUBAGENT_ENTRY_POINT(ECS)
 {
        *ppInfo = &m_info;
        return TRUE;
 }
 
-
-//
-// DLL entry point
-//
-
 #ifdef _WIN32
 
+/**
+ * DLL entry point
+ */
 BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
 {
    if (dwReason == DLL_PROCESS_ATTACH)
@@ -284,22 +280,3 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
 }
 
 #endif
-
-
-//
-// NetWare library entry point
-//
-
-#ifdef _NETWARE
-
-int _init(void)
-{
-       return 0;
-}
-
-int _fini(void)
-{
-       return 0;
-}
-
-#endif
index 3d943cc..c700f23 100644 (file)
@@ -6,7 +6,7 @@ netsvc_la_CPPFLAGS=-I@top_srcdir@/include
 netsvc_la_LDFLAGS = -module -avoid-version
 netsvc_la_LIBADD = ../../../libnetxms/libnetxms.la -lcurl
 
-EXTRA_DIST = netsvc.h
+EXTRA_DIST = netsvc.h netsvc.vcproj
 
 if !STATIC_BUILD
 install-exec-hook:
index 35ace29..68c4504 100644 (file)
@@ -36,10 +36,9 @@ UINT32 g_flags = NETSVC_AF_VERIFYPEER;
 char g_certBundle[1024] = {0};
 UINT32 g_timeout = 30;
 
-//
-// Config file definition
-//
-
+/**
+ * Config file definition
+ */
 static NX_CFG_TEMPLATE m_cfgTemplate[] =
 {
    { _T("VerifyPeer"), CT_BOOLEAN, 0, 0, NETSVC_AF_VERIFYPEER, 0, &g_flags },
@@ -48,11 +47,9 @@ static NX_CFG_TEMPLATE m_cfgTemplate[] =
    { _T(""), CT_END_OF_LIST, 0, 0, 0, 0, NULL }
 };
 
-
-//
-// Callback for processing data received from cURL
-//
-
+/**
+ * Callback for processing data received from cURL
+ */
 static size_t OnCurlDataReceived(char *ptr, size_t size, size_t nmemb, void *userdata)
 {
    // TODO: it assumed that size * nmemb will always fit into size_t
@@ -75,13 +72,11 @@ static size_t OnCurlDataReceived(char *ptr, size_t size, size_t nmemb, void *use
    return size * nmemb;
 }
 
-
-//
-// Handler for Service.Status(url, pattern)
-// 
-// TODO: Unicode support!
-//
-
+/**
+ * Handler for Service.Status(url, pattern)
+ * 
+ * TODO: Unicode support!
+ */
 static LONG H_CheckService(const TCHAR *parameters, const TCHAR *arg, TCHAR *value)
 {
    int ret = SYSINFO_RC_ERROR;
@@ -185,12 +180,11 @@ static LONG H_CheckService(const TCHAR *parameters, const TCHAR *arg, TCHAR *val
    return ret;
 }
 
-
-//
-// Subagent initialization
-//
-
-static BOOL SubagentInit(Config *config) {
+/**
+ * Subagent initialization
+ */
+static BOOL SubagentInit(Config *config) 
+{
    bool ret = false;
 
        config->parseTemplate(_T("netsvc"), m_cfgTemplate);
@@ -216,26 +210,25 @@ static BOOL SubagentInit(Config *config) {
    return ret;
 }
 
-//
-//
-// Called by master agent at unload
-//
-
+/**
+ * Called by master agent at unload
+ */
 static void SubagentShutdown()
 {
    curl_global_cleanup();
 }
 
-
-//
-// Subagent information
-//
-
+/**
+ * Provided parameters
+ */
 static NETXMS_SUBAGENT_PARAM m_parameters[] = 
 {
    { _T("Service.Check(*)"), H_CheckService, NULL, DCI_DT_INT, _T("Service {instance} status") },
 };
 
+/**
+ * Subagent information
+ */
 static NETXMS_SUBAGENT_INFO m_info = 
 {
    NETXMS_SUBAGENT_INFO_MAGIC,
@@ -249,12 +242,25 @@ static NETXMS_SUBAGENT_INFO m_info =
    0, NULL     // push parameters
 };
 
-//
-// Entry point for NetXMS agent
-//
-
+/**
+ * Entry point for NetXMS agent
+ */
 DECLARE_SUBAGENT_ENTRY_POINT(NETSVC)
 {
    *ppInfo = &m_info;
    return TRUE;
 }
+
+#ifdef _WIN32
+
+/**
+ * DLL entry point
+ */
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+{
+   if (dwReason == DLL_PROCESS_ATTACH)
+      DisableThreadLibraryCalls(hInstance);
+       return TRUE;
+}
+
+#endif
index 63e4a51..a1d158e 100644 (file)
@@ -32,8 +32,8 @@ enum
 
 typedef struct
 {
-   INT32 size;
-   INT32 allocated;
+   size_t size;
+   size_t allocated;
    char *data;
 } RequestData;
 
diff --git a/src/agent/subagents/netsvc/netsvc.vcproj b/src/agent/subagents/netsvc/netsvc.vcproj
new file mode 100644 (file)
index 0000000..0692b04
--- /dev/null
@@ -0,0 +1,388 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+       ProjectType="Visual C++"
+       Version="8.00"
+       Name="netsvc"
+       ProjectGUID="{17C5C5F3-3F13-47F4-8606-1EC9B5416DB2}"
+       RootNamespace="netsvc"
+       Keyword="Win32Proj"
+       >
+       <Platforms>
+               <Platform
+                       Name="Win32"
+               />
+               <Platform
+                       Name="x64"
+               />
+       </Platforms>
+       <ToolFiles>
+       </ToolFiles>
+       <Configurations>
+               <Configuration
+                       Name="Debug|Win32"
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+                       IntermediateDirectory="$(ConfigurationName)"
+                       ConfigurationType="2"
+                       CharacterSet="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\..\..\..\include"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;NETSVC_EXPORTS"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               Detect64BitPortabilityProblems="false"
+                               DebugInformationFormat="4"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="ws2_32.lib libcurl.lib"
+                               OutputFile="$(OutDir)\$(ProjectName).nsm"
+                               LinkIncremental="2"
+                               GenerateDebugInformation="true"
+                               SubSystem="2"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCWebDeploymentTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Debug|x64"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="2"
+                       CharacterSet="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\..\..\..\include"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;NETSVC_EXPORTS"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               Detect64BitPortabilityProblems="true"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="ws2_32.lib libcurl.lib"
+                               OutputFile="$(OutDir)\$(ProjectName).nsm"
+                               LinkIncremental="2"
+                               GenerateDebugInformation="true"
+                               SubSystem="2"
+                               TargetMachine="17"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCWebDeploymentTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|Win32"
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+                       IntermediateDirectory="$(ConfigurationName)"
+                       ConfigurationType="2"
+                       CharacterSet="1"
+                       WholeProgramOptimization="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               AdditionalIncludeDirectories="..\..\..\..\include"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;NETSVC_EXPORTS"
+                               RuntimeLibrary="2"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               Detect64BitPortabilityProblems="false"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="ws2_32.lib libcurl.lib"
+                               OutputFile="$(OutDir)\$(ProjectName).nsm"
+                               LinkIncremental="1"
+                               GenerateDebugInformation="true"
+                               SubSystem="2"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               TargetMachine="1"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCWebDeploymentTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|x64"
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                       ConfigurationType="2"
+                       CharacterSet="1"
+                       WholeProgramOptimization="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                               TargetEnvironment="3"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               AdditionalIncludeDirectories="..\..\..\..\include"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;NETSVC_EXPORTS"
+                               RuntimeLibrary="2"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               Detect64BitPortabilityProblems="true"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="ws2_32.lib libcurl.lib"
+                               OutputFile="$(OutDir)\$(ProjectName).nsm"
+                               LinkIncremental="1"
+                               GenerateDebugInformation="true"
+                               SubSystem="2"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               TargetMachine="17"
+                       />
+                       <Tool
+                               Name="VCALinkTool"
+                       />
+                       <Tool
+                               Name="VCManifestTool"
+                       />
+                       <Tool
+                               Name="VCXDCMakeTool"
+                       />
+                       <Tool
+                               Name="VCBscMakeTool"
+                       />
+                       <Tool
+                               Name="VCFxCopTool"
+                       />
+                       <Tool
+                               Name="VCAppVerifierTool"
+                       />
+                       <Tool
+                               Name="VCWebDeploymentTool"
+                       />
+                       <Tool
+                               Name="VCPostBuildEventTool"
+                       />
+               </Configuration>
+       </Configurations>
+       <References>
+       </References>
+       <Files>
+               <Filter
+                       Name="Source Files"
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+                       >
+                       <File
+                               RelativePath=".\main.cpp"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="Header Files"
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+                       >
+                       <File
+                               RelativePath=".\netsvc.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\..\..\include\nms_agent.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\..\..\include\nms_common.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\..\..\include\nms_threads.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\..\..\include\nms_util.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\..\..\include\nxlog.h"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="Resource Files"
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+                       >
+               </Filter>
+       </Files>
+       <Globals>
+       </Globals>
+</VisualStudioProject>
index 7c70f22..858a81a 100644 (file)
@@ -156,27 +156,29 @@ LONG getParameters(const TCHAR *parameter, const TCHAR *argument, TCHAR *value)
        return ret;
 }
 
+/**
+ * Config template
+ */
+static DatabaseInfo s_info;
+static TCHAR s_dbPassEncrypted[MAX_DB_STRING] = _T("");
+static NX_CFG_TEMPLATE s_configTemplate[] = 
+{
+       { _T("Id"),                                        CT_STRING, 0, 0, MAX_STR,       0, s_info.id },
+       { _T("Name"),                              CT_STRING, 0, 0, MAX_STR,       0, s_info.name },
+       { _T("TnsName"),                           CT_STRING, 0, 0, MAX_STR,       0, s_info.name },
+       { _T("UserName"),                          CT_STRING, 0, 0, MAX_USERNAME,  0, s_info.username },
+       { _T("Password"),                          CT_STRING, 0, 0, MAX_PASSWORD,  0, s_info.password },
+   { _T("EncryptedPassword"), CT_STRING, 0, 0, MAX_DB_STRING, 0, s_dbPassEncrypted },
+       { _T(""), CT_END_OF_LIST, 0, 0, 0, 0, NULL }
+};
 
 /*
  * Subagent initialization
  */
-
 static BOOL SubAgentInit(Config *config)
 {
        BOOL result = TRUE;
-       static DatabaseInfo info;
        int i;
-       TCHAR dbPassEncrypted[MAX_DB_STRING] = _T("");
-       static NX_CFG_TEMPLATE configTemplate[] = 
-       {
-               { _T("Id"),                                        CT_STRING, 0, 0, MAX_STR,       0, info.id },
-               { _T("Name"),                              CT_STRING, 0, 0, MAX_STR,       0, info.name },
-               { _T("TnsName"),                           CT_STRING, 0, 0, MAX_STR,       0, info.name },
-               { _T("UserName"),                          CT_STRING, 0, 0, MAX_USERNAME,  0, info.username },
-               { _T("Password"),                          CT_STRING, 0, 0, MAX_PASSWORD,  0, info.password },
-          { _T("EncryptedPassword"), CT_STRING, 0, 0, MAX_DB_STRING, 0, dbPassEncrypted },
-               { _T(""), CT_END_OF_LIST, 0, 0, 0, 0, NULL }
-       };
 
        // Init db driver
        g_driverHandle = DBLoadDriver(_T("oracle.ddr"), NULL, TRUE, NULL, NULL);
@@ -193,22 +195,21 @@ static BOOL SubAgentInit(Config *config)
 
        // Load configuration from "oracle" section to allow simple configuration
        // of one database without XML includes
-       memset(&info, 0, sizeof(info));
+       memset(&s_info, 0, sizeof(s_info));
        g_dbCount = -1;
-       if (config->parseTemplate(_T("ORACLE"), configTemplate))
+       if (config->parseTemplate(_T("ORACLE"), s_configTemplate))
        {
-               if (info.name[0] != 0)
+               if (s_info.name[0] != 0)
                {
-                       if (info.id[0] == 0)
-                               _tcscpy(info.id, info.name);
-                       memcpy(&g_dbInfo[++g_dbCount], &info, sizeof(DatabaseInfo));
+                       if (s_info.id[0] == 0)
+                               _tcscpy(s_info.id, s_info.name);
+         if (*s_dbPassEncrypted != 0)
+         {
+            DecryptPassword(s_info.username, s_dbPassEncrypted, s_info.password);
+         }
+                       memcpy(&g_dbInfo[++g_dbCount], &s_info, sizeof(DatabaseInfo));
                        g_dbInfo[g_dbCount].accessMutex = MutexCreate();
                }
-
-          if (*dbPassEncrypted != '\0')
-          {
-             DecryptPassword(info.username, dbPassEncrypted, info.password);
-          }
        }
 
        // Load full-featured XML configuration
@@ -217,29 +218,29 @@ static BOOL SubAgentInit(Config *config)
                for (i = 1; result && i <= MAX_DATABASES; i++)
                {
                        TCHAR section[MAX_STR];
-                       memset((void*)&info, 0, sizeof(info));
+                       memset((void*)&s_info, 0, sizeof(s_info));
                        _sntprintf(section, MAX_STR, _T("oracle/databases/database#%d"), i);
-                       dbPassEncrypted[0] = _T('\0');
+                       s_dbPassEncrypted[0] = 0;
 
-                       if ((result = config->parseTemplate(section, configTemplate)) != TRUE)
+                       if ((result = config->parseTemplate(section, s_configTemplate)) != TRUE)
                        {
                                AgentWriteLog(EVENTLOG_ERROR_TYPE, _T("%s: error parsing configuration template"), MYNAMESTR);
                                return FALSE;
                        }
-                       if (info.name[0] != _T('\0'))
-                               memcpy((void*)&g_dbInfo[++g_dbCount], (void*)&info, sizeof(info));
+                       if (s_info.name[0] != 0)
+                               memcpy(&g_dbInfo[++g_dbCount], &s_info, sizeof(s_info));
                        else
                                continue;
-                       if (info.username[0] == '\0')
+                       if (s_info.username[0] == 0)
                        {
                                AgentWriteLog(EVENTLOG_ERROR_TYPE, _T("%s: error getting username for "), MYNAMESTR);
                                result = FALSE;
                        }
-         if (*dbPassEncrypted != _T('\0'))
+         if (*s_dbPassEncrypted != _T('\0'))
          {
-            result = DecryptPassword(info.username, dbPassEncrypted, info.password);
+            result = DecryptPassword(s_info.username, s_dbPassEncrypted, s_info.password);
          }
-         if (info.password[0] == '\0')
+         if (s_info.password[0] == '\0')
          {
             AgentWriteLog(EVENTLOG_ERROR_TYPE, _T("%s: error getting password for "), MYNAMESTR);
             result = FALSE;
@@ -274,7 +275,7 @@ static BOOL SubAgentInit(Config *config)
 // Shutdown handler
 //
 
-static void SubAgentShutdown(void)
+static void SubAgentShutdown()
 {
        AgentWriteLog(EVENTLOG_INFORMATION_TYPE, _T("%s: shutting down"), MYNAMESTR);
        ConditionSet(g_shutdownCondition);
@@ -332,6 +333,10 @@ THREAD_RESULT THREAD_CALL queryThread(void* arg)
                        db.connected = true;
                        db.version = getOracleVersion(db.handle);
                }
+      else
+      {
+         AgentWriteLog(EVENTLOG_ERROR_TYPE, _T("%s: can't connect to DB: %s"), MYNAMESTR, errorText);
+      }
 
                while (db.connected)
                {
@@ -423,8 +428,6 @@ bool getParametersFromDB( int dbIndex )
 //
 // Subagent information
 //
-
-
 static NETXMS_SUBAGENT_PARAM m_parameters[] =
 {
        { _T("Oracle.Sessions.Count(*)"), getParameters, _T("X"), DCI_DT_INT, _T("Oracle/Sessions: Number of sessions opened") },
index 9ab2096..b48715b 100644 (file)
@@ -310,6 +310,10 @@ static bool ReadVMInfo(kstat_ctl_t *kc, struct vminfo *info)
  */
 static time_t s_lastSwapInfoUpdate = 0;
 static MUTEX s_swapInfoMutex = MutexCreate();
+
+/**
+ * All swap counters are in blocks
+ */
 static UINT64 s_swapUsed = 0;
 static UINT64 s_swapFree = 0;
 static UINT64 s_swapTotal = 0;
@@ -319,7 +323,7 @@ static UINT64 s_swapTotal = 0;
  */
 static void UpdateSwapInfo()
 {
-   static char METHOD_NAME[16] = "UpdateSwapInfo";
+   static TCHAR METHOD_NAME[] = _T("UpdateSwapInfo");
 
    int num = swapctl(SC_GETNSWP, NULL);
    if (num == -1)
@@ -328,16 +332,17 @@ static void UpdateSwapInfo()
       return;
    }
 
-   swaptable *swapTable = (swaptable *)malloc(num * sizeof(swapent_t) + sizeof(swaptable));
+   swaptbl_t *swapTable = (swaptbl_t *)malloc(num * sizeof(swapent_t) + sizeof(swaptbl_t));
    if (swapTable == NULL)
    {
       AgentWriteDebugLog(6, _T("%s: %s: failed to allocate the swap table"), AGENT_NAME, METHOD_NAME);
       return;
    }
    swapTable->swt_n = num;
+   char buffer[MAXPATHLEN];
    for (int i = 0; i < num; i++)
    {
-      swapTable[i].swt_ent[i].ste_path = (char *)malloc(sizeof(TCHAR) * MAXPATHLEN);
+      swapTable->swt_ent[i].ste_path = buffer;
    }
 
    int ret = swapctl(SC_LIST, swapTable);
@@ -348,15 +353,14 @@ static void UpdateSwapInfo()
       return;
    }
 
-   UINT64 freeBytes = 0, totalBytes = 0;
-   int bytesPerPage = (int)((sysconf(_SC_PAGESIZE) >> DEV_BSHIFT) * DEV_BSIZE);
+   UINT64 totalBytes = 0;
+   UINT64 freeBytes = 0;
 
    swapent *swapEntry = swapTable->swt_ent;
    for(int i = 0; i < num; i++)
    {
-      totalBytes += (INT64)swapEntry[i].ste_pages * bytesPerPage;
-      freeBytes += (INT64)swapEntry[i].ste_free * bytesPerPage;
-      free(swapEntry[i].ste_path);
+      totalBytes += (INT64)swapEntry[i].ste_pages;
+      freeBytes += (INT64)swapEntry[i].ste_free;
    }
 
    free(swapTable);
@@ -424,69 +428,65 @@ LONG H_MemoryInfo(const TCHAR *pszParam, const TCHAR *pArg, TCHAR *pValue)
          nRet = ReadKStatValue("unix", 0, "system_pages", "freemem", NULL, &kn);
          if (nRet == SYSINFO_RC_SUCCESS)
          {
-            ret_double(pValue, (double)(sysconf(_SC_PHYS_PAGES) - kn.value.ul) * 100.0 /  (double)sysconf(_SC_PHYS_PAGES));
+            ret_double(pValue, (double)(sysconf(_SC_PHYS_PAGES) - kn.value.ul) * 100.0 / sysconf(_SC_PHYS_PAGES));
          }
          break;
       case MEMINFO_SWAP_TOTAL:
-         ret_uint64(pValue, GetSwapCounter(&s_swapTotal));
+         ret_uint64(pValue, GetSwapCounter(&s_swapTotal) * qwPageSize);
          break;
       case MEMINFO_SWAP_FREE:
-         ret_uint64(pValue, GetSwapCounter(&s_swapFree));
+         ret_uint64(pValue, GetSwapCounter(&s_swapFree) * qwPageSize);
          break;
       case MEMINFO_SWAP_FREEPCT:
          {
             GetSwapCounter(&s_swapTotal);
-            ret_double(pValue, s_swapTotal == 0 ? 0 : (double)GetSwapCounter(&s_swapFree) * 100.0 / (double)s_swapTotal);
+            ret_double(pValue, s_swapTotal == 0 ? 0 : (double)GetSwapCounter(&s_swapFree) * 100.0 / s_swapTotal);
          }
          break;
       case MEMINFO_SWAP_USED:
-         ret_uint64(pValue, GetSwapCounter(&s_swapUsed));
+         ret_uint64(pValue, GetSwapCounter(&s_swapUsed) * qwPageSize);
          break;
       case MEMINFO_SWAP_USEDPCT:
          {
             GetSwapCounter(&s_swapTotal);
-            ret_double(pValue, s_swapTotal == 0 ? 0 : (double)GetSwapCounter(&s_swapUsed) * 100.0 / (double)s_swapTotal);
+            ret_double(pValue, s_swapTotal == 0 ? 0 : (double)GetSwapCounter(&s_swapUsed) * 100.0 / s_swapTotal);
          }
          break;
       case MEMINFO_VIRTUAL_TOTAL:
-         ret_uint64(pValue, ((QWORD)sysconf(_SC_PHYS_PAGES) * qwPageSize) + GetSwapCounter(&s_swapTotal));
+         ret_uint64(pValue, ((UINT64)sysconf(_SC_PHYS_PAGES) + GetSwapCounter(&s_swapTotal)) * qwPageSize);
          break;
       case MEMINFO_VIRTUAL_FREE:
          nRet = ReadKStatValue("unix", 0, "system_pages", "freemem", NULL, &kn);
          if (nRet == SYSINFO_RC_SUCCESS)
          {
-            ret_uint64(pValue, ((QWORD)kn.value.ul * qwPageSize) + GetSwapCounter(&s_swapFree));
+            ret_uint64(pValue, ((UINT64)kn.value.ul + GetSwapCounter(&s_swapFree)) * qwPageSize);
          }
          break;
       case MEMINFO_VIRTUAL_FREEPCT:
          nRet = ReadKStatValue("unix", 0, "system_pages", "freemem", NULL, &kn);
          if (nRet == SYSINFO_RC_SUCCESS)
          {
-            ret_double(pValue,
-                  (((double)kn.value.ul * qwPageSize) + (double)GetSwapCounter(&s_swapFree))
-                  /
-                  (((double)sysconf(_SC_PHYS_PAGES) * qwPageSize) + (double)GetSwapCounter(&s_swapTotal))
-                  * 100.0
-            );
+            UINT64 freeMem = (UINT64)kn.value.ul + GetSwapCounter(&s_swapFree);
+            UINT64 totalMem = (UINT64)sysconf(_SC_PHYS_PAGES) + GetSwapCounter(&s_swapTotal);
+
+            ret_double(pValue, (double)(freeMem * 100) / totalMem);
          }
          break;
       case MEMINFO_VIRTUAL_USED:
          nRet = ReadKStatValue("unix", 0, "system_pages", "freemem", NULL, &kn);
          if (nRet == SYSINFO_RC_SUCCESS)
          {
-            ret_uint64(pValue, ((QWORD)(sysconf(_SC_PHYS_PAGES) - kn.value.ul) * qwPageSize) + GetSwapCounter(&s_swapUsed));
+            ret_uint64(pValue, (UINT64)(sysconf(_SC_PHYS_PAGES) - kn.value.ul + GetSwapCounter(&s_swapUsed)) * qwPageSize);
          }
          break;
       case MEMINFO_VIRTUAL_USEDPCT:
          nRet = ReadKStatValue("unix", 0, "system_pages", "freemem", NULL, &kn);
          if (nRet == SYSINFO_RC_SUCCESS)
          {
-            ret_double(pValue,
-                  (((double)(sysconf(_SC_PHYS_PAGES) - kn.value.ul) * qwPageSize) + (double)GetSwapCounter(&s_swapUsed))
-                  /
-                  (((double)sysconf(_SC_PHYS_PAGES) * qwPageSize) + (double)GetSwapCounter(&s_swapTotal))
-                  * 100.0
-            );
+            UINT64 freeMem = (UINT64)kn.value.ul + GetSwapCounter(&s_swapFree);
+            UINT64 totalMem = (UINT64)sysconf(_SC_PHYS_PAGES) + GetSwapCounter(&s_swapTotal);
+
+            ret_double(pValue, (double)(totalMem - freeMem) * 100.0 / totalMem);
          }
          break;
       default:
index 74c1646..6a665a6 100644 (file)
@@ -3,8 +3,8 @@
 
 [Setup]
 AppName=NetXMS Management Console
-AppVerName=NetXMS Management Console 1.2.11
-AppVersion=1.2.11
+AppVerName=NetXMS Management Console 1.2.12
+AppVersion=1.2.12
 AppPublisher=NetXMS Team
 AppPublisherURL=http://www.netxms.org
 AppSupportURL=http://www.netxms.org
@@ -13,7 +13,7 @@ DefaultDirName={pf}\NetXMS Management Console
 DefaultGroupName=NetXMS
 AllowNoIcons=yes
 LicenseFile=..\..\..\GPL.txt
-OutputBaseFilename=netxms-console-1.2.11
+OutputBaseFilename=netxms-console-1.2.12
 Compression=lzma
 SolidCompression=yes
 LanguageDetectionMethod=none
index 78ac506..ce82ca7 100644 (file)
@@ -790,11 +790,9 @@ extern "C" void EXPORT DrvFreeResult(DBDRV_RESULT pResult)
        }
 }
 
-
-//
-// Perform asynchronous SELECT query
-//
-
+/**
+ * Perform asynchronous SELECT query
+ */
 extern "C" DBDRV_ASYNC_RESULT EXPORT DrvAsyncSelect(PG_CONN *pConn, WCHAR *pwszQuery, DWORD *pdwError, WCHAR *errorText)
 {
        BOOL bSuccess = FALSE;
@@ -816,6 +814,7 @@ extern "C" DBDRV_ASYNC_RESULT EXPORT DrvAsyncSelect(PG_CONN *pConn, WCHAR *pwszQ
                   strcat(pszReq, pszQueryUTF8);
                   if (UnsafeDrvQuery(pConn, pszReq, errorText))
                   {
+            ((PG_CONN *)pConn)->pFetchBuffer = PQdescribePortal(pConn->pHandle, "cur1");
                           bSuccess = TRUE;
                   }
                   free(pszReq);
@@ -840,11 +839,9 @@ extern "C" DBDRV_ASYNC_RESULT EXPORT DrvAsyncSelect(PG_CONN *pConn, WCHAR *pwszQ
        return (DBDRV_ASYNC_RESULT)pConn;
 }
 
-
-//
-// Fetch next result line from asynchronous SELECT results
-//
-
+/**
+ * Fetch next result line from asynchronous SELECT results
+ */
 extern "C" BOOL EXPORT DrvFetch(DBDRV_ASYNC_RESULT pConn)
 {
    BOOL bResult = TRUE;
@@ -876,11 +873,9 @@ extern "C" BOOL EXPORT DrvFetch(DBDRV_ASYNC_RESULT pConn)
    return bResult;
 }
 
-
-//
-// Get field length from async quety result
-//
-
+/**
+ * Get field length from async quety result
+ */
 extern "C" LONG EXPORT DrvGetFieldLengthAsync(PG_CONN *pConn, int nColumn)
 {
        if ((pConn == NULL) || (pConn->pFetchBuffer == NULL))
@@ -903,16 +898,10 @@ extern "C" LONG EXPORT DrvGetFieldLengthAsync(PG_CONN *pConn, int nColumn)
        return (LONG)strlen(value);
 }
 
-
-//
-// Get field from current row in async query result
-//
-
-extern "C" WCHAR EXPORT *DrvGetFieldAsync(
-               PG_CONN *pConn,
-               int nColumn,
-               WCHAR *pBuffer,
-               int nBufSize)
+/**
+ * Get field from current row in async query result
+ */
+extern "C" WCHAR EXPORT *DrvGetFieldAsync(PG_CONN *pConn, int nColumn, WCHAR *pBuffer, int nBufSize)
 {
        char *pszResult;
 
@@ -954,14 +943,12 @@ extern "C" WCHAR EXPORT *DrvGetFieldAsync(
    return pBuffer;
 }
 
-
-//
-// Get column count in async query result
-//
-
+/**
+ * Get column count in async query result
+ */
 extern "C" int EXPORT DrvGetColumnCountAsync(DBDRV_ASYNC_RESULT hResult)
 {
-       return ((hResult != NULL) && (((PG_CONN *)hResult)->pFetchBuffer != NULL))? PQnfields(((PG_CONN *)hResult)->pFetchBuffer) : 0;
+       return ((hResult != NULL) && (((PG_CONN *)hResult)->pFetchBuffer != NULL)) ? PQnfields(((PG_CONN *)hResult)->pFetchBuffer) : 0;
 }
 
 /**
index 291dbc6..96ac60c 100644 (file)
 
 #include "libnxdb.h"
 
-/**
- * Pool connection information
- */
-struct PoolConnectionInfo
-{
-   DB_HANDLE handle;
-   bool inUse;
-   time_t lastAccessTime;
-   time_t connectTime;
-};
-
 static DB_DRIVER m_driver;
 static TCHAR m_server[256];
 static TCHAR m_login[256];
@@ -69,6 +58,8 @@ static void DBConnectionPoolPopulate()
          conn->inUse = false;
          conn->connectTime = time(NULL);
          conn->lastAccessTime = conn->connectTime;
+         conn->srcFile[0] = 0;
+         conn->srcLine = 0;
          m_connections.add(conn);
       }
       else
@@ -216,7 +207,7 @@ void LIBNXDB_EXPORTABLE DBConnectionPoolShutdown()
  * Acquire connection from pool. This function never fails - if it's impossible to acquire
  * pooled connection, fallback connection will be returned.
  */
-DB_HANDLE LIBNXDB_EXPORTABLE DBConnectionPoolAcquireConnection()
+DB_HANDLE LIBNXDB_EXPORTABLE __DBConnectionPoolAcquireConnection(const char *srcFile, int srcLine)
 {
        MutexLock(m_poolAccessMutex);
 
@@ -228,6 +219,9 @@ DB_HANDLE LIBNXDB_EXPORTABLE DBConnectionPoolAcquireConnection()
                {
                        handle = conn->handle;
                        conn->inUse = true;
+         conn->lastAccessTime = time(NULL);
+         strncpy(conn->srcFile, srcFile, 128);
+         conn->srcLine = srcLine;
                        break;
                }
        }
@@ -242,6 +236,8 @@ DB_HANDLE LIBNXDB_EXPORTABLE DBConnectionPoolAcquireConnection()
          conn->inUse = true;
          conn->connectTime = time(NULL);
          conn->lastAccessTime = conn->connectTime;
+         strncpy(conn->srcFile, srcFile, 128);
+         conn->srcLine = srcLine;
          m_connections.add(conn);
          handle = conn->handle;
       }
@@ -280,6 +276,8 @@ void LIBNXDB_EXPORTABLE DBConnectionPoolReleaseConnection(DB_HANDLE handle)
                {
          conn->inUse = false;
          conn->lastAccessTime = time(NULL);
+         conn->srcFile[0] = 0;
+         conn->srcLine = 0;
                        break;
                }
        }
@@ -311,3 +309,20 @@ int LIBNXDB_EXPORTABLE DBConnectionPoolGetAcquiredCount()
        MutexUnlock(m_poolAccessMutex);
    return count;
 }
+
+/**
+ * Get copy of active DB connections.
+ * Returned list must be deleted by the caller.
+ */
+ObjectArray<PoolConnectionInfo> LIBNXDB_EXPORTABLE *DBConnectionPoolGetConnectionList()
+{
+   ObjectArray<PoolConnectionInfo> *list = new ObjectArray<PoolConnectionInfo>(32, 32, true);
+       MutexLock(m_poolAccessMutex);
+   for(int i = 0; i < m_connections.size(); i++)
+      if (m_connections.get(i)->inUse)
+      {
+         list->add((PoolConnectionInfo *)nx_memdup(m_connections.get(i), sizeof(PoolConnectionInfo)));
+      }
+       MutexUnlock(m_poolAccessMutex);
+   return list;
+}
index be58215..c8d5907 100644 (file)
@@ -482,11 +482,9 @@ UINT32 LIBNXDB_EXPORTABLE DBGetFieldULong(DB_RESULT hResult, int iRow, int iColu
    return dwVal;
 }
 
-
-//
-// Get field's value as unsigned 64-bit int
-//
-
+/**
+ * Get field's value as unsigned 64-bit int
+ */
 UINT64 LIBNXDB_EXPORTABLE DBGetFieldUInt64(DB_RESULT hResult, int iRow, int iColumn)
 {
    INT64 iVal;
@@ -509,11 +507,9 @@ UINT64 LIBNXDB_EXPORTABLE DBGetFieldUInt64(DB_RESULT hResult, int iRow, int iCol
    return qwVal;
 }
 
-
-//
-// Get field's value as signed long
-//
-
+/**
+ * Get field's value as signed long
+ */
 INT32 LIBNXDB_EXPORTABLE DBGetFieldLong(DB_RESULT hResult, int iRow, int iColumn)
 {
    TCHAR *pszVal, szBuffer[256];
index 7596446..9b07ee9 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 7596446cd7c2bff66099f2dba5972a37a3ef820b
+Subproject commit 9b07ee93095e604f8583fe419e17d90775f4d0b6
index e2cf317..56e69fc 100644 (file)
@@ -2,7 +2,7 @@
 ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
 
 #include "setup.iss"
-OutputBaseFilename=netxms-1.2.11-minimal
+OutputBaseFilename=netxms-1.2.12-minimal
 
 [Components]
 Name: "base"; Description: "Base Files"; Types: full compact custom; Flags: fixed
@@ -88,28 +88,32 @@ Source: "..\..\..\Release\nxsnmpset.exe"; DestDir: "{app}\bin"; Flags: ignorever
 Source: "..\..\..\Release\nxupload.exe"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\Release\nxmibc.exe"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\Release\nxagentd.exe"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\winnt.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\winnt.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\Release\winperf.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\winperf.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\Release\wmi.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\wmi.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\Release\ping.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\ping.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\Release\portcheck.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\portcheck.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\dbquery.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\dbquery.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\Release\ecs.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\Release\ecs.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\informix.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\informix.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\Release\logwatch.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\Release\logwatch.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\Release\ups.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\ups.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\netsvc.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\netsvc.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\Release\odbcquery.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\Release\odbcquery.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\Release\informix.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\informix.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\Release\oracle.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\Release\oracle.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\ping.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\ping.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\portcheck.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\portcheck.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\ups.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\ups.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\winnt.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\winnt.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\winperf.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\winperf.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\wmi.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\wmi.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\Release\at.ndd"; DestDir: "{app}\lib\ndd"; Flags: ignoreversion; Components: server
 Source: "..\..\..\Release\at.pdb"; DestDir: "{app}\lib\ndd"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\Release\avaya-ers.dll"; DestDir: "{app}\lib\ndd"; Flags: ignoreversion; Components: server
@@ -163,6 +167,7 @@ Source: "..\..\..\Release\nxappget.exe"; DestDir: "{app}\bin"; Flags: ignorevers
 ; Third party files
 Source: "..\files\windows\x86\libeay32.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: base
 Source: "..\files\windows\x86\ssleay32.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: base
+Source: "..\files\windows\x86\libcurl.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 ; Install-time files
 Source: "..\files\windows\x86\vcredist_x86.exe"; DestDir: "{app}\var"; DestName: "vcredist.exe"; Flags: ignoreversion deleteafterinstall; Components: base
 Source: "..\files\windows\x86\rm.exe"; DestDir: "{app}\var"; Flags: ignoreversion deleteafterinstall; Components: base
index 34bbc93..ffceb79 100644 (file)
@@ -1,7 +1,7 @@
 ; Installation script for NetXMS Server / Windows x64
 
 #include "setup.iss"
-OutputBaseFilename=netxms-1.2.11-x64-minimal
+OutputBaseFilename=netxms-1.2.12-x64-minimal
 ArchitecturesInstallIn64BitMode=x64
 ArchitecturesAllowed=x64
 
@@ -89,28 +89,32 @@ Source: "..\..\..\x64\Release\nxsnmpset.exe"; DestDir: "{app}\bin"; Flags: ignor
 Source: "..\..\..\x64\Release\nxupload.exe"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\x64\Release\nxmibc.exe"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\x64\Release\nxagentd.exe"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\winnt.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\winnt.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\x64\Release\winperf.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\winperf.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\x64\Release\wmi.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\wmi.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\x64\Release\ping.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\ping.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\x64\Release\portcheck.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\portcheck.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\dbquery.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\dbquery.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\x64\Release\ecs.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\x64\Release\ecs.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\informix.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\informix.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\x64\Release\logwatch.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\x64\Release\logwatch.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\x64\Release\ups.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\ups.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\netsvc.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\netsvc.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\x64\Release\odbcquery.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\x64\Release\odbcquery.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\x64\Release\informix.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\informix.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\x64\Release\oracle.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\x64\Release\oracle.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\ping.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\ping.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\portcheck.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\portcheck.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\ups.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\ups.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\winnt.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\winnt.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\winperf.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\winperf.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\wmi.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\wmi.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\x64\Release\at.ndd"; DestDir: "{app}\lib\ndd"; Flags: ignoreversion; Components: server
 Source: "..\..\..\x64\Release\at.pdb"; DestDir: "{app}\lib\ndd"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\x64\Release\avaya-ers.dll"; DestDir: "{app}\lib\ndd"; Flags: ignoreversion; Components: server
@@ -163,6 +167,7 @@ Source: "..\..\..\x64\Release\nxappget.exe"; DestDir: "{app}\bin"; Flags: ignore
 ; Third party files
 Source: "..\files\windows\x64\libeay32.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: base
 Source: "..\files\windows\x64\ssleay32.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: base
+Source: "..\files\windows\x64\libcurl.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 ; Install-time files
 Source: "..\files\windows\x64\vcredist_x64.exe"; DestDir: "{app}\var"; DestName: "vcredist.exe"; Flags: ignoreversion deleteafterinstall; Components: base
 Source: "..\files\windows\x86\rm.exe"; DestDir: "{app}\var"; Flags: ignoreversion deleteafterinstall; Components: base
index dc96116..cf709c8 100644 (file)
@@ -1,7 +1,7 @@
 ; Installation script for NetXMS Server / Windows x64
 
 #include "setup.iss"
-OutputBaseFilename=netxms-1.2.11-x64
+OutputBaseFilename=netxms-1.2.12-x64
 ArchitecturesInstallIn64BitMode=x64
 ArchitecturesAllowed=x64
 
@@ -95,28 +95,32 @@ Source: "..\..\..\x64\Release\nxsnmpset.exe"; DestDir: "{app}\bin"; Flags: ignor
 Source: "..\..\..\x64\Release\nxupload.exe"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\x64\Release\nxmibc.exe"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\x64\Release\nxagentd.exe"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\winnt.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\winnt.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\x64\Release\winperf.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\winperf.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\x64\Release\wmi.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\wmi.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\x64\Release\ping.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\ping.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\x64\Release\portcheck.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\portcheck.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\dbquery.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\dbquery.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\x64\Release\ecs.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\x64\Release\ecs.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\informix.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\informix.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\x64\Release\logwatch.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\x64\Release\logwatch.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\x64\Release\ups.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\ups.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\netsvc.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\netsvc.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\x64\Release\odbcquery.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\x64\Release\odbcquery.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\x64\Release\informix.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\x64\Release\informix.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\x64\Release\oracle.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\x64\Release\oracle.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\ping.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\ping.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\portcheck.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\portcheck.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\ups.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\ups.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\winnt.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\winnt.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\winperf.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\winperf.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\x64\Release\wmi.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\x64\Release\wmi.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\x64\Release\at.ndd"; DestDir: "{app}\lib\ndd"; Flags: ignoreversion; Components: server
 Source: "..\..\..\x64\Release\at.pdb"; DestDir: "{app}\lib\ndd"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\x64\Release\avaya-ers.dll"; DestDir: "{app}\lib\ndd"; Flags: ignoreversion; Components: server
@@ -183,6 +187,7 @@ Source: "..\..\..\x64\Release\nxappget.exe"; DestDir: "{app}\bin"; Flags: ignore
 ; Third party files
 Source: "..\files\windows\x64\libeay32.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: base
 Source: "..\files\windows\x64\ssleay32.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: base
+Source: "..\files\windows\x64\libcurl.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\files\windows\x64\libmysql.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server\mysql
 Source: "..\files\windows\x64\libpq.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server\pgsql
 Source: "..\files\windows\x64\libintl.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server\pgsql
index 95e8b46..c95df4e 100644 (file)
@@ -2,7 +2,7 @@
 ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
 
 #include "setup.iss"
-OutputBaseFilename=netxms-1.2.11
+OutputBaseFilename=netxms-1.2.12
 
 [Components]
 Name: "base"; Description: "Base Files"; Types: full compact custom; Flags: fixed
@@ -94,28 +94,32 @@ Source: "..\..\..\Release\nxsnmpset.exe"; DestDir: "{app}\bin"; Flags: ignorever
 Source: "..\..\..\Release\nxupload.exe"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\Release\nxmibc.exe"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\Release\nxagentd.exe"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\winnt.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\winnt.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\Release\winperf.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\winperf.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\Release\wmi.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\wmi.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\Release\ping.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\ping.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\Release\portcheck.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\portcheck.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\dbquery.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\dbquery.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\Release\ecs.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\Release\ecs.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\informix.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\informix.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\Release\logwatch.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\Release\logwatch.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\Release\ups.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\ups.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\netsvc.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\netsvc.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\Release\odbcquery.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\Release\odbcquery.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
-Source: "..\..\..\Release\informix.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
-Source: "..\..\..\Release\informix.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\Release\oracle.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\..\..\Release\oracle.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\ping.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\ping.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\portcheck.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\portcheck.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\ups.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\ups.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\winnt.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\winnt.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\winperf.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\winperf.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
+Source: "..\..\..\Release\wmi.nsm"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
+Source: "..\..\..\Release\wmi.pdb"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\Release\at.ndd"; DestDir: "{app}\lib\ndd"; Flags: ignoreversion; Components: server
 Source: "..\..\..\Release\at.pdb"; DestDir: "{app}\lib\ndd"; Flags: ignoreversion; Components: server and pdb
 Source: "..\..\..\Release\avaya-ers.dll"; DestDir: "{app}\lib\ndd"; Flags: ignoreversion; Components: server
@@ -189,6 +193,7 @@ Source: "..\files\windows\x86\oci.dll"; DestDir: "{app}\bin"; Flags: ignoreversi
 Source: "..\files\windows\x86\oraociei11.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server\oracle
 Source: "..\files\windows\x86\ssleay32.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: base
 Source: "..\files\windows\x86\libeay32.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: base
+Source: "..\files\windows\x86\libcurl.dll"; DestDir: "{app}\bin"; Flags: ignoreversion; Components: server
 Source: "..\files\windows\x86\jre\*"; DestDir: "{app}\bin\jre"; Flags: ignoreversion recursesubdirs; Components: jre
 ; Install-time files
 Source: "..\files\windows\x86\vcredist_x86.exe"; DestDir: "{app}\var"; DestName: "vcredist.exe"; Flags: ignoreversion deleteafterinstall; Components: base
index 66b2eb8..21b65da 100644 (file)
@@ -1,7 +1,7 @@
 [Setup]
 AppName=NetXMS WebUI
-AppVerName=NetXMS WebUI 1.2.11
-AppVersion=1.2.11
+AppVerName=NetXMS WebUI 1.2.12
+AppVersion=1.2.12
 AppPublisher=Raden Solutions
 AppPublisherURL=http://www.radensolutions.com
 AppSupportURL=http://www.netxms.org
index f846d0b..86a4649 100644 (file)
@@ -1,7 +1,7 @@
 [Setup]
 AppName=NetXMS
-AppVerName=NetXMS 1.2.11
-AppVersion=1.2.11
+AppVerName=NetXMS 1.2.12
+AppVersion=1.2.12
 AppPublisher=Raden Solutions
 AppPublisherURL=http://www.radensolutions.com
 AppSupportURL=http://www.netxms.org
index b8d31fd..86487e7 100644 (file)
@@ -2,7 +2,7 @@
 
 #include "setup-webui.iss"
 
-OutputBaseFilename=netxms-webui-1.2.11-x64
+OutputBaseFilename=netxms-webui-1.2.12-x64
 ArchitecturesInstallIn64BitMode=x64
 ArchitecturesAllowed=x64
 
index e573553..c2fa33d 100644 (file)
@@ -1,7 +1,7 @@
 ; Installation script for NetXMS WebUI / Windows
 
 #include "setup-webui.iss"
-OutputBaseFilename=netxms-webui-1.2.11
+OutputBaseFilename=netxms-webui-1.2.12
 
 [Files]
 Source: ..\files\windows\x86\prunsrv.exe; DestDir: "{app}\WebUI"; BeforeInstall: StopAllServices; Flags: ignoreversion; Components: webui
index 387267e..b357de3 100644 (file)
@@ -1,7 +1,7 @@
 @echo off
 call set_build_number.cmd
 rem set version=1.2.10-M3-%build_number%
-set version=1.2.11
+set version=1.2.12
 
 cd win32.win32.x86
 zip -r nxmc-%version%-win32-x86.zip nxmc
index 2775f96..e666de1 100644 (file)
@@ -3,7 +3,7 @@
     <parent>
         <groupId>org.netxms</groupId>
         <artifactId>netxms</artifactId>
-        <version>1.3.0</version>
+        <version>1.2.12</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
index f45b51a..f69bbac 100644 (file)
@@ -4,7 +4,7 @@
        <parent>
                <groupId>org.netxms</groupId>
                <artifactId>netxms</artifactId>
-               <version>1.3.0</version>
+               <version>1.2.12</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index 9507f7a..6b36928 100644 (file)
@@ -4,7 +4,7 @@
        <parent>
                <groupId>org.netxms</groupId>
                <artifactId>netxms</artifactId>
-               <version>1.3.0</version>
+               <version>1.2.12</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index 6194a7f..2caa0cd 100644 (file)
@@ -1,5 +1,5 @@
 package org.netxms.base;
 public final class BuildNumber {
-   public static final String TEXT = "7858";
-   public static final int NUMBER = 7858;
+   public static final String TEXT = "7861";
+   public static final int NUMBER = 7861;
 }
index 634aa09..8cd4f46 100644 (file)
@@ -313,6 +313,7 @@ public class NXCPCodes
        public static final int CMD_CHANGE_OBJECT_TOOL_STATUS = 0x011F;
        public static final int CMD_SET_ALARM_STATUS_FLOW = 0x0120;
        public static final int CMD_DELETE_ALARM_NOTE = 0x0121;
+   public static final int CMD_GET_EFFECTIVE_RIGHTS = 0x0122;
 
        // CMD_RS_ - Reporting Server related codes
        public static final int CMD_RS_LIST_REPORTS = 0x1100;
@@ -785,6 +786,7 @@ public class NXCPCodes
    public static final long VID_FILE_DATA = 460;
    public static final long VID_ALARM_STATUS_FLOW_STATE = 461;
    public static final long VID_GROUPS = 462;
+   public static final long VID_EFFECTIVE_RIGHTS = 463;
 
        public static final long VID_ACL_USER_BASE = 0x00001000L;
        public static final long VID_ACL_USER_LAST = 0x00001FFFL;
index b37ff15..b50b00c 100644 (file)
@@ -26,7 +26,7 @@ import java.util.UUID;
 public final class NXCommon
 {
        // Version information
-       public static final String VERSION = "1.3.0";
+       public static final String VERSION = "1.2.12";
        
        public static final UUID EMPTY_GUID = UUID.fromString("00000000-0000-0000-0000-000000000000");
 }
index c72b97e..aaf1294 100644 (file)
@@ -4,7 +4,7 @@
        <parent>
                <groupId>org.netxms</groupId>
                <artifactId>netxms</artifactId>
-               <version>1.3.0</version>
+               <version>1.2.12</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index c8cc490..a416875 100644 (file)
@@ -37,6 +37,7 @@ public class UserAccessRights
    public static final int SYSTEM_ACCESS_MANAGE_SUMMARY_TBLS = 0x01000000;
    public static final int SYSTEM_ACCESS_REPORTING_SERVER    = 0x02000000;
    public static final int SYSTEM_ACCESS_XMPP_COMMANDS       = 0x04000000;
+   public static final int SYSTEM_ACCESS_MANAGE_IMAGE_LIB    = 0x08000000;
        
        public static final int OBJECT_ACCESS_READ          = 0x00000001;
        public static final int OBJECT_ACCESS_MODIFY        = 0x00000002;
index 8ea2b93..13a38b4 100644 (file)
@@ -4,7 +4,7 @@
        <parent>
                <groupId>org.netxms</groupId>
                <artifactId>netxms</artifactId>
-               <version>1.3.0</version>
+               <version>1.2.12</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index 0ca9a91..d8f7084 100644 (file)
@@ -65,6 +65,7 @@ public class NXCNotification extends SessionNotification
        public static final int DCI_SUMMARY_TABLE_DELETED = 1022;
        public static final int DCI_CERTIFICATE_CHANGED = 1023;
        public static final int ALARM_STATUS_FLOW_CHANGED = 1024;
+       public static final int FILE_LIST_CHANGED = 1025;
 
        public static final int OBJECT_SYNC_COMPLETED = 2001;
        
index 84f4444..f567a06 100644 (file)
@@ -1207,7 +1207,8 @@ public class NXCSession implements Session, ScriptLibraryManager, UserManager, S
    public NXCPMessage waitForMessage(final int code, final long id, final int timeout) throws NXCException
    {
       final NXCPMessage msg = msgWaitQueue.waitForMessage(code, id, timeout);
-      if (msg == null) throw new NXCException(RCC.TIMEOUT);
+      if (msg == null) 
+         throw new NXCException(RCC.TIMEOUT);
       return msg;
    }
 
@@ -1220,7 +1221,8 @@ public class NXCSession implements Session, ScriptLibraryManager, UserManager, S
    public NXCPMessage waitForMessage(final int code, final long id) throws NXCException
    {
       final NXCPMessage msg = msgWaitQueue.waitForMessage(code, id);
-      if (msg == null) throw new NXCException(RCC.TIMEOUT);
+      if (msg == null) 
+         throw new NXCException(RCC.TIMEOUT);
       return msg;
    }
 
@@ -3321,10 +3323,34 @@ public class NXCSession implements Session, ScriptLibraryManager, UserManager, S
       // appropriate notification without waiting for actual server update
       synchronized(objectList)
       {
-         objectList.remove(objectId);
+         AbstractObject object = objectList.get(objectId);
+         if (object != null)
+         {
+            objectList.remove(objectId);
+            removeOrphanedObjects(object);
+         }
       }
       sendNotification(new NXCNotification(NXCNotification.OBJECT_DELETED, objectId));
    }
+   
+   /**
+    * Remove orphaned objects (with last parent left)
+    * 
+    * @param parent
+    */
+   private void removeOrphanedObjects(AbstractObject parent)
+   {
+      Iterator<Long> it = parent.getChildren();
+      while(it.hasNext())
+      {
+         AbstractObject object = objectList.get(it.next());
+         if ((object != null) && (object.getParentCount() == 1))
+         {
+            objectList.remove(object.getObjectId());
+            removeOrphanedObjects(object);
+         }
+      }
+   }
 
    /**
     * Hook method to populate NXCP message with custom object's data on object modification.
@@ -3782,7 +3808,7 @@ public class NXCSession implements Session, ScriptLibraryManager, UserManager, S
       data.setInheritAccessRights(inheritAccessRights);
       modifyObject(data);
    }
-
+   
    /**
     * Change report's definition (wrapper for modifyObject())
     *
@@ -3863,6 +3889,23 @@ public class NXCSession implements Session, ScriptLibraryManager, UserManager, S
       waitForRCC(msg.getMessageId());
    }
 
+   /**
+    * Get effective rights of currently logged in user to given object.
+    * 
+    * @param objectId
+    * @return
+    * @throws IOException
+    * @throws NXCException
+    */
+   public int getEffectiveRights(final long objectId) throws IOException, NXCException
+   {
+      NXCPMessage msg = newMessage(NXCPCodes.CMD_GET_EFFECTIVE_RIGHTS);
+      msg.setVariableInt32(NXCPCodes.VID_OBJECT_ID, (int) objectId);
+      sendMessage(msg);
+      return waitForRCC(msg.getMessageId()).getVariableAsInteger(NXCPCodes.VID_EFFECTIVE_RIGHTS);
+   }
+
+
    /**
     * Common internal implementation for bindObject, unbindObject, and
     * removeTemplate
@@ -5960,6 +6003,10 @@ public class NXCSession implements Session, ScriptLibraryManager, UserManager, S
       throws IOException, NXCException
    {
       final NXCPMessage msg = newMessage(NXCPCodes.CMD_UPLOAD_FILE);
+      if(serverFileName.equals(""))
+      {
+         serverFileName = localFile.getName();
+      }
       msg.setVariable(NXCPCodes.VID_FILE_NAME, serverFileName);
       sendMessage(msg);
       waitForRCC(msg.getMessageId());
index 55e0291..1333f6e 100644 (file)
@@ -4,7 +4,6 @@
 package org.netxms.client;
 
 import java.util.Date;
-
 import org.netxms.base.NXCPMessage;
 
 /**
@@ -16,6 +15,7 @@ public class ServerFile
        private String name;
        private long size;
        private Date modifyicationTime;
+   private String type;
        
        /**
         * Create server file object from NXCP message.
@@ -23,11 +23,21 @@ public class ServerFile
         * @param msg NXCP message
         * @param baseId base variable ID
         */
-       protected ServerFile(NXCPMessage msg, long baseId)
-       {
-               name = msg.getVariableAsString(baseId);
-               size = msg.getVariableAsInt64(baseId + 1);
-               modifyicationTime = msg.getVariableAsDate(baseId + 2);
+   protected ServerFile(NXCPMessage msg, long baseId)
+   {
+      name = msg.getVariableAsString(baseId);
+      size = msg.getVariableAsInt64(baseId + 1);
+      modifyicationTime = msg.getVariableAsDate(baseId + 2);
+
+      String[] parts = name.split("\\."); //$NON-NLS-1$
+      if (parts.length > 1)
+      {
+         type = parts[parts.length - 1];
+      }
+      else
+      {
+         type = " ";
+      }
        }
 
        /**
@@ -53,4 +63,12 @@ public class ServerFile
        {
                return modifyicationTime;
        }
+       
+   /**
+    * @return the type
+    */
+   public String getType()
+   {
+      return type;
+   }
 }
index 6f585e6..1bd5b20 100644 (file)
@@ -118,7 +118,7 @@ public class Log
                msg.setVariableInt32(NXCPCodes.VID_LOG_HANDLE, handle);
                filter.fillMessage(msg);
                session.sendMessage(msg);
-               final NXCPMessage response = session.waitForRCC(msg.getMessageId());
+               final NXCPMessage response = session.waitForRCC(msg.getMessageId(), 1800000);
                numRecords = response.getVariableAsInt64(NXCPCodes.VID_NUM_ROWS);
        }
        
@@ -154,7 +154,7 @@ public class Log
                msg.setVariableInt64(NXCPCodes.VID_NUM_ROWS, rowCount);
                msg.setVariableInt16(NXCPCodes.VID_FORCE_RELOAD, refresh ? 1 : 0);
                session.sendMessage(msg);
-               session.waitForRCC(msg.getMessageId());
+               session.waitForRCC(msg.getMessageId(), 1800000);
                return session.receiveTable(msg.getMessageId(), NXCPCodes.CMD_LOG_DATA);
        }
 
index e376a35..0123fa9 100644 (file)
@@ -134,6 +134,9 @@ public abstract class AbstractObject
        protected HashSet<Long> parents = new HashSet<Long>(0);
        protected HashSet<Long> children = new HashSet<Long>(0);
        protected Map<String, String> customAttributes = new HashMap<String, String>(0);
+       
+       private int effectiveRights = 0;
+       private boolean effectiveRightsCached = false;
 
        /**
         * Create dummy object of GENERIC class
@@ -274,6 +277,16 @@ public abstract class AbstractObject
        {
                return image.equals(NXCommon.EMPTY_GUID);
        }
+       
+       /**
+        * Get number of parent objects
+        * 
+        * @return
+        */
+       public int getParentCount()
+       {
+          return parents.size();
+       }
 
        /**
         * @return Iterator for list of parent objects
@@ -759,4 +772,28 @@ public abstract class AbstractObject
        {
                this.session = session;
        }
+
+   /**
+    * Get effective rights for this object. On first call this method
+    * will do request to server, and on all subsequent calls
+    * will return cached value obtained at first call.
+    * 
+    * @return effective user rights on this object
+    */
+   public int getEffectiveRights()
+   {
+      if (effectiveRightsCached)
+         return effectiveRights;
+      
+      try
+      {
+         effectiveRights = session.getEffectiveRights(objectId);
+         effectiveRightsCached = true;
+      }
+      catch(Exception e)
+      {
+         effectiveRights = 0;
+      }
+      return effectiveRights;
+   }
 }
index f7676aa..4d6fc38 100644 (file)
@@ -2,11 +2,11 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: org.netxms.ui.eclipse.actionmanager
 Bundle-SymbolicName: org.netxms.ui.eclipse.actionmanager;singleton:=true
-Bundle-Version: 1.2.11
+Bundle-Version: 1.2.12
 Bundle-Activator: org.netxms.ui.eclipse.actionmanager.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
- org.netxms.ui.eclipse.console;bundle-version="1.2.7"
+ org.netxms.ui.eclipse.console;bundle-version="1.2.12"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
index 3fee9a4..cff0c9c 100644 (file)
@@ -1,6 +1,6 @@
 action.OpenActionsConfiguration=Configuraci\u00f3n de Acciones
 actionDescription.OpenActionsConfiguration=Abrir una vista para configurar acciones
-actionSet.ActionManager.label = Action Manager
+actionSet.ActionManager.label=Action Manager
 decorator.actions=Decorador de Acciones
 decorator.actions.description=A\u00f1ade el icono "desactivado" a las acciones del servidor no activadas
 view.ActionsConfiguration=Configuraci\u00f3n de Acciones
index a266c6e..ad687cd 100644 (file)
@@ -1,6 +1,6 @@
 action.OpenActionsConfiguration=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439
 actionDescription.OpenActionsConfiguration=\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u043e\u043a\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439
-actionSet.ActionManager.label = \u041c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439
+actionSet.ActionManager.label=\u041c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439
 decorator.actions=\u041e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u0430
 decorator.actions.description=\u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0438\u043a\u043e\u043d\u043a\u043e\u0439
 view.ActionsConfiguration=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439
index d53e690..f9fe353 100644 (file)
@@ -1,6 +1,6 @@
 action.OpenActionsConfiguration=\u6d3b\u52a8\u914d\u7f6e
 actionDescription.OpenActionsConfiguration=\u6253\u5f00\u6d3b\u52a8\u914d\u7f6e\u89c6\u56fe
-actionSet.ActionManager.label = Action Manager
+actionSet.ActionManager.label=Action Manager
 decorator.actions=\u670d\u52a1\u5668\u6d3b\u52a8\u754c\u9762\u7f8e\u5316
 decorator.actions.description=\u5f53\u6d3b\u52a8\u88ab\u7981\u7528\u65f6\u6807\u7b7e\u663e\u793a\u4e3a\u7981\u7528\u6807\u5fd7
 view.ActionsConfiguration=\u6d3b\u52a8\u914d\u7f6e
index 4c0d195..2390215 100644 (file)
@@ -8,8 +8,10 @@ public class Messages extends NLS
        public static String ActionLabelProvider_ActionTypeExecute;
        public static String ActionLabelProvider_ActionTypeForward;
        public static String ActionLabelProvider_ActionTypeMail;
+   public static String ActionLabelProvider_ActionTypeNXSL;
        public static String ActionLabelProvider_ActionTypeRemoteExec;
        public static String ActionLabelProvider_ActionTypeSMS;
+   public static String ActionLabelProvider_ActionTypeXMPP;
        public static String ActionLabelProvider_Unknown;
        public static String ActionManager_ActionDelete;
        public static String ActionManager_ActionNew;
index 669dc17..eef0281 100644 (file)
@@ -1,8 +1,10 @@
 ActionLabelProvider_ActionTypeExecute=Execute
 ActionLabelProvider_ActionTypeForward=Forward Event
-ActionLabelProvider_ActionTypeMail=Send E-Mail
+ActionLabelProvider_ActionTypeMail=E-Mail
+ActionLabelProvider_ActionTypeNXSL=NXSL Script
 ActionLabelProvider_ActionTypeRemoteExec=Remote Execute
-ActionLabelProvider_ActionTypeSMS=Send SMS
+ActionLabelProvider_ActionTypeSMS=SMS
+ActionLabelProvider_ActionTypeXMPP=XMPP Message
 ActionLabelProvider_Unknown=Unknown
 ActionManager_ActionDelete=&Delete
 ActionManager_ActionNew=&New action...
index 2e0d582..afe6270 100644 (file)
@@ -1,49 +1,51 @@
-ActionLabelProvider_ActionTypeExecute=Spou\u0161t\u011Bt
-ActionLabelProvider_ActionTypeForward=Sm\u011Brovat ud\u00E1lost
-ActionLabelProvider_ActionTypeMail=Poslat e-mail
-ActionLabelProvider_ActionTypeRemoteExec=Spou\u0161t\u011Bt vzd\u00E1len\u011B
-ActionLabelProvider_ActionTypeSMS=Poslat SMS
-ActionLabelProvider_Unknown=Nezn\u00E1m\u00FD
+ActionLabelProvider_ActionTypeExecute=Spou\u0161t\u011bt
+ActionLabelProvider_ActionTypeForward=Sm\u011brovat ud\u00e1lost
+ActionLabelProvider_ActionTypeMail=E-mail
+ActionLabelProvider_ActionTypeNXSL=NXSL skript
+ActionLabelProvider_ActionTypeRemoteExec=Spou\u0161t\u011bt vzd\u00e1len\u011b
+ActionLabelProvider_ActionTypeSMS=SMS
+ActionLabelProvider_ActionTypeXMPP=XMPP zpr\u00e1va
+ActionLabelProvider_Unknown=Nezn\u00e1m\u00fd
 ActionManager_ActionDelete=&Smazat
-ActionManager_ActionNew=&Nov\u00E1 akce...
+ActionManager_ActionNew=&Nov\u00e1 akce...
 ActionManager_ActionProperties=&Vlastnosti...
 ActionManager_ColumnData=Data
-ActionManager_ColumnName=Jm\u00E9no
-ActionManager_ColumnRcpt=P\u0159\u00EDjemce
-ActionManager_ColumnSubj=Zpr\u00E1va
+ActionManager_ColumnName=Jm\u00e9no
+ActionManager_ColumnRcpt=P\u0159\u00edjemce
+ActionManager_ColumnSubj=Zpr\u00e1va
 ActionManager_ColumnType=Typ
-ActionManager_ConfirmDelete=Opravdu chcete smazat ozna\u010Den\u00E9 akce?
-ActionManager_Confirmation=Potvrzen\u00ED
+ActionManager_ConfirmDelete=Opravdu chcete smazat ozna\u010den\u00e9 akce?
+ActionManager_Confirmation=Potvrzen\u00ed
 ActionManager_CreateJobError=Nelze vytvo\u0159it akci
 ActionManager_CreateJobName=Vytvo\u0159it novou akci
 ActionManager_DeleteJobError=Nelze smazat akci
 ActionManager_DeleteJobName=Smazat akci
-ActionManager_LoadJobError=Nelze na\u010D\u00EDst konfiguraci akc\u00ED ze serveru
-ActionManager_LoadJobName=Na\u010D\u00EDst konfiguraci akc\u00ED
+ActionManager_LoadJobError=Nelze na\u010d\u00edst konfiguraci akc\u00ed ze serveru
+ActionManager_LoadJobName=Na\u010d\u00edst konfiguraci akc\u00ed
 ActionManager_UpdateJobError=Nelze aktualizovat akci
 ActionManager_UpdateJobName=Aktualizovat akci
 EditActionDlg_Action=Akce agenta
-EditActionDlg_ActionDisabled=Akce je &zak\u00E1z\u00E1na
-EditActionDlg_Command=P\u0159\u00EDkaz
+EditActionDlg_ActionDisabled=Akce je &zak\u00e1z\u00e1na
+EditActionDlg_Command=P\u0159\u00edkaz
 EditActionDlg_CreateAction=Vytvo\u0159it akci
 EditActionDlg_EditAction=Editovat akci
-EditActionDlg_ExecCommandOnNode=Spustit p\u0159\u00EDkaz na vzd\u00E1len\u00E9m prvku pomoc\u00ED agenta 
-EditActionDlg_ExecCommandOnServer=Spustit p\u0159\u00EDkaz na management serveru
+EditActionDlg_ExecCommandOnNode=Spustit p\u0159\u00edkaz na vzd\u00e1len\u00e9m prvku pomoc\u00ed agenta
+EditActionDlg_ExecCommandOnServer=Spustit p\u0159\u00edkaz na management serveru
 EditActionDlg_ExecuteScript=Spustit &NXSL skript
-EditActionDlg_ForwardEvent=Sm\u011Brovat ud\u00E1lost na jin\u00FD NetXMS server
-EditActionDlg_MailSubject=P\u0159edm\u011Bt e-mailu
-EditActionDlg_MessageText=Text zpr\u00E1vy
-EditActionDlg_Name=Jm\u00E9no
-EditActionDlg_Options=Nastaven\u00ED
-EditActionDlg_PhoneNumber=Telefonn\u00ED \u010D\u00EDslo
-EditActionDlg_Recipient=Adresa p\u0159\u00EDjemce
-EditActionDlg_RemoteHost=Vzd\u00E1len\u00FD po\u010D\u00EDta\u010D
-EditActionDlg_RemoteServer=Vzd\u00E1len\u00FD NetXMS server
-EditActionDlg_ScriptName=N\u00E1zev skriptu
+EditActionDlg_ForwardEvent=Sm\u011brovat ud\u00e1lost na jin\u00fd NetXMS server
+EditActionDlg_MailSubject=P\u0159edm\u011bt e-mailu
+EditActionDlg_MessageText=Text zpr\u00e1vy
+EditActionDlg_Name=Jm\u00e9no
+EditActionDlg_Options=Nastaven\u00ed
+EditActionDlg_PhoneNumber=Telefonn\u00ed \u010d\u00edslo
+EditActionDlg_Recipient=Adresa p\u0159\u00edjemce
+EditActionDlg_RemoteHost=Vzd\u00e1len\u00fd po\u010d\u00edta\u010d
+EditActionDlg_RemoteServer=Vzd\u00e1len\u00fd NetXMS server
+EditActionDlg_ScriptName=N\u00e1zev skriptu
 EditActionDlg_SenMail=Poslat e-mail
 EditActionDlg_SendSMS=Poslat SMS na mobil
 EditActionDlg_SendXMPPMessage=Send XMPP message
 EditActionDlg_Type=Typ
 EditActionDlg_XMPPID=Jabber/XMPP ID
 OpenActionManager_Error=Chyba
-OpenActionManager_ErrorOpeningView=Chyba p\u0159i otev\u00EDr\u00E1n\u00ED\:
+OpenActionManager_ErrorOpeningView=Chyba p\u0159i otev\u00edr\u00e1n\u00ed\:
index 2cec1a6..bddcdac 100644 (file)
@@ -1,8 +1,10 @@
 ActionLabelProvider_ActionTypeExecute=Ejecutar
 ActionLabelProvider_ActionTypeForward=Reenviar Evento
-ActionLabelProvider_ActionTypeMail=Enviar Correo
+ActionLabelProvider_ActionTypeMail=Correo
+ActionLabelProvider_ActionTypeNXSL=NXSL Script
 ActionLabelProvider_ActionTypeRemoteExec=Ejecutar en Remoto
-ActionLabelProvider_ActionTypeSMS=Enviar SMS
+ActionLabelProvider_ActionTypeSMS=SMS
+ActionLabelProvider_ActionTypeXMPP=XMPP message
 ActionLabelProvider_Unknown=Desconocido
 ActionManager_ActionDelete=&Eliminar
 ActionManager_ActionNew=&Nueva acci\u00f3n...
@@ -46,4 +48,4 @@ EditActionDlg_SendXMPPMessage=Send XMPP message
 EditActionDlg_Type=Tipo
 EditActionDlg_XMPPID=Jabber/XMPP ID
 OpenActionManager_Error=Error
-OpenActionManager_ErrorOpeningView=Error al abrir la vista: 
+OpenActionManager_ErrorOpeningView=Error al abrir la vista:
index a689b17..2e9db00 100644 (file)
@@ -1,8 +1,10 @@
 ActionLabelProvider_ActionTypeExecute=\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c
-ActionLabelProvider_ActionTypeForward=\u041f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0421\u043e\u0431\u044b\u0442\u0438\u0435
-ActionLabelProvider_ActionTypeMail=\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0438\u0441\u044c\u043c\u043e (E-Mail)
+ActionLabelProvider_ActionTypeForward=\u041f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435
+ActionLabelProvider_ActionTypeMail=\u041f\u0438\u0441\u044c\u043c\u043e (E-Mail)
+ActionLabelProvider_ActionTypeNXSL=\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439 NXSL
 ActionLabelProvider_ActionTypeRemoteExec=\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c \u0443\u0437\u043b\u0435
-ActionLabelProvider_ActionTypeSMS=\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 (SMS)
+ActionLabelProvider_ActionTypeSMS=\u041a\u043e\u0440\u043e\u0442\u043a\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 (SMS)
+ActionLabelProvider_ActionTypeXMPP=XMPP \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435
 ActionLabelProvider_Unknown=\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e
 ActionManager_ActionDelete=&\u0423\u0434\u0430\u043b\u0438\u0442\u044c
 ActionManager_ActionNew=&\u041d\u043e\u0432\u043e\u0435 \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435...
@@ -46,4 +48,4 @@ EditActionDlg_SendXMPPMessage=\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u
 EditActionDlg_Type=\u0422\u0438\u043f
 EditActionDlg_XMPPID=Jabber/XMPP ID
 OpenActionManager_Error=\u041e\u0448\u0438\u0431\u043a\u0430
-OpenActionManager_ErrorOpeningView=\u041e\u0448\u0438\u0431\u043a\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f: 
+OpenActionManager_ErrorOpeningView=\u041e\u0448\u0438\u0431\u043a\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f:
index da33185..94419ec 100644 (file)
@@ -1,8 +1,10 @@
 ActionLabelProvider_ActionTypeExecute=\u6267\u884c
 ActionLabelProvider_ActionTypeForward=\u4e0a\u4e00\u4e8b\u4ef6
 ActionLabelProvider_ActionTypeMail=\u53d1\u9001EMAIL
+ActionLabelProvider_ActionTypeNXSL=NXSL Script
 ActionLabelProvider_ActionTypeRemoteExec=\u8fdc\u7a0b\u6267\u884c
 ActionLabelProvider_ActionTypeSMS=\u53d1\u9001\u77ed\u4fe1
+ActionLabelProvider_ActionTypeXMPP=XMPP message
 ActionLabelProvider_Unknown=\u672a\u77e5
 ActionManager_ActionDelete=\u5220\u9664
 ActionManager_ActionNew=\u65b0\u52a8\u4f5c...
@@ -46,4 +48,4 @@ EditActionDlg_SendXMPPMessage=Send XMPP message
 EditActionDlg_Type=\u7c7b\u578b
 EditActionDlg_XMPPID=Jabber/XMPP ID
 OpenActionManager_Error=\u9519\u8bef
-OpenActionManager_ErrorOpeningView=\u6253\u5f00\u89c6\u56fe\u9519\u8bef: 
+OpenActionManager_ErrorOpeningView=\u6253\u5f00\u89c6\u56fe\u9519\u8bef:
index 4e005a8..5e3e897 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * NetXMS - open source network management system
- * Copyright (C) 2003-2010 Victor Kirhenshtein
+ * Copyright (C) 2003-2014 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
@@ -33,7 +33,15 @@ import org.netxms.ui.eclipse.actionmanager.views.ActionManager;
  */
 public class ActionLabelProvider implements ITableLabelProvider
 {
-       private static final String[] ACTION_TYPE = { Messages.get().ActionLabelProvider_ActionTypeExecute, Messages.get().ActionLabelProvider_ActionTypeRemoteExec, Messages.get().ActionLabelProvider_ActionTypeMail, Messages.get().ActionLabelProvider_ActionTypeSMS, Messages.get().ActionLabelProvider_ActionTypeForward };
+       private static final String[] ACTION_TYPE = { 
+          Messages.get().ActionLabelProvider_ActionTypeExecute, 
+          Messages.get().ActionLabelProvider_ActionTypeRemoteExec, 
+          Messages.get().ActionLabelProvider_ActionTypeMail, 
+          Messages.get().ActionLabelProvider_ActionTypeSMS, 
+          Messages.get().ActionLabelProvider_ActionTypeForward, 
+         Messages.get().ActionLabelProvider_ActionTypeNXSL, 
+          Messages.get().ActionLabelProvider_ActionTypeXMPP 
+          };
        
        private ILabelProvider workbenchLabelProvider;
        
index 1f41dd6..b4f2558 100644 (file)
@@ -96,7 +96,7 @@ public interface DataChart
        public abstract boolean isLegendVisible();
        
        /**
-        * Set legend position
+        * Set legend position (constants defined in GraphSettings)
         * 
         * @param position
         */
index 377c604..1165c8b 100644 (file)
@@ -664,7 +664,7 @@ public class LineChart extends Chart implements HistoricalDataChart
        public int addParameter(GraphItem item)
        {
                items.add(item);
-               return items.size();
+               return items.size() - 1;
        }
 
        /* (non-Javadoc)
index 077a7e0..63c9d42 100644 (file)
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry exported="true" kind="lib" path="jar/certificate-manager-1.3.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="jar/netxms-base-1.3.0.jar" sourcepath="/netxms-base"/>
-       <classpathentry exported="true" kind="lib" path="jar/netxms-client-1.3.0.jar" sourcepath="/netxms-client"/>
-       <classpathentry exported="true" kind="lib" path="jar/netxms-client-api-1.3.0.jar"/>
+       <classpathentry exported="true" kind="lib" path="jar/certificate-manager-1.2.12.jar"/>
+       <classpathentry exported="true" kind="lib" path="jar/netxms-base-1.2.12.jar"/>
+       <classpathentry exported="true" kind="lib" path="jar/netxms-client-1.2.12.jar" sourcepath="/netxms-client"/>
+       <classpathentry exported="true" kind="lib" path="jar/netxms-client-api-1.2.12.jar"/>
        <classpathentry exported="true" kind="lib" path="jar/simple-xml-2.6.4.jar"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
index 6a67549..6ee4198 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-SymbolicName: org.netxms.ui.eclipse.console;singleton:=true
-Bundle-Version: 1.3.0
+Bundle-Version: 1.2.12
 Bundle-Activator: org.netxms.ui.eclipse.console.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
@@ -14,10 +14,10 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
 Bundle-ClassPath: .,
  jar/simple-xml-2.6.4.jar,
- jar/certificate-manager-1.3.0.jar,
- jar/netxms-base-1.3.0.jar,
- jar/netxms-client-1.3.0.jar,
- jar/netxms-client-api-1.3.0.jar
+ jar/certificate-manager-1.2.12.jar,
+ jar/netxms-base-1.2.12.jar,
+ jar/netxms-client-1.2.12.jar,
+ jar/netxms-client-api-1.2.12.jar
 Export-Package: org.netxms.api.client,
  org.netxms.api.client.constants,
  org.netxms.api.client.images,
index 3d0cdd5..23d5218 100644 (file)
@@ -8,8 +8,8 @@ bin.includes = plugin.xml,\
                splash.bmp,\
                jar/,\
                OSGI-INF/,\
-               jar/certificate-manager-1.3.0.jar,\
-               jar/netxms-base-1.3.0.jar,\
-               jar/netxms-client-1.3.0.jar,\
-               jar/netxms-client-api-1.3.0.jar
+               jar/certificate-manager-1.2.12.jar,\
+               jar/netxms-base-1.2.12.jar,\
+               jar/netxms-client-1.2.12.jar,\
+               jar/netxms-client-api-1.2.12.jar
 jars.compile.order = .
index cacaab2..8a339f2 100644 (file)
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?pde version="3.5"?>
 
-<product name="%product.name" id="org.netxms.ui.eclipse.console.product" application="org.netxms.ui.eclipse.console.application" version="1.2.11" useFeatures="false" includeLaunchers="true">
+<product name="%product.name" id="org.netxms.ui.eclipse.console.product" application="org.netxms.ui.eclipse.console.application" version="1.2.12" useFeatures="false" includeLaunchers="true">
 
    <aboutInfo>
       <image path="/Core/icons/launcher/128x128.png"/>
       <text>
          NetXMS Management Console
 
-Version 1.2.11
+Version 1.2.12
 Copyright (c) 2003-2014 Raden Solutions
       </text>
    </aboutInfo>
index 02af67d..7e417c9 100644 (file)
@@ -62,7 +62,7 @@
          </property>
          <property
                name="aboutText"
-               value="NetXMS Management Console&#x0A;&#x0A;Version 1.2.11&#x0A;Copyright (c) 2003-2014 Raden Solutions">
+               value="NetXMS Management Console&#x0A;&#x0A;Version 1.2.12&#x0A;Copyright (c) 2003-2014 Raden Solutions">
          </property>
          <property
                name="startupForegroundColor"
index 3600917..e6a2ccb 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.branding.IProductConstants;
 import org.eclipse.ui.splash.BasicSplashHandler;
+import org.netxms.base.BuildNumber;
 import org.netxms.base.NXCommon;
 
 /**
@@ -87,7 +88,7 @@ public class SplashHandler extends BasicSplashHandler
                        {
                                e.gc.setForeground(versionColor);
                                e.gc.setFont(versionFont);
-                               e.gc.drawText(Messages.get().SplashHandler_Version + NXCommon.VERSION, 209, 181, true);
+                               e.gc.drawText(Messages.get().SplashHandler_Version + NXCommon.VERSION + " (" + BuildNumber.TEXT + ")", 209, 181, true);
                        }
                });
                content.addDisposeListener(new DisposeListener() {
index 67d4934..4d3acec 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * NetXMS - open source network management system
- * Copyright (C) 2003-2013 Victor Kirhenshtein
+ * Copyright (C) 2003-2014 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
@@ -30,13 +30,16 @@ import org.eclipse.ui.ISaveablePart;
 import org.eclipse.ui.IViewSite;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.part.ViewPart;
+import org.netxms.api.client.constants.UserAccessRights;
 import org.netxms.client.NXCSession;
 import org.netxms.client.objects.Dashboard;
 import org.netxms.ui.eclipse.actions.RefreshAction;
 import org.netxms.ui.eclipse.console.resources.SharedIcons;
+import org.netxms.ui.eclipse.dashboard.Activator;
 import org.netxms.ui.eclipse.dashboard.Messages;
 import org.netxms.ui.eclipse.dashboard.widgets.DashboardControl;
 import org.netxms.ui.eclipse.dashboard.widgets.internal.DashboardModifyListener;
+import org.netxms.ui.eclipse.jobs.ConsoleJob;
 import org.netxms.ui.eclipse.shared.ConsoleSharedData;
 import org.netxms.ui.eclipse.tools.MessageDialogHelper;
 
@@ -49,6 +52,7 @@ public class DashboardView extends ViewPart implements ISaveablePart
        
        private NXCSession session;
        private Dashboard dashboard;
+       private boolean readOnly = true;
        private DashboardControl dbc;
        private Composite parentComposite;
        private DashboardModifyListener dbcModifyListener;
@@ -85,25 +89,51 @@ public class DashboardView extends ViewPart implements ISaveablePart
        @Override
        public void createPartControl(Composite parent)
        {
+          ConsoleJob job = new ConsoleJob("Get effective rights", this, Activator.PLUGIN_ID, null) {
+         @Override
+         protected void runInternal(IProgressMonitor monitor) throws Exception
+         {
+            readOnly = ((dashboard.getEffectiveRights() & UserAccessRights.OBJECT_ACCESS_MODIFY) == 0);
+         }
+         
+         @Override
+         protected String getErrorMessage()
+         {
+            return "Cannot get effective rights for dashboard object";
+         }
+      };
+      job.start();
+      
+      // FIXME: rewrite waiting
+      try
+      {
+         job.join();
+      }
+      catch(InterruptedException e)
+      {
+      }
+          
                parentComposite = parent;
                dbc = new DashboardControl(parent, SWT.NONE, dashboard, this, false);
-               dbcModifyListener = new DashboardModifyListener() {
-                       @Override
-                       public void save()
-                       {
-                               actionSave.setEnabled(false);
-                               firePropertyChange(PROP_DIRTY);
-                       }
-                       
-                       @Override
-                       public void modify()
-                       {
-                               actionSave.setEnabled(true);
-                               firePropertyChange(PROP_DIRTY);
-                       }
-               };
-               dbc.setModifyListener(dbcModifyListener);
-
+               if (!readOnly)
+               {
+               dbcModifyListener = new DashboardModifyListener() {
+                       @Override
+                       public void save()
+                       {
+                               actionSave.setEnabled(false);
+                               firePropertyChange(PROP_DIRTY);
+                       }
+                       
+                       @Override
+                       public void modify()
+                       {
+                               actionSave.setEnabled(true);
+                               firePropertyChange(PROP_DIRTY);
+                       }
+               };
+               dbc.setModifyListener(dbcModifyListener);
+               }
                createActions();
                contributeToActionBars();
        }
@@ -241,19 +271,22 @@ public class DashboardView extends ViewPart implements ISaveablePart
         */
        private void fillLocalPullDown(IMenuManager manager)
        {
-               manager.add(actionEditMode);
-               manager.add(actionSave);
-               manager.add(new Separator());
-               manager.add(actionAddAlarmBrowser);
-               manager.add(actionAddLabel);
-               manager.add(actionAddLineChart);
-               manager.add(actionAddBarChart);
-               manager.add(actionAddPieChart);
-               manager.add(actionAddTubeChart);
-               manager.add(actionAddStatusIndicator);
-               manager.add(actionAddAvailabilityChart);
-               manager.add(actionAddDashboard);
-               manager.add(new Separator());
+          if (!readOnly)
+          {
+               manager.add(actionEditMode);
+               manager.add(actionSave);
+               manager.add(new Separator());
+               manager.add(actionAddAlarmBrowser);
+               manager.add(actionAddLabel);
+               manager.add(actionAddLineChart);
+               manager.add(actionAddBarChart);
+               manager.add(actionAddPieChart);
+               manager.add(actionAddTubeChart);
+               manager.add(actionAddStatusIndicator);
+               manager.add(actionAddAvailabilityChart);
+               manager.add(actionAddDashboard);
+               manager.add(new Separator());
+          }
                manager.add(actionRefresh);
        }
 
@@ -265,8 +298,11 @@ public class DashboardView extends ViewPart implements ISaveablePart
         */
        private void fillLocalToolBar(IToolBarManager manager)
        {
-               manager.add(actionEditMode);
-               manager.add(actionSave);
+          if (!readOnly)
+          {
+               manager.add(actionEditMode);
+               manager.add(actionSave);
+          }
                manager.add(actionRefresh);
        }
        
@@ -302,7 +338,7 @@ public class DashboardView extends ViewPart implements ISaveablePart
        @Override
        public boolean isDirty()
        {
-               return dbc.isModified();
+               return dbc.isModified() && !readOnly;
        }
 
        /* (non-Javadoc)
@@ -320,7 +356,7 @@ public class DashboardView extends ViewPart implements ISaveablePart
        @Override
        public boolean isSaveOnCloseNeeded()
        {
-               return dbc.isModified();
+               return dbc.isModified() && !readOnly;
        }
 
        /**
@@ -346,7 +382,10 @@ public class DashboardView extends ViewPart implements ISaveablePart
                                dbc = new DashboardControl(parentComposite, SWT.NONE, dashboard, this, false);
                                parentComposite.layout(true, true);
                                setPartName(Messages.get().DashboardView_PartNamePrefix + dashboard.getObjectName());
-                               dbc.setModifyListener(dbcModifyListener);
+                               if (!readOnly)
+                               {
+                                  dbc.setModifyListener(dbcModifyListener);
+                               }
                        }
                        else
                        {
@@ -357,7 +396,10 @@ public class DashboardView extends ViewPart implements ISaveablePart
                {
                        dbc = new DashboardControl(parentComposite, SWT.NONE, dashboard, dbc.getElements(), this, dbc.isModified());
                        parentComposite.layout(true, true);
-                       dbc.setModifyListener(dbcModifyListener);
+                       if (!readOnly)
+                       {
+                          dbc.setModifyListener(dbcModifyListener);
+                       }
                }
 
                actionSave.setEnabled((dbc != null) ? dbc.isModified() : false);
index ee89c29..99c39e7 100644 (file)
@@ -1,7 +1,13 @@
 #Properties file for org.netxms.ui.eclipse.filemanager
 action.label.UploadFile = Upload file...
 command.description.UploadToServer = Upload local file to server
+command.description.ServerFileList = Open server file list
 command.name.UploadToServer = Upload file to server...
+command.name.ServerFileList = Open server file list
 actionSet.label.FileManager = File Manager Action Set
 action.label.UploadToServer = Upload file to server...
-action.tooltip.UploadToServer = Upload local file to server's file store
\ No newline at end of file
+action.label.ServerFileList = Server File List
+action.tooltip.UploadToServer = Upload local file to server's file store
+action.tooltip.ServerFileList = Show list with files stored by netXMS on server side
+view.ServerFileList.name = Server File List
+category.Views = Views
\ No newline at end of file
index 20c33e6..c1946cb 100644 (file)
@@ -1,6 +1,12 @@
+action.label.ServerFileList=Server File List
 action.label.UploadFile=Nahr\u00E1t soubor...
 action.label.UploadToServer=Nahr\u00E1t soubor na server...
+action.tooltip.ServerFileList=Show list with files stored by netXMS on server side
 action.tooltip.UploadToServer=Nahr\u00E1t lok\u00E1ln\u00ED soubor na serverov\u00E9 \u00FAlo\u017Ei\u0161t\u011B
 actionSet.label.FileManager=Ak\u010Dn\u00ED set spr\u00E1vce soubor\u016F
+category.Views=Views
+command.description.ServerFileList=Open server file list
 command.description.UploadToServer=Nahr\u00E1t lok\u00E1ln\u00ED soubor na server
+command.name.ServerFileList=Open server file list
 command.name.UploadToServer=Nahr\u00E1t soubor na server...
+view.ServerFileList.name=Server File List
index 157dd39..d8dd85c 100644 (file)
@@ -1,6 +1,12 @@
-action.label.UploadFile = Upload file...
-action.label.UploadToServer = Upload file to server...
-action.tooltip.UploadToServer = Upload local file to server's file store
-actionSet.label.FileManager = File Manager Action Set
-command.description.UploadToServer = Upload local file to server
-command.name.UploadToServer = Upload file to server...
+action.label.ServerFileList=Server File List
+action.label.UploadFile=Upload file...
+action.label.UploadToServer=Upload file to server...
+action.tooltip.ServerFileList=Show list with files stored by netXMS on server side
+action.tooltip.UploadToServer=Upload local file to server's file store
+actionSet.label.FileManager=File Manager Action Set
+category.Views=Views
+command.description.ServerFileList=Open server file list
+command.description.UploadToServer=Upload local file to server
+command.name.ServerFileList=Open server file list
+command.name.UploadToServer=Upload file to server...
+view.ServerFileList.name=Server File List
index da04f89..2b1fc1b 100644 (file)
@@ -1,6 +1,12 @@
-action.label.UploadFile = \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b...
-action.label.UploadToServer = \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440...
-action.tooltip.UploadToServer = \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430
-actionSet.label.FileManager = \u0424\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440
-command.description.UploadToServer = \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440
-command.name.UploadToServer = \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440...
+action.label.ServerFileList=Server File List
+action.label.UploadFile=\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b...
+action.label.UploadToServer=\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440...
+action.tooltip.ServerFileList=Show list with files stored by netXMS on server side
+action.tooltip.UploadToServer=\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430
+actionSet.label.FileManager=\u0424\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440
+category.Views=Views
+command.description.ServerFileList=Open server file list
+command.description.UploadToServer=\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440
+command.name.ServerFileList=Open server file list
+command.name.UploadToServer=\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440...
+view.ServerFileList.name=Server File List
index 157dd39..d8dd85c 100644 (file)
@@ -1,6 +1,12 @@
-action.label.UploadFile = Upload file...
-action.label.UploadToServer = Upload file to server...
-action.tooltip.UploadToServer = Upload local file to server's file store
-actionSet.label.FileManager = File Manager Action Set
-command.description.UploadToServer = Upload local file to server
-command.name.UploadToServer = Upload file to server...
+action.label.ServerFileList=Server File List
+action.label.UploadFile=Upload file...
+action.label.UploadToServer=Upload file to server...
+action.tooltip.ServerFileList=Show list with files stored by netXMS on server side
+action.tooltip.UploadToServer=Upload local file to server's file store
+actionSet.label.FileManager=File Manager Action Set
+category.Views=Views
+command.description.ServerFileList=Open server file list
+command.description.UploadToServer=Upload local file to server
+command.name.ServerFileList=Open server file list
+command.name.UploadToServer=Upload file to server...
+view.ServerFileList.name=Server File List
index e41084a..36346ee 100644 (file)
@@ -1,6 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.4"?>
 <plugin>
+   <extension
+         point="org.eclipse.ui.views">
+      <view
+            category="org.netxms.ui.eclipse.viewcategory.config"
+            class="org.netxms.ui.eclipse.filemanager.views.ViewServerFile"
+            icon="icons/file.png"
+            id="org.netxms.ui.eclipse.usermanager.view.server_files"
+            name="%view.ServerFileList.name"
+            restorable="true">
+      </view>
+   </extension>
    <extension
          point="org.eclipse.core.runtime.adapters">
       <factory
             id="org.netxms.ui.eclipse.filemanager.commands.upload_file_to_server"
             name="%command.name.UploadToServer">
       </command>
+      <command
+            description="%command.ServerFileList.description"
+            id="org.netxms.ui.eclipse.console.category.views.open_server_file_list"
+            name="%command.ServerFileList.name">
+      </command>
    </extension>
    <extension
          point="org.eclipse.ui.actionSets">
                menubarPath="tools/additions"
                tooltip="%action.tooltip.UploadToServer">
          </action>
+         <action
+               class="org.netxms.ui.eclipse.filemanager.actions.GetServerFileList"
+               definitionId="org.netxms.ui.eclipse.console.category.views.open_server_file_list"
+               icon="icons/file.png"
+               id="org.netxms.ui.eclipse.usermanager.view.server_files"
+               label="%action.label.ServerFileList"
+               menubarPath="config/additions"
+               toolbarPath="config/additions"
+               tooltip="%action.tooltip.ServerFileList">
+         </action>
       </actionSet>
    </extension>
    <extension
index fe3d010..a4a584d 100644 (file)
@@ -5,7 +5,9 @@ import org.eclipse.osgi.util.NLS;
 public class Messages extends NLS
 {
        private static final String BUNDLE_NAME = "org.netxms.ui.eclipse.filemanager.messages"; //$NON-NLS-1$
-       public static String LocalFileSelector_AllFiles;
+       public static String GetServerFileList_ErrorMessageFileView;
+   public static String GetServerFileList_ErrorMessageFileViewTitle;
+   public static String LocalFileSelector_AllFiles;
        public static String LocalFileSelector_None;
        public static String LocalFileSelector_SelectFile;
        public static String LocalFileSelector_Tooltip;
@@ -35,7 +37,18 @@ public class Messages extends NLS
        public static String UploadFileToServer_JobError;
        public static String UploadFileToServer_JobTitle;
        public static String UploadFileToServer_TaskNamePrefix;
-       static
+       public static String ViewServerFile_DeletAck;
+   public static String ViewServerFile_DeleteConfirmation;
+   public static String ViewServerFile_DeleteFileOnServerAction;
+   public static String ViewServerFile_DeletFileFromServerJob;
+   public static String ViewServerFile_ErrorDeleteFileJob;
+   public static String ViewServerFile_FileName;
+   public static String ViewServerFile_FileSize;
+   public static String ViewServerFile_FileType;
+   public static String ViewServerFile_ModificationDate;
+   public static String ViewServerFile_ShowFilterAction;
+   public static String ViewServerFile_UploadFileOnServerAction;
+   static
        {
                // initialize resource bundle
                NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/actions/GetServerFileList.java b/src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/actions/GetServerFileList.java
new file mode 100644 (file)
index 0000000..b76881a
--- /dev/null
@@ -0,0 +1,85 @@
+/**
+ * NetXMS - open source network management system
+ * Copyright (C) 2003-2009 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.netxms.ui.eclipse.filemanager.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PartInitException;
+import org.netxms.ui.eclipse.filemanager.Messages;
+import org.netxms.ui.eclipse.filemanager.views.ViewServerFile;
+import org.netxms.ui.eclipse.tools.MessageDialogHelper;
+
+public class GetServerFileList implements IWorkbenchWindowActionDelegate
+{
+       private IWorkbenchWindow window;
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
+        */
+       @Override
+       public void dispose()
+       {
+               // TODO Auto-generated method stub
+               
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
+        */
+       @Override
+       public void init(IWorkbenchWindow window)
+       {
+               this.window = window;
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+        */
+       @Override
+       public void run(IAction action)
+       {
+               if(window != null)
+               {       
+                       try 
+                       {
+                               window.getActivePage().showView(ViewServerFile.ID);
+                       } 
+                       catch (PartInitException e) 
+                       {
+                               MessageDialogHelper.openError(window.getShell(), Messages.get().GetServerFileList_ErrorMessageFileViewTitle, Messages.get().GetServerFileList_ErrorMessageFileView + e.getMessage());
+                       }
+               }
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+        */
+       @Override
+       public void selectionChanged(IAction action, ISelection selection)
+       {
+               // TODO Auto-generated method stub
+               
+       }
+
+       public static void main(String[] args) {
+               // TODO Auto-generated method stub
+       }
+}
index cda7579..bf77e4c 100644 (file)
@@ -1,3 +1,5 @@
+GetServerFileList_ErrorMessageFileView=Error opening server file list: 
+GetServerFileList_ErrorMessageFileViewTitle=Error opening server file view
 LocalFileSelector_AllFiles=All files
 LocalFileSelector_None=<none>
 LocalFileSelector_SelectFile=Select File
@@ -28,3 +30,14 @@ UploadFileToAgent_JobTitle=Initiate file upload to agent
 UploadFileToServer_JobError=Cannot upload file to server
 UploadFileToServer_JobTitle=Upload file to server
 UploadFileToServer_TaskNamePrefix=Upload file 
+ViewServerFile_DeletAck=Are you sure you want to delete this file?
+ViewServerFile_DeleteConfirmation=Delete confirmation
+ViewServerFile_DeleteFileOnServerAction=Delete file on server
+ViewServerFile_DeletFileFromServerJob=Delete file from server
+ViewServerFile_ErrorDeleteFileJob=Error while deleting file.
+ViewServerFile_FileName=File name
+ViewServerFile_FileSize=File size
+ViewServerFile_FileType=File type
+ViewServerFile_ModificationDate=Modification day
+ViewServerFile_ShowFilterAction=Show filter
+ViewServerFile_UploadFileOnServerAction=Upload new file on server
index 2b04132..4d01ab5 100644 (file)
@@ -1,3 +1,5 @@
+GetServerFileList_ErrorMessageFileView=Error opening server file list:
+GetServerFileList_ErrorMessageFileViewTitle=Error opening server file view
 LocalFileSelector_AllFiles=V\u0161echny soubory
 LocalFileSelector_None=<\u017E\u00E1dn\u00FD>
 LocalFileSelector_SelectFile=Vybrat soubor
@@ -28,3 +30,14 @@ UploadFileToAgent_JobTitle=Inicializovat nahr\u00E1n\u00ED souboru do agenta
 UploadFileToServer_JobError=Nelze nahr\u00E1t soubor na server
 UploadFileToServer_JobTitle=Nahr\u00E1t soubor na server
 UploadFileToServer_TaskNamePrefix=Nahr\u00E1t soubor
+ViewServerFile_DeletAck=Are you sure you want to delete this file?
+ViewServerFile_DeletFileFromServerJob=Delete file from server
+ViewServerFile_DeleteConfirmation=Delete confirmation
+ViewServerFile_DeleteFileOnServerAction=Delete file on server
+ViewServerFile_ErrorDeleteFileJob=Error while deleting file.
+ViewServerFile_FileName=File name
+ViewServerFile_FileSize=File size
+ViewServerFile_FileType=File type
+ViewServerFile_ModificationDate=Modification day
+ViewServerFile_ShowFilterAction=Show filter
+ViewServerFile_UploadFileOnServerAction=Upload new file on server
index 433adc4..1e7aff0 100644 (file)
@@ -1,3 +1,5 @@
+GetServerFileList_ErrorMessageFileView=Error opening server file list:
+GetServerFileList_ErrorMessageFileViewTitle=Error opening server file view
 LocalFileSelector_AllFiles=Todos los ficheros
 LocalFileSelector_None=<ninguno>
 LocalFileSelector_SelectFile=Seleccionar Fichero
@@ -28,3 +30,14 @@ UploadFileToAgent_JobTitle=Iniciar el env\u00edo del fichero al agente
 UploadFileToServer_JobError=No es posible subir el fichero al servidor
 UploadFileToServer_JobTitle=Subir fichero al servidor
 UploadFileToServer_TaskNamePrefix=Subir fichero
+ViewServerFile_DeletAck=Are you sure you want to delete this file?
+ViewServerFile_DeletFileFromServerJob=Delete file from server
+ViewServerFile_DeleteConfirmation=Delete confirmation
+ViewServerFile_DeleteFileOnServerAction=Delete file on server
+ViewServerFile_ErrorDeleteFileJob=Error while deleting file.
+ViewServerFile_FileName=File name
+ViewServerFile_FileSize=File size
+ViewServerFile_FileType=File type
+ViewServerFile_ModificationDate=Modification day
+ViewServerFile_ShowFilterAction=Show filter
+ViewServerFile_UploadFileOnServerAction=Upload new file on server
index 117f98a..36b18ca 100644 (file)
@@ -1,3 +1,5 @@
+GetServerFileList_ErrorMessageFileView=Error opening server file list:
+GetServerFileList_ErrorMessageFileViewTitle=Error opening server file view
 LocalFileSelector_AllFiles=\u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b
 LocalFileSelector_None=<\u043d\u0435\u0442>
 LocalFileSelector_SelectFile=\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0444\u0430\u0439\u043b
@@ -27,4 +29,15 @@ UploadFileToAgent_JobError=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043
 UploadFileToAgent_JobTitle=\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043d\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0444\u0430\u0439\u043b\u0430
 UploadFileToServer_JobError=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440
 UploadFileToServer_JobTitle=\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440
-UploadFileToServer_TaskNamePrefix=\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 
+UploadFileToServer_TaskNamePrefix=\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430
+ViewServerFile_DeletAck=Are you sure you want to delete this file?
+ViewServerFile_DeletFileFromServerJob=Delete file from server
+ViewServerFile_DeleteConfirmation=Delete confirmation
+ViewServerFile_DeleteFileOnServerAction=Delete file on server
+ViewServerFile_ErrorDeleteFileJob=Error while deleting file.
+ViewServerFile_FileName=File name
+ViewServerFile_FileSize=File size
+ViewServerFile_FileType=File type
+ViewServerFile_ModificationDate=Modification day
+ViewServerFile_ShowFilterAction=Show filter
+ViewServerFile_UploadFileOnServerAction=Upload new file on server
index cda7579..8448974 100644 (file)
@@ -1,3 +1,5 @@
+GetServerFileList_ErrorMessageFileView=Error opening server file list:
+GetServerFileList_ErrorMessageFileViewTitle=Error opening server file view
 LocalFileSelector_AllFiles=All files
 LocalFileSelector_None=<none>
 LocalFileSelector_SelectFile=Select File
@@ -27,4 +29,15 @@ UploadFileToAgent_JobError=Cannot start file upload job
 UploadFileToAgent_JobTitle=Initiate file upload to agent
 UploadFileToServer_JobError=Cannot upload file to server
 UploadFileToServer_JobTitle=Upload file to server
-UploadFileToServer_TaskNamePrefix=Upload file 
+UploadFileToServer_TaskNamePrefix=Upload file
+ViewServerFile_DeletAck=Are you sure you want to delete this file?
+ViewServerFile_DeletFileFromServerJob=Delete file from server
+ViewServerFile_DeleteConfirmation=Delete confirmation
+ViewServerFile_DeleteFileOnServerAction=Delete file on server
+ViewServerFile_ErrorDeleteFileJob=Error while deleting file.
+ViewServerFile_FileName=File name
+ViewServerFile_FileSize=File size
+ViewServerFile_FileType=File type
+ViewServerFile_ModificationDate=Modification day
+ViewServerFile_ShowFilterAction=Show filter
+ViewServerFile_UploadFileOnServerAction=Upload new file on server
diff --git a/src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/views/ViewServerFile.java b/src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/views/ViewServerFile.java
new file mode 100644 (file)
index 0000000..83306e3
--- /dev/null
@@ -0,0 +1,473 @@
+/**
+ * NetXMS - open source network management system
+ * Copyright (C) 2003-2014 Raden Solutions
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.netxms.ui.eclipse.filemanager.views;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.commands.ActionHandler;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.part.ViewPart;
+import org.netxms.api.client.ProgressListener;
+import org.netxms.api.client.SessionListener;
+import org.netxms.api.client.SessionNotification;
+import org.netxms.client.NXCNotification;
+import org.netxms.client.NXCSession;
+import org.netxms.client.ServerFile;
+import org.netxms.ui.eclipse.actions.RefreshAction;
+import org.netxms.ui.eclipse.console.resources.SharedIcons;
+import org.netxms.ui.eclipse.filemanager.Activator;
+import org.netxms.ui.eclipse.filemanager.Messages;
+import org.netxms.ui.eclipse.filemanager.dialogs.StartClientToServerFileUploadDialog;
+import org.netxms.ui.eclipse.filemanager.views.helpers.ServerFileComparator;
+import org.netxms.ui.eclipse.filemanager.views.helpers.ServerFileFilter;
+import org.netxms.ui.eclipse.filemanager.views.helpers.ServerFileLabelProvider;
+import org.netxms.ui.eclipse.jobs.ConsoleJob;
+import org.netxms.ui.eclipse.shared.ConsoleSharedData;
+import org.netxms.ui.eclipse.tools.MessageDialogHelper;
+import org.netxms.ui.eclipse.tools.WidgetHelper;
+import org.netxms.ui.eclipse.widgets.FilterText;
+import org.netxms.ui.eclipse.widgets.SortableTableViewer;
+
+/**
+ * Editor for server files
+ */
+public class ViewServerFile extends ViewPart implements SessionListener
+{
+   public static final String ID = "org.netxms.ui.eclipse.usermanager.view.server_files"; //$NON-NLS-1$
+   
+   private static final String TABLE_CONFIG_PREFIX = "ServerFilesEditor"; //$NON-NLS-1$
+
+   // Columns
+   public static final int COLUMN_NAME = 0;
+   public static final int COLUMN_TYPE = 1;
+   public static final int COLUMN_SIZE = 2;
+   public static final int COLUMN_MODIFYED = 3;
+       
+   private boolean filterEnabled = false;
+   private Composite content;
+   private ServerFile[] files;
+   private ServerFileFilter filter;
+   private FilterText filterText;
+   private SortableTableViewer viewer;
+   private NXCSession session;
+   private Action actionRefresh;
+   private Action actionNew;
+   private Action actionDelete;
+   private Action actionShowFilter;
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+        */
+       @Override
+       public void createPartControl(Composite parent)
+       {
+               session = (NXCSession)ConsoleSharedData.getSession();
+               
+               content = new Composite(parent, SWT.NONE);
+               content.setLayout(new FormLayout());
+               
+               // Create filter area
+               filterText = new FilterText(content, SWT.NONE);
+               filterText.addModifyListener(new ModifyListener() {
+                       @Override
+                       public void modifyText(ModifyEvent e)
+                       {
+                               onFilterModify();
+                       }
+               });
+               filterText.setCloseAction(new Action() {
+                       @Override
+                       public void run()
+                       {
+                               enableFilter(false);
+                       }
+               });
+               
+               final String[] columnNames = {Messages.get().ViewServerFile_FileName, Messages.get().ViewServerFile_FileType, Messages.get().ViewServerFile_FileSize, Messages.get().ViewServerFile_ModificationDate};
+               final int[] columnWidths = { 300, 150, 300, 300 };
+               viewer = new SortableTableViewer(content, columnNames, columnWidths, 0, SWT.UP, SortableTableViewer.DEFAULT_STYLE);
+               WidgetHelper.restoreTableViewerSettings(viewer, Activator.getDefault().getDialogSettings(), TABLE_CONFIG_PREFIX);
+               viewer.setContentProvider(new ArrayContentProvider());
+               viewer.setLabelProvider(new ServerFileLabelProvider());
+               viewer.setComparator(new ServerFileComparator());
+               filter = new ServerFileFilter();
+               viewer.addFilter(filter);
+               viewer.addSelectionChangedListener(new ISelectionChangedListener()
+               {
+                       @Override
+                       public void selectionChanged(SelectionChangedEvent event)
+                       {
+                               IStructuredSelection selection = (IStructuredSelection)event.getSelection();
+                               if (selection != null)
+                               {
+                                       actionDelete.setEnabled(selection.size() > 0);
+                               }
+                       }
+               });
+               viewer.getTable().addDisposeListener(new DisposeListener() {
+                       @Override
+                       public void widgetDisposed(DisposeEvent e)
+                       {
+                               WidgetHelper.saveTableViewerSettings(viewer, Activator.getDefault().getDialogSettings(), TABLE_CONFIG_PREFIX);
+                       }
+               });
+               
+               
+               // Setup layout
+               FormData fd = new FormData();
+               fd.left = new FormAttachment(0, 0);
+               fd.top = new FormAttachment(filterText);
+               fd.right = new FormAttachment(100, 0);
+               fd.bottom = new FormAttachment(100, 0);
+               viewer.getTable().setLayoutData(fd);
+               
+               fd = new FormData();
+               fd.left = new FormAttachment(0, 0);
+               fd.top = new FormAttachment(0, 0);
+               fd.right = new FormAttachment(100, 0);
+               filterText.setLayoutData(fd);
+               
+               createActions();
+               contributeToActionBars();
+               createPopupMenu();
+               session.addListener(this);
+               
+               filterText.setCloseAction(actionShowFilter);            
+               
+               // Set initial focus to filter input line
+               if (filterEnabled)
+                       filterText.setFocus();
+               else
+                       enableFilter(false);    // Will hide filter area correctly
+               
+               refreshFileList();
+       }
+
+       /**
+        * Create actions
+        */
+       private void createActions()
+       {
+               final IHandlerService handlerService = (IHandlerService)getSite().getService(IHandlerService.class);
+               actionRefresh = new RefreshAction(this) {
+                       @Override
+                       public void run()
+                       {
+                               refreshFileList();
+                       }
+               };
+               
+               actionNew = new Action(Messages.get().ViewServerFile_UploadFileOnServerAction) {
+                       @Override
+                       public void run()
+                       {
+                               createFile();
+                       }
+               };
+               actionNew.setImageDescriptor(SharedIcons.ADD_OBJECT);
+               
+               actionDelete = new Action(Messages.get().ViewServerFile_DeleteFileOnServerAction) {
+                       @Override
+                       public void run()
+                       {
+                               deleteFile();
+                       }
+               };
+               actionDelete.setImageDescriptor(SharedIcons.DELETE_OBJECT);
+               actionShowFilter = new Action(Messages.get().ViewServerFile_ShowFilterAction, Action.AS_CHECK_BOX) {
+                       @Override
+                       public void run()
+                       {
+                               enableFilter(!filterEnabled);
+                               actionShowFilter.setChecked(filterEnabled);
+                       }
+           };
+           actionShowFilter.setChecked(filterEnabled);
+           actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.datacollection.commands.show_dci_filter"); //$NON-NLS-1$
+               final ActionHandler showFilterHandler = new ActionHandler(actionShowFilter);
+               handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), showFilterHandler);
+       }
+
+       /**
+        * Contribute actions to action bar
+        */
+       private void contributeToActionBars()
+       {
+               IActionBars bars = getViewSite().getActionBars();
+               fillLocalPullDown(bars.getMenuManager());
+               fillLocalToolBar(bars.getToolBarManager());
+       }
+
+       /**
+        * Fill local pull-down menu
+        * 
+        * @param manager
+        *           Menu manager for pull-down menu
+        */
+       private void fillLocalPullDown(IMenuManager manager)
+       {
+               manager.add(actionShowFilter);
+               manager.add(new Separator());
+               manager.add(actionNew);
+               manager.add(actionDelete);
+               manager.add(new Separator());
+               manager.add(actionRefresh);
+       }
+
+       /**
+        * Fill local tool bar
+        * 
+        * @param manager
+        *           Menu manager for local tool bar
+        */
+       private void fillLocalToolBar(IToolBarManager manager)
+       {
+               manager.add(actionShowFilter);
+               manager.add(new Separator());
+               manager.add(actionNew);
+               manager.add(actionDelete);
+               manager.add(new Separator());
+               manager.add(actionRefresh);
+       }
+       
+       /**
+        * Create pop-up menu for user list
+        */
+       private void createPopupMenu()
+       {
+               // Create menu manager
+               MenuManager menuMgr = new MenuManager();
+               menuMgr.setRemoveAllWhenShown(true);
+               menuMgr.addMenuListener(new IMenuListener() {
+                       public void menuAboutToShow(IMenuManager mgr)
+                       {
+                               fillContextMenu(mgr);
+                       }
+               });
+
+               // Create menu
+               Menu menu = menuMgr.createContextMenu(viewer.getControl());
+               viewer.getControl().setMenu(menu);
+
+               // Register menu for extension.
+               getSite().registerContextMenu(menuMgr, viewer);
+       }
+
+       /**
+        * Fill context menu
+        * 
+        * @param mgr Menu manager
+        */
+       protected void fillContextMenu(final IMenuManager mgr)
+       {
+               mgr.add(actionShowFilter);
+               mgr.add(new Separator());
+               mgr.add(actionNew);
+               mgr.add(actionDelete);
+               mgr.add(new Separator());
+               mgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
+               mgr.add(new Separator());
+       }
+
+       /**
+        * Refresh file list
+        */
+       private void refreshFileList()
+       {
+          new ConsoleJob(Messages.get().SelectServerFileDialog_JobTitle, null, Activator.PLUGIN_ID, null) {
+                       @Override
+                       protected void runInternal(IProgressMonitor monitor) throws Exception
+                       {
+                               files = session.listServerFiles();
+                               runInUIThread(new Runnable() {
+                                       @Override
+                                       public void run()
+                                       {
+                                               viewer.setInput(files);
+                                       }
+                               });
+                       }
+
+                       @Override
+                       protected String getErrorMessage()
+                       {
+                               return Messages.get().SelectServerFileDialog_JobError;
+                       }
+               }.start();
+       }
+       
+       /**
+        * Create new file
+        */
+       private void createFile()
+       {
+               final StartClientToServerFileUploadDialog dlg = new StartClientToServerFileUploadDialog(getSite().getShell());
+               if (dlg.open() == Window.OK)
+               {
+                       final NXCSession session = (NXCSession)ConsoleSharedData.getSession();
+                       new ConsoleJob(Messages.get().UploadFileToServer_JobTitle, null, Activator.PLUGIN_ID, null) {
+                               @Override
+                               protected void runInternal(final IProgressMonitor monitor) throws Exception
+                               {
+                                       session.uploadFileToServer(dlg.getLocalFile(), dlg.getRemoteFileName(), new ProgressListener() {
+                                               private long prevWorkDone = 0;
+                                               
+                                               @Override
+                                               public void setTotalWorkAmount(long workTotal)
+                                               {
+                                                       monitor.beginTask(Messages.get().UploadFileToServer_TaskNamePrefix + dlg.getLocalFile().getAbsolutePath(), (int)workTotal);
+                                               }
+                                               
+                                               @Override
+                                               public void markProgress(long workDone)
+                                               {
+                                                       monitor.worked((int)(workDone - prevWorkDone));
+                                                       prevWorkDone = workDone;
+                                               }
+                                       });
+                                       monitor.done();
+                               }
+                               
+                               @Override
+                               protected String getErrorMessage()
+                               {
+                                       return Messages.get().UploadFileToServer_JobError;
+                               }
+                       }.start();
+               }
+       }
+       
+       /**
+        * Delete selected file
+        */
+       private void deleteFile()
+       {
+               IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
+               if (selection.isEmpty())
+                       return;
+               
+               if (!MessageDialogHelper.openConfirm(getSite().getShell(), Messages.get().ViewServerFile_DeleteConfirmation, Messages.get().ViewServerFile_DeletAck))
+                       return;
+               
+               final Object[] objects = selection.toArray();
+               new ConsoleJob(Messages.get().ViewServerFile_DeletFileFromServerJob, this, Activator.PLUGIN_ID, Activator.PLUGIN_ID) {
+                       @Override
+                       protected String getErrorMessage()
+                       {
+                               return Messages.get().ViewServerFile_ErrorDeleteFileJob;
+                       }
+
+                       @Override
+                       protected void runInternal(IProgressMonitor monitor) throws Exception
+                       {
+                               for(int i = 0; i < objects.length; i++)
+                               {
+                                       session.deleteServerFile(((ServerFile)objects[i]).getName());
+                               }
+                       }
+               }.start();
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
+        */
+       @Override
+       public void setFocus()
+       {
+               viewer.getControl().setFocus();
+       }
+
+       /* (non-Javadoc)
+        * @see org.netxms.api.client.SessionListener#notificationHandler(org.netxms.api.client.SessionNotification)
+        */
+       @Override
+       public void notificationHandler(final SessionNotification n)
+       {
+          if(n.getCode() == NXCNotification.FILE_LIST_CHANGED)
+          {
+             refreshFileList();
+          }
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.part.WorkbenchPart#dispose()
+        */
+       @Override
+       public void dispose()
+       {
+               session.removeListener(this);
+               super.dispose();
+       }
+       
+       /**
+        * Enable or disable filter
+        * 
+        * @param enable New filter state
+        */
+       private void enableFilter(boolean enable)
+       {
+               filterEnabled = enable;
+               filterText.setVisible(filterEnabled);
+               FormData fd = (FormData)viewer.getTable().getLayoutData();
+               fd.top = enable ? new FormAttachment(filterText) : new FormAttachment(0, 0);
+               content.layout();
+               if (enable)
+               {
+                       filterText.setFocus();
+               }
+               else
+               {
+                       filterText.setText(""); //$NON-NLS-1$
+                       onFilterModify();
+               }
+       }
+
+       /**
+        * Handler for filter modification
+        */
+       private void onFilterModify()
+       {
+               final String text = filterText.getText();
+               filter.setFilterString(text);
+               viewer.refresh(false);
+       }
+}
diff --git a/src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/views/helpers/ServerFileComparator.java b/src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/views/helpers/ServerFileComparator.java
new file mode 100644 (file)
index 0000000..bb64c75
--- /dev/null
@@ -0,0 +1,52 @@
+/**
+ * 
+ */
+package org.netxms.ui.eclipse.filemanager.views.helpers;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.TableColumn;
+import org.netxms.client.ServerFile;
+import org.netxms.ui.eclipse.filemanager.views.ViewServerFile;
+
+/**
+ * Comparator for ServerFile objects
+ *
+ */
+public class ServerFileComparator extends ViewerComparator
+{
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+        */
+       @Override
+       public int compare(Viewer viewer, Object e1, Object e2)
+       {
+               TableColumn sortColumn = ((TableViewer)viewer).getTable().getSortColumn();
+               if (sortColumn == null)
+                       return 0;
+               
+               int rc;
+               switch((Integer)sortColumn.getData("ID")) //$NON-NLS-1$
+               {
+                       case ViewServerFile.COLUMN_NAME:
+                               rc = ((ServerFile)e1).getName().compareToIgnoreCase(((ServerFile)e2).getName());
+                               break;
+                       case ViewServerFile.COLUMN_TYPE:
+                               rc = ((ServerFile)e1).getType().compareToIgnoreCase(((ServerFile)e2).getType());
+                               break;
+                       case ViewServerFile.COLUMN_SIZE:
+                               rc = Long.signum(((ServerFile)e1).getSize() - ((ServerFile)e2).getSize());
+                               break;
+                       case ViewServerFile.COLUMN_MODIFYED:
+                               rc = ((ServerFile)e1).getModifyicationTime().compareTo(((ServerFile)e2).getModifyicationTime());
+                               break;
+                       default:
+                               rc = 0;
+                               break;
+               }
+               int dir = ((TableViewer)viewer).getTable().getSortDirection();
+               return (dir == SWT.UP) ? rc : -rc;
+       }
+}
diff --git a/src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/views/helpers/ServerFileFilter.java b/src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/views/helpers/ServerFileFilter.java
new file mode 100644 (file)
index 0000000..d16b249
--- /dev/null
@@ -0,0 +1,60 @@
+/**
+ * NetXMS - open source network management system
+ * Copyright (C) 2003-2011 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.netxms.ui.eclipse.filemanager.views.helpers;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.netxms.client.ServerFile;
+
+/**
+ * Filter for server file editor
+ */
+public class ServerFileFilter extends ViewerFilter
+{
+       private String filterString = null;
+
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+        */
+       @Override
+       public boolean select(Viewer viewer, Object parentElement, Object element)
+       {
+               if ((filterString == null) || (filterString.isEmpty()))
+                       return true;
+               
+               final ServerFile filename = (ServerFile)element;
+               return filename.getName().toLowerCase().contains(filterString);
+       }
+
+       /**
+        * @return the filterString
+        */
+       public String getFilterString()
+       {
+               return filterString;
+       }
+
+       /**
+        * @param filterString the filterString to set
+        */
+       public void setFilterString(String filterString)
+       {
+               this.filterString = filterString.toLowerCase();
+       }
+}
diff --git a/src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/views/helpers/ServerFileLabelProvider.java b/src/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/views/helpers/ServerFileLabelProvider.java
new file mode 100644 (file)
index 0000000..df0f5e2
--- /dev/null
@@ -0,0 +1,100 @@
+/**
+ * NetXMS - open source network management system
+ * Copyright (C) 2003-2011 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.netxms.ui.eclipse.filemanager.views.helpers;
+
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.netxms.client.ServerFile;
+import org.netxms.ui.eclipse.console.resources.RegionalSettings;
+import org.netxms.ui.eclipse.filemanager.views.ViewServerFile;
+
+/**
+ * Label provider for ServerFile objects
+ *
+ */
+public class ServerFileLabelProvider extends LabelProvider implements ITableLabelProvider
+{
+       private WorkbenchLabelProvider wbLabelProvider;
+       
+       public ServerFileLabelProvider()
+       {
+               wbLabelProvider = new WorkbenchLabelProvider();
+       }
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+        */
+       @Override
+       public Image getColumnImage(Object element, int columnIndex)
+       {
+               if (columnIndex == 0)
+                       return getImage(element);
+               return null;
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+        */
+       @Override
+       public String getColumnText(Object element, int columnIndex)
+       {
+               switch(columnIndex)
+               {
+                       case ViewServerFile.COLUMN_NAME:
+                               return getText(element);
+                       case ViewServerFile.COLUMN_TYPE:
+                               return ((ServerFile)element).getType();
+                       case ViewServerFile.COLUMN_SIZE:
+                               return Long.toString(((ServerFile)element).getSize());
+                       case ViewServerFile.COLUMN_MODIFYED:
+                               return RegionalSettings.getDateTimeFormat().format(((ServerFile)element).getModifyicationTime());
+               }
+               return null;
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
+        */
+       @Override
+       public Image getImage(Object element)
+       {
+               return wbLabelProvider.getImage(element);
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
+        */
+       @Override
+       public String getText(Object element)
+       {
+               return wbLabelProvider.getText(element);
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.viewers.BaseLabelProvider#dispose()
+        */
+       @Override
+       public void dispose()
+       {
+               wbLabelProvider.dispose();
+               super.dispose();
+       }
+}
index 1c22ce5..5ced628 100644 (file)
@@ -76,7 +76,9 @@ public class ImageLibrary extends ViewPart implements ImageUpdateListener
 
        protected int currentIconSize = MIN_GRID_ICON_SIZE;
 
-       /* (non-Javadoc)
+       /*
+        * (non-Javadoc)
+        * 
         * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
         */
        @Override
@@ -132,7 +134,9 @@ public class ImageLibrary extends ViewPart implements ImageUpdateListener
                });
        }
 
-       /* (non-Javadoc)
+       /*
+        * (non-Javadoc)
+        * 
         * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
         */
        @Override
@@ -240,6 +244,14 @@ public class ImageLibrary extends ViewPart implements ImageUpdateListener
                actionZoomOut.setImageDescriptor(SharedIcons.ZOOM_OUT);
        }
 
+       protected void verifyImageFile(String fileName)
+       {
+               if (fileName != null)
+               {
+                       new Image(getSite().getShell().getDisplay(), fileName);
+               }
+       }
+
        /**
         * @param galleryItem
         * @param name
@@ -254,6 +266,7 @@ public class ImageLibrary extends ViewPart implements ImageUpdateListener
                        @Override
                        protected void runInternal(final IProgressMonitor monitor) throws Exception
                        {
+                               verifyImageFile(fileName);
                                if (fileName != null)
                                {
                                        FileInputStream stream = null;
@@ -280,13 +293,13 @@ public class ImageLibrary extends ViewPart implements ImageUpdateListener
 
                                session.modifyImage(image, new ProgressListener() {
                                        private long prevDone = 0;
-                                       
+
                                        @Override
                                        public void setTotalWorkAmount(long workTotal)
                                        {
                                                monitor.beginTask(Messages.get().ImageLibrary_UpdateImage, (int)workTotal);
                                        }
-                                       
+
                                        @Override
                                        public void markProgress(long workDone)
                                        {
@@ -295,7 +308,7 @@ public class ImageLibrary extends ViewPart implements ImageUpdateListener
                                        }
                                });
 
-                               //ImageProvider.getInstance().syncMetaData(session, getSite().getShell().getDisplay());
+                               // ImageProvider.getInstance().syncMetaData(session, getSite().getShell().getDisplay());
                                ImageProvider.getInstance().syncMetaData();
                                refreshImages(); /* TODO: update single element */
 
@@ -321,6 +334,8 @@ public class ImageLibrary extends ViewPart implements ImageUpdateListener
                        @Override
                        protected void runInternal(final IProgressMonitor monitor) throws Exception
                        {
+                               verifyImageFile(fileName);
+
                                final LibraryImage image = new LibraryImage();
 
                                final long fileSize = new File(fileName).length();
@@ -330,7 +345,7 @@ public class ImageLibrary extends ViewPart implements ImageUpdateListener
                                        stream = new FileInputStream(fileName);
                                        byte imageData[] = new byte[(int)fileSize];
                                        stream.read(imageData);
-       
+
                                        image.setBinaryData(imageData);
                                        image.setName(name);
                                        image.setCategory(category);
@@ -343,13 +358,13 @@ public class ImageLibrary extends ViewPart implements ImageUpdateListener
 
                                session.createImage(image, new ProgressListener() {
                                        private long prevDone = 0;
-                                       
+
                                        @Override
                                        public void setTotalWorkAmount(long workTotal)
                                        {
                                                monitor.beginTask(Messages.get().ImageLibrary_UploadImage, (int)workTotal);
                                        }
-                                       
+
                                        @Override
                                        public void markProgress(long workDone)
                                        {
@@ -358,7 +373,7 @@ public class ImageLibrary extends ViewPart implements ImageUpdateListener
                                        }
                                });
 
-                               ///ImageProvider.getInstance().syncMetaData(session, getSite().getShell().getDisplay());
+                               // /ImageProvider.getInstance().syncMetaData(session, getSite().getShell().getDisplay());
                                // TODO: check
                                ImageProvider.getInstance().syncMetaData();
                                refreshImages(); /* TODO: update local copy */
index 3c9e190..d9db30c 100644 (file)
@@ -83,6 +83,7 @@ public class ObjectFigureLargeLabel extends ObjectFigure
 
       additionalInfo = new Label(object.getObjectName());
       additionalInfo.setLabelAlignment(PositionConstants.LEFT);
+      additionalInfo.setFont(labelProvider.getLabelFont());
       add(additionalInfo);
       gd = new GridData();
       gd.horizontalAlignment = SWT.FILL;
index 3513f9a..7312a4d 100644 (file)
@@ -2,16 +2,17 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: NXMC Object Browser Plug-in
 Bundle-SymbolicName: org.netxms.ui.eclipse.objectbrowser;singleton:=true
-Bundle-Version: 1.2.10
+Bundle-Version: 1.2.12
 Bundle-Activator: org.netxms.ui.eclipse.objectbrowser.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
  org.eclipse.core.runtime;bundle-version="3.7.0",
- org.netxms.ui.eclipse.console;bundle-version="1.2.10"
+ org.netxms.ui.eclipse.console;bundle-version="1.2.12"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
 Export-Package: org.netxms.ui.eclipse.objectbrowser.api,
  org.netxms.ui.eclipse.objectbrowser.dialogs,
  org.netxms.ui.eclipse.objectbrowser.shared,
  org.netxms.ui.eclipse.objectbrowser.views,
- org.netxms.ui.eclipse.objectbrowser.widgets
+ org.netxms.ui.eclipse.objectbrowser.widgets,
+ org.netxms.ui.eclipse.objectbrowser.widgets.internal
index b3f22ed..731c6ce 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * NetXMS - open source network management system
- * Copyright (C) 2003-2013 Victor Kirhenshtein
+ * Copyright (C) 2003-2014 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
@@ -711,7 +711,14 @@ public class ObjectTree extends Composite
 
             IStructuredSelection selection = (IStructuredSelection)LocalSelectionTransfer.getTransfer().getSelection();
             TreePath path = ((TreeSelection)selection).getPaths()[0];
-            AbstractObject parent = (AbstractObject)path.getSegment(path.getSegmentCount() - 2);
+            
+            long parentId = 0;
+            if (path.getSegmentCount() > 1)
+            {
+               final AbstractObject parent = (AbstractObject)path.getSegment(path.getSegmentCount() - 2);
+               if (parent != null)
+                  parentId = parent.getObjectId();
+            }
             
             Iterator<?> it = selection.iterator();
             if(!it.hasNext())
@@ -768,7 +775,7 @@ public class ObjectTree extends Composite
                      break;
                }
 
-               if(((AbstractObject)object).getParents().next() != (parent.getObjectId()))
+               if(((AbstractObject)object).getParents().next() != parentId)
                   return false;
                
                if(!filter.contains(((AbstractObject)target).getObjectClass()) || target.equals(object)){
index 82a978c..da700bc 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: NXMC Object Tools plugin
 Bundle-SymbolicName: org.netxms.ui.eclipse.objecttools;singleton:=true
-Bundle-Version: 1.2.11
+Bundle-Version: 1.2.12
 Bundle-Activator: org.netxms.ui.eclipse.objecttools.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
index 4d3c1f0..9cc52ae 100644 (file)
@@ -122,17 +122,15 @@ public class ObjectToolsDynamicMenu extends ContributionItem implements IWorkben
                int added = 0;
                for(int i = 0; i < tools.length; i++)
                {
-                       boolean allowed = isToolAllowed(tools[i], nodes);
-                       boolean enabled = (tools[i].getFlags() & ObjectTool.DISABLED) == 0 ;
-                       
-                       if (allowed && isToolApplicable(tools[i], nodes) && enabled)
+                       boolean enabled = (tools[i].getFlags() & ObjectTool.DISABLED) == 0;
+                       if (enabled && isToolAllowed(tools[i], nodes) && isToolApplicable(tools[i], nodes))
                        {
                                String[] path = tools[i].getName().split("\\-\\>"); //$NON-NLS-1$
                        
                                Menu rootMenu = toolsMenu;
                                for(int j = 0; j < path.length - 1; j++)
                                {
-                                       String key = path[j].replace("&", ""); //$NON-NLS-1$ //$NON-NLS-2$
+               final String key = rootMenu.hashCode() + "@" + path[j].replace("&", ""); //$NON-NLS-1$ //$NON-NLS-2$
                                        Menu currMenu = menus.get(key);
                                        if (currMenu == null)
                                        {
index 5e51d85..3c7dae4 100644 (file)
@@ -2,14 +2,14 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: NXMC SNMP Plug-in
 Bundle-SymbolicName: org.netxms.ui.eclipse.snmp;singleton:=true
-Bundle-Version: 1.2.10
+Bundle-Version: 1.2.12
 Bundle-Activator: org.netxms.ui.eclipse.snmp.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
  org.eclipse.core.runtime;bundle-version="3.7.0",
  org.netxms.ui.eclipse.eventmanager;bundle-version="1.2.10",
- org.netxms.ui.eclipse.console;bundle-version="1.2.10",
- org.netxms.ui.eclipse.objectbrowser;bundle-version="1.2.10",
+ org.netxms.ui.eclipse.console;bundle-version="1.2.12",
+ org.netxms.ui.eclipse.objectbrowser;bundle-version="1.2.12",
  org.eclipse.core.resources;bundle-version="3.7.101"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
index 44f3e41..bb0391f 100644 (file)
@@ -44,7 +44,7 @@ import org.netxms.ui.eclipse.snmp.Messages;
  */
 public final class MibCache implements ConsoleLoginListener
 {      
-       private static MibTree mibTree = new MibTree();
+       private static MibTree mibTree = null;
 
        /* (non-Javadoc)
         * @see org.netxms.ui.eclipse.console.api.ConsoleLoginListener#afterLogin(org.netxms.client.NXCSession, org.eclipse.swt.widgets.Display)
@@ -108,8 +108,6 @@ public final class MibCache implements ConsoleLoginListener
                                              file.delete();
                                                }
                                        }
-                                       
-                                       MibCache.mibTree = new MibTree(mibFile);
                                }
                        }
 
@@ -128,7 +126,35 @@ public final class MibCache implements ConsoleLoginListener
         */
        public static MibTree getMibTree()
        {
-               return mibTree;
+          if (mibTree != null)
+             return mibTree;
+
+      Location loc = Platform.getInstanceLocation();
+      if (loc != null)
+      {
+         File targetDir;
+         try
+         {
+            targetDir = new File(loc.getURL().toURI());
+         }
+         catch(URISyntaxException e)
+         {
+            targetDir = new File(loc.getURL().getPath());
+         }
+         File mibFile = new File(targetDir, "netxms.mib"); //$NON-NLS-1$
+         if (mibFile.exists())
+         {
+            try
+            {
+               mibTree = new MibTree(mibFile);
+            }
+            catch(Exception e)
+            {
+               Activator.logError("Cannot load MIB file", e);
+            }
+         }
+      }
+               return (mibTree != null) ? mibTree : new MibTree();
        }
        
        /**
@@ -143,6 +169,9 @@ public final class MibCache implements ConsoleLoginListener
         */
        public static MibObject findObject(String oid, boolean exactMatch)
        {
+          if (mibTree == null)
+             return null;
+          
                SnmpObjectId id;
                try
                {
index 09a0e5d..c492a4b 100644 (file)
@@ -29,7 +29,6 @@ import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
 import org.netxms.client.NXCSession;
 import org.netxms.client.objects.AbstractNode;
 import org.netxms.client.objects.AbstractObject;
@@ -72,7 +71,7 @@ public class ShowVlans implements IObjectActionDelegate
                                protected void runInternal(IProgressMonitor monitor) throws Exception
                                {
                                        final List<VlanInfo> vlans = session.getVlans(objectId);
-                                       PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+                                       runInUIThread(new Runnable() {
                                                @Override
                                                public void run()
                                                {
index 52ce061..00a86d6 100644 (file)
@@ -97,6 +97,7 @@ public class Messages extends NLS
        public static String SystemRights_EditEPP;
        public static String SystemRights_EditServerConfig;
    public static String SystemRights_ExecuteXMPPCommands;
+   public static String SystemRights_ManageImageLibrary;
        public static String SystemRights_JobError;
        public static String SystemRights_JobTitle;
        public static String SystemRights_LoginAsMobile;
index c66aaa1..117de51 100644 (file)
@@ -90,6 +90,7 @@ SystemRights_DeleteAlarms=Delete alarms
 SystemRights_EditEPP=Edit event processing policy
 SystemRights_EditServerConfig=Edit server configuration variables
 SystemRights_ExecuteXMPPCommands=Execute commands via XMPP
+SystemRights_ManageImageLibrary=Manage Image Library
 SystemRights_JobError=Cannot update user object
 SystemRights_JobTitle=Update user database object
 SystemRights_LoginAsMobile=Login as mobile device
index f059edc..34bc9d1 100644 (file)
@@ -96,6 +96,7 @@ SystemRights_LoginAsMobile=P\u0159ihl\u00E1sit se jako mobiln\u00ED za\u0159\u00
 SystemRights_ManageAgents=Spravovat konfigurace agent\u016F
 SystemRights_ManageDCISummaryTables=Manage DCI summary tables
 SystemRights_ManageFiles=Spravovat soubory na serveru
+SystemRights_ManageImageLibrary=Manage Image Library
 SystemRights_ManageMappingTables=Spravovat mapovac\u00ED tabulky
 SystemRights_ManagePackages=Spravovat bal\u00ED\u010Dky
 SystemRights_ManageScripts=Spravovat knihovnu skript\u016F
index 5690b54..7c871fc 100644 (file)
@@ -96,6 +96,7 @@ SystemRights_LoginAsMobile=Login as mobile device
 SystemRights_ManageAgents=Manage agent configurations
 SystemRights_ManageDCISummaryTables=Manage DCI summary tables
 SystemRights_ManageFiles=Manage server files
+SystemRights_ManageImageLibrary=Manage Image Library
 SystemRights_ManageMappingTables=Manage mapping tables
 SystemRights_ManagePackages=Manage packages
 SystemRights_ManageScripts=Manage script library
index 1525e4d..348554c 100644 (file)
@@ -96,6 +96,7 @@ SystemRights_LoginAsMobile=\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044
 SystemRights_ManageAgents=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0430\u0433\u0435\u043d\u0442\u0430
 SystemRights_ManageDCISummaryTables=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0434\u043d\u044b\u043c\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u043c\u0435\u0442\u0440\u0438\u043a
 SystemRights_ManageFiles=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435
+SystemRights_ManageImageLibrary=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439
 SystemRights_ManageMappingTables=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439
 SystemRights_ManagePackages=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438
 SystemRights_ManageScripts=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432
index 5690b54..7c871fc 100644 (file)
@@ -96,6 +96,7 @@ SystemRights_LoginAsMobile=Login as mobile device
 SystemRights_ManageAgents=Manage agent configurations
 SystemRights_ManageDCISummaryTables=Manage DCI summary tables
 SystemRights_ManageFiles=Manage server files
+SystemRights_ManageImageLibrary=Manage Image Library
 SystemRights_ManageMappingTables=Manage mapping tables
 SystemRights_ManagePackages=Manage packages
 SystemRights_ManageScripts=Manage script library
index 2b4d618..f4ce4e8 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
       <groupId>org.netxms</groupId>
       <artifactId>netxms</artifactId>
-      <version>1.2.11</version>
+      <version>1.2.12</version>
     </parent>
 
     <groupId>org.netxms</groupId>
index 95f5c1d..862f054 100644 (file)
@@ -3,7 +3,7 @@
 
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.netxms</groupId>
-  <version>1.3.0</version>
+  <version>1.2.12</version>
   <artifactId>netxms</artifactId>
   <packaging>pom</packaging>
   <name>NetXMS Meta-package</name>
index a7c72fa..02973a4 100644 (file)
@@ -324,10 +324,11 @@ TCHAR LIBNETXMS_EXPORTABLE *NXCPMessageCodeName(WORD wCode, TCHAR *pszBuffer)
       _T("CMD_CANCEL_FILE_MONITORING"),
       _T("CMD_CHANGE_OBJECT_TOOL_STATUS"),
       _T("CMD_SET_ALARM_STATUS_FLOW"),
-      _T("CMD_DELETE_ALARM_NOTE")
+      _T("CMD_DELETE_ALARM_NOTE"),
+      _T("CMD_GET_EFFECTIVE_RIGHTS")
    };
 
-   if ((wCode >= CMD_LOGIN) && (wCode <= CMD_DELETE_ALARM_NOTE))
+   if ((wCode >= CMD_LOGIN) && (wCode <= CMD_GET_EFFECTIVE_RIGHTS))
       _tcscpy(pszBuffer, pszMsgNames[wCode - CMD_LOGIN]);
    else
       _sntprintf(pszBuffer, 64, _T("CMD_0x%04X"), wCode);
index 798aa5e..ffe2ffe 100644 (file)
@@ -65,6 +65,26 @@ void StringSet::add(const TCHAR *str)
    }
 }
 
+/**
+ * Add string to set - must be allocated by malloc()
+ */
+void StringSet::addPreallocated(TCHAR *str)
+{
+   StringSetEntry *entry;
+   int keyLen = (int)(_tcslen(str) * sizeof(TCHAR));
+   HASH_FIND(hh, m_data, str, keyLen, entry);
+   if (entry == NULL)
+   {
+      entry = (StringSetEntry *)malloc(sizeof(StringSetEntry));
+      entry->str = str;
+      HASH_ADD_KEYPTR(hh, m_data, entry->str, keyLen, entry);
+   }
+   else
+   {
+      free(str);
+   }
+}
+
 /**
  * Remove string from set
  */
@@ -96,7 +116,7 @@ void StringSet::clear()
 /**
  * Check if given string is in set
  */
-bool StringSet::exist(const TCHAR *str)
+bool StringSet::contains(const TCHAR *str)
 {
    StringSetEntry *entry;
    int keyLen = (int)(_tcslen(str) * sizeof(TCHAR));
@@ -135,3 +155,77 @@ void StringSet::addAll(StringSet *src)
       add(entry->str);
    }
 }
+
+/**
+ * Add all entries from TCHAR pointer arrays
+ */
+void StringSet::addAll(TCHAR **strings, int count)
+{
+   for(int i = 0; i < count; i++)
+      if (strings[i] != NULL)
+         add(strings[i]);
+}
+
+/**
+ * Fill NXCP message with string set data
+ *
+ * @param msg NXCP message
+ * @param baseId base ID for data fields
+ * @param countId ID of field where number of strings should be placed
+ */
+void StringSet::fillMessage(CSCPMessage *msg, UINT32 baseId, UINT32 countId)
+{
+   UINT32 varId = baseId;
+   StringSetEntry *entry, *tmp;
+   HASH_ITER(hh, m_data, entry, tmp)
+   {
+      msg->SetVariable(varId++, entry->str);
+   }
+   msg->SetVariable(countId, varId - baseId);
+}
+
+/**
+ * Add all strings from NXCP message
+ *
+ * @param msg NXCP message
+ * @param baseId base ID for data fields
+ * @param countId ID of field with number of strings
+ * @param clearBeforeAdd if set to true, existing content will be deleted
+ * @param toUppercase if set to true, all strings will be converted to upper case before adding
+ */
+void StringSet::addAllFromMessage(CSCPMessage *msg, UINT32 baseId, UINT32 countId, bool clearBeforeAdd, bool toUppercase)
+{
+   if (clearBeforeAdd)
+      clear();
+
+   int count = (int)msg->GetVariableLong(countId);
+   UINT32 varId = baseId;
+   for(int i = 0; i < count; i++)
+   {
+      TCHAR *str = msg->GetVariableStr(varId++);
+      if (str != NULL)
+      {
+         if (toUppercase)
+            _tcsupr(str);
+         addPreallocated(str);
+      }
+   }
+}
+
+/**
+ * Get all entries as one string, optionally separated by given separator
+ *
+ * @parm separator optional separator, may be NULL
+ */
+String StringSet::getAll(const TCHAR *separator)
+{
+   String result;
+   StringSetEntry *entry, *tmp;
+   HASH_ITER(hh, m_data, entry, tmp)
+   {
+      if ((separator != NULL) && (result.getSize() > 0))
+         result += separator;
+      result += entry->str;
+   }
+   return result;
+}
index ff4a79f..a86205a 100644 (file)
@@ -933,9 +933,8 @@ int wstat(const WCHAR *_path, struct stat *_sbuf)
 int w##func(const WCHAR *_path) \
 { \
        char path[MAX_PATH]; \
-       WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK | WC_DEFAULTCHAR, \
-                           _path, -1, path, MAX_PATH, NULL, NULL); \
-       return chdir(path); \
+       WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK | WC_DEFAULTCHAR, _path, -1, path, MAX_PATH, NULL, NULL); \
+       return func(path); \
 }
 
 #if !HAVE_WCHDIR
@@ -955,7 +954,19 @@ DEFINE_PATH_FUNC(remove)
 #endif
 
 #if !HAVE_WMKSTEMP
-DEFINE_PATH_FUNC(mkstemp)
+
+int LIBNETXMS_EXPORTABLE wmkstemp(WCHAR *_path)
+{
+   char path[MAX_PATH];
+   WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK | WC_DEFAULTCHAR, _path, -1, path, MAX_PATH, NULL, NULL);
+   int rc = mkstemp(path);
+   if (rc != -1)
+   {
+      MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, path, -1, _path, wcslen(_path) + 1);
+   }
+   return rc;
+}
+
 #endif
 
 #if !HAVE_WPOPEN
index abdc4cd..5dde41e 100644 (file)
@@ -1,7 +1,7 @@
 /* 
 ** NetXMS - Network Management System
 ** NetXMS Scripting Language Interpreter
-** Copyright (C) 2003-2013 Victor Kirhenshtein
+** Copyright (C) 2003-2014 Victor Kirhenshtein
 **
 ** This program is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU Lesser General Public License as published by
@@ -944,7 +944,7 @@ static int F_index_rindex(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NX
        }
 
        int index = 0;  // 0 = not found
-       if ((substrLength < strLength) && (substrLength > 0))
+       if ((substrLength <= strLength) && (substrLength > 0))
        {
                if (reverse)
                {
@@ -959,7 +959,7 @@ static int F_index_rindex(int argc, NXSL_Value **argv, NXSL_Value **ppResult, NX
                }
                else
                {
-                       for(int i = start; i < (int)(strLength - substrLength); i++)
+                       for(int i = start; i <= (int)(strLength - substrLength); i++)
                        {
                                if (!memcmp(&str[i], substr, substrLength * sizeof(TCHAR)))
                                {
index 0b74421..84cb139 100644 (file)
@@ -460,18 +460,18 @@ void conn_disconnect_clean(xmpp_conn_t * const conn)
  */
 void conn_disconnect(xmpp_conn_t * const conn) 
 {
-    xmpp_debug(conn->ctx, "xmpp", "Closing socket.");
-    conn->state = XMPP_STATE_DISCONNECTED;
-    if (conn->tls) {
-       tls_stop(conn->tls);
-       tls_free(conn->tls);
-       conn->tls = NULL;
-    }
-    sock_close(conn->sock);
-
-    /* fire off connection handler */
-    conn->conn_handler(conn, XMPP_CONN_DISCONNECT, conn->error,
-                      conn->stream_error, conn->userdata);
+   xmpp_debug(conn->ctx, "xmpp", "Closing socket.");
+   conn->state = XMPP_STATE_DISCONNECTED;
+   if (conn->tls) 
+   {
+      tls_stop(conn->tls);
+      tls_free(conn->tls);
+      conn->tls = NULL;
+   }
+   sock_close(conn->sock);
+
+   /* fire off connection handler */
+   conn->conn_handler(conn, XMPP_CONN_DISCONNECT, conn->error, conn->stream_error, conn->userdata);
 }
 
 /* prepares a parser reset.  this is called from handlers. we can't</