Skip to content

Commit 8d82925

Browse files
committed
Version 2.1: Now counting the instances of a project language variant specific.
1 parent 2243161 commit 8d82925

3 files changed

Lines changed: 77 additions & 31 deletions

File tree

README.md

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# TemplateDependenceChecker
2-
_Version 2.0_
2+
_Version 2.1_
33

44
"TemplateDependenceChecker" is a SmartTree enhancement for the Opentext Website Management Server allowing to check the assignment of every template of a content class within all connected projects.
55

@@ -13,7 +13,8 @@ This is third party software. The author is not affiliated in any manner with Op
1313

1414
Copy the folder "TemplateDependenceChecker" into the folder "plugins" of your CMS installation.
1515
Switch to Server Manager and import the plugin via "Administer Plug-Ins" - "Plug-Ins", action menu "Import Plug-In".
16-
Assign it to all your desired projects and set the appropriate user rights there if necessary.
16+
Assign it to all your desired projects and set the appropriate user rights there if necessary.
17+
Activate it.
1718

1819
The plugin then appears in the action menu of every content class node within these projects.
1920

@@ -27,8 +28,9 @@ This file contains the dialog box the plugin will start with. Translate the germ
2728

2829
This file contains the plugin script itself. Translate the german variables (lines 21-32) if necessary.
2930

30-
The plugin must be run under an administrator account. Please enter the corresponding login data. This user must have the role "Administrator" and "Template
31-
Editor" in all projects, and the number of allowed sessions should be set to at least 2.
31+
The plugin must be run under an administrator account. Please enter the corresponding login data in lines 18+19.
32+
This user must have the role "Administrator" and "Template Editor" in all projects, and the number of allowed sessions should be set to at least 2.
33+
The user also must have access to all language variants in every project. If a language variant is denied for him, it will not occur in the report, and there will be no error message regarding this.
3234

3335
## How to use
3436

@@ -45,14 +47,16 @@ Finally it will show a report that lists:
4547
- Which one is not assigned at all.
4648
- The number of active instances of the content class
4749

48-
The report looks like the following:
50+
The report looks like the following block. This block repeats for each project:
4951

5052
```
5153
Project: <Name of the connected project>
5254
5355
<Name of the 1st template>: -
54-
<Name of the 2nd template >: Assigned to <Number> project variants
55-
<Number> Instances
56+
<Name of the 2nd template >: Assigned to <Number> project variants
57+
58+
<Name of language variant 1>: <Number> Instances
59+
<Name of language variant 2>: <Number> Instances
5660
```
5761

5862
(The "-" after the first template means that it is not assigned).
@@ -68,6 +72,28 @@ The following error messages can occur:
6872
- "Content class not found" (Variable `dlgContentClassNotFound`):
6973
The content class cannot be accessed (e.g. due to authorization packets).
7074

75+
## Changelog
76+
77+
**Version 2.1**
78+
May 31, 2017
79+
Language specific counting of instances
80+
81+
**Version 2.0**
82+
September 10, 2014
83+
Add counting instances
84+
85+
**Version 1.2**
86+
October 25, 2013
87+
Adaption for version 11 (ENU instead of ENG in plugin XML file)
88+
89+
**Version 1.1**
90+
April 28, 2011
91+
Adaption for version 10 (ASP object changed)
92+
93+
**Version 1.0**
94+
May 6, 2009
95+
Plugin created
96+
7197
## License and exclusion of liability
7298

