summaryrefslogtreecommitdiff
path: root/wizards/source/webwizard
diff options
context:
space:
mode:
authorBehrend Cornelius <bc@openoffice.org>2001-08-08 14:15:48 +0000
committerBehrend Cornelius <bc@openoffice.org>2001-08-08 14:15:48 +0000
commit76429c106add00f9a3f72b945cdc1b10bc574ca4 (patch)
tree67be911c8f0bc5b189ad0bc506c8eb5635ee1ede /wizards/source/webwizard
parentcb2273fbcfc18d04afa9fb8c8e6d8106a29fd518 (diff)
#90363# import of xml writer templates now possible
Diffstat (limited to 'wizards/source/webwizard')
-rw-r--r--wizards/source/webwizard/Bullets.xba3
-rw-r--r--wizards/source/webwizard/HtmlAutoPilotBasic.xba62
-rw-r--r--wizards/source/webwizard/Language.xba94
-rw-r--r--wizards/source/webwizard/WebWzrd.xdl4
4 files changed, 124 insertions, 39 deletions
diff --git a/wizards/source/webwizard/Bullets.xba b/wizards/source/webwizard/Bullets.xba
index 7695a20a6861..3c6412eb0d75 100644
--- a/wizards/source/webwizard/Bullets.xba
+++ b/wizards/source/webwizard/Bullets.xba
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Bullets" script:language="StarBasic">REM ***** BASIC *****
-
+Option Explicit
Sub SetBulletGraphics(sBulletUrl as String)
@@ -60,6 +60,7 @@ End Sub
Sub BulletUrlsToSavePath(SavePath as String)
Dim n as Integer
Dim m as Integer
+Dim i as Integer
Dim sNewBulletUrl as String
Dim oLevel()
Dim oRules
diff --git a/wizards/source/webwizard/HtmlAutoPilotBasic.xba b/wizards/source/webwizard/HtmlAutoPilotBasic.xba
index 661313f02105..4d2569dd6e79 100644
--- a/wizards/source/webwizard/HtmlAutoPilotBasic.xba
+++ b/wizards/source/webwizard/HtmlAutoPilotBasic.xba
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
-<script:module xmlns:script="http://openoffice.org/2000/script" script:name="HtmlAutoPilotBasic" script:language="StarBasic">
-&apos; Variables must be declared
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="HtmlAutoPilotBasic" script:language="StarBasic">&apos; Variables must be declared
Option Explicit
+
Public bWithBackGraphic as Boolean
Public oStyle as Object
&apos; Maximum number of content templates, style templates and bullets
@@ -17,7 +17,7 @@ Public NumberOfLayouts%, NumberOfStyles%
Public Style(8, MaxStyles) as String
&apos; Filled with title, file name
-Public Layout$(2, MaxLayouts%)
+Public Layout$(2, MaxLayouts)
Public TextureDir$, BulletDir$, GraphicsDir$, GalleryDir$, PhotosDir$
Public CurrentBullet$, CurrentPrev$, CurrentNext$, CurrentHome$, CurrentTop$
@@ -106,8 +106,8 @@ Dim CurInd as Integer
ToggleDialogControls(False)
oBaseDocument.LockControllers
&apos; Get selected list entry and corresponding file name
- CurInd = GetCurIndex(DialogModel.lbTemplate, Layout$(), NumberofLayouts%, 2)
- oCursor = oBaseDocument.Text.CreateTextCursor
+ CurInd = GetCurIndex(DialogModel.lbTemplate, Layout(), NumberofLayouts%, 2)
+ oCursor = oBaseDocument.Text.CreateTextCursor()
oCursor.GotoStart(False)
oCursor.GotoEnd(True)
oCursor.InsertDocumentfromURL(FileStr, NoArgs())
@@ -268,13 +268,12 @@ Dim sNewFileUrl as String
End Function
+
Function FillupWebListbox(oUcb as Object, sFileFilter as String, oDialog as Object, ListboxName as String, List() as String)
Dim oDocInfo as Object
-Dim oComp as Object
-Dim oRealDocInfo as Object
Dim oListboxControl as Object
+Dim Description as String
Dim sField as String
-Dim sDescription as String
Dim sFieldList() as String
Dim bItemFound as Boolean
Dim MaxIndex as Integer
@@ -282,7 +281,6 @@ Dim DirContent() as String
Dim FileName as String
Dim TemplatePath as String
Dim FilterLen as Integer
-Dim MyArray()
Dim i as Integer
Dim m as Integer
Dim n as Integer
@@ -290,56 +288,48 @@ Dim s as Integer
Dim a as Integer
Dim SelList(0) as Integer
Dim LocMaxIndex as Integer
-Dim FileProperties(0) as new com.sun.star.beans.PropertyValue
- FileProperties(0).Name = &quot;Hidden&quot;
- FileProperties(0).Value = True
+Dim InfoNames()
oListboxControl = oDialog.GetControl(ListboxName)
+ oDocInfo = CreateUnoService(&quot;com.sun.star.document.DocumentProperties&quot;)
FilterLen = Len(sFileFilter)
bItemFound = False
TemplatePath = GetOfficeSubPath(&quot;Template&quot;, &quot;wizard/web/&quot;)
DirContent() = oUcb.GetFolderContents(TemplatePath,True)
-
+
LocMaxIndex = Ubound(DirContent())
-
- oDocInfo = createUNOService(&quot;com.sun.star.document.DocumentProperties&quot;)
-
- Dim SortList(LocMaxIndex,2)
+
+ Dim SortList(LocMaxIndex,1)
For i = 0 to LocMaxIndex
SortList(i,0) = DirContent(i)
- oDocInfo.read(DirContent(i))
- SortList(i,1) = oDocInfo.Title
- If Left(FileNameOutOfPath(DirContent(i),getPathSeparator()),3) = &quot;stl&quot; Then
- oComp = StarDesktop.LoadComponentFromURL(DirContent(i),&quot;_blank&quot;,0,FileProperties())
- oRealDocInfo = oComp.getDocumentInfo()
- SortList(i,2) = oRealDocInfo
- oComp.dispose()
- End If
-
+ SortList(i,1) = RetrieveDocTitle(oDocInfo, DirContent(i))
Next i
SortList() = BubbleSortList(SortList(),True)
-
+ For i = 0 to LocMaxIndex
+ DirContent(i) = SortList(i,0)
+ Next i
a = 0
For i = 0 To LocMaxIndex
- FileName = SortList(i,0)
+ FileName = DirContent(i)
If Instr(1,Filename, sFileFilter) Then
bItemFound = True
-
- sDescription = SortList(i,1)
- oListboxControl.AddItem(sDescription,a)
+ Description = RetrieveDocTitle(oDocInfo, FileName)
+ oDocInfo.Read(FileName)
+ InfoNames = oDocInfo.ElementNames()
+ oListboxControl.AddItem(Description,a)
a = a + 1
- List(1,i) = sDescription
+ List(1,i) = Description
If sFileFilter = &quot;/cnt&quot; Then
List(2,i) = Filename
Else
m = 2
For n = 0 To 3
- sField = SortList(i,2).GetUserFieldValue(n)
+ sField = oDocInfo.GetByName(InfoNames(n))
sFieldList() = ArrayoutofString(sField, &quot; &quot;, MaxIndex)
For s = 0 To MaxIndex
If m &lt; 6 Then
- List(m,i) = sFieldList(s) &amp; &quot;.gif&quot;
+ List(m,i) = sFieldList(s) &amp; &quot;.gif&quot;
Else
- List(m,i) = sFieldList(s)
+ List(m,i) = sFieldList(s)
End If
m = m + 1
Next s
@@ -348,8 +338,6 @@ Dim FileProperties(0) as new com.sun.star.beans.PropertyValue
End If
End If
Next i
-
- &apos; No content template? Error message, close new empty document, stop execution
If Not bItemfound Then
MsgBox(WebWiz_gErrContentNotFound$ , 16, WebWiz_gWizardName$)
oBaseDocument.Dispose()
diff --git a/wizards/source/webwizard/Language.xba b/wizards/source/webwizard/Language.xba
index 74215b36a92f..989cc2d9f644 100644
--- a/wizards/source/webwizard/Language.xba
+++ b/wizards/source/webwizard/Language.xba
@@ -34,4 +34,98 @@ Sub GetPaths
BulletDir = GetOfficeSubPath(&quot;Gallery&quot;, &quot;bullets/&quot;)
PhotosDir = GetPathSettings(&quot;Gallery&quot;, False, 1)
End Sub
+
+
+
+&apos;Function FillupWebListbox(oUcb as Object, sFileFilter as String, oDialog as Object, ListboxName as String, List() as String)
+&apos;Dim oDocInfo as Object
+&apos;Dim oComp as Object
+&apos;Dim oRealDocInfo as Object
+&apos;Dim oListboxControl as Object
+&apos;Dim sField as String
+&apos;Dim sDescription as String
+&apos;Dim sFieldList() as String
+&apos;Dim bItemFound as Boolean
+&apos;Dim MaxIndex as Integer
+&apos;Dim DirContent() as String
+&apos;Dim FileName as String
+&apos;Dim TemplatePath as String
+&apos;Dim FilterLen as Integer
+&apos;Dim MyArray()
+&apos;Dim i as Integer
+&apos;Dim m as Integer
+&apos;Dim n as Integer
+&apos;Dim s as Integer
+&apos;Dim a as Integer
+&apos;&apos;Dim SelList(0) as Integer
+&apos;Dim LocMaxIndex as Integer
+&apos;Dim FileProperties(0) as new com.sun.star.beans.PropertyValue&apos;
+&apos; FileProperties(0).Name = &quot;Hidden&quot;
+&apos; FileProperties(0).Value = True
+&apos; oListboxControl = oDialog.GetControl(ListboxName)
+&apos; FilterLen = Len(sFileFilter)
+&apos; bItemFound = False
+&apos; TemplatePath = GetOfficeSubPath(&quot;Template&quot;, &quot;wizard/web/&quot;)
+&apos; DirContent() = oUcb.GetFolderContents(TemplatePath,True)
+&apos; LocMaxIndex = Ubound(DirContent())
+&apos; oDocInfo = CreateUNOService(&quot;com.sun.star.document.DocumentProperties&quot;)
+&apos; Dim SortList(LocMaxIndex,2)
+&apos; Dim LocFileName as String
+&apos; For i = 0 to LocMaxIndex
+&apos; LocFileName = DirContent(i)
+&apos; SortList(i,0) = DirContent(i)
+&apos; oDocInfo.read(LocFileName)
+&apos; SortList(i,1) = oDocInfo.Title
+&apos; If Left(FileNameOutOfPath(DirContent(i),getPathSeparator()),3) = &quot;stl&quot; Then
+&apos; oComp = StarDesktop.LoadComponentFromURL(DirContent(i),&quot;_blank&quot;,0,FileProperties())
+&apos; oRealDocInfo = oComp.getDocumentInfo()
+&apos; SortList(i,2) = oRealDocInfo
+&apos; oComp.dispose()
+ &apos; &apos; End If
+ &apos;&apos;
+&apos; Next i
+&apos; SortList() = BubbleSortList(SortList(),True)
+&apos;
+&apos; a = 0
+&apos; For i = 0 To LocMaxIndex
+&apos; FileName = SortList(i,0)
+&apos; If Instr(1,Filename, sFileFilter) Then
+&apos; bItemFound = True
+&apos;
+&apos; sDescription = SortList(i,1)
+&apos; oListboxControl.AddItem(sDescription,a)
+&apos; a = a + 1
+&apos; List(1,i) = sDescription
+&apos; If sFileFilter = &quot;/cnt&quot; Then
+&apos; List(2,i) = Filename
+&apos; Else
+&apos; m = 2
+&apos; For n = 0 To 3
+&apos; sField = SortList(i,2).GetUserFieldValue(n)
+&apos; sFieldList() = ArrayoutofString(sField, &quot; &quot;, MaxIndex)
+&apos; For s = 0 To MaxIndex
+&apos; If m &lt; 6 Then
+&apos; List(m,i) = sFieldList(s) &amp; &quot;.gif&quot;
+&apos; Else
+&apos; List(m,i) = sFieldList(s)
+&apos; End If
+&apos; m = m + 1
+&apos; Next s
+&apos; Next n
+&apos; List(8,i) = FileName
+&apos; End If
+&apos; End If
+&apos; Next i
+&apos;
+&apos; &apos; No content template? Error message, close new empty document, stop execution
+&apos; If Not bItemfound Then
+&apos; MsgBox(WebWiz_gErrContentNotFound$ , 16, WebWiz_gWizardName$)
+&apos; oBaseDocument.Dispose()
+&apos; Stop
+&apos; End If
+&apos; SelList(0) = 0
+&apos; oListboxControl.Model.SelectedItems() = SelList()
+&apos; FillupWebListbox = i
+&apos;End Function
+
</script:module> \ No newline at end of file
diff --git a/wizards/source/webwizard/WebWzrd.xdl b/wizards/source/webwizard/WebWzrd.xdl
index ad66c7045dee..0e51ad21469c 100644
--- a/wizards/source/webwizard/WebWzrd.xdl
+++ b/wizards/source/webwizard/WebWzrd.xdl
@@ -5,7 +5,9 @@
<dlg:button dlg:id="cbCancel" dlg:tab-index="0" dlg:left="6" dlg:top="190" dlg:width="50" dlg:height="14" dlg:help-url="HID:34206" dlg:value="Cancel">
<dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="WebWizard.HtmlAutoPilotBasic.CancelHTMLWizard"/>
</dlg:button>
- <dlg:button dlg:id="cbHelp" dlg:tab-index="1" dlg:left="66" dlg:top="190" dlg:width="50" dlg:height="14" dlg:help-url="HID:34200" dlg:value="cbHelp"/>
+ <dlg:button dlg:id="cbHelp" dlg:tab-index="1" dlg:left="66" dlg:top="190" dlg:width="50" dlg:height="14" dlg:tag="34200" dlg:help-url="HID:34200" dlg:value="cbHelp">
+ <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="Tools.Recursive.ShowHelperDialog"/>
+ </dlg:button>
<dlg:button dlg:id="cbGoOn" dlg:tab-index="2" dlg:left="214" dlg:top="190" dlg:width="50" dlg:height="14" dlg:help-url="HID:34205" dlg:value="cbGoOn">
<dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="WebWizard.HtmlAutoPilotBasic.EndDialog"/>
</dlg:button>