23 #include "wxgis/catalog/gxobject.h"
24 #include "wxgis/catalog/gxdataset.h"
25 #include "wxgis/core/json/jsonval.h"
26 #include "wxgis/catalog/contupdater.h"
30 #include "wxgis/net/curl.h"
32 #include <wx/hashmap.h>
41 class WXDLLIMPEXP_GIS_CLT wxGxNGWService :
47 DECLARE_CLASS(wxGxNGWService)
49 wxGxNGWService(
wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
50 virtual ~wxGxNGWService(
void);
52 virtual wxString GetCategory(
void)
const {
return wxString(_(
"NextGIS Web service")); };
53 virtual void Refresh(
void);
55 virtual bool Connect(
void);
56 virtual bool Disconnect(
void);
57 virtual bool IsConnected(
void);
59 virtual bool Delete(
void);
60 virtual bool CanDelete(
void) {
return true; };
61 virtual bool Rename(
const wxString& NewName);
62 virtual bool CanRename(
void) {
return true; };
63 virtual bool Copy(
const CPLString &szDestPath,
ITrackCancel*
const pTrackCancel);
64 virtual bool CanCopy(
const CPLString &szDestPath) {
return true; };
65 virtual bool Move(
const CPLString &szDestPath,
ITrackCancel*
const pTrackCancel);
66 virtual bool CanMove(
const CPLString &szDestPath) {
return CanCopy(szDestPath) & CanDelete(); };
68 virtual bool AreChildrenViewable(
void)
const {
return true; };
69 virtual bool HasChildren(
void);
70 virtual bool CanCreate(
long nDataType,
long DataSubtype);
73 virtual wxString GetLogin()
const;
74 virtual wxString GetPassword()
const;
75 virtual wxString GetURL()
const;
77 virtual void LoadChildren(
void);
78 virtual bool ConnectToNGW();
79 virtual void ReadConnectionFile();
84 bool m_bChildrenLoaded, m_bIsConnected, m_bIsAuthorized;
85 wxString m_sAuthCookie;
95 enum wxGISEnumNGWResourcesType
97 enumNGWResourceTypeNone,
98 enumNGWResourceTypeResourceGroup,
99 enumNGWResourceTypePostgisLayer,
100 enumNGWResourceTypePostgisConnection,
101 enumNGWResourceTypeWMSServerService,
102 enumNGWResourceTypeBaseLayers,
103 enumNGWResourceTypeWebMap,
104 enumNGWResourceTypeWFSServerService,
105 enumNGWResourceTypeVectorLayer
108 WX_DECLARE_HASH_MAP(
int,
wxJSONValue, wxIntegerHash, wxIntegerEqual, wxNGWResourceDataMap);
117 class WXDLLIMPEXP_GIS_CLT wxGxNGWResource :
public wxGxRemoteId
121 virtual ~wxGxNGWResource(
void);
123 virtual bool DeleteResource();
124 virtual bool RenameResource(
const wxString &sNewName);
125 virtual int GetParentResourceId()
const = 0;
126 virtual void ReportError(
int nHTTPCode,
const wxString& sBody);
128 wxGISEnumNGWResourcesType m_eResourceType;
130 wxString m_sDescription;
131 wxString m_sDisplayName;
135 wxArrayString m_aPermissions;
136 wxArrayString m_aScopes;
137 wxGxNGWService *m_pService;
147 class WXDLLIMPEXP_GIS_CLT wxGxNGWResourceGroup :
151 public wxGxNGWResource
153 DECLARE_CLASS(wxGxNGWResourceGroup)
155 wxGxNGWResourceGroup(wxGxNGWService *pService, const
wxJSONValue &Data,
wxGxObject *oParent, const wxString &soName = _("Resource Group"), const CPLString &soPath = "");
156 virtual ~wxGxNGWResourceGroup(
void);
158 virtual
bool Destroy();
159 virtual wxString GetCategory(
void)
const {
return wxString(_(
"Resource Group")); };
161 virtual void Refresh(
void);
163 virtual bool AreChildrenViewable(
void)
const {
return true; };
164 virtual bool HasChildren(
void);
165 virtual bool CanCreate(
long nDataType,
long DataSubtype);
167 virtual bool Delete(
void);
168 virtual bool CanDelete(
void);
169 virtual bool Rename(
const wxString& NewName);
170 virtual bool CanRename(
void);
171 virtual bool Copy(
const CPLString &szDestPath,
ITrackCancel*
const pTrackCancel);
172 virtual bool CanCopy(
const CPLString &szDestPath);
173 virtual bool Move(
const CPLString &szDestPath,
ITrackCancel*
const pTrackCancel);
174 virtual bool CanMove(
const CPLString &szDestPath);
176 virtual wxString CheckUniqName(
const wxString &sName,
const wxString& sAdd = wxT(
" "),
int nCounter = 0)
const;
177 virtual bool CreateResource(
const wxString &sName, wxGISEnumNGWResourcesType eType);
179 virtual void LoadChildren(
void);
181 virtual bool CreateResourceGroup(
const wxString &sName);
182 virtual wxGISEnumNGWResourcesType GetType(
const wxJSONValue &Data)
const;
183 virtual int GetParentResourceId()
const;
185 virtual wxGxObjectMap GetRemoteObjects();
186 virtual void AddObject(
int nRemoteId,
const wxString &sName);
189 wxNGWResourceDataMap m_moJSONData;
200 class WXDLLIMPEXP_GIS_CLT wxGxNGWRootResource :
201 public wxGxNGWResourceGroup
203 DECLARE_CLASS(wxGxNGWRootResource)
205 wxGxNGWRootResource(wxGxNGWService *pService,
wxGxObject *oParent, const wxString &soName = _("Resources"), const CPLString &soPath = "");
206 virtual ~wxGxNGWRootResource(
void);
208 virtual wxString GetCategory(
void)
const {
return wxString(_(
"NGW resources")); };
210 virtual bool CanDelete(
void);
211 virtual bool CanRename(
void);
212 virtual bool CanCopy(
const CPLString &szDestPath);
213 virtual bool CanMove(
const CPLString &szDestPath);
223 class WXDLLIMPEXP_GIS_CLT wxGxNGWLayer :
224 public wxGxNGWResource,
227 DECLARE_CLASS(wxGxNGWLayer)
229 wxGxNGWLayer(wxGxNGWService *pService, wxGISEnumNGWResourcesType eType, const
wxJSONValue &Data,
wxGxObject *oParent, const wxString &soName, const CPLString &soPath = "");
230 virtual ~wxGxNGWLayer(
void);
232 virtual wxString GetCategory(
void) const;
236 virtual
int GetParentResourceId() const;
239 #endif // wxGIS_USE_CURL
The JSON value class implementation.
Definition: jsonval.h:91
Definition: gxdataset.h:151
A TrackCancel interface class.
Definition: core.h:144
Definition: gxobject.h:78
Definition: contupdater.h:70
Definition: contupdater.h:36
Definition: catalog.h:123
Definition: gxobject.h:37