7399
This software is licensed under a [Creative Commons GNU General Public License](http://creativecommons.org/licenses/GPL/2.0/). Some rights reserved.
@@ -91,22 +117,4 @@ You may exercise the freedoms specified here provided that you comply with the e
91117
- 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.
92118
- 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.
93119

94-
Any of the above conditions can be waived if you get permission from the copyright holder.
95-
96-
## Changelog
97-
98-
**Version 2.0**
99-
September 10, 2014
100-
Add counting instances
101-
102-
**Version 1.2**
103-
October 25, 2013
104-
Adaption for version 11 (ENU instead of ENG in plugin XML file)
105-
106-
**Version 1.1**
107-
April 28, 2011
108-
Adaption for version 10 (ASP object changed)
109-
110-
**Version 1.0**
111-
May 6, 2009
112-
Plugin created
120+
Any of the above conditions can be waived if you get permission from the copyright holder.

TemplateDependenceChecker.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<PLUGINS>
3-
<PLUGIN name="SF Tools: TemplateDependenceChecker" url="TemplateDependenceChecker/TemplateDependenceChecker_dlg.asp" compatibility="7.5" company="SF eBusiness GmbH" contact="Stefan Buchali" email="stefan.buchali@sfe.de" telefon="07032/932-303" website="www.sfe.de">
3+
<PLUGIN name="SF Tools: TemplateDependenceChecker" url="TemplateDependenceChecker/TemplateDependenceChecker_dlg.asp" compatibility="7.5" company="UDG United Digital Group" contact="Stefan Buchali" email="stefan.buchali@udg.de" telefon="+49 7032 932 303" website="www.udg.de">
44
<DESCRIPTIONS>
55
<DEU name="Template-Verwendung in Tochterprojekten anzeigen"/>
66
<ENG name="Show template usage in child projects"/>

TemplateDependenceChecker_do.asp

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ set XMLTemplatesDoc = Server.CreateObject("MSXML2.DOMDocument")
6060
XMLTemplatesDoc.async = false
6161
XMLTemplatesDoc.validateOnParse = false
6262
63+
set XMLLanguagesDoc = Server.CreateObject("MSXML2.DOMDocument")
64+
XMLLanguagesDoc.async = false
65+
XMLLanguagesDoc.validateOnParse = false
66+
6367
' RedDot Object fuer RQL-Zugriffe anlegen
6468
set objIO = Server.CreateObject("OTWSMS.AspLayer.PageData")
6569
@@ -188,13 +192,46 @@ if InStr(ServerAnswer,"guid")>0 then
188192
189193
Set TemplateVariantList = nothing
190194
191-
'Instanzen zählen
195+
'Verfügbare Sprachen auslesen
192196
xmlSendDoc= "<IODATA loginguid=""" & RqlAdmLoginGUID & """ sessionkey=""" & RqlAdmSessionKey & """>"&_
193-
"<PAGE action=""search"" templateguid=""" & TemplateToCheckGUID & """ flags=""0"" maxrecords=""999999""/>"&_
197+
"<PROJECT>"&_
198+
"<LANGUAGEVARIANTS action=""list""/>"&_
199+
"</PROJECT>"&_
194200
"</IODATA>"
195201
ServerAnswer = objIO.ServerExecuteXml (xmlSendDoc, sError)
196-
XMLDoc.loadXML(ServerAnswer)
197-
resultStr = resultStr & "<p>" & XMLDoc.SelectNodes("//PAGE").length & " " & dlgInstances & "</p>"
202+
XMLLanguagesDoc.loadXML(ServerAnswer)
203+
204+
CurrentLangGuid = XMLLanguagesDoc.selectSingleNode("//LANGUAGEVARIANT[@checked='1']").getAttribute("guid")
205+
206+
resultStr = resultStr & "<p>"
207+
Set IterateLanguages = XMLLanguagesDoc.selectNodes("//LANGUAGEVARIANT")
208+
for each IterateLanguage in IterateLanguages
209+
'Umschalten zur Sprache
210+
xmlSendDoc= "<IODATA loginguid=""" & RqlAdmLoginGUID & """ sessionkey=""" & RqlAdmSessionKey & """>"&_
211+
"<PROJECT>"&_
212+
"<LANGUAGEVARIANT action=""setactive"" guid="""&IterateLanguage.getAttribute("guid")&"""/>"&_
213+
"</PROJECT>"&_
214+
"</IODATA>"
215+
ServerAnswer = objIO.ServerExecuteXml (xmlSendDoc, sError)
216+
217+
'Instanzen zählen
218+
xmlSendDoc= "<IODATA loginguid=""" & RqlAdmLoginGUID & """ sessionkey=""" & RqlAdmSessionKey & """>"&_
219+
"<PAGE action=""search"" templateguid=""" & TemplateToCheckGUID & """ flags=""0"" maxrecords=""999999""/>"&_
220+
"</IODATA>"
221+
ServerAnswer = objIO.ServerExecuteXml (xmlSendDoc, sError)
222+
XMLDoc.loadXML(ServerAnswer)
223+
resultStr = resultStr & IterateLanguage.getAttribute("name") & " (" & IterateLanguage.getAttribute("language") & "): " & XMLDoc.SelectNodes("//PAGE").length & " " & dlgInstances & "<br />"
224+
next
225+
Set IterateLanguages = nothing
226+
resultStr = resultStr & "</p>"
227+
228+
'Zurückschalten zur Anfangsprache
229+
xmlSendDoc= "<IODATA loginguid=""" & RqlAdmLoginGUID & """ sessionkey=""" & RqlAdmSessionKey & """>"&_
230+
"<PROJECT>"&_
231+
"<LANGUAGEVARIANT action=""setactive"" guid=""" & CurrentLangGuid & """/>"&_
232+
"</PROJECT>"&_
233+
"</IODATA>"
234+
ServerAnswer = objIO.ServerExecuteXml (xmlSendDoc, sError)
198235
199236
else
200237
resultStr = resultStr & "<p><b>" & dlgError & ": " & dlgContentClassNotFound & "!</b></p>"
@@ -229,6 +266,7 @@ set XMLDoc = nothing
229266
set XMLFoldersDoc = nothing
230267
set XMLProjDoc = nothing
231268
set XMLTemplatesDoc = nothing
269+
set XMLLanguagesDoc = nothing
232270
set objIO = nothing
233271
%>
234272
<html>

0 commit comments

Comments
 (0)