diff options
author | Behrend Cornelius <bc@openoffice.org> | 2001-08-08 14:15:48 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2001-08-08 14:15:48 +0000 |
commit | 76429c106add00f9a3f72b945cdc1b10bc574ca4 (patch) | |
tree | 67be911c8f0bc5b189ad0bc506c8eb5635ee1ede /wizards/source/webwizard | |
parent | cb2273fbcfc18d04afa9fb8c8e6d8106a29fd518 (diff) |
#90363# import of xml writer templates now possible
Diffstat (limited to 'wizards/source/webwizard')
-rw-r--r-- | wizards/source/webwizard/Bullets.xba | 3 | ||||
-rw-r--r-- | wizards/source/webwizard/HtmlAutoPilotBasic.xba | 62 | ||||
-rw-r--r-- | wizards/source/webwizard/Language.xba | 94 | ||||
-rw-r--r-- | wizards/source/webwizard/WebWzrd.xdl | 4 |
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"> -' Variables must be declared +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="HtmlAutoPilotBasic" script:language="StarBasic">' Variables must be declared Option Explicit + Public bWithBackGraphic as Boolean Public oStyle as Object ' Maximum number of content templates, style templates and bullets @@ -17,7 +17,7 @@ Public NumberOfLayouts%, NumberOfStyles% Public Style(8, MaxStyles) as String ' 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 ' 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 = "Hidden" - FileProperties(0).Value = True +Dim InfoNames() oListboxControl = oDialog.GetControl(ListboxName) + oDocInfo = CreateUnoService("com.sun.star.document.DocumentProperties") FilterLen = Len(sFileFilter) bItemFound = False TemplatePath = GetOfficeSubPath("Template", "wizard/web/") DirContent() = oUcb.GetFolderContents(TemplatePath,True) - + LocMaxIndex = Ubound(DirContent()) - - oDocInfo = createUNOService("com.sun.star.document.DocumentProperties") - - 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) = "stl" Then - oComp = StarDesktop.LoadComponentFromURL(DirContent(i),"_blank",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 = "/cnt" 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, " ", MaxIndex) For s = 0 To MaxIndex If m < 6 Then - List(m,i) = sFieldList(s) & ".gif" + List(m,i) = sFieldList(s) & ".gif" 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 - - ' 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("Gallery", "bullets/") PhotosDir = GetPathSettings("Gallery", False, 1) End Sub + + + +'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 sField as String +'Dim sDescription as String +'Dim sFieldList() as String +'Dim bItemFound as Boolean +'Dim MaxIndex as Integer +'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 +'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 = "Hidden" +' FileProperties(0).Value = True +' oListboxControl = oDialog.GetControl(ListboxName) +' FilterLen = Len(sFileFilter) +' bItemFound = False +' TemplatePath = GetOfficeSubPath("Template", "wizard/web/") +' DirContent() = oUcb.GetFolderContents(TemplatePath,True) +' LocMaxIndex = Ubound(DirContent()) +' oDocInfo = CreateUNOService("com.sun.star.document.DocumentProperties") +' Dim SortList(LocMaxIndex,2) +' Dim LocFileName as String +' For i = 0 to LocMaxIndex +' LocFileName = DirContent(i) +' SortList(i,0) = DirContent(i) +' oDocInfo.read(LocFileName) +' SortList(i,1) = oDocInfo.Title +' If Left(FileNameOutOfPath(DirContent(i),getPathSeparator()),3) = "stl" Then +' oComp = StarDesktop.LoadComponentFromURL(DirContent(i),"_blank",0,FileProperties()) +' oRealDocInfo = oComp.getDocumentInfo() +' SortList(i,2) = oRealDocInfo +' oComp.dispose() + ' ' End If + '' +' Next i +' SortList() = BubbleSortList(SortList(),True) +' +' a = 0 +' For i = 0 To LocMaxIndex +' FileName = SortList(i,0) +' If Instr(1,Filename, sFileFilter) Then +' bItemFound = True +' +' sDescription = SortList(i,1) +' oListboxControl.AddItem(sDescription,a) +' a = a + 1 +' List(1,i) = sDescription +' If sFileFilter = "/cnt" Then +' List(2,i) = Filename +' Else +' m = 2 +' For n = 0 To 3 +' sField = SortList(i,2).GetUserFieldValue(n) +' sFieldList() = ArrayoutofString(sField, " ", MaxIndex) +' For s = 0 To MaxIndex +' If m < 6 Then +' List(m,i) = sFieldList(s) & ".gif" +' Else +' List(m,i) = sFieldList(s) +' End If +' m = m + 1 +' Next s +' Next n +' List(8,i) = FileName +' End If +' End If +' Next i +' +' ' No content template? Error message, close new empty document, stop execution +' If Not bItemfound Then +' MsgBox(WebWiz_gErrContentNotFound$ , 16, WebWiz_gWizardName$) +' oBaseDocument.Dispose() +' Stop +' End If +' SelList(0) = 0 +' oListboxControl.Model.SelectedItems() = SelList() +' FillupWebListbox = i +'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> |