Skip to content

Commit e9df3ea

Browse files
committed
Production ready!
1 parent 33d6662 commit e9df3ea

2 files changed

Lines changed: 128 additions & 1 deletion

File tree

README.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,60 @@
11
# saveMapPosition
2-
This plugin saves map coordinates (lat/long) into two standard elements. It is designed to act as the receiving part of a webservice or s.th. of that kind that retrieves these data from google maps or any other geolocation service (not included).
2+
3+
This plugin saves map coordinates (lat/long) into two standard elements.
4+
It is designed to act as the receiving part of a webservice or s.th. of that kind that
5+
retrieves these data from google maps or any other geolocation service (not included).
6+
7+
## Installation
8+
9+
### Installation on the server
10+
11+
Copy the "saveMapPosition" folder into the "plugins" folder of your CMS installation.
12+
It is not necessary to import the plugin to the Server Manager.
13+
14+
## How to use
15+
16+
The plugin is designed to receive the following parameters via an AJAX call using the POST method:
17+
18+
### Parameters
19+
20+
| name | description |
21+
| -------------------- | ----------------------------------------- |
22+
| sessionkey | Current sessionkey |
23+
| loginguid | Current login guid |
24+
| pageguid | Guid of the current page |
25+
| saveMapPositionX | Lat value to be saved |
26+
| saveMapPositionY | Long value to be saved |
27+
| saveEltTemplateNameX | Template element name of the lat element |
28+
| saveEltTemplateNameY | Template element name of the long element |
29+
30+
### Return value
31+
32+
The plugin only saves ther given values into the given elements. Due to the standard WSM
33+
workflow, the page is changed and therefore becomes a new Draft.
34+
35+
The plugin returns "ok" when the values were successfully saved. There is no further error handling.
36+
37+
## License and exclusion of liability
38+
39+
This software is licensed under a [Creative Commons GNU General Public License](http://creativecommons.org/licenses/GPL/2.0/). Some rights reserved.
40+
41+
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 3 of the License, or (at your option) any later version.
42+
43+
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.
44+
45+
You should have received a copy of the GNU General Public License along with TemplateDependenceChecker. If not, see http://www.gnu.org/licenses.
46+
47+
The GNU General Public License is a Free Software license. Like any Free Software license, it grants to you the four following freedoms:
48+
49+
0. The freedom to run the program for any purpose.
50+
1. The freedom to study how the program works and adapt it to your needs.
51+
2. The freedom to redistribute copies so you can help your neighbor.
52+
3. The freedom to improve the program and release your improvements to the public, so that the whole community benefits.
53+
54+
You may exercise the freedoms specified here provided that you comply with the express conditions of this license. The principal conditions are:
55+
56+
- You must conspicuously and appropriately publish on each copy distributed an appropriate copyright notice and disclaimer of warranty and keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of the GNU General Public License along with the Program. Any translation of the GNU General Public License must be accompanied by the GNU General Public License.
57+
- If you modify your copy or copies of the program or any portion of it, or develop a program based upon it, you may distribute the resulting work provided you do so under the GNU General Public License. Any translation of the GNU General Public License must be accompanied by the GNU General Public License.
58+
- If you copy or distribute the program, you must accompany it with the complete corresponding machine-readable source code or with a written offer, valid for at least three years, to furnish the complete corresponding machine-readable source code.
59+
60+
Any of the above conditions can be waived if you get permission from the copyright holder.

saveMapPosition_do.asp

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<%
2+
'Copyright (C) Stefan Buchali, UDG United Digital Group, www.udg.de
3+
'
4+
'This software is licensed under a
5+
'Creative Commons GNU General Public License (http://creativecommons.org/licenses/GPL/2.0/)
6+
'Some rights reserved.
7+
'
8+
'You should have received a copy of the GNU General Public License
9+
'along with saveMapPosition. If not, see http://www.gnu.org/licenses/.
10+
11+
Response.ContentType = "text/html"
12+
Response.Charset = "utf-8"
13+
14+
Server.ScriptTimeOut=300
15+
16+
SessionKey=request.form("sessionkey")
17+
RedakteurLoginGUID=request.form("loginguid")
18+
AktuelleSeiteGUID = request.form("pageguid")
19+
20+
' Eingaben holen
21+
saveMapPositionX = request.form("saveMapPositionX")
22+
saveMapPositionY = request.form("saveMapPositionY")
23+
saveEltTemplateNameX = request.form("saveEltTemplateNameX")
24+
saveEltTemplateNameY = request.form("saveEltTemplateNameY")
25+
26+
27+
if saveMapPositionX="" then saveMapPositionX="#"&SessionKey end if
28+
if saveMapPositionY="" then saveMapPositionY="#"&SessionKey end if
29+
30+
31+
' XML-Verarbeitung per Microsoft-DOM vorbereiten
32+
set XMLDoc = Server.CreateObject("MSXML2.DOMDocument")
33+
XMLDoc.async = false
34+
XMLDoc.validateOnParse = false
35+
36+
' RedDot Object fuer RQL-Zugriffe anlegen
37+
set objIO = Server.CreateObject("OTWSMS.AspLayer.PageData")
38+
39+
' Variablendeklaration
40+
Dim xmlSendDoc ' RQL-Anfrage, die zum Server geschickt wird
41+
Dim ServerAnswer ' Antwort des Servers
42+
43+
44+
'Elemente der Seite auslesen
45+
xmlSendDoc= "<IODATA loginguid=""" & RedakteurLoginGUID & """ sessionkey=""" & SessionKey & """ dialoglanguageid=""DEU"">"&_
46+
"<PAGE guid=""" & AktuelleSeiteGUID & """>"&_
47+
"<ELEMENTS action=""load"" />"&_
48+
"</PAGE>"&_
49+
"</IODATA>"
50+
ServerAnswer = objIO.ServerExecuteXml (xmlSendDoc, sError)
51+
XMLDoc.loadXML(ServerAnswer)
52+
saveEltGuidX = XMLDoc.selectsinglenode("//ELEMENT/@guid[../@name='" & saveEltTemplateNameX & "']").text
53+
saveEltGuidY = XMLDoc.selectsinglenode("//ELEMENT/@guid[../@name='" & saveEltTemplateNameY & "']").text
54+
55+
56+
'Eingaben speichern
57+
xmlSendDoc= "<IODATA loginguid=""" & RedakteurLoginGUID & """ sessionkey=""" & SessionKey & """>"&_
58+
"<ELEMENTS action=""save"" reddotcacheguid="""">"&_
59+
"<ELT guid=""" & saveEltGuidX & """ type=""1"" value=""" & saveMapPositionX & """/>"&_
60+
"<ELT guid=""" & saveEltGuidY & """ type=""1"" value=""" & saveMapPositionY & """/>"&_
61+
"</ELEMENTS>"&_
62+
"</IODATA>"
63+
ServerAnswer = objIO.ServerExecuteXml (xmlSendDoc, sError)
64+
65+
66+
set objIO = nothing
67+
set XMLDoc = nothing
68+
69+
%>ok

0 commit comments

Comments
 (0)