1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?> 2cdf0e10cSrcweir<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> 33e02b54dSAndrew Rist<!--*********************************************************** 43e02b54dSAndrew Rist * 53e02b54dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 63e02b54dSAndrew Rist * or more contributor license agreements. See the NOTICE file 73e02b54dSAndrew Rist * distributed with this work for additional information 83e02b54dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 93e02b54dSAndrew Rist * to you under the Apache License, Version 2.0 (the 103e02b54dSAndrew Rist * "License"); you may not use this file except in compliance 113e02b54dSAndrew Rist * with the License. You may obtain a copy of the License at 123e02b54dSAndrew Rist * 133e02b54dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 143e02b54dSAndrew Rist * 153e02b54dSAndrew Rist * Unless required by applicable law or agreed to in writing, 163e02b54dSAndrew Rist * software distributed under the License is distributed on an 173e02b54dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 183e02b54dSAndrew Rist * KIND, either express or implied. See the License for the 193e02b54dSAndrew Rist * specific language governing permissions and limitations 203e02b54dSAndrew Rist * under the License. 213e02b54dSAndrew Rist * 223e02b54dSAndrew Rist ***********************************************************--> 23cdf0e10cSrcweir<script:module xmlns:script="http://openoffice.org/2000/script" script:name="DialogModul" script:language="StarBasic">Option Explicit 24cdf0e10cSrcweir 25cdf0e10cSrcweirPublic Const bDebugWizard = True 26cdf0e10cSrcweir 27cdf0e10cSrcweirPublic Const SBFIRSTAPPLCHECKED = 0 28cdf0e10cSrcweirPublic Const SBSECONDAPPLCHECKED = 1 29cdf0e10cSrcweirPublic Const SBTHIRDAPPLCHECKED = 2 30cdf0e10cSrcweirPublic Const SBFOURTHAPPLCHECKED = 3 31cdf0e10cSrcweirPublic bFilterTracingAvailable as Boolean 32cdf0e10cSrcweirPublic WizardMode as String 33cdf0e10cSrcweirPublic Const SBMICROSOFTMODE = "MS" 34cdf0e10cSrcweirPublic Const SBXMLMODE = "SO" 35cdf0e10cSrcweir' The absolute maximal Number of possible Applications 36cdf0e10cSrcweirPublic Const Twip = 425 37cdf0e10cSrcweirPublic Const SBMAXAPPLCOUNT = 4 38cdf0e10cSrcweirPublic MaxApplCount as Integer 39cdf0e10cSrcweirPublic CurOffice As Integer 40cdf0e10cSrcweirPublic SOBitmapPath As String 41cdf0e10cSrcweirPublic SOWorkPath As String 42cdf0e10cSrcweirPublic SOTemplatePath as String 43cdf0e10cSrcweirPublic bCancelTask As Boolean 44cdf0e10cSrcweirPublic bDoKeepApplValues as Boolean 45cdf0e10cSrcweirPublic iApplSection as Integer 46cdf0e10cSrcweirPublic oUcb as Object 47cdf0e10cSrcweirPublic PathSeparator as String 48cdf0e10cSrcweir 49cdf0e10cSrcweirPublic ApplCount as Integer 50cdf0e10cSrcweirPublic sKeyName(SBMAXAPPLCOUNT-1) as String 51cdf0e10cSrcweirPublic sValueName(SBMAXAPPLCOUNT-1) as String 52cdf0e10cSrcweirPublic sCRLF as String 53cdf0e10cSrcweirPublic MSFilterName(5,4) as String 54cdf0e10cSrcweirPublic XMLFilterName(7,3) as String 'Number of different formats 55cdf0e10cSrcweirPublic FilterTracingLogPath(2) as String 56cdf0e10cSrcweirPublic bMSApplFilterTracingAvailable(2) as String 57cdf0e10cSrcweirPublic bTakeOverTargetName(2) as Boolean 58cdf0e10cSrcweirPublic bTakeOverPathName(2) as Boolean 59cdf0e10cSrcweir 60cdf0e10cSrcweir' e.g.: 61cdf0e10cSrcweir' XMLFilterName(x,0) = "sdw" ' in documents we take the extensions; in SO-templates the appropriate Filtername 62cdf0e10cSrcweir' XMLFilterName(x,1) = "swriter: StarWriter 5.0" ' the filtername of the target-format 63cdf0e10cSrcweir' XMLFilterName(x,2) = "sxw" ' the target extension 64cdf0e10cSrcweir 65cdf0e10cSrcweirPublic Applications(SBMAXAPPLCOUNT-1,9) 66cdf0e10cSrcweir 67cdf0e10cSrcweirPublic Const SBAPPLCONVERT = 0 68cdf0e10cSrcweirPublic Const SBDOCCONVERT = 1 69cdf0e10cSrcweirPublic Const SBDOCRECURSIVE = 2 70cdf0e10cSrcweirPublic Const SBDOCSOURCE = 3 71cdf0e10cSrcweirPublic Const SBDOCTARGET = 4 72cdf0e10cSrcweirPublic Const SBTEMPLCONVERT = 5 73cdf0e10cSrcweirPublic Const SBTEMPLRECURSIVE = 6 74cdf0e10cSrcweirPublic Const SBTEMPLSOURCE = 7 75cdf0e10cSrcweirPublic Const SBTEMPLTARGET = 8 76cdf0e10cSrcweirPublic Const SBAPPLKEY = 9 77cdf0e10cSrcweirPublic XMLTemplateList() 78cdf0e10cSrcweir 79cdf0e10cSrcweir' Application-relating Data are stored in this Array 80cdf0e10cSrcweir' according to the following structure: 81cdf0e10cSrcweir' Applications(X,0) = True/False (Application is to be converted) 82cdf0e10cSrcweir' Applications(X,1) = True/False (Documents are to be converted) 83cdf0e10cSrcweir' Applications(X,2) = True/False (Including Subdirectories) 84cdf0e10cSrcweir' Applications(X,3) = "File:///..." (SourceUrl of the documents) 85cdf0e10cSrcweir' Applications(X,4) = "File///:..." (TargetUrl of the documents) 86cdf0e10cSrcweir' Applications(X,5) = True/False (Templates are to be converted) 87cdf0e10cSrcweir' Applications(X,6) = True/False (Including Subdirectories) 88cdf0e10cSrcweir' Applications(X,7) = "File:///..." (SourceUrl of the templates) 89cdf0e10cSrcweir' Applications(X,8) = "File:///..." (TargetUrl of the templates) 90cdf0e10cSrcweir' Applications(X,9) = 0 (Key to the original Index of the Applications) 91cdf0e10cSrcweir 92*bc0b50ddSTsutomu UchinoPublic Const SBMAXEXTENSIONLENGTH = 17 93cdf0e10cSrcweir 94cdf0e10cSrcweir 95cdf0e10cSrcweirSub FillStep_Welcome() 96cdf0e10cSrcweirDim i as Integer 97cdf0e10cSrcweir' bDoKeepApplValues = False 98cdf0e10cSrcweir ImportDialogArea.Title = sTitle 99cdf0e10cSrcweir With ImportDialog 100cdf0e10cSrcweir .cmdHelp.Label = sHelpButton 101cdf0e10cSrcweir .cmdCancel.Label = sCancelButton 102cdf0e10cSrcweir .cmdBack.Label = sBackButton 103cdf0e10cSrcweir .cmdGoOn.Label = sNextButton 104cdf0e10cSrcweir .WelcomeTextLabel.Label = sWelcomeTextLabel1 105cdf0e10cSrcweir .WelcomeTextLabel2.Label = sWelcomeTextLabel2 106cdf0e10cSrcweir .WelcomeTextLabel3.Label = sWelcomeTextLabel3 107cdf0e10cSrcweir 108cdf0e10cSrcweir .optMSDocuments.Label = sContainerName(0) 109cdf0e10cSrcweir .chkMSApplication1.Label = sMsDocumentCheckbox(0) 110cdf0e10cSrcweir .chkMSApplication2.Label = sMsDocumentCheckbox(1) 111cdf0e10cSrcweir .chkMSApplication3.Label = sMsDocumentCheckbox(2) 112cdf0e10cSrcweir 113cdf0e10cSrcweir .optSODocuments.Label = sContainerName(1) 114cdf0e10cSrcweir .chkSOApplication1.Label = sSODocumentCheckbox(0) 115cdf0e10cSrcweir .chkSOApplication2.Label = sSODocumentCheckbox(1) 116cdf0e10cSrcweir .chkSOApplication3.Label = sSODocumentCheckbox(2) 117cdf0e10cSrcweir .chkSOApplication4.Label = sSODocumentCheckbox(3) 118cdf0e10cSrcweir .cmdBack.Enabled = False 119cdf0e10cSrcweir .Step = 1 120cdf0e10cSrcweir 121cdf0e10cSrcweir If Not oFactoryKey.hasbyName("com.sun.star.text.TextDocument") Then 122cdf0e10cSrcweir .chkLogfile.State = 0 123cdf0e10cSrcweir .chkLogfile.Enabled = False 124cdf0e10cSrcweir End If 125cdf0e10cSrcweir End With 126cdf0e10cSrcweir CheckModuleInstallation() 127cdf0e10cSrcweir ToggleNextButton() 128cdf0e10cSrcweirEnd Sub 129cdf0e10cSrcweir 130cdf0e10cSrcweir 131cdf0e10cSrcweirSub FillStep_InputPaths(OfficeIndex as Integer, bStartup as Boolean) 132cdf0e10cSrcweirDim Index as Integer 133cdf0e10cSrcweirDim oNullObject as Object 134cdf0e10cSrcweir If bStartup And Not bDoKeepApplValues Then 135cdf0e10cSrcweir If ImportDialog.optMSDocuments.State = 1 Then 136cdf0e10cSrcweir SetupMSConfiguration() 137cdf0e10cSrcweir Else 138cdf0e10cSrcweir SetupXMLConfiguration() 139cdf0e10cSrcweir End If 140cdf0e10cSrcweir FillUpApplicationList() 141cdf0e10cSrcweir End If 142cdf0e10cSrcweir CurOffice = OfficeIndex 143cdf0e10cSrcweir Index = Applications(CurOffice,SBAPPLKEY) 144cdf0e10cSrcweir InitializePathsforCurrentApplication(Index) 145cdf0e10cSrcweir With ImportDialog 146cdf0e10cSrcweir .chkTemplatePath.Label = sTemplateCheckbox(Index) 147cdf0e10cSrcweir .chkDocumentPath.State = Abs(Applications(CurOffice,SBDOCCONVERT)) 148cdf0e10cSrcweir .chkDocumentSearchSubDir.State = Abs(Applications(CurOffice,SBDOCRECURSIVE)) 149cdf0e10cSrcweir .txtDocumentImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCSOURCE)) 150cdf0e10cSrcweir .txtDocumentExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCTARGET)) 151cdf0e10cSrcweir .hlnDocuments.Label = sProgressMoreDocs 152cdf0e10cSrcweir If WizardMode = SBXMLMODE Then 153cdf0e10cSrcweir ImportDialogArea.Title = sTitle & " - " & sSODocumentCheckBox(Index) 154cdf0e10cSrcweir Else 155cdf0e10cSrcweir ImportDialogArea.Title = sTitle & " - " & sMSDocumentCheckBox(Index) 156cdf0e10cSrcweir End If 157cdf0e10cSrcweir If WizardMode = SBXMLMODE AND Index = 3 Then 158cdf0e10cSrcweir ' Note: SO-Helper Applications are partly treated like templates although they only have documents 159cdf0e10cSrcweir .hlnTemplates.Label = sProgressMoreDocs 160cdf0e10cSrcweir .chkTemplatePath.Label = sSOHelperDocuments(0,0) 161cdf0e10cSrcweir .chkTemplatePath.Enabled = oFactoryKey.HasByName(sSOHelperDocuments(0,1)) 162cdf0e10cSrcweir .chkDocumentPath.Label = sSOHelperDocuments(1,0) 163cdf0e10cSrcweir .chkDocumentPath.Enabled = oFactoryKey.HasByName(sSOHelperDocuments(1,1)) 164cdf0e10cSrcweir Else 165cdf0e10cSrcweir .chkTemplatePath.Enabled = True 166cdf0e10cSrcweir .chkDocumentPath.Enabled = True 167cdf0e10cSrcweir .chkTemplatePath.Label = sTemplateCheckbox(Index) 168cdf0e10cSrcweir .chkDocumentPath.Label = sDocumentCheckbox(Index) 169cdf0e10cSrcweir .hlnTemplates.Label = sProgressMoreTemplates 170cdf0e10cSrcweir End If 171cdf0e10cSrcweir .chkTemplatePath.State = Abs(Applications(CurOffice,SBTEMPLCONVERT)) 172cdf0e10cSrcweir ToggleInputPaths(oNullObject,"Template") 173cdf0e10cSrcweir ToggleInputPaths(oNullObject,"Document") 174cdf0e10cSrcweir .chkTemplateSearchSubDir.State = Abs(Applications(CurOffice,SBTEMPLRECURSIVE)) 175cdf0e10cSrcweir .txtTemplateImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBTEMPLSOURCE)) 176cdf0e10cSrcweir .txtTemplateExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBTEMPLTARGET)) 177cdf0e10cSrcweir .cmdGoOn.Label = sNextButton 178cdf0e10cSrcweir .cmdBack.Enabled = True 179cdf0e10cSrcweir ImportDialog.Step = 2 180cdf0e10cSrcweir End With 181cdf0e10cSrcweir ImportDialogArea.GetControl("chkTemplatePath").SetFocus() 182cdf0e10cSrcweir ToggleNextButton() 183cdf0e10cSrcweirEnd Sub 184cdf0e10cSrcweir 185cdf0e10cSrcweir 186cdf0e10cSrcweirSub FillUpApplicationList() 187cdf0e10cSrcweirDim i as Integer 188cdf0e10cSrcweirDim a as Integer 189cdf0e10cSrcweirDim BoolValue as Boolean 190cdf0e10cSrcweir If Not bDoKeepApplValues Then 191cdf0e10cSrcweir a = 0 192cdf0e10cSrcweir For i = 1 To ApplCount 193cdf0e10cSrcweir If ImportDialog.optMSDocuments.State = 1 Then 194cdf0e10cSrcweir BoolValue = ImportDialogArea.GetControl("chkMSApplication" & i).Model.State = 1 195cdf0e10cSrcweir Else 196cdf0e10cSrcweir BoolValue = ImportDialogArea.GetControl("chkSOApplication" & i).Model.State = 1 197cdf0e10cSrcweir End If 198cdf0e10cSrcweir Applications(a,SBAPPLCONVERT) = BoolValue 199cdf0e10cSrcweir Applications(a,SBDOCCONVERT) = BoolValue 200cdf0e10cSrcweir Applications(a,SBDOCRECURSIVE) = BoolValue 201cdf0e10cSrcweir Applications(a,SBDOCSOURCE) = "" ' GetDefaultPath(i) 202cdf0e10cSrcweir Applications(a,SBDOCTARGET) = "" ' SOWorkPath 203cdf0e10cSrcweir Applications(a,SBTEMPLCONVERT) = BoolValue 204cdf0e10cSrcweir Applications(a,SBTEMPLRECURSIVE) = BoolValue 205cdf0e10cSrcweir Applications(a,SBTEMPLSOURCE) = "" ' GetTemplateDefaultPath(i) 206cdf0e10cSrcweir Applications(a,SBTEMPLTARGET) = "" ' GetTargetTemplatePath(i) 207cdf0e10cSrcweir Applications(a,SBAPPLKEY) = i-1 208cdf0e10cSrcweir If BoolValue Then 209cdf0e10cSrcweir a = a + 1 210cdf0e10cSrcweir End If 211cdf0e10cSrcweir Next i 212cdf0e10cSrcweir ApplCount = a 213cdf0e10cSrcweir End If 214cdf0e10cSrcweirEnd Sub 215cdf0e10cSrcweir 216cdf0e10cSrcweir 217cdf0e10cSrcweirSub InitializePathsforCurrentApplication(i as Integer) 218cdf0e10cSrcweir AssignPathToCurrentApplication(SBDOCSOURCE, GetDefaultPath(i)) 219cdf0e10cSrcweir AssignPathToCurrentApplication(SBDOCTARGET, SOWorkPath) 220cdf0e10cSrcweir AssignPathToCurrentApplication(SBTEMPLSOURCE, GetTemplateDefaultPath(i)) 221cdf0e10cSrcweir AssignPathToCurrentApplication(SBTEMPLTARGET, GetTargetTemplatePath(i)) 222cdf0e10cSrcweirEnd Sub 223cdf0e10cSrcweir 224cdf0e10cSrcweir 225cdf0e10cSrcweirSub AssignPathToCurrentApplication(Index as Integer, NewPath as String) 226cdf0e10cSrcweir If Applications(CurOffice,Index) = "" Then 227cdf0e10cSrcweir If CurOffice > 0 Then 228cdf0e10cSrcweir Applications(CurOffice,Index) = Applications(CurOffice-1,Index) 229cdf0e10cSrcweir Else 230cdf0e10cSrcweir Applications(CurOffice,Index) = NewPath 231cdf0e10cSrcweir End If 232cdf0e10cSrcweir End If 233cdf0e10cSrcweirEnd Sub 234cdf0e10cSrcweir 235cdf0e10cSrcweir 236cdf0e10cSrcweirSub SaveStep_InputPath() 237cdf0e10cSrcweir Applications(CurOffice,SBDOCCONVERT) = ImportDialog.chkDocumentPath.State = 1 238cdf0e10cSrcweir Applications(CurOffice,SBDOCRECURSIVE) = ImportDialog.chkDocumentSearchSubDir.State = 1 239cdf0e10cSrcweir Applications(CurOffice,SBDOCSOURCE) = ConvertToURL(ImportDialog.txtDocumentImportPath.Text) 240cdf0e10cSrcweir Applications(CurOffice,SBDOCTARGET) = ConvertToUrl(ImportDialog.txtDocumentExportPath.Text) 241cdf0e10cSrcweir Applications(CurOffice,SBTEMPLCONVERT) = ImportDialog.chkTemplatePath.State = 1 242cdf0e10cSrcweir Applications(CurOffice,SBTEMPLRECURSIVE) = ImportDialog.chkTemplateSearchSubDir.State = 1 243cdf0e10cSrcweir Applications(CurOffice,SBTEMPLSOURCE) = ConvertToURL(ImportDialog.txtTemplateImportPath.Text) 244cdf0e10cSrcweir Applications(CurOffice,SBTEMPLTARGET) = ConvertToURL(ImportDialog.txtTemplateExportPath.Text) 245cdf0e10cSrcweirEnd Sub 246cdf0e10cSrcweir 247cdf0e10cSrcweir 248cdf0e10cSrcweirSub ToggleInputPaths(aEvent as Object, Optional sDocType) 249cdf0e10cSrcweirDim bDoEnable as Boolean 250cdf0e10cSrcweirDim sLocDocType as String 251cdf0e10cSrcweirDim oCheckBox as Object 252cdf0e10cSrcweir If Not IsNull(aEvent) Then 253cdf0e10cSrcweir sLocDocType = aEvent.Source.Model.Tag 254cdf0e10cSrcweir Else 255cdf0e10cSrcweir sLocDocType = sDocType 256cdf0e10cSrcweir End If 257cdf0e10cSrcweir With ImportDialogArea 258cdf0e10cSrcweir oCheckBox = .GetControl("chk" & sLocDocType & "Path").Model 259cdf0e10cSrcweir bDoEnable = oCheckBox.State = 1 And oCheckBox.Enabled 260cdf0e10cSrcweir .GetControl("lbl" & sLocDocType & "Import").Model.Enabled = bDoEnable 261cdf0e10cSrcweir .GetControl("lbl" & sLocDocType & "Export").Model.Enabled = bDoEnable 262cdf0e10cSrcweir .GetControl("txt" & sLocDocType & "ImportPath").Model.Enabled = bDoEnable 263cdf0e10cSrcweir .GetControl("txt" & sLocDocType & "ExportPath").Model.Enabled = bDoEnable 264cdf0e10cSrcweir .GetControl("chk" & sLocDocType & "SearchSubDir").Model.Enabled = bDoEnable 265cdf0e10cSrcweir .GetControl("cmd" & sLocDocType & "Import").Model.Enabled = bDoEnable 266cdf0e10cSrcweir .GetControl("cmd" & sLocDocType & "Export").Model.Enabled = bDoEnable 267cdf0e10cSrcweir End With 268cdf0e10cSrcweir ToggleNextButton() 269cdf0e10cSrcweirEnd Sub 270cdf0e10cSrcweir 271cdf0e10cSrcweir 272cdf0e10cSrcweirFunction MakeSummaryString() 273cdf0e10cSrcweirDim sTmpText As String 274cdf0e10cSrcweirDim i as Integer 275cdf0e10cSrcweirDim Index as Integer 276cdf0e10cSrcweirDim sAddText as String 277cdf0e10cSrcweir For i = 0 To ApplCount -1 278cdf0e10cSrcweir Index = Applications(i,SBAPPLKEY) 279cdf0e10cSrcweir GetFilterTracingLogPath(i, Index) 280cdf0e10cSrcweir If Applications(i,SBTEMPLCONVERT) Then 281cdf0e10cSrcweir ' Templates are to be converted 282cdf0e10cSrcweir sAddText = "" 283cdf0e10cSrcweir If WizardMode = SBMICROSOFTMODE Then 284cdf0e10cSrcweir sAddText = sSumMSTemplates(Index) & sCRLF 285cdf0e10cSrcweir Else 286cdf0e10cSrcweir sAddText = sSumSOTemplates(Index) & sCRLF 287cdf0e10cSrcweir End If 288cdf0e10cSrcweir sTmpText = sTmpText & sAddText & ConvertFromUrl(Applications(i,SBTEMPLSOURCE)) & sCRLF 289cdf0e10cSrcweir If Applications(i,SBTEMPLRECURSIVE) Then 290cdf0e10cSrcweir ' Including Subdirectories 291cdf0e10cSrcweir sTmpText = sTmpText & sSumInclusiveSubDir & sCRLF 292cdf0e10cSrcweir End If 293cdf0e10cSrcweir sTmpText = sTmpText & sSumSaveDocuments & sCRLF 294cdf0e10cSrcweir sTmpText = sTmpText & ConvertFromUrl(Applications(i,SBTEMPLTARGET)) & sCRLF 295cdf0e10cSrcweir sTmpText = sTmpText & sCRLF 296cdf0e10cSrcweir End If 297cdf0e10cSrcweir 298cdf0e10cSrcweir If Applications(i,SBDOCCONVERT) Then 299cdf0e10cSrcweir ' Documents are to be converted 300cdf0e10cSrcweir If WizardMode = SBMICROSOFTMODE Then 301cdf0e10cSrcweir sAddText = sSumMSDocuments(Index) & sCRLF 302cdf0e10cSrcweir Else 303cdf0e10cSrcweir sAddText = sSumSODocuments(Index) & sCRLF 304cdf0e10cSrcweir End If 305cdf0e10cSrcweir sTmpText = sTmpText & sAddText & ConvertFromUrl(Applications(i,SBDOCSOURCE)) & sCRLF 306cdf0e10cSrcweir 307cdf0e10cSrcweir If Applications(i,SBDOCRECURSIVE) Then 308cdf0e10cSrcweir ' Including Subdirectories 309cdf0e10cSrcweir sTmpText = sTmpText & sSumInclusiveSubDir & sCRLF 310cdf0e10cSrcweir End If 311cdf0e10cSrcweir 312cdf0e10cSrcweir sTmpText = sTmpText & sSumSaveDocuments & sCRLF 313cdf0e10cSrcweir sTmpText = sTmpText & ConvertFromUrl(Applications(i,SBDOCTARGET)) & sCRLF 314cdf0e10cSrcweir sTmpText = sTmpText & sCRLF 315cdf0e10cSrcweir End If 316cdf0e10cSrcweir Next i 317cdf0e10cSrcweir MakeSummaryString = sTmpText 318cdf0e10cSrcweirEnd Function 319cdf0e10cSrcweir 320cdf0e10cSrcweir 321cdf0e10cSrcweirSub FillStep_Summary() 322cdf0e10cSrcweir ImportDialogArea.Title = sTitle 323cdf0e10cSrcweir With ImportDialog 324cdf0e10cSrcweir .SummaryTextbox.Text = MakeSummaryString() 325cdf0e10cSrcweir .cmdGoOn.Enabled = .SummaryTextbox.Text <> "" 326cdf0e10cSrcweir .cmdGoOn.Label = sBeginButton 327cdf0e10cSrcweir .SummaryHeaderLabel.Label = sSummaryHeader 328cdf0e10cSrcweir .Step = 3 329cdf0e10cSrcweir End With 330cdf0e10cSrcweir ImportDialogArea.GetControl("SummaryHeaderLabel").SetFocus() 331cdf0e10cSrcweirEnd Sub 332cdf0e10cSrcweir 333cdf0e10cSrcweir 334cdf0e10cSrcweirSub FillStep_Progress() 335cdf0e10cSrcweir With ImportDialog 336cdf0e10cSrcweir .cmdBack.Enabled = False 337cdf0e10cSrcweir .cmdGoOn.Enabled = False 338cdf0e10cSrcweir .hlnProgress.Label = sProgressPage_1 339cdf0e10cSrcweir .LabelRetrieval.FontWeight = com.sun.star.awt.FontWeight.BOLD 340cdf0e10cSrcweir .LabelRetrieval.Label = sProgressPage_2 341cdf0e10cSrcweir .LabelCurProgress.Label = sProgressPage_3 342cdf0e10cSrcweir .LabelCurDocumentRetrieval.Label = "" 343cdf0e10cSrcweir .LabelCurTemplateRetrieval.Label = "" 344cdf0e10cSrcweir .LabelCurDocument.Label = "" 345cdf0e10cSrcweir .Step = 4 346cdf0e10cSrcweir End With 347cdf0e10cSrcweir ImportDialogArea.GetControl("LabelRetrieval").SetFocus() 348cdf0e10cSrcweir If ImportDialog.chkLogfile.State = 1 Then 349cdf0e10cSrcweir ImportDialog.cmdShowLogFile.DefaultButton = True 350cdf0e10cSrcweir End If 351cdf0e10cSrcweirEnd Sub 352cdf0e10cSrcweir 353cdf0e10cSrcweir 354cdf0e10cSrcweirSub GetFilterTracingLogPath(i as Integer, Index as Integer) 355cdf0e10cSrcweirDim aNodePath(0) as new com.sun.star.beans.PropertyValue 356cdf0e10cSrcweirDim oMasterKey 357cdf0e10cSrcweirDim oImportKey 358cdf0e10cSrcweirDim oWordKey 359cdf0e10cSrcweirDim oExcelkey 360cdf0e10cSrcweirDim oPowerpointKey 361cdf0e10cSrcweirDim oFilterService 362cdf0e10cSrcweir aNodePath(0).Name = "nodepath" 363cdf0e10cSrcweir aNodePath(0).Value = "org.openoffice.Office.Tracing" 364cdf0e10cSrcweir oFilterService = createUnoService("com.sun.star.util.FilterTracer") 365cdf0e10cSrcweir bFilterTracingAvailable = Not IsNull(oFilterService) 366cdf0e10cSrcweir If bFilterTracingAvailable Then 367cdf0e10cSrcweir oMasterkey = GetRegistryKeyContent("org.openoffice.Office.Tracing/") 368cdf0e10cSrcweir If oMasterKey.hasbyName("Import") Then 369cdf0e10cSrcweir oImportKey = GetRegistryKeyContent("org.openoffice.Office.Tracing/Import") 370cdf0e10cSrcweir bMSApplFilterTracingAvailable(i) = CheckMSImportAvailability(oImportkey, MSFiltername(Index, 4), FilterTracingLogPath(i), bTakeOverTargetName(i), bTakeOverPathName(i)) 371cdf0e10cSrcweir End If 372cdf0e10cSrcweir End If 373cdf0e10cSrcweirEnd Sub 374cdf0e10cSrcweir 375cdf0e10cSrcweir 376cdf0e10cSrcweirFunction CheckMSImportAvailability(oImportkey, MSApplName as String, MSLogPath as String, bTakeOverTargetname as String, bTakeOverpathName as String) as Boolean 377cdf0e10cSrcweirDim bApplIsAvailable as Boolean 378cdf0e10cSrcweirDim oApplKey 379cdf0e10cSrcweirDim LocApplName as String 380cdf0e10cSrcweirDim LocApplPath as String 381cdf0e10cSrcweir bApplIsAvailable = oImportKey.hasbyName(MSApplName) 382cdf0e10cSrcweir If bApplIsAvailable Then 383cdf0e10cSrcweir oApplKey = oImportKey.getByName(MSApplName) 384cdf0e10cSrcweir bApplIsAvailable = oApplKey.On 385cdf0e10cSrcweir LocApplName = oApplKey.Name 386cdf0e10cSrcweir LocApplPath = oApplKey.Path 387cdf0e10cSrcweir bTakeOverTargetName = (LocApplName = "") 388cdf0e10cSrcweir bTakeOverPathName = (LocApplPath = "") 389cdf0e10cSrcweir MSLogPath = LocApplPath & "/" & LocApplName & ".log" 390cdf0e10cSrcweir End If 391cdf0e10cSrcweir CheckMSImportAvailability() = bApplIsAvailable 392cdf0e10cSrcweirEnd Function 393cdf0e10cSrcweir 394cdf0e10cSrcweir 395cdf0e10cSrcweir 396cdf0e10cSrcweirSub SetupMSConfiguration() 397cdf0e10cSrcweir iApplSection = 0 398cdf0e10cSrcweir Wizardmode = SBMICROSOFTMODE 399cdf0e10cSrcweir MaxApplCount = 3 400cdf0e10cSrcweir ApplCount = 3 401cdf0e10cSrcweir ' chkTemplatePath-Captions 402cdf0e10cSrcweir GetApplResourceArray(1009 + iApplSection, ApplCount, sTemplateCheckBox()) 403cdf0e10cSrcweir ' DocumentCheckbox- Captions 404cdf0e10cSrcweir GetApplResourceArray(1009 + iApplSection + ApplCount, ApplCount, sDocumentCheckBox()) 405cdf0e10cSrcweir 406cdf0e10cSrcweir sKeyName(0) = "Software\Microsoft\Office\8.0\Word\Options" 407cdf0e10cSrcweir sKeyName(1) = "Software\Microsoft\Office\8.0\Excel\Microsoft Excel" 408cdf0e10cSrcweir sKeyName(2) = "Software\Microsoft\Office\8.0\PowerPoint\Recent Folder List\Default" 409cdf0e10cSrcweir 410cdf0e10cSrcweir sValueName(0) = "DOC-PATH" 411cdf0e10cSrcweir sValueName(1) = "DefaultPath" 412cdf0e10cSrcweir sValueName(2) = "" 413cdf0e10cSrcweir 414cdf0e10cSrcweir' See definition of Filtername-Array about meaning of fields 415*bc0b50ddSTsutomu Uchino MSFilterName(0,0) = "doc|docx|docm" 416*bc0b50ddSTsutomu Uchino MSFilterName(0,1) = "writer8|writer8|writer8" 417*bc0b50ddSTsutomu Uchino MSFilterName(0,2) = "odt|odt|odt" 418cdf0e10cSrcweir MSFilterName(0,3) = sMSDocumentCheckBox(0) 419cdf0e10cSrcweir MSFilterName(0,4) = "Word" 420cdf0e10cSrcweir 421cdf0e10cSrcweir 422*bc0b50ddSTsutomu Uchino MSFilterName(1,0) = "xls|xlsx|xlsm" 423*bc0b50ddSTsutomu Uchino MSFilterName(1,1) = "calc8|calc8|calc8" 424*bc0b50ddSTsutomu Uchino MSFilterName(1,2) = "ods|ods|ods" 425cdf0e10cSrcweir MSFilterName(1,3) = sMSDocumentCheckBox(1) 426cdf0e10cSrcweir MSFilterName(1,4) = "Excel" 427cdf0e10cSrcweir 428*bc0b50ddSTsutomu Uchino MSFilterName(2,0) = "ppt|pps|pptx|pptm" 429*bc0b50ddSTsutomu Uchino MSFilterName(2,1) = "impress8|impress8|impress8|impress8" 430*bc0b50ddSTsutomu Uchino MSFilterName(2,2) = "odp|odp|odp|odp" 431cdf0e10cSrcweir MSFilterName(2,3) = sMSDocumentCheckBox(2) 432cdf0e10cSrcweir MSFilterName(2,4) = "PowerPoint" 433cdf0e10cSrcweir 434*bc0b50ddSTsutomu Uchino MSFilterName(3,0) = "dot|dotx|dotm" 435*bc0b50ddSTsutomu Uchino MSFilterName(3,1) = "writer8_template|writer8_template|writer8_template" 436*bc0b50ddSTsutomu Uchino MSFilterName(3,2) = "ott|ott|ott" 437cdf0e10cSrcweir MSFilterName(3,3) = sMSTemplateCheckBox(0) 438cdf0e10cSrcweir MSFilterName(3,4) = "Word" 439cdf0e10cSrcweir 440*bc0b50ddSTsutomu Uchino MSFilterName(4,0) = "xlt|xltx|xltm" 441*bc0b50ddSTsutomu Uchino MSFilterName(4,1) = "calc8_template|calc8_template|calc8_template" 442*bc0b50ddSTsutomu Uchino MSFilterName(4,2) = "ots|ots|ots" 443cdf0e10cSrcweir MSFilterName(4,3) = sMSTemplateCheckBox(1) 444cdf0e10cSrcweir MSFilterName(4,4) = "Excel" 445cdf0e10cSrcweir 446*bc0b50ddSTsutomu Uchino MSFilterName(5,0) = "pot|potx|potm" 447*bc0b50ddSTsutomu Uchino MSFilterName(5,1) = "impress8_template|impress8_template|impress8_template" 448*bc0b50ddSTsutomu Uchino MSFilterName(5,2) = "otp|otp|otp" 449cdf0e10cSrcweir MSFilterName(5,3) = sMSTemplateCheckBox(2) 450cdf0e10cSrcweir MSFilterName(5,4) = "PowerPoint" 451cdf0e10cSrcweirEnd Sub 452cdf0e10cSrcweir 453cdf0e10cSrcweir 454cdf0e10cSrcweir 455cdf0e10cSrcweir' This is an extract from "http://util.openoffice.org/source/browse/util/sot/source/base/exchange.cxx?rev=1.25&content-type=text/x-cvsweb-markup" 456cdf0e10cSrcweir' about the listed defined mimetypes that are required to define binary StarOffice templates that have for all applications the same extension ".vor" 457cdf0e10cSrcweir 458cdf0e10cSrcweir' 26 SOT_FORMATSTR_ID_STARWRITER_30*/ { "application/x-openoffice-starwriter-30;windows_formatname=\"StarWriter 3.0\"", "StarWriter 3.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 459cdf0e10cSrcweir' 27 SOT_FORMATSTR_ID_STARWRITER_40*/ { "application/x-openoffice-starwriter-40;windows_formatname=\"StarWriter 4.0\"", "StarWriter 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 460cdf0e10cSrcweir' 28 SOT_FORMATSTR_ID_STARWRITER_50*/ { "application/x-openoffice-starwriter-50;windows_formatname=\"StarWriter 5.0\"", "StarWriter 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 461cdf0e10cSrcweir 462cdf0e10cSrcweir' 29 SOT_FORMATSTR_ID_STARWRITERWEB_40*/ { "application/x-openoffice-starwriterweb-40;windows_formatname=\"StarWriter/Web 4.0\"", "StarWriter/Web 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 463cdf0e10cSrcweir' 30 SOT_FORMATSTR_ID_STARWRITERWEB_50*/ { "application/x-openoffice-starwriterweb-50;windows_formatname=\"StarWriter/Web 5.0\"", "StarWriter/Web 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 464cdf0e10cSrcweir 465cdf0e10cSrcweir' 31 SOT_FORMATSTR_ID_STARWRITERGLOB_40*/ { "application/x-openoffice-starwriterglob-40;windows_formatname=\"StarWriter/Global 4.0\"", "StarWriter/Global 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 466cdf0e10cSrcweir' 32 SOT_FORMATSTR_ID_STARWRITERGLOB_50*/ { "application/x-openoffice-starwriterglob-50;windows_formatname=\"StarWriter/Global 5.0\"", "StarWriter/Global 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 467cdf0e10cSrcweir 468cdf0e10cSrcweir' 33 SOT_FORMATSTR_ID_STARDRAW*/ { "application/x-openoffice-stardraw;windows_formatname=\"StarDrawDocument\"", "StarDrawDocument", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 469cdf0e10cSrcweir' 34 SOT_FORMATSTR_ID_STARDRAW_40*/ { "application/x-openoffice-stardraw-40;windows_formatname=\"StarDrawDocument 4.0\"", "StarDrawDocument 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 470cdf0e10cSrcweir' 36 SOT_FORMATSTR_ID_STARDRAW_50*/ { "application/x-openoffice-stardraw-50;windows_formatname=\"StarDraw 5.0\"", "StarDraw 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 471cdf0e10cSrcweir 472cdf0e10cSrcweir' 35 SOT_FORMATSTR_ID_STARIMPRESS_50*/ { "application/x-openoffice-starimpress-50;windows_formatname=\"StarImpress 5.0\"", "StarImpress 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 473cdf0e10cSrcweir 474cdf0e10cSrcweir' 37 SOT_FORMATSTR_ID_STARCALC*/ { "application/x-openoffice-starcalc;windows_formatname=\"StarCalcDocument\"", "StarCalcDocument", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 475cdf0e10cSrcweir' 38 SOT_FORMATSTR_ID_STARCALC_40*/ { "application/x-openoffice-starcalc-40;windows_formatname=\"StarCalc 4.0\"", "StarCalc 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 476cdf0e10cSrcweir' 39 SOT_FORMATSTR_ID_STARCALC_50*/ { "application/x-openoffice-starcalc-50;windows_formatname=\"StarCalc 5.0\"", "StarCalc 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 477cdf0e10cSrcweir 478cdf0e10cSrcweir' 40 SOT_FORMATSTR_ID_STARCHART*/ { "application/x-openoffice-starchart;windows_formatname=\"StarChartDocument\"", "StarChartDocument", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 479cdf0e10cSrcweir' 41 SOT_FORMATSTR_ID_STARCHART_40*/ { "application/x-openoffice-starchart-40;windows_formatname=\"StarChartDocument 4.0\"", "StarChartDocument 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 480cdf0e10cSrcweir' 42 SOT_FORMATSTR_ID_STARCHART_50*/ { "application/x-openoffice-starchart-50;windows_formatname=\"StarChart 5.0\"", "StarChart 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 481cdf0e10cSrcweir 482cdf0e10cSrcweir' 46 SOT_FORMATSTR_ID_STARMATH*/ { "application/x-openoffice-starmath;windows_formatname=\"StarMath\"", "StarMath", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 483cdf0e10cSrcweir' 47 SOT_FORMATSTR_ID_STARMATH_40*/ { "application/x-openoffice-starmath-40;windows_formatname=\"StarMathDocument 4.0\"", "StarMathDocument 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 484cdf0e10cSrcweir' 48 SOT_FORMATSTR_ID_STARMATH_50*/ { "application/x-openoffice-starmath-50;windows_formatname=\"StarMath 5.0\"", "StarMath 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 485cdf0e10cSrcweir 486cdf0e10cSrcweir 487cdf0e10cSrcweirSub SetupXMLConfiguration() 488cdf0e10cSrcweir iApplSection = 1000 489cdf0e10cSrcweir Wizardmode = SBXMLMODE 490cdf0e10cSrcweir ApplCount = 4 491cdf0e10cSrcweir MaxApplCount = 4 492cdf0e10cSrcweir XMLTemplateList = Array("vor", "sti", "stw" , "stc" , "std") 493cdf0e10cSrcweir ' chkTemplatePath-Captions 494cdf0e10cSrcweir GetApplResourceArray(1009 + iApplSection, ApplCount, sTemplateCheckBox()) 495cdf0e10cSrcweir ' DocumentCheckbox- Captions 496cdf0e10cSrcweir GetApplResourceArray(1009 + iApplSection + ApplCount, ApplCount, sDocumentCheckBox()) 497cdf0e10cSrcweir 498cdf0e10cSrcweir XMLFilterName(0,0) = "sdw|sxw" 499cdf0e10cSrcweir XMLFilterName(0,1) = "writer8|writer8" 500cdf0e10cSrcweir XMLFilterName(0,2) = "odt|odt" 501cdf0e10cSrcweir XMLFilterName(0,3) = sDocumentCheckBox(0) 502cdf0e10cSrcweir 503cdf0e10cSrcweir XMLFilterName(1,0) = "sdc|sxc" 504cdf0e10cSrcweir XMLFilterName(1,1) = "calc8|calc8" 505cdf0e10cSrcweir XMLFilterName(1,2) = "ods|ods" 506cdf0e10cSrcweir XMLFilterName(1,3) = sDocumentCheckBox(1) 507cdf0e10cSrcweir 508cdf0e10cSrcweir If oFactoryKey.HasByName("com.sun.star.drawing.DrawingDocument") and oFactoryKey.HasByName("com.sun.star.presentation.PresentationDocument") Then 509cdf0e10cSrcweir XMLFilterName(2,0) = "sdd|sda|sxi|sxd" 510cdf0e10cSrcweir XMLFilterName(2,1) = "impress8|draw8|impress8|draw8" 511cdf0e10cSrcweir XMLFilterName(2,2) = "odp|odg|odp|odg" 512cdf0e10cSrcweir Elseif oFactoryKey.HasByName("com.sun.star.drawing.DrawingDocument") Then 513cdf0e10cSrcweir XMLFilterName(2,0) = "sda|sxd" 514cdf0e10cSrcweir XMLFilterName(2,1) = "draw8|draw8" 515cdf0e10cSrcweir XMLFilterName(2,2) = "odg|odg" 516cdf0e10cSrcweir Elseif oFactoryKey.HasByName("com.sun.star.presentation.PresentationDocument") Then 517cdf0e10cSrcweir XMLFilterName(2,0) = "sdd|sxi" 518cdf0e10cSrcweir XMLFilterName(2,1) = "impress8|impress8" 519cdf0e10cSrcweir XMLFilterName(2,2) = "odp|odp" 520cdf0e10cSrcweir End If 521cdf0e10cSrcweir XMLFilterName(2,3) = sDocumentCheckBox(2) 522cdf0e10cSrcweir 523cdf0e10cSrcweir 524cdf0e10cSrcweir XMLFilterName(3,0) = "smf|sxm" 525cdf0e10cSrcweir XMLFilterName(3,1) = "math8|math8" 526cdf0e10cSrcweir XMLFilterName(3,2) = "odf|odf" 527cdf0e10cSrcweir XMLFilterName(3,3) = sDocumentCheckBox(3) 528cdf0e10cSrcweir 529cdf0e10cSrcweir XMLFilterName(4,0) = "application/x-openoffice-starwriter|application/vnd.stardivision.writer/web|application/vnd.sun.xml.writer|application/vnd.sun.xml.writerweb" 530cdf0e10cSrcweir XMLFilterName(4,1) = "writer8_template|writerweb8_writer_template|writer8_template|writerweb8_writer_template" 531cdf0e10cSrcweir XMLFilterName(4,2) = "ott|oth|ott|oth" 532cdf0e10cSrcweir XMLFilterName(4,3) = sTemplateCheckBox(0) 533cdf0e10cSrcweir 534cdf0e10cSrcweir 535cdf0e10cSrcweir XMLFilterName(5,0) = "application/x-openoffice-starcalc|application/vnd.sun.xml.calc" 536cdf0e10cSrcweir XMLFilterName(5,1) = "calc8_template|calc8_template" 537cdf0e10cSrcweir XMLFilterName(5,2) = "ots|ots" 538cdf0e10cSrcweir XMLFilterName(5,3) = sTemplateCheckBox(1) 539cdf0e10cSrcweir 540cdf0e10cSrcweir ' due to bug #108942# impress templates of the version 4.0 have to be handled in a special way because their mimetype 541cdf0e10cSrcweir ' falsely points to the draw application. 542cdf0e10cSrcweir If oFactoryKey.HasByName("com.sun.star.drawing.DrawingDocument") and oFactoryKey.HasByName("com.sun.star.presentation.PresentationDocument") Then 543cdf0e10cSrcweir XMLFilterName(6,0) = "application/x-openoffice-starimpress|application/x-openoffice-stardraw-40|application/x-openoffice-stardraw|application/vnd.sun.xml.impress|application/vnd.sun.xml.draw" 544cdf0e10cSrcweir XMLFilterName(6,1) = "impress8_template|impress8_template|draw8_template|impress8_template|draw8_template" 545cdf0e10cSrcweir XMLFilterName(6,2) = "otp|otp|otg|otp|otg" 546cdf0e10cSrcweir Elseif oFactoryKey.HasByName("com.sun.star.drawing.DrawingDocument") Then 547cdf0e10cSrcweir XMLFilterName(6,0) = "application/x-openoffice-stardraw|application/vnd.sun.xml.draw" 548cdf0e10cSrcweir XMLFilterName(6,1) = "draw8_template|draw8_template" 549cdf0e10cSrcweir XMLFilterName(6,2) = "otg|otg" 550cdf0e10cSrcweir Elseif oFactoryKey.HasByName("com.sun.star.presentation.PresentationDocument") Then 551cdf0e10cSrcweir XMLFilterName(6,0) = "application/x-openoffice-starimpress|application/x-openoffice-stardraw-40|application/vnd.sun.xml.impress" 552cdf0e10cSrcweir XMLFilterName(6,1) = "impress8_template|impress8_template|impress8_template" 553cdf0e10cSrcweir XMLFilterName(6,2) = "otp|otp|otp" 554cdf0e10cSrcweir End If 555cdf0e10cSrcweir XMLFilterName(6,3) = sTemplateCheckBox(2) 556cdf0e10cSrcweir 557cdf0e10cSrcweir If oFactoryKey.HasByName("com.sun.star.text.GlobalDocument") Then 558cdf0e10cSrcweir XMLFilterName(7,0) = "sgl|sxg" 559cdf0e10cSrcweir XMLFilterName(7,1) = "writerglobal8|writerglobal8" 560cdf0e10cSrcweir XMLFilterName(7,2) = "odm|odm" 561cdf0e10cSrcweir XMLFilterName(7,3) = sTemplateCheckBox(3) 562cdf0e10cSrcweir End If 563cdf0e10cSrcweirEnd Sub 564cdf0e10cSrcweir 565cdf0e10cSrcweir 566cdf0e10cSrcweirFunction CheckControlPath(oCheckbox as Object, oTextBox as Object, ByVal bDoEnable as Boolean) 567cdf0e10cSrcweirDim sPath as String 568cdf0e10cSrcweir If Not bDoEnable Then 569cdf0e10cSrcweir CheckControlPath = False 570cdf0e10cSrcweir ElseIf oCheckbox.State = 0 Then 571cdf0e10cSrcweir CheckControlPath = True 572cdf0e10cSrcweir Else 573cdf0e10cSrcweir sPath = ConvertToUrl(Trim(oTextBox.Text) 574cdf0e10cSrcweir CheckControlPath = oUcb.Exists(sPath) 575cdf0e10cSrcweir End If 576cdf0e10cSrcweirEnd Function 577cdf0e10cSrcweir 578cdf0e10cSrcweir 579cdf0e10cSrcweirFunction CheckInputPaths() as Boolean 580cdf0e10cSrcweirDim bChangePage as Boolean 581cdf0e10cSrcweir bChangePage = CheckTextBoxPath(ImportDialog.txtTemplateImportPath, True, False, sTitle, False) 582cdf0e10cSrcweir bChangePage = CheckTextBoxPath(ImportDialog.txtTemplateExportPath, bChangePage, True, sTitle, False) 583cdf0e10cSrcweir bChangePage = CheckTextBoxPath(ImportDialog.txtDocumentImportPath, bChangePage, False, sTitle, False) 584cdf0e10cSrcweir bChangePage = CheckTextBoxPath(ImportDialog.txtDocumentExportPath, bChangePage, True, sTitle, False) 585cdf0e10cSrcweir CheckInputPaths = bChangePage 586cdf0e10cSrcweirEnd Function 587cdf0e10cSrcweir 588cdf0e10cSrcweir 589cdf0e10cSrcweirFunction CheckTextBoxPath(oTextBox as Object, ByVal bCheck as Boolean, bCreateNew as Boolean, sTitle as String, bgetResources as Boolean) as Boolean 590cdf0e10cSrcweirDim iCreate as Integer 591cdf0e10cSrcweirDim sQueryMessage as String 592cdf0e10cSrcweirDim sUrlPath as String 593cdf0e10cSrcweirDim sMessageNoDir as String 594cdf0e10cSrcweirDim sShowPath as String 595cdf0e10cSrcweirDim oLocUcb as Object 596cdf0e10cSrcweir oLocUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess") 597cdf0e10cSrcweir If bGetResources Then 598cdf0e10cSrcweir If InitResources("ImportWizard","imp") then 599cdf0e10cSrcweir sNoDirCreation = GetResText(1050) 600cdf0e10cSrcweir sMsgDirNotThere = GetResText(1051) 601cdf0e10cSrcweir sQueryForNewCreation = GetResText(1052) 602cdf0e10cSrcweir Else 603cdf0e10cSrcweir CheckTextBoxPath() = False 604cdf0e10cSrcweir Exit Function 605cdf0e10cSrcweir End If 606cdf0e10cSrcweir End If 607cdf0e10cSrcweir If oTextBox.Enabled Then 608cdf0e10cSrcweir If bCheck Then 609cdf0e10cSrcweir sShowPath = oTextBox.Text 610cdf0e10cSrcweir sUrlPath = ConvertToUrl(sShowPath) 611cdf0e10cSrcweir If Not oLocUcb.Exists(sUrlPath) Then 612cdf0e10cSrcweir If Not bCreateNew Then 613cdf0e10cSrcweir ' Sourcedirectories must be existing, Targetdirectories may be created new 614cdf0e10cSrcweir sQueryMessage = ReplaceString(sMsgDirNotThere, sShowPath,"%1") 615cdf0e10cSrcweir Msgbox(sQueryMessage,16,sTitle) 616cdf0e10cSrcweir CheckTextBoxPath() = False 617cdf0e10cSrcweir Exit Function 618cdf0e10cSrcweir Else 619cdf0e10cSrcweir sQueryMessage = ReplaceString(sMsgDirNotThere, sShowPath,"%1") 620cdf0e10cSrcweir sQueryMessage = sQueryMessage & Chr(13) & sQueryForNewCreation 621cdf0e10cSrcweir iCreate = Msgbox (sQueryMessage, 36, sTitle) 622cdf0e10cSrcweir If iCreate = 6 Then 623cdf0e10cSrcweir On Local Error Goto NOVALIDPATH 624cdf0e10cSrcweir CreateFolder(sUrlPath) 625cdf0e10cSrcweir If Not oLocUcb.Exists(sUrlPath) Then 626cdf0e10cSrcweir Goto NOVALIDPATH 627cdf0e10cSrcweir End If 628cdf0e10cSrcweir Else 629cdf0e10cSrcweir CheckTextBoxPath() = False 630cdf0e10cSrcweir Exit Function 631cdf0e10cSrcweir End If 632cdf0e10cSrcweir End If 633cdf0e10cSrcweir End If 634cdf0e10cSrcweir CheckTextBoxPath() = True 635cdf0e10cSrcweir Else 636cdf0e10cSrcweir CheckTextBoxPath() = False 637cdf0e10cSrcweir End If 638cdf0e10cSrcweir Else 639cdf0e10cSrcweir CheckTextBoxPath() = True 640cdf0e10cSrcweir End If 641cdf0e10cSrcweir Exit Function 642cdf0e10cSrcweirNOVALIDPATH: 643cdf0e10cSrcweir sMessageNoDir = ReplaceString(sNoDirCreation, sShowPath, "%1") 644cdf0e10cSrcweir Msgbox(sMessageNoDir, 16, sTitle) 645cdf0e10cSrcweir CheckTextBoxPath() = False 646cdf0e10cSrcweirEnd Function 647cdf0e10cSrcweir 648cdf0e10cSrcweir 649cdf0e10cSrcweirSub InitializeProgressPage(oDialog as Object) 650cdf0e10cSrcweir oDialog.LabelRetrieval.FontWeight = com.sun.star.awt.FontWeight.NORMAL 651cdf0e10cSrcweir oDialog.LabelCurProgress.FontWeight = com.sun.star.awt.FontWeight.BOLD 652cdf0e10cSrcweirEnd Sub 653cdf0e10cSrcweir 654cdf0e10cSrcweir 655cdf0e10cSrcweirSub SetProgressDisplay(AbsFound as Integer) 656cdf0e10cSrcweir ImportDialog.LabelRetrieval.Label = sProgressPage_2 & " " & ReplaceString(sProgressPage_5, Str(AbsFound) & " ", "%1") 657cdf0e10cSrcweir ImportDialog.LabelCurDocumentRetrieval.Label = sProgressFound & " " & CStr(AbsDocuFound) & " " & sProgressMoreDocs 658cdf0e10cSrcweir ImportDialog.LabelCurTemplateRetrieval.Label = sProgressFound & " " & CStr(AbsTemplateFound) & " " & sProgressMoreTemplates 659cdf0e10cSrcweirEnd Sub 660cdf0e10cSrcweir 661cdf0e10cSrcweirSub TakoverFolderName(aEvent as Object) 662cdf0e10cSrcweirDim RefControlName as String 663cdf0e10cSrcweirDim oRefControl 664cdf0e10cSrcweir RefControlName = aEvent.Source.Model.Tag 665cdf0e10cSrcweir oRefControl = ImportDialogArea.GetControl(RefControlName) 666cdf0e10cSrcweir GetFolderName(oRefControl.Model) 667cdf0e10cSrcweir ToggleNextButton() 668cdf0e10cSrcweirEnd Sub 669cdf0e10cSrcweir 670cdf0e10cSrcweir 671cdf0e10cSrcweirSub FinalizeDialogButtons() 672cdf0e10cSrcweir ImportDialog.cmdShowLogFile.Enabled = ((Isnull(oLogDocument) = False) And (ImportDialog.chkLogfile.State = 1)) 673cdf0e10cSrcweir ImportDialog.cmdCancel.Enabled = False 674cdf0e10cSrcweir ImportDialog.cmdGoOn.Label = sCloseButton 675cdf0e10cSrcweir ImportDialog.cmdGoOn.Enabled = True 676cdf0e10cSrcweirEnd Sub 6773e02b54dSAndrew Rist</script:module> 678