1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: g_export_html.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-08-28 11:42:05 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* Owner : wolfram.garten@sun.com
36 '* short description :
38 '*********************************************************************
40 ' #1 tHtmlExport_Webcast
41 '\********************************************************************
46 Dim Adresse1 as string
47 Dim Liste(50) as string
53 printlog "open 'tools->options' and set first/last name and email adress on the page 'StarOffice->UserData' "
55 hToolsOptions ("STAROFFICE","USERDATA")
56 VorName.SetText "Garfield"
57 ZuName.SetText "Peanuts"
58 EMail.SetText "recumbent@sun.com"
59 Kontext "ExtrasOptionenDlg"
62 printlog "create directory if not exists and delete the content, if exists user\\work\\html\\ "
63 app.mkDir ((ConvertPath (gOfficePath + "user\work\html\"))
65 GetFileList ((ConvertPath (gOfficePath + "user\work\html\")), "*.*" , Liste() )
66 if (KillFileList (Liste()) <> TRUE) then
67 for i = 1 to ListCount (Liste())
68 Warnlog "File Not deleted: " + i + ": '" + Liste(i) + "'"
72 printlog "open application "
75 '------------------ simple document --------------------
76 printlog "create a rectrangle "
77 hTextrahmenErstellen ("This is a test text",10,10,40,20)
79 printlog "create another rectrangle "
80 hRechteckErstellen (50,50,70,70)
82 '####################################
83 Printlog "test if no file is created, if dialog is canceld"
84 printlog "call 'File->Export'"
86 Kontext "ExportierenDlg"
88 gHTMLFilter = Dateityp.GetItemText(1)
89 Dateityp.Select(gHTMLFilter)
90 printlog "set Filename to 'user\\work\\html\\expo0.html' "
91 sFile = ConvertPath (gOfficePath + "user\work\html\expo0")
92 Dateiname.SetText sFile
94 printlog "click button 'Save' "
98 if Active.Exists Then Active.Yes
99 '---------------------------------------------------------
100 printlog "now we are on the dialog -1- 'Assign design' "
101 Kontext "HTMLExport1"
102 printlog "click button 'Cancel' "
106 GetFileList ((ConvertPath (gOfficePath + "user\work\html\")), "*.*" , Liste() )
108 Printlog "used file name: " + sFile
109 if (ListCount (Liste()) > 0) then
110 warnlog "dialog for export was canceled, but file was created :-("
111 for i = 1 to ListCount (Liste())
112 Warnlog "File created: " + i + ": '" + Liste(i) + "'"
114 KillFileList (Liste())
116 '####################################
117 Printlog "'test if files are created"
118 printlog "call 'File->Export'"
120 Kontext "ExportierenDlg"
123 printlog "select Filetype 'HTML...' aka 'WebPage' "
124 Dateityp.Select gHTMLFilter
126 errorlog " Filter not available :-( : '"+gHTMLFilter+"'"
128 printlog "Selects the first entry - which should be html "
131 printlog "set Filename to 'user\\work\\html\\expo.html' "
132 sFile = ConvertPath (gOfficePath + "user\work\html\expo.html")
133 Dateiname.SetText sFile
135 printlog "click button 'Save' "
139 if Active.Exists Then Active.Yes
140 '---------------------------------------------------------
141 Printlog "now we are on the dialog -1- 'Assign design' "
142 Kontext "HTMLExport1"
143 printlog "'New design' should be checked "
144 if (NeuesDesign.IsEnabled <> TRUE) then
145 warnlog "NewDesign is not enabled by default :-("
147 printlog "click button 'Next >>' "
150 Printlog "now we are on the dialog -2- 'Publication Type & Options' "
151 Kontext "HTMLExport2"
152 printlog "checkbox 'Standard HTML Format' is checked by default "
153 if (Standard.IsChecked <> TRUE) then
154 warnlog "Standard is not enabled by default :-("
157 printlog "checkbox 'Title Page' is checked by default "
158 if Not TitelseiteErzeugen.IsChecked Then
159 TitelSeiteErzeugen.Check
160 Warnlog "- 'create Titlepage' should be checked as default :-("
162 if (gApplication = "IMPRESS") then
163 printlog "if application is impress: the checkbox 'Show notes' is enabled by default"
164 If (Notizenanzeigen.IsChecked <> TRUE) Then
165 warnlog "- 'Show notes' checked as default :-("
166 Notizenanzeigen.Check
169 printlog "click button 'Next >>' "
171 Printlog "now we are on the dialog -3- 'png/gif/jpeg & resolution & sound' "
172 Kontext "HTMLExport3"
173 printlog "checkbox 'PNG' is checked by default "
174 if (PNG.isChecked <> TRUE) then
175 warnlog "Save Graphic as 'PNG' is not checked as default :-("
178 printlog "Listbox compression '75%' is selected by default "
179 if (Kompressionswert.GetSelText <> "75%") then
180 warnlog "'Compression' should be '75%', but is: '" + Kompressionswert.GetSelText + "'"
181 Kompressionswert.Select "75%"
183 printlog "checkbox 'low monitor resolution' is checked by default "
184 if (NiedrigeAufloesung.IsChecked <> TRUE)Then
185 warnlog "Monitor resolution 'low' is not selected as default :-("
186 NiedrigeAufloesung.Check
188 printlog "checkbox 'export sounds' is checked by default "
189 if (KlaengeExportieren.IsChecked <> true) then
190 warnlog "'Export Sounds' is not checked as default :-("
191 KlaengeExportieren.Check
193 printlog "click button 'Next >>' "
196 Printlog "now we are on the dialog -4- 'Information for the title page' "
197 Kontext "HTMLExport4"
198 printlog "the names you entered in the options have to appeare here! "
199 sTemp = Autor.GetText
201 if (sTemp <> "Garfield Peanuts") then
202 warnlog "Value for 'Author' is other than expected, should 'Garfield Peanuts', is: '"+sTemp+"'"
204 sTemp = EMail.GetText
205 Adresse1=EMail.GetText
206 if (sTemp <> "recumbent@sun.com") then
207 warnlog "Value for 'Email' is other than expected, should be 'recumbent@sun.com', is: '"+sTemp+"'"
209 printlog "set text in field 'your homepage' "
210 Homepage.SetText "mahler"
211 AdditionalInformation.SetText "QualityApprooved"
212 printlog "click button 'Next >>' "
215 Printlog "now we are on the dialog -5- 'select button style' "
216 Kontext "HTMLExport5"
218 printlog "checkbox 'Text only' should be checked by default "
219 if (NurText.ischecked <> TRUE) then
220 warnlog "'Text only' is not checked by default :-("
223 printlog "click button 'Next >>' "
226 printlog "now we are on the dialog -6- 'select color scheme' "
227 Kontext "HTMLExport6"
229 ' maybe check if colour dialog comes up ?! TBO
235 printlog "'Apply color schemes from document' should be checked per default :-) "
236 if (FarbenAusDok.IsChecked <> TRUE) Then
237 warnlog "'Apply color schemes from document' should be checked per default :-("
241 printlog "click button 'Create' "
244 Printlog "now we are on the dialog -7- 'Name HTML Design' "
247 Designname.SetText "Lem's Standard"
251 if active.exists (5) then
252 printlog " the name for this design already exists : '" + active.GetText+ "'"
255 printlog "check number and names of created files "
256 Printlog "used file name: '" + sFile + "'"
258 GetFileList ((ConvertPath (gOfficePath + "user\work\html\")), "*.*" , Liste() )
260 x = ListCount(Liste())
261 if gApplication = "DRAW" then
263 Warnlog "- Number of files is not correct, it should be:3 but it is: '" + x + "' - Draw"
265 printlog "("+i+"/"+x+"): '"+Liste(i)+"'"
270 Warnlog "- Number of files is not correct, it should be:4 but it is: '" + x + "' - Impress"
272 printlog "("+i+"/"+x+"): '"+Liste(i)+"'"
276 printlog "check if fileextension is common - .htm or .html for all files the same "
278 GetFileList ((ConvertPath (gOfficePath + "user\work\html\")), "*.htm" , Liste() )
280 x = ListCount(Liste())
282 GetFileList ((ConvertPath (gOfficePath + "user\work\html\")), "*.html" , Liste() )
284 i = ListCount(Liste())
285 if ((x > 0) AND (i > 0)) Then
286 Warnlog " fileextension is different between HTML-files :-( (htm/html)"
287 Warnlog " htm : " + x
288 Warnlog " html: " + i
290 '--------------------------------------------------------
291 Printlog "check if design is created in dialog"
293 printlog "File->Export "
295 Kontext "ExportierenDlg"
296 printlog "Set Filename to user\\work\\html\\expo.html "
297 Dateiname.SetText sFile
299 printlog "select Filetype 'HTML...' aka 'WebPage' "
300 Dateityp.Select gHTMLFilter
302 errorlog " Filter not available :-( : '"+gHTMLFilter+"'"
305 printlog "click button 'save' "
309 ' active about overwriting existing file
310 if Active.Exists Then Active.Yes
311 '---------------------------------------------------------
313 Kontext "HTMLExport1"
316 printlog "now 'existing design' is checkable -> check it "
317 ExistierendesDesign.Check
319 printlog "there has to be 1 design in the list, select and delete it "
320 x = Designliste.GetItemCount
322 warnlog "there is an unexpected count on designs in the list, expected 1, but there are : '" + x + "'"
325 sTemp = Designliste.GetSelText
326 if sTemp = "Lem's Standard" Then
327 Printlog "- Created design exists in list and will be deleted now"
332 Warnlog "- Created design does not appear in the list it is: '"+sTemp+"'"
335 Warnlog "- List could not be accessed"
340 if Active.Exists then
344 Printlog "used file name: '" + sFile + "'"
345 ' TBOTODO CHECK files contenet !
349 '---------------------------------------------------------
351 testcase tHtmlExport_Webcast
353 Dim iWaitIndex as integer
357 dim Liste ( 200 ) as String
360 printlog "create directories if not exists and delete the content, if exists user\\work\\html\\[asp|perl]\\ "
361 app.mkDir (ConvertPath (gOfficePath + "user\work\html\asp\"))
362 app.mkDir (ConvertPath (gOfficePath + "user\work\html\perl\"))
364 GetFileList ((ConvertPath (gOfficePath + "user\work\html\asp\")), "*.*" , Liste() )
366 if (KillFileList (Liste()) <> TRUE) then
367 for i = 1 to ListCount (Liste())
368 Warnlog "File Not deleted: " + i + ": '" + Liste(i) + "'"
372 GetFileList ((ConvertPath (gOfficePath + "user\work\html\perl\")), "*.*" , Liste() )
374 if (KillFileList (Liste()) <> TRUE) then
375 for i = 1 to ListCount (Liste())
376 Warnlog "File Not deleted: " + i + ": '" + Liste(i) + "'"
380 printlog "File->Autopillot->Presentation... " '---------
381 FileAutopilotPresentation
383 if Active.Exists(1) then
384 WarnlogActive.GetText
392 printlog "Page 1 of autopilot"
393 Kontext "AutopilotPraesentation1"
394 printlog "uncheck 'preview' "
396 printlog "click on button 'create' "
397 AutopilotPraesentation1.OK
399 '************************************ Page 1
400 Printlog "create a presentation and save it for further references"
401 printlog "start creating the presentation now "'------------------------------
402 Printlog "- Create presentation"
403 printlog "select 'click to add title' with [TAB] and press [F2] to edit the placeholder title "
404 hTypeKeys "<TAB><F2>"
406 Select Case Ucase(gApplication)
407 case "DRAW" : hMouseClick DocumentDraw,50,50
408 case "IMPRESS" : hMouseClick DocumentImpress,50,50
411 printlog "Type 'This is a test text', select it. "
412 hTextrahmenErstellen ("This is a test text",10,10,40,20)
415 Kontext "TextObjectbar"
417 if TextObjectbar.Exists <> TRUE then
418 ViewToolbarsTextFormatting
421 Kontext "TextObjectbar"
422 printlog "click 'bold text' in object toolbar "
425 printlog "press [esacpe][tab] to get out of edit mode and select the next placeholder "
426 hTypeKeys "<escape><TAB>"
428 printlog "SlideShow->Effects "
429 SlideShowCustomAnimation
434 printlog "Dialog 'Custom Animation' comes up "
436 printlog "Switch to TabPage: Entrance "
437 active.setPage(TabEntrance)
438 Kontext "TabEntrance"
439 if TabEntrance.Exists (5) then
441 printlog "select effect 'ABC v' :-) "
443 printlog "select speed 'slow' -> first item in list "
448 errorlog "SlideShowEffects wasnt closed as it should have been"
450 if TabEntrance.Exists then
452 warnlog "TabEntrance.Ok didn't seem to close the dialog."
454 printlog "TabEntrance was closed as it should"
459 printlog "activate grafik insert dialog by typing [return] "
461 InsertGraphicsFromFile
462 Kontext "GrafikEinfuegenDlg"
463 if GrafikEinfuegenDlg.Exists <> TRUE then
466 printlog "insert grafik: global\\input\\graf_inp\\borabora.jpg "
467 Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\borabora.jpg")
471 printlog "select 'click to add an outline' with [TAB] and press [F2] to edit the placeholder "
472 hTypeKeys "<TAB><F2>"
473 printlog "insert text and select the words by typing [strg a] "
474 hTypeKeys "Mecury<RETURN>Venus<RETURN>Earth<RETURN>Mars<RETURN>Jupiter<RETURN>Saturn<RETURN>Uranus<RETURN>Neptune<RETURN>Pluto"
477 printlog "format->character "
481 Active.SetPage TabFont
483 printlog "set font size to '18' on tabpage 'font' "
485 SizeWest.SetText "18"
489 printlog "click button OK "
492 printlog "click 'bold text' in object toolbar "
493 Kontext "TextObjectbar"
498 warnlog "Objectbar 'Text' not available :-( / didn't change automatical!"
499 hTypeKeys "<escape><escape><escape><tab><tab><TAB>"
503 hTypeKeys "<SHIFT><END>"
504 Kontext "TextObjectbar"
509 warnlog "darn again TBO"
513 printlog "SlideShow-> CustomAnimation "
514 SlideShowCustomAnimation
520 printlog "Switch to TabPage: Entrance "
521 active.setPage(TabEntrance)
522 kontext "TabEntrance"
523 Effects.TypeKeys "<DOWN>",8
528 warnlog "select another effect, assign is not possible"
530 '******************************** Page 2 Merkur
531 printlog "create a 2nd slide with: insert->slide "
534 hTypekeys "<Pagedown>"
536 printlog "select 'click to add title' with [TAB] and press [F2] to edit the placeholder title "
537 hTypeKeys "<TAB><F2>"
539 printlog "Type 'MERKUR', select it via Edit-Select All"
540 hTextrahmenErstellen ("MERKUR",10,10,60,30)
543 printlog "click 'bold text' in object toolbar "
544 Kontext "TextObjectbar"
547 printlog "press [esacpe][tab][return] to get out of edit mode and select the next placeholder and activate grafik insert dialog "
548 ' hTypeKeys "<escape><tab><return>"
549 hTypeKeys "<escape><tab>"
550 InsertGraphicsFromFile
552 printlog "insert grafik: global\\input\\graf_inp\\borabora.jpg "
553 Kontext "GrafikEinfuegenDlg"
554 Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\borabora.jpg")
558 printlog "select 'click to add an outline' with [TAB] and press [F2] to edit the placeholder "
559 hTypeKeys "<TAB><F2>"
560 printlog "insert text and select the words by typing [strg a] "
562 hTypeKeys "Reciprocal Mass *5972000<SHIFT RETURN>Mass (Erde=1) 0,0558<SHIFT RETURN>Mass in kg 3,30310<SHIFT RETURN>"
563 hTypeKeys "Equator-radius (km) 2440<SHIFT RETURN>Equator-radius (Erde=1)0,382<SHIFT RETURN>Middle density (kg/m^3) 5400<SHIFT RETURN>"
564 hTypeKeys "Gravity acceleration at the equator (m/s^2) 3,78<SHIFT RETURN>Flightvelocity at the equator (km/s) 4,3<SHIFT RETURN>Sidereal rotationtime 58,65 Tage<SHIFT RETURN>"
565 hTypeKeys "Bias of the equatorplane against the orbitplane 0><SHIFT RETURN>Time of circulation 88 days<SHIFT RETURN>Distance to the sun Sun (km) 58Mio.<SHIFT RETURN>Temperatur at the day 350C<SHIFT RETURN>"
566 hTypeKeys "Temperatur at night -170C<SHIFT RETURN>Diameter (km) 4800"
569 printlog "format->character "
573 Active.SetPage TabFont
575 printlog "set font size to '18' on tabpage 'font' "
577 SizeWest.SetText "16"
581 printlog "click button OK "
584 printlog "click 'bold text' in object toolbar "
585 Kontext "TextObjectbar"
589 warnlog "Objectbar 'Text' not available :-( / didn't change automatical!"
590 hTypeKeys "<escape><escape><escape><tab><tab><TAB>"
594 hTypeKeys "<SHIFT><END>"
595 Kontext "TextObjectbar"
599 warnlog "darn again TBO"
603 printlog "save file with impress filter : user\\work\\webcast.odp "
604 sFile = ConvertPath (gOfficePath + "user\work\webcast")
605 if (Dir (sFile + ".odp") <> "") then app.kill (sFile + ".odp")
607 hFileSaveAsWithFilterKill ((sFile + ".odp") , "impress8" )
608 Printlog "saved presentation: " + sFile + ".odp"
609 '------------------------- Exportieren als ASP Web-Cast
610 Printlog "'export as webcast ASP"
611 printlog "File->SaveAs "
614 Kontext "ExportierenDlg"
616 printlog "select Filetype 'HTML...' aka 'WebPage' "
617 gHTMLFilter = Dateityp.GetItemText(1)
618 Dateityp.Select(gHTMLFilter)
620 errorlog " Filter not available :-( : '"+gHTMLFilter+"'"
622 printlog "Selects the first entry - which should be html "
624 printlog "Set Filename to user\\work\\webcst_asp.html "
625 sFile = ConvertPath (gOfficePath + "user\work\html\asp\webcast.html")
626 Dateiname.SetText sFile
627 printlog "click button 'save' "
630 Kontext "Active"' ????????? TBO
631 if Active.Exists (5) Then Active.Yes
633 printlog "now we are on the dialog -1- 'Assign design' "
634 Kontext "HTMLExport1"
636 printlog "click button 'Next >>' "
639 printlog "now we are on the dialog -2- 'Publication Type & Options' "
640 Kontext "HTMLExport2"
642 Printlog "check 'WebCast'"
645 Printlog "check 'Active Server Pages (ASP)'"
647 printlog "click button 'Next >>' "
649 printlog "now we are on the dialog -3- 'gif/jpeg & resolution & sound' "
650 Kontext "HTMLExport3"
652 printlog "check Save graphics as 'GIF' "
654 printlog "check 'Medium (monitor) Resolution' "
655 MittlereAufloesung.Check
657 printlog "click button 'Create' "
660 printlog "now we are on the dialog -7- 'Name HTML Design' "
662 printlog "click button 'Do Not Save' "
663 if HTMLDesign.Exists Then HTMLDesign.Cancel
665 do while HTMLDesign.Exists AND iWaitIndex < 30
667 iWaitIndex = iWaitIndex + 1
669 Printlog "- Check number of safed files"
670 Printlog "file saved: '" + sFile + "'"
672 GetFileList ((ConvertPath (gOfficePath + "user\work\html\asp\")), "*.*" , Liste() )
674 x = ListCount(Liste())
676 Warnlog "- Number of files is not correct, it should be:11 but it is: '" + x + "'"
678 printlog "("+i+"/"+x+"): '"+Liste(i)+"'"
681 '------------------------- Exportieren als ASP Web-Cast
682 Printlog "export as webcast PERL"
683 Kontext "DocumentImpress"
685 printlog "File->export "
688 Kontext "ExportierenDlg"
689 printlog "select Filetype 'HTML...' aka 'WebPage' "
691 Dateityp.Select gHTMLFilter
693 errorlog " Filter not available :-( : '"+gHTMLFilter+"'"
694 Dateityp.Select 1 ' selects the first one just in case anything else is selected.
695 printlog "Selected " + Dateityp.GetSelText + " manually."
698 printlog "Set Filename to user\\work\\wbcst_p.html "
699 sFile = ConvertPath (gOfficePath + "user\work\html\perl\webcast")
700 Dateiname.SetText sFile
701 printlog "click button 'save' "
705 printlog "click button 'save' "
706 if Active.Exists Then Active.Yes
708 printlog "now we are on the dialog -1- 'Assign design' "
709 Kontext "HTMLExport1"
711 printlog "click button 'Next >>' "
714 printlog "now we are on the dialog -2- 'Publication Type & Options' "
715 Kontext "HTMLExport2"
717 Printlog "check 'WebCast'"
720 Printlog "check 'Perl'"
723 printlog "'URL for listeners' "
724 printlog "URL for listeners compare to to TBO: "+BeamerURL.GetText
725 printlog "set 'URL for presentation' to 'wbcst_prl.html' "
726 PraesentationURL.SetText "wbcst_prl"
728 printlog "set 'URL for perl scrips' to '/WebCast/cgi-bin/' "
729 ScriptURL.SetText "/WebCast/cgi-bin/"
730 printlog "presentation url? : "+ (gOfficePath + "/WebCast/cgi-bin/wbcst_prl")
732 printlog "click button 'Next >>' "
735 printlog "now we are on the dialog -3- 'gif/jpeg & resolution & sound' "
736 Kontext "HTMLExport3"
738 printlog "check Save graphics as 'GIF' "
740 printlog "check 'Medium (monitor) Resolution' "
741 MittlereAufloesung.Check
743 printlog "click button 'Create' "
747 if HTMLDesign.Exists Then HTMLDesign.Cancel
748 Printlog "- Presentation saved and exported into both Webcast formats. all files can be found here: " + gOfficePath + "output\impress\web-cast\"
749 Printlog "file saved: '" + sFile + ".html'"
752 GetFileList ((ConvertPath (gOfficePath + "user\work\html\perl\")), "*.*" , Liste() )
753 x = ListCount(Liste())
755 Warnlog "- Number of files is not correct, it should be:5 but it is: '" + x + "'"
757 printlog "("+i+"/"+x+"): '"+Liste(i)+"'"
762 ' TBO: TODO FILECHECK IF EXISTS
763 endcase 'tHtmlExport_Webcast