summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards/web
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-06-16 17:09:32 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-02-17 22:21:57 +0000
commit5b3022860abfe7eefd2e25b60b5b2a563b42b3c0 (patch)
tree2282861b405cad2e8f8e60f20d614a8e7b1d0f2f /wizards/com/sun/star/wizards/web
parent9bc537b7943bc4d82e759b394941f89c35658516 (diff)
tdf#99967 Drop Web Wizard
Change-Id: Ibc0f45a03e16f3fe4ee54b24de30ba88e43a4aab Reviewed-on: https://gerrit.libreoffice.org/26381 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'wizards/com/sun/star/wizards/web')
-rw-r--r--wizards/com/sun/star/wizards/web/AbstractErrorHandler.py181
-rw-r--r--wizards/com/sun/star/wizards/web/BackgroundsDialog.py225
-rw-r--r--wizards/com/sun/star/wizards/web/CallWizard.py75
-rw-r--r--wizards/com/sun/star/wizards/web/ErrorHandler.py79
-rw-r--r--wizards/com/sun/star/wizards/web/ExtensionVerifier.py38
-rw-r--r--wizards/com/sun/star/wizards/web/FTPDialog.py412
-rw-r--r--wizards/com/sun/star/wizards/web/FTPDialogResources.py70
-rw-r--r--wizards/com/sun/star/wizards/web/IconsDialog.py123
-rw-r--r--wizards/com/sun/star/wizards/web/ImageListDialog.py231
-rw-r--r--wizards/com/sun/star/wizards/web/Process.py606
-rw-r--r--wizards/com/sun/star/wizards/web/ProcessErrorHandler.py61
-rw-r--r--wizards/com/sun/star/wizards/web/ProcessErrors.py32
-rw-r--r--wizards/com/sun/star/wizards/web/ProcessStatusRenderer.py48
-rw-r--r--wizards/com/sun/star/wizards/web/StatusDialog.py172
-rw-r--r--wizards/com/sun/star/wizards/web/StylePreview.py95
-rw-r--r--wizards/com/sun/star/wizards/web/TOCPreview.py63
-rw-r--r--wizards/com/sun/star/wizards/web/TypeDetection.py54
-rw-r--r--wizards/com/sun/star/wizards/web/WWD_Events.py943
-rw-r--r--wizards/com/sun/star/wizards/web/WWD_General.py305
-rw-r--r--wizards/com/sun/star/wizards/web/WWD_Startup.py664
-rw-r--r--wizards/com/sun/star/wizards/web/WWHID.py154
-rw-r--r--wizards/com/sun/star/wizards/web/WebConfigSet.py247
-rw-r--r--wizards/com/sun/star/wizards/web/WebWizardConst.py58
-rw-r--r--wizards/com/sun/star/wizards/web/WebWizardDialog.py712
-rw-r--r--wizards/com/sun/star/wizards/web/WebWizardDialogResources.py308
-rw-r--r--wizards/com/sun/star/wizards/web/__init__.py0
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGArgument.py23
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGContent.py39
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGDesign.py56
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGDocument.py316
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGExporter.py45
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGFilter.py23
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGGeneralInfo.py39
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGIconSet.py26
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGImage.py21
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGLayout.py53
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGPublish.py49
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGSession.py83
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGSessionName.py27
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGSettings.py169
-rw-r--r--wizards/com/sun/star/wizards/web/data/CGStyle.py35
-rw-r--r--wizards/com/sun/star/wizards/web/data/TypeDetection.py54
-rw-r--r--wizards/com/sun/star/wizards/web/data/__init__.py0
-rw-r--r--wizards/com/sun/star/wizards/web/export/AbstractExporter.py103
-rw-r--r--wizards/com/sun/star/wizards/web/export/ConfiguredExporter.py50
-rw-r--r--wizards/com/sun/star/wizards/web/export/CopyExporter.py49
-rw-r--r--wizards/com/sun/star/wizards/web/export/Exporter.py40
-rw-r--r--wizards/com/sun/star/wizards/web/export/FilterExporter.py54
-rw-r--r--wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.py70
-rw-r--r--wizards/com/sun/star/wizards/web/export/__init__.py1
-rw-r--r--wizards/com/sun/star/wizards/web/web.component25
51 files changed, 0 insertions, 7406 deletions
diff --git a/wizards/com/sun/star/wizards/web/AbstractErrorHandler.py b/wizards/com/sun/star/wizards/web/AbstractErrorHandler.py
deleted file mode 100644
index 6fb858d8c742..000000000000
--- a/wizards/com/sun/star/wizards/web/AbstractErrorHandler.py
+++ /dev/null
@@ -1,181 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from abc import abstractmethod
-
-from .ErrorHandler import ErrorHandler
-from ..common.SystemDialog import SystemDialog
-
-from com.sun.star.awt.VclWindowPeerAttribute import OK, DEF_OK, OK_CANCEL, DEF_CANCEL
-from com.sun.star.awt.VclWindowPeerAttribute import YES_NO, DEF_NO, DEF_YES
-
-#import com.sun.star.awt.VclWindowPeerAttribute
-
-
-# An abstract implementation of ErrorHandler, which
-# uses a renderer method geMessageFor(Exception, Object, int, int)
-# (in this class still abstract...)
-# to render the errors, and displays
-# error messages.
-class AbstractErrorHandler(ErrorHandler):
-
- xmsf = None
- peer = None
-
- def __init__(self, xmsf, peer_):
- self.xmsf = xmsf
- self.peer = peer_
-
- # Implementation of ErrorHandler:
- # shows a message box with the rendered error.
- # @param arg identifies the error. This object is passed to the render method
- # which returns the right error message.
- # @return true/false for continue/abort.
- def error(self, ex, arg, ix, errorType):
- if (errorType == ErrorHandler.ERROR_FATAL):
- return not self.showMessage(self.getMessageFor(ex, arg, ix, errorType), errorType)
- elif (errorType == ErrorHandler.ERROR_PROCESS_FATAL):
- return not self.showMessage(self.getMessageFor(ex, arg, ix, errorType), errorType)
- elif (errorType == ErrorHandler.ERROR_NORMAL_ABORT):
- return self.showMessage(self.getMessageFor(ex, arg, ix, errorType), errorType)
- elif (errorType == ErrorHandler.ERROR_NORMAL_IGNORE):
- return self.showMessage(self.getMessageFor(ex, arg, ix, errorType), errorType)
- elif (errorType == ErrorHandler.ERROR_QUESTION_CANCEL):
- return self.showMessage(self.getMessageFor(ex, arg, ix, errorType), errorType)
- elif (errorType == ErrorHandler.ERROR_QUESTION_OK):
- return self.showMessage(self.getMessageFor(ex, arg, ix, errorType), errorType)
- elif (errorType == ErrorHandler.ERROR_QUESTION_NO):
- return self.showMessage(self.getMessageFor(ex, arg, ix, errorType), errorType)
- elif (errorType == ErrorHandler.ERROR_QUESTION_YES):
- return self.showMessage(self.getMessageFor(ex, arg, ix, errorType), errorType)
- elif (errorType == ErrorHandler.ERROR_WARNING):
- return self.showMessage(self.getMessageFor(ex, arg, ix, errorType), errorType)
- elif (errorType == ErrorHandler.ERROR_MESSAGE):
- return self.showMessage(self.getMessageFor(ex, arg, ix, errorType), errorType)
- raise ValueError("unknown error type")
-
- # @deprecated
- # @param message
- # @param errorType
- # @return true if the ok/yes button is clicked, false otherwise.
- def showMessage(self, message, errorType):
- return self.showMessage1(self.xmsf, self.peer, message, errorType)
-
- # display a message
- # @deprecated
- # @param xmsf
- # @param message the message to display
- # @param errorType an int constant from the ErrorHandler interface.
- # @return
- @classmethod
- def showMessage1(self, xmsf, peer, message, errorType):
- serviceName = self.getServiceNameFor(errorType)
- attribute = self.getAttributeFor(errorType)
- b = SystemDialog.showMessageBox(xmsf, serviceName, attribute, message, peer)
- return b == self.getTrueFor(errorType)
-
- @classmethod
- def showMessage2(self, xmsf, peer, message, dialogType, buttons, defaultButton, returnTrueOn):
- b = SystemDialog.showMessageBox(xmsf, dialogType, defaultButton + buttons, message, peer, )
- return b == returnTrueOn
-
-
- # normally ok(1) is the value for true.
- # but a question dialog may use yes. so i use this method
- # for each error type to get its type of "true" value.
- # @param errorType
- # @return
- @classmethod
- def getTrueFor(self, errorType):
- if (errorType in (ErrorHandler.ERROR_FATAL, ErrorHandler.ERROR_PROCESS_FATAL,
- ErrorHandler.ERROR_NORMAL_ABORT, ErrorHandler.ERROR_NORMAL_IGNORE,
- ErrorHandler.ERROR_QUESTION_CANCEL, ErrorHandler.ERROR_QUESTION_OK)):
- return 1
- elif (errorType in (ErrorHandler.ERROR_QUESTION_NO, ErrorHandler.ERROR_QUESTION_YES)):
- return 2
- elif (errorType in (ErrorHandler.ERROR_WARNING, ErrorHandler.ERROR_MESSAGE)):
- return 1
- raise ValueError("unknown error type")
-
-
- # @param errorType
- # @return the Uno attributes for each error type.
- @classmethod
- def getAttributeFor(self, errorType):
- if (errorType == ErrorHandler.ERROR_FATAL):
- return OK
- elif (errorType == ErrorHandler.ERROR_PROCESS_FATAL):
- return OK
- elif (errorType == ErrorHandler.ERROR_NORMAL_ABORT):
- return OK_CANCEL + DEF_CANCEL
- elif (errorType == ErrorHandler.ERROR_NORMAL_IGNORE):
- return OK_CANCEL + DEF_OK
- elif (errorType == ErrorHandler.ERROR_QUESTION_CANCEL):
- return OK_CANCEL + DEF_CANCEL
- elif (errorType == ErrorHandler.ERROR_QUESTION_OK):
- return OK_CANCEL + DEF_OK
- elif (errorType == ErrorHandler.ERROR_QUESTION_NO):
- return YES_NO + DEF_NO
- elif (errorType == ErrorHandler.ERROR_QUESTION_YES):
- return YES_NO + DEF_YES
- elif (errorType == ErrorHandler.ERROR_WARNING):
- return OK
- elif (errorType == ErrorHandler.ERROR_MESSAGE):
- return OK
- raise ValueError("unknown error type")
-
- # @deprecated
- # @param errorType
- # @return the uno service name for each error type
- @classmethod
- def getServiceNameFor(self, errorType):
- if (errorType == ErrorHandler.ERROR_FATAL):
- return "errorbox"
- elif (errorType == ErrorHandler.ERROR_PROCESS_FATAL):
- return "errorbox"
- elif (errorType == ErrorHandler.ERROR_NORMAL_ABORT):
- return "errorbox"
- elif (errorType == ErrorHandler.ERROR_NORMAL_IGNORE):
- return "warningbox"
- elif (errorType == ErrorHandler.ERROR_QUESTION_CANCEL):
- return "querybox"
- elif (errorType == ErrorHandler.ERROR_QUESTION_OK):
- return "querybox"
- elif (errorType == ErrorHandler.ERROR_QUESTION_NO):
- return "querybox"
- elif (errorType == ErrorHandler.ERROR_QUESTION_YES):
- return "querybox"
- elif (errorType == ErrorHandler.ERROR_WARNING):
- return "warningbox"
- elif (errorType == ErrorHandler.ERROR_MESSAGE):
- return "infobox"
- raise ValueError("unknown error type")
-
- # renders the error
- # @param ex the exception
- # @param arg a free argument
- # @param ix a free argument
- # @param type the error type (from the int constants
- # in ErrorHandler interface)
- # @return a Strings which will be displayed in the message box,
- # and which describes the error, and the needed action from the user.
- @abstractmethod
- def getMessageFor(self, ex, arg, ix, errorType):
- pass
-
-
-
diff --git a/wizards/com/sun/star/wizards/web/BackgroundsDialog.py b/wizards/com/sun/star/wizards/web/BackgroundsDialog.py
deleted file mode 100644
index 1844876954f4..000000000000
--- a/wizards/com/sun/star/wizards/web/BackgroundsDialog.py
+++ /dev/null
@@ -1,225 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-import traceback
-
-from .ImageListDialog import ImageListDialog
-from .WWHID import HID_BG
-from .WebWizardConst import *
-from ..common.SystemDialog import SystemDialog
-from ..common.FileAccess import FileAccess
-from ..common.Configuration import Configuration
-from ..common.ListModel import ListModel
-from ..ui.ImageList import ImageList
-
-from com.sun.star.awt import Size
-
-class BackgroundsDialog(ImageListDialog):
-
- def __init__(self, xmsf, set_, resources):
- super(BackgroundsDialog, self).__init__(xmsf, HID_BG,
- (resources.resBackgroundsDialog,
- resources.resBackgroundsDialogCaption,
- resources.resOK,
- resources.resCancel,
- resources.resHelp,
- resources.resDeselect,
- resources.resOther,
- resources.resCounter))
- self.sd = SystemDialog.createOpenDialog(xmsf)
- self.sd.addFilter(
- resources.resImages, "*.jpg;*.jpeg;*.jpe;*.gif", True)
- self.sd.addFilter(resources.resAllFiles, "*.*", False)
- self.settings = set_.root
- self.fileAccess = FileAccess(xmsf)
- #COMMENTED
- #self.il.setListModel(Model(set_))
- self.il.listModel = self.Model(set_, self)
- self.il.imageSize = Size (40, 40)
- self.il.renderer = self.BGRenderer(0, self)
- self.build()
-
- '''
- triggered when the user clicks the "other" button.
- opens a "file open" dialog, adds the selected
- image to the list and to the web wizard configuration,
- and then jumps to the new image, selecting it in the list.
- @see add(String)
- '''
-
- def other(self):
- filename = self.sd.callOpenDialog(
- False, self.settings.cp_DefaultSession.cp_InDirectory)
- if filename is not None and len(filename) > 0 and filename[0] is not None:
- self.settings.cp_DefaultSession.cp_InDirectory = \
- FileAccess.getParentDir(filename[0])
- i = self.add(filename[0])
- self.il.setSelected(i)
- self.il.display(i)
-
- '''
- adds the given image to the image list (to the model)
- and to the web wizard configuration.
- @param s
- @return
- '''
-
- def add(self, s):
- #first i check the item does not already exists in the list...
- i = 0
- while i < self.il.listModel.getSize():
- if self.il.listModel.getElementAt(i) == s:
- return i
- i += 1
-
- self.il.listModel.add1(s)
- try:
- configView = Configuration.getConfigurationRoot(
- self.xMSF, FileAccess.connectURLs(
- CONFIG_PATH, "BackgroundImages"), True)
- i = len(Configuration.getChildrenNames(configView)) + 1
- o = Configuration.addConfigNode(configView, "" + str(i))
- Configuration.set(s, "Href", o)
- Configuration.commit(configView)
- except Exception:
- traceback.print_exc()
-
- return self.il.listModel.getSize() - 1
-
- '''
- an ImageList Imagerenderer implemtation.
- The image URL is the object given from the list model.
- the image name, got from the "render" method is
- the filename portion of the url.
- @author rpiterman
- '''
-
- class BGRenderer(ImageList.IImageRenderer):
- cut = 0
-
- def __init__(self, cut_, parent):
- self.cut = cut_
- self.parent = parent
-
- def getImageUrl(self, listItem):
- if (listItem is not None):
- return listItem
- return None
-
- def render(self, obj):
- return "" if (obj is None) else FileAccess.getFilename(self.parent.fileAccess.getPath(obj, None))
-
- '''
- This is a list model for the image list of the
- backgrounds dialog.
- It takes the Backgrounds config set as an argument,
- and "parses" it to a list of files:
- It goes through each image in the set, and checks it:
- if it is a directory it lists all image files in this directory.
- if it is a file, it adds the file to the list.
- @author rpiterman
- '''
-
- class Model(ListModel):
-
- parent = None
- listModel = []
-
- '''
- constructor. </br>
- see class description for a description of
- the handling of the given model
- @param model the configuration set of the background images.
- '''
-
- def __init__(self, model, parent):
- self.parent = parent
- try:
- i = 0
- while i < model.getSize():
- image = model.getElementAt(i)
- path = parent.sd.xStringSubstitution.substituteVariables(
- image.cp_Href, False)
- if parent.fileAccess.exists(path, False):
- self.addDir(path)
- else:
- self.remove(model.getKey(image))
-
- i += 1
- except Exception:
- traceback.print_exc()
-
- '''
- when instanciating the model, it checks if each image
- exists. If it doesn't, it will be removed from
- the configuration.
- This is what this method does...
- @param imageName
- '''
-
- def remove(self, imageName):
- try:
- conf = Configuration.getConfigurationRoot(
- self.parent.xMSF, CONFIG_PATH + "/BackgroundImages",
- True)
- Configuration.removeNode(conf, imageName)
- except Exception:
- traceback.print_exc()
-
- '''
- if the given url is a directory
- adds the images in the given directory,
- otherwise (if it is a file) adds the file to the list.
- @param url
- '''
-
- def addDir(self, url):
- if self.parent.fileAccess.isDirectory(url):
- self.add(self.parent.fileAccess.listFiles(url, False))
- else:
- self.add1(url)
-
- '''
- adds the given filenames (urls) to
- the list
- @param filenames
- '''
-
- def add(self, filenames):
- i = 0
- while i < len(filenames):
- self.add1(filenames[i])
- i += 1
-
- '''
- adds the given image url to the list.
- if and only if it ends with jpg, jpeg or gif
- (case insensitive)
- @param filename image url.
- '''
-
- def add1(self, filename):
- lcase = filename.lower()
- if lcase.endswith("jpg") or lcase.endswith("jpeg") or \
- lcase.endswith("gif"):
- self.listModel.append(filename)
-
- def getSize(self):
- return len(self.listModel)
-
- def getElementAt(self, arg0):
- return self.listModel[arg0]
diff --git a/wizards/com/sun/star/wizards/web/CallWizard.py b/wizards/com/sun/star/wizards/web/CallWizard.py
deleted file mode 100644
index 6f5bd2360951..000000000000
--- a/wizards/com/sun/star/wizards/web/CallWizard.py
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-import unohelper
-import traceback
-
-from .WWD_Events import WWD_Events
-from ..common.Desktop import Desktop
-
-from com.sun.star.lang import XServiceInfo
-from com.sun.star.task import XJobExecutor
-
-# pythonloader looks for a static g_ImplementationHelper variable
-g_ImplementationHelper = unohelper.ImplementationHelper()
-g_implName = "com.sun.star.wizards.web.CallWizard"
-
-# implement a UNO component by deriving from the standard unohelper.Base class
-# and from the interface(s) you want to implement.
-class CallWizard(unohelper.Base, XJobExecutor, XServiceInfo):
- def __init__(self, ctx):
- # store the component context for later use
- self.ctx = ctx
-
- def trigger(self, args):
- try:
- ww = WWD_Events(self.ctx.ServiceManager)
- ww.show()
- ww.cleanup()
- except Exception as e:
- print ("Wizard failure exception " + str(type(e)) +
- " message " + str(e) + " args " + str(e.args) +
- traceback.format_exc())
-
- @classmethod
- def callRemote(self):
- ConnectStr = \
- "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext"
- try:
- xmsf = Desktop.connect(ConnectStr)
- ww = WWD_Events(xmsf)
- ww.show()
- ww.cleanup()
- except Exception:
- traceback.print_exc()
-
- def getImplementationName(self):
- return g_implName
-
- def supportsService(self, ServiceName):
- return g_ImplementationHelper.supportsService(g_implName, ServiceName)
-
- def getSupportedServiceNames(self):
- return g_ImplementationHelper.getSupportedServiceNames(g_implName)
-
-g_ImplementationHelper.addImplementation( \
- CallWizard, # UNO object class
- g_implName, # implementation name
- ("com.sun.star.task.Job",),) # list of implemented services
- # (the only service)
-
-# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/wizards/com/sun/star/wizards/web/ErrorHandler.py b/wizards/com/sun/star/wizards/web/ErrorHandler.py
deleted file mode 100644
index 743ecf5e54bd..000000000000
--- a/wizards/com/sun/star/wizards/web/ErrorHandler.py
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-
-from com.sun.star.awt.VclWindowPeerAttribute import OK, DEF_OK, OK_CANCEL, DEF_CANCEL
-from com.sun.star.awt.VclWindowPeerAttribute import YES_NO, DEF_NO
-
-class ErrorHandler:
-
- MESSAGE_INFO = "infobox"
- MESSAGE_QUESTION = "querybox"
- MESSAGE_ERROR = "errorbox"
- MESSAGE_WARNING = "warningbox"
- BUTTONS_OK = OK
- BUTTONS_OK_CANCEL = OK_CANCEL
- BUTTONS_YES_NO = YES_NO
- RESULT_CANCEL = 0
- RESULT_OK = 1
- RESULT_YES = 2
- DEF_OK = DEF_OK
- DEF_NO = DEF_NO
- DEF_CANCEL = DEF_CANCEL
-
- #Error type for fatal errors which should abort application
- # execution. Should actually never be used :-)
- ERROR_FATAL = 0
- # An Error type for errors which should stop the current process.
- ERROR_PROCESS_FATAL = 1
- # An Error type for errors to which the user can choose, whether
- # to continue or to abort the current process.
- # default is abort.
- ERROR_NORMAL_ABORT = 2
- # An Error type for errors to which the user can choose, whether
- # to continue or to abort the current process.
- # default is continue.
- ERROR_NORMAL_IGNORE = 3
- # An error type for warnings which requires user interaction.
- # (a question :-) )
- # Default is abort (cancel).
- ERROR_QUESTION_CANCEL = 4
- # An error type for warnings which requires user interaction
- # (a question :-) )
- # Default is to continue (ok).
- ERROR_QUESTION_OK = 5
- # An error type for warnings which requires user interaction.
- # (a question :-) )
- # Default is abort (No).
- ERROR_QUESTION_NO = 6
- # An error type for warnings which requires user interaction
- # (a question :-) )
- # Default is to continue (Yes).
- ERROR_QUESTION_YES = 7
- # An error type which is just a warning...
- ERROR_WARNING = 8
- # An error type which just tells the user something
- # ( like "you look tired! you should take a bath! and so on)
- ERROR_MESSAGE = 9
-
- # @param ex the exception that accured
- # @param arg an object as help for recognizing the exception
- # @param ix an integer which helps for detailed recognizing of the exception
- # @param errorType one of the int constants defined by this Interface
- # @return true if the execution should continue, false if it should stop.
- def error(self, ex, arg, ix, errorType):
- pass
-
diff --git a/wizards/com/sun/star/wizards/web/ExtensionVerifier.py b/wizards/com/sun/star/wizards/web/ExtensionVerifier.py
deleted file mode 100644
index 524027be52b8..000000000000
--- a/wizards/com/sun/star/wizards/web/ExtensionVerifier.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-
-from ..common.UCB import UCB
-
-# Verifies all String that do not end with
-# the given extension.
-# This is used to exclude from a copy all the
-# xsl files, so I copy from a layout directory
-# all the files that do *not* end with xsl.
-class ExtensionVerifier(UCB.Verifier):
-
- extension = ""
-
- def __init__(self, extension_):
- self.extension = "." + extension_
-
- # @return true if the given object is
- # a String which does not end with the
- # given extension.
- def verify(self, obj):
- if (isinstance(obj, str)):
- return not obj.endswith(self.extension)
- return False
diff --git a/wizards/com/sun/star/wizards/web/FTPDialog.py b/wizards/com/sun/star/wizards/web/FTPDialog.py
deleted file mode 100644
index 63d3f2cb0f66..000000000000
--- a/wizards/com/sun/star/wizards/web/FTPDialog.py
+++ /dev/null
@@ -1,412 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-import traceback
-import uno
-
-from .WWHID import *
-from .FTPDialogResources import FTPDialogResources
-from ..ui.WizardDialog import WizardDialog
-from ..ui.UIConsts import UIConsts
-from ..ui.event.DataAware import DataAware
-from ..ui.event.UnoDataAware import UnoDataAware
-from ..common.PropertyNames import PropertyNames
-from ..common.SystemDialog import SystemDialog
-from ..common.FileAccess import FileAccess
-from ..common.HelpIds import HelpIds
-from ..common.UCB import UCB
-
-from com.sun.star.ucb import AuthenticationRequest
-from com.sun.star.ucb import InteractiveAugmentedIOException
-from com.sun.star.ucb import InteractiveNetworkConnectException
-from com.sun.star.ucb import InteractiveNetworkResolveNameException
-from com.sun.star.ucb import OpenCommandArgument2
-from com.sun.star.ucb.OpenMode import FOLDERS
-
-# This is the FTP Dialog. <br/>
-# The Dialog enables the user:
-# (*) entering FTP server and user information.
-# (*) testing the connection.
-# (*) choosing a directory on the server.
-# If a connection was established successfully, the user may
-# press OK, which will change
-# the CGPublish object properties according the user's input.
-# If no connection was established. the OK and Choose-Dir button are disabled.
-# See the method "disconnect()" which disables them.
-#
-# I use here the DataAware concept to automatically update
-# the members ip, username, and password (via the methods setXXX(...))
-# for details see the ui.events.DataAware classes. <br/>
-class FTPDialog(WizardDialog):
- RES_OK = 1
- RES_CANCEL = 2
- RES_HELP = 3
-
- # A Constant used for the setLabel(int) method to change the
- # status-display. "unknown" is the status when the user first
- # opens the dialog, or changes the servername/username/password.
- STATUS_UNKNOWN = 0
- # A Constant used for the setLabel(int) method to change the
- # status-display. (connection established)
- STATUS_OK = 1
- # A Constant used for the setLabel(int) method to change the
- # status-display.
- STATUS_USER_PWD_WRONG = 2
- # A Constant used for the setLabel(int) method to change the
- # status-display.
- STATUS_SERVER_NOT_FOUND = 3
- # A Constant used for the setLabel(int) method to change the
- # status-display.
- STATUS_NO_RIGHTS = 4
- # A Constant used for the setLabel(int) method to change the
- # status-display.
- STATUS_HOST_UNREACHABLE = 5
- # A Constant used for the setLabel(int) method to change the
- # status-display.
- STATUS_CONNECTING = 6
- # The icon url for error
- ICON_ERROR = "ftperror.gif"
- # The icon url for ok (connection ok)
- ICON_OK = "ftpconnected.gif"
- # The icon url for unknown - this is the status when
- # the user first opens the dialog
- ICON_UNKNOWN = "ftpunknown.gif"
- # The icon url for an icon representing the "connecting" state.
- ICON_CONNECTING = "ftpconnecting.gif" # GUI Components as Class members.
-
- # constructor.
- # constructs the UI.
- # @param xmsf
- # @param p the publishert object that contains the data
- # for this dialog
- # @throws Exception
- def __init__(self, xmsf, p, oWizardResource):
-
- super(FTPDialog, self).__init__(xmsf, HID_FTP)
- self.publish = p
-
- templateDir = p.root.soTemplateDir
- self.imagesDirectory = FileAccess.connectURLs(templateDir, "../wizard/bitmap/")
-
- self.dataAware = []
- self.host = ""
- self.username = ""
- self.password = ""
-
- # Load Resources
- self.resources = FTPDialogResources(oWizardResource)
- self.ucb = UCB(xmsf)
-
- # set dialog properties...
- self.setDialogProperties(True, 210, True, 104, 52, 1, 1,
- self.resources.resFTPDialog_title, 310)
-
- # add controls to dialog
- self.build()
- #make the hostname, username and password textfield data-aware.
- self.configure()
- #make sure we display a disconnected status.
- self.disconnect()
-
-
- # Add controls to dialog.
- def build(self):
- PROPNAMES_LABEL = (PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH)
- PROPNAMES_BUTTON = (PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH)
- PROPNAMES_BUTTON2 = (PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "PushButtonType", PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH)
-
- self.ln1 = self.insertFixedLine("ln1",
- PROPNAMES_LABEL,
- (8, self.resources.resln1_value, "ln1", 6, 6, 0, 210))
- self.lblFTPAddress = self.insertLabel("lblFTPAddress",
- PROPNAMES_LABEL,
- (8, self.resources.reslblFTPAddress_value, "lblFTPAddress", 12, 20, 1, 95))
- self.txtHost = self.insertTextField("txtHost", "disconnect",
- (PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH),
- (12, HelpIds.getHelpIdString(HID_FTP_SERVER), "txtIP", 110, 18, 2, 106), self)
- self.lblUsername = self.insertLabel("lblUsername",
- PROPNAMES_LABEL,
- (8, self.resources.reslblUsername_value, "lblUsername", 12, 36, 3, 85))
- self.txtUsername = self.insertTextField("txtUsername", "disconnect",
- (PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH),
- (12, HelpIds.getHelpIdString(HID_FTP_USERNAME), "txtUsername", 110, 34, 4, 106), self)
- self.lblPassword = self.insertLabel("lblPassword",
- PROPNAMES_LABEL,
- (8, self.resources.reslblPassword_value, "lblPassword", 12, 52, 5, 85))
- self.txtPassword = self.insertTextField("txtPassword", "disconnect",
- ("EchoChar", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH),
- (42, 12, HelpIds.getHelpIdString(HID_FTP_PASS), "txtPassword", 110, 50, 6, 106), self)
- self.ln2 = self.insertFixedLine("ln2",
- PROPNAMES_LABEL,
- (8, self.resources.resln2_value, "ln2", 6, 68, 7, 210))
- self.btnTestConnection = self.insertButton("btnConnect", "connect",
- PROPNAMES_BUTTON,
- (14, HelpIds.getHelpIdString(HID_FTP_TEST), self.resources.resbtnConnect_value, "btnConnect", 12, 80, 8, 50), self)
- self.imgStatus = self.insertImage("imgStatus",
- ("Border", PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, "ScaleImage", "Tabstop", PropertyNames.PROPERTY_WIDTH),
- (0, 14, 68, 80, False, False, 14))
- self.lblStatus = self.insertLabel("lblStatus",
- PROPNAMES_LABEL,
- (8, self.resources.resFTPDisconnected, "lblStatus", 86, 82, 9, 130))
- self.ln3 = self.insertFixedLine("ln3",
- PROPNAMES_LABEL,
- (8, self.resources.resln3_value, "ln3", 6, 100, 10, 210))
- self.txtDir = self.insertTextField("txtDir", None,
- (PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_NAME, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, "Text", PropertyNames.PROPERTY_WIDTH),
- (False, 12, HelpIds.getHelpIdString(HID_FTP_TXT_PATH), "txtDir", 12, 113, 11, self.resources.restxtDir_value, 184), self)
- self.btnDir = self.insertButton("btnDir", "chooseDirectory",
- PROPNAMES_BUTTON,
- (14, HelpIds.getHelpIdString(HID_FTP_BTN_PATH), self.resources.resbtnDir_value, "btnDir", 199, 112, 12, 16), self)
- self.btnOK = self.insertButton("btnOK", None,
- PROPNAMES_BUTTON2,
- (14, HelpIds.getHelpIdString(HID_FTP_OK), self.resources.resbtnOK_value, "btnOK", 165, 142, self.RES_OK, 13, 50), self)
- self.btnCancel = self.insertButton("btnCancel",
- None, PROPNAMES_BUTTON2,
- (14, HelpIds.getHelpIdString(HID_FTP_CANCEL), self.resources.resbtnCancel_value, "btnCancel", 113, 142, self.RES_CANCEL, 14, 50), self)
- self.btnHelp = self.insertButton("btnHelp", None,
- PROPNAMES_BUTTON2,
- (14, "", self.resources.resbtnHelp_value, "btnHelp", 57, 142, self.RES_HELP, 15, 50), self)
-
-
- # Make hostname, username and password text fields data aware.
- def configure(self):
- self.dataAware.append(UnoDataAware.attachEditControl(self, "host", self.txtHost, True))
- self.dataAware.append(UnoDataAware.attachEditControl(self, "username", self.txtUsername, True))
- self.dataAware.append(UnoDataAware.attachEditControl(self, "password", self.txtPassword, True))
-
- # Shows the dialog.
- # If the user clicks ok, changes the given CGPublish properties to the
- # user input.
- # @param parent a dialog to center this dialog to.
- # @return 0 for cancel, 1 for ok.
- # @throws Exception - well, if something goes wrong...
- def execute(self, parent):
- self.host = self.extractHost(self.publish.cp_URL)
- self.username = "" if (self.publish.cp_Username == None) else self.publish.cp_Username
- self.password = "" if (self.publish.password == None) else self.publish.password
- self.folder = self.extractDir(self.publish.cp_URL)
- self.setLabel(self.STATUS_UNKNOWN)
-
- self.enableTestButton()
- self.updateUI()
- result = self.executeDialogFromParent(parent)
- # change the CGPublish properties
- if (result == 1):
- self.publish.cp_URL = "ftp://" + self.getHost() + self.getDir()
- self.publish.cp_Username = self.username
- self.publish.password = self.password
-
- return result
-
- # updates the hostname, username, password and
- # directory text fields.
- # It's called upon initialization.
- def updateUI(self):
- DataAware.updateUIs(self.dataAware)
- self.setDir(self.folder)
-
- # extract the hostname out of the url used by the
- # publisher. This url does not include the username:password string.
- # @param ftpUrl
- # @return
- def extractHost(self, ftpUrl):
- if (ftpUrl is None or len(ftpUrl) < 6):
- return ""
- url = ftpUrl[6:]
- i = url.find("/")
- if (i == -1):
- return url
- else:
- return url[:i]
-
- # used to get data from the CGPublish object.
- # @param ftpUrl
- # @return the directory portion of the ftp-url
- def extractDir(self, ftpUrl):
- if (ftpUrl is None or len(ftpUrl) < 6):
- return "/"
- url = ftpUrl[6:]
- i = url.find("/")
- if (i == -1):
- return "/"
- else:
- return url[i:]
-
- # enables/disables the "test" button
- # according to the status of the hostname, username, password text fields.
- # If one of these fields is empty, the button is disabled.
- def enableTestButton(self):
- self.setEnabled(self.btnTestConnection, not (self.isEmpty(self.host) or self.isEmpty(self.username) or self.isEmpty(self.password)))
-
- # @param s
- # @return True if the string is None or "".
- def isEmpty(self, s):
- return (s is None) or (s == "")
-
- # @return the ftp url with username and password,
- # but without the directory portion.
- def getAccountUrl(self):
- return "ftp://" + self.username + ":" + self.password + "@" + self.getHost()
-
- # return the host name without the "ftp://"
- # @return
- def getHost(self):
- return self.getHost1(self.host)
-
- @classmethod
- def getHost1(self, s):
- return s[6:] if s.startswith("ftp://") else s
-
- # @return the full ftp url including username, password and directory portion.
- def getFullUrl(self):
- return self.getAccountUrl() + self.folder
-
- # First I try to connect to the full url, including directory.
- # If an InteractiveAugmentedIOException accures, I try again,
- # this time without the dir spec. If this works, I change the dir
- # to "/", if not I say to the user its his problem...
- def connect(self):
- self.setEnabled(self.btnTestConnection, False)
- self.setLabel(self.STATUS_CONNECTING)
- success = False
- try:
- self.connect1(self.getFullUrl())
- success = True
- except InteractiveAugmentedIOException:
- try:
- self.connect1(self.getAccountUrl())
- self.setDir("/")
- success = True
- except Exception:
- self.setLabel(self.STATUS_NO_RIGHTS)
- except InteractiveNetworkResolveNameException:
- self.setLabel(self.STATUS_SERVER_NOT_FOUND)
- except AuthenticationRequest:
- self.setLabel(self.STATUS_USER_PWD_WRONG)
- except InteractiveNetworkConnectException:
- self.setLabel(self.STATUS_HOST_UNREACHABLE)
- except Exception:
- self.setLabel(-1)
- traceback.print_exc()
-
- if (success):
- self.setLabel(self.STATUS_OK)
- self.setEnabled(self.btnDir, True)
- self.setEnabled(self.btnOK, True)
-
- self.setEnabled(self.btnTestConnection, True)
-
-
- # To try the connection I do some actions that
- # seem logical to me: <br/>
- # I get a ucb content.
- # I list the files in this content.
- # I call the ucb "open" command.
- # I get the PropertyNames.PROPERTY_TITLE property of this content.
- # @param acountUrl
- # @throws Exception
- def connect1(self, acountUrl):
- content = self.ucb.getContent(self.getAccountUrl())
-
- # open the content
- aArg = OpenCommandArgument2()
- aArg.Mode = FOLDERS # FOLDER, DOCUMENTS -> simple filter
- aArg.Priority = 32768 # Ignored by most implementations
-
- self.ucb.executeCommand(content, "open", aArg)
-
- # changes the ftp subdirectory, in both
- # the UI and the data.
- # @param s the directory.
- def setDir(self, s):
- self.folder = s
- self.txtDir.Model.Text = self.folder
-
- # @return the ftp subdirecrtory.
- def getDir(self):
- return self.folder
-
- # changes the status label to disconnected status, and
- # disables the ok and choose-dir buttons.
- # This method is called also when the hostname, username
- # and passwordtext fields change.
- def disconnect(self):
- self.enableTestButton()
- self.setEnabled(self.btnOK, False)
- self.setEnabled(self.btnDir, False)
- self.setLabel(self.STATUS_UNKNOWN)
-
- # changes the status label and icon, according to the
- # given status
- # @param status one of the private status-constants.
- # if this param is not one of them, an "unknown error" status is displayed.
- def setLabel(self, status):
- if status == self.STATUS_UNKNOWN:
- # not connected yet
- self.setLabel1(self.resources.resFTPDisconnected, self.ICON_UNKNOWN)
- elif status == self.STATUS_OK:
- # connected!
- self.setLabel1(self.resources.resFTPConnected, self.ICON_OK)
- elif status == self.STATUS_USER_PWD_WRONG:
- # wrong password
- self.setLabel1(self.resources.resFTPUserPwdWrong, self.ICON_ERROR)
- elif status == self.STATUS_SERVER_NOT_FOUND:
- # problem resolving server name
- self.setLabel1(self.resources.resFTPServerNotFound, self.ICON_ERROR)
- elif status == self.STATUS_NO_RIGHTS:
- # rights problem
- self.setLabel1(self.resources.resFTPRights, self.ICON_ERROR)
- elif status == self.STATUS_HOST_UNREACHABLE:
- # host unreachable (firewall?)
- self.setLabel1(self.resources.resFTPHostUnreachable, self.ICON_ERROR)
- elif status == self.STATUS_CONNECTING:
- self.setLabel1(self.resources.resConnecting, self.ICON_CONNECTING)
- else:
- self.setLabel1(self.resources.resFTPUnknownError, self.ICON_ERROR)
-
- # changes the text of the status label and
- # (TODO) the status image.
- # @param label
- # @param image
- def setLabel1(self, label, image):
- setattr(self.lblStatus.Model, PropertyNames.PROPERTY_LABEL, label)
- setattr(self.imgStatus.Model, PropertyNames.PROPERTY_IMAGEURL, self.imageUrl(image))
-
- def imageUrl(self, s):
- return self.imagesDirectory + s
-
- # called when the user clicks
- # the choose-dir button. ("...")
- # Opens the pickFolder dialog.
- # checks if the returned folder is an ftp folder.
- # sets the textbox and the data to the new selected dir.
- def chooseDirectory(self):
- sd = SystemDialog.createOfficeFolderDialog(self.xMSF)
- newUrl = sd.callFolderDialog(self.resources.resFTPDirectory, "", self.getFullUrl())
- if (newUrl is not None):
- # if the user chose a local directory,
- # sI do not accept it.
- if (newUrl.startswith("ftp://")):
- self.setDir(self.extractDir(newUrl))
- else:
- AbstractErrorHandler.showMessage(self.xMSF, self.xUnoDialog.getPeer(), self.resources.resIllegalFolder, ErrorHandler.ERROR_PROCESS_FATAL)
-
- # practical to have such a method...
- # @param p the publisher object that contains the ftp connection info.
- # @return the full ftp url with username password and everything one needs.
- @classmethod
- def getFullURL1(self, p):
- return "ftp://" + p.cp_Username + ":" + p.password + "@" + self.getHost1(p.cp_URL)
diff --git a/wizards/com/sun/star/wizards/web/FTPDialogResources.py b/wizards/com/sun/star/wizards/web/FTPDialogResources.py
deleted file mode 100644
index 184159c1400a..000000000000
--- a/wizards/com/sun/star/wizards/web/FTPDialogResources.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-
-class FTPDialogResources(object):
-
- RID_FTPDIALOG_START = 4200
- RID_COMMON_START = 500
-
- def __init__(self, oWizardResource):
- self.resFTPDialog_title = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 0)
- self.reslblUsername_value = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 1)
- self.reslblPassword_value = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 2)
- self.resbtnConnect_value = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 3)
- self.resln1_value = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 4)
- self.reslblFTPAddress_value = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 5)
- self.resln2_value = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 6)
- self.resln3_value = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 7)
- self.resbtnDir_value = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 8)
- self.resFTPDisconnected = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 9)
- self.resFTPConnected = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 10)
- self.resFTPUserPwdWrong = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 11)
- self.resFTPServerNotFound = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 12)
- self.resFTPRights = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 13)
- self.resFTPHostUnreachable = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 14)
- self.resFTPUnknownError = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 15)
- self.resFTPDirectory = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 16)
- self.resIllegalFolder = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 17)
- self.resConnecting = oWizardResource.getResText(
- self.RID_FTPDIALOG_START + 18)
-
- self.resbtnCancel_value = oWizardResource.getResText(
- self.RID_COMMON_START + 11)
- self.resbtnOK_value = oWizardResource.getResText(
- self.RID_COMMON_START + 18)
- self.resbtnHelp_value = oWizardResource.getResText(
- self.RID_COMMON_START + 15)
-
- self.restxtDir_value = "/"
diff --git a/wizards/com/sun/star/wizards/web/IconsDialog.py b/wizards/com/sun/star/wizards/web/IconsDialog.py
deleted file mode 100644
index 14862cfeeb0b..000000000000
--- a/wizards/com/sun/star/wizards/web/IconsDialog.py
+++ /dev/null
@@ -1,123 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-from .ImageListDialog import ImageListDialog
-from .WWHID import HID_IS
-from ..common.FileAccess import FileAccess
-from ..common.ListModel import ListModel
-from ..ui.ImageList import ImageList
-
-from com.sun.star.awt import Size
-
-'''
-@author rpiterman
-The dialog class for choosing an icon set.
-This class simulates a model, though it does not functions really as one,
-since it does not cast events.
-It also implements the ImageList.ImageRenderer interface, to handle
-its own objects.
-'''
-
-class IconsDialog(ImageListDialog, ImageList.IImageRenderer, ListModel):
-
- def __init__(self, xmsf, set_, resources):
- super(IconsDialog, self).__init__(xmsf, HID_IS,
- (resources.resIconsDialog,
- resources.resIconsDialogCaption,
- resources.resOK,
- resources.resCancel,
- resources.resHelp,
- resources.resDeselect,
- resources.resOther,
- resources.resCounter))
- self.htmlexpDirectory = FileAccess.getOfficePath2(
- xmsf, "Gallery", "share", "")
- self.icons = \
- ["firs", "prev", "next", "last", "nav", "text", "up", "down"]
- self.set = set_
- self.objects = range(self.set.getSize() * len(self.icons))
-
- self.il.listModel = self
- self.il.renderer = self
- self.il.rows = 4
- self.il.cols = 8
- self.il.ImageSize = Size (20, 20)
- self.il.showButtons = False
- self.il.rowSelect = True
- self.il.scaleImages = False
- self.showDeselectButton = True
- self.showOtherButton = False
- self.build()
-
- def getIconset(self):
- if self.getSelected() is None:
- return None
- else:
- selected = self.getSelected()
- value = int(selected / len(self.icons))
- return "iconset" + str(value)
- #return self.set.getKey(value)
-
- def setIconset(self, iconset):
- icon = self.set.getIndexOf(self.set.getElement(iconset)) * len(self.icons)
- aux = None
- if icon >=0:
- aux = self.objects[icon]
- self.setSelected(aux)
-
- def addListDataListener(self, listener):
- pass
-
- def removeListDataListener(self, listener):
- pass
-
- def getSize(self):
- return self.set.getSize() * len(self.icons)
-
- def getElementAt(self, arg0):
- return self.objects[arg0]
-
- def getImageUrl(self, listItem):
- i = listItem
- iset = self.getIconsetNum(i)
- icon = self.getIconNum(i)
- return self.htmlexpDirectory + "/htmlexpo/" \
- + self.getIconsetPref(iset) + self.icons[icon] + self.getIconsetPostfix(iset)
-
- def render(self, object):
- if object is None:
- return ""
-
- i = object
- iset = self.getIconsetNum(i)
- return self.getIconset1(iset).cp_Name
-
- def getIconsetNum(self, i):
- return int(i / len(self.icons))
-
- def getIconNum(self, i):
- return i % len(self.icons)
-
- def getIconsetPref(self, iconset):
- return self.getIconset1(iconset).cp_FNPrefix
-
- def getIconsetPostfix(self, iconset):
- return self.getIconset1(iconset).cp_FNPostfix
-
- def getIconset1(self, i):
- return self.set.getElementAt(i)
diff --git a/wizards/com/sun/star/wizards/web/ImageListDialog.py b/wizards/com/sun/star/wizards/web/ImageListDialog.py
deleted file mode 100644
index 743f95611e73..000000000000
--- a/wizards/com/sun/star/wizards/web/ImageListDialog.py
+++ /dev/null
@@ -1,231 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-import uno
-
-from ..ui.UnoDialog2 import UnoDialog2
-from ..ui.ImageList import ImageList
-from ..common.HelpIds import HelpIds
-from ..common.PropertyNames import PropertyNames
-from ..common.IRenderer import IRenderer
-
-from com.sun.star.awt import FontDescriptor
-from com.sun.star.awt.PushButtonType import OK, CANCEL, HELP, STANDARD
-from com.sun.star.awt import Size
-
-'''
-This class is a general implementation for a
-dialog which displays a choice of images.
-The model and the renderer are
-still abstract in this class.
-To use the class one should extend it,
-in the constructor then set the imageList
-properties (member name il) like image size, grid size,
-model renderer aso, and then call "build".
-This class uses a counter renderer which
-gets an expression which contains %START %END %TOTAL and replaces
-them with the actual numbers.
-<BR/>
-two buttons: "other" and "none" which are there
-to enable choosing images that are not in the list and
-"no image" respectivley, are optional, with default to True,
-so dialogs which do not need those, should set the corresponding
-members showDeselectButton and/or showOtherButton to false.
-<br/>
-the constructor should receive, among others, an Array of String resources
-see constructor documentation for details.
-
-@author rpiterman
-'''
-
-class ImageListDialog(UnoDialog2):
- RES_TITLE = 0
- RES_LABEL = 1
- RES_OK = 2
- RES_CANCEL = 3
- RES_HELP = 4
- RES_DESELECT = 5
- RES_OTHER = 6
- RES_COUNTER = 7
- START = "%START"
- END = "%END"
- TOTAL = "%TOTAL"
-
- '''
- @param xmsf
- @param resources_ a string array with the following strings :
- dialog title, label text, ok, cancel, help, deselect, other.
- <br/> if "deselect" and "other" are not displayed,
- the array can also be shorter. but if "other" is displayed
- and "deselect" not, both must be there :-(
- '''
-
- def __init__(self, xmsf, hid_, resources_):
- super(ImageListDialog, self).__init__(xmsf)
- self.hid = hid_
- self.cutFilename = 0
- self.showDeselectButton = True
- self.showOtherButton = True
- self.fontDescriptor1 = FontDescriptor()
- self.resources = resources_
- self.il = ImageList()
- self.il.counterRenderer = self.ARenderer(
- self.resources[ImageListDialog.RES_COUNTER])
-
- '''
- adds the controls to the dialog, depending on
- the size of the image list.
- This method should be called by subclasses after setting
- the il ImageList member properties
- '''
-
- def build(self):
- #set dialog properties...
- ilWidth = (self.il.imageSize.Width + self.il.gap.Width) \
- * self.il.cols + self.il.gap.Width
- ilHeight = (self.il.imageSize.Height + self.il.gap.Height) \
- * self.il.rows + self.il.gap.Height
- dialogWidth = 6 + ilWidth + 6 + 50 + 6
- dialogHeight = 3 + 16 + 3 + (ilHeight + 8 + 14) + 6
- uno.invoke(self.xDialogModel, "setPropertyValues",(
- ("Closeable",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL,
- "Moveable",
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- "Title",
- PropertyNames.PROPERTY_WIDTH),
- (True, dialogHeight, HelpIds.getHelpIdString(self.hid), True,
- "imgDialog", 59, 24, 1,
- self.resources[ImageListDialog.RES_TITLE],dialogWidth)))
- #Set member- FontDescriptors...
- self.fontDescriptor1.Weight = 150
- PROPNAMES = ("DefaultButton",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- "PushButtonType",
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH)
- iButtonsX = 6 + ilWidth + 6
- self.btnOK = self.insertButton(
- "btnOK", None, PROPNAMES,
- (True, 14, HelpIds.getHelpIdString(self.hid + 3),
- self.resources[ImageListDialog.RES_OK], "btnOK",
- iButtonsX, 22, uno.Any("short", OK), 7, 50), self)
- self.btnCancel = self.insertButton(
- "btnCancel", None, PROPNAMES,
- (False, 14, HelpIds.getHelpIdString(self.hid + 4),
- self.resources[ImageListDialog.RES_CANCEL], "btnCancel",
- iButtonsX, 41, uno.Any("short", CANCEL), 8, 50), self)
- self.btnHelp = self.insertButton(
- "btnHelp", None, PROPNAMES,
- (False, 14, "", self.resources[ImageListDialog.RES_HELP],
- "CommandButton3", iButtonsX, 71,
- uno.Any("short", HELP), 9, 50), self)
- if self.showOtherButton:
- aux = 0
- if self.showDeselectButton:
- aux = 19
- otherY = 22 + ilHeight - 14 - aux
- self.btnOther = self.insertButton(
- "btnOther", "other", PROPNAMES,
- (False, 14, HelpIds.getHelpIdString(self.hid + 1),
- self.resources[ImageListDialog.RES_OTHER], "btnOther",
- iButtonsX, otherY,
- uno.Any("short", STANDARD), 5, 50), self)
-
- if self.showDeselectButton:
- deselectY = 22 + ilHeight - 14
- self.btnDeselect = self.insertButton(
- "btnNoImage", "deselect", PROPNAMES,
- (False, 14, HelpIds.getHelpIdString(self.hid + 2),
- self.resources[ImageListDialog.RES_DESELECT], "btnNoImage",
- iButtonsX, deselectY,
- uno.Any("short", STANDARD), 4, 50), self)
-
- self.il.step = 1
- self.il.pos = Size(6, 22)
- self.il.helpURL = self.hid + 5
- self.il.tabIndex = 1
- self.il.create(self)
- self.lblTitle = self.insertLabel("lblTitle",
- ("FontDescriptor",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (self.fontDescriptor1, 8,
- self.resources[ImageListDialog.RES_LABEL],
- "lblTitle", 6, 6, 1, 4, 216))
-
- '''
- is called when the user clicks "none"
- '''
-
- def deselect(self):
- self.il.setSelected(-1)
-
- '''
- @return the currently elected object.
- '''
-
- def getSelected(self):
- return self.il.getSelectedObject()
-
- '''
- sets the currently selected object.
- @param obj the object (out of the model) to be selected.
- '''
-
- def setSelected(self, obj):
- self.il.setSelected(obj)
- self.il.showSelected()
-
- '''
- The counter renderer, which uses a template.
- The template replaces the Strings "%START", "%END" and
- "%TOTAL" with the respective values.
- @author rpiterman
- '''
- class ARenderer(IRenderer):
-
- '''
- @param aTemplate is a template for this renderer.
- The strings %START, %END ,%TOTAL will be replaced
- with the actual values.
- '''
-
- def __init__(self, aTemplate):
- self.template = aTemplate
-
- def render(self, counter):
- s = self.template.replace(ImageListDialog.START, "" + \
- str(counter.start))
- s = s.replace(ImageListDialog.END, "" + str(counter.end))
- s = s.replace(ImageListDialog.TOTAL, "" + str(counter.max))
- return s
diff --git a/wizards/com/sun/star/wizards/web/Process.py b/wizards/com/sun/star/wizards/web/Process.py
deleted file mode 100644
index 37aa03e1c1ec..000000000000
--- a/wizards/com/sun/star/wizards/web/Process.py
+++ /dev/null
@@ -1,606 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-import traceback
-import importlib
-
-from .WebWizardConst import *
-from ..common.UCB import UCB
-from ..common.FileAccess import FileAccess
-from ..ui.event.Task import Task
-from ..ui.event.CommonListener import StreamListenerProcAdapter
-from .ProcessErrors import ProcessErrors
-from .ExtensionVerifier import ExtensionVerifier
-from .ErrorHandler import ErrorHandler
-from .data.CGDocument import CGDocument
-
-from com.sun.star.io import IOException
-from com.sun.star.uno import SecurityException
-from com.sun.star.beans import NamedValue
-from com.sun.star.beans import StringPair
-
-# This class is used to process a CGSession object
-# and generate a site. </br>
-# it does the following: <br/>
-# 1. create a temporary directory.<br/>
-# 2. export documents to the temporary directory.<br/>
-# 3. generate the TOC page, includes copying images from the
-# web wizard work directory and other layout files.<br/>
-# 4. publish, or copy, from the temporary directory to
-# different destinations.<br/>
-# 5. delete the temporary directory.<br/>
-# <br/>
-# to follow up the status/errors it uses a TaskListener object,
-# and an ErrorHandler. <br/>
-# in practice, the TaskListener is the status dialog,
-# and the Errorhandler does the interaction with the user,
-# if something goes wrong.<br/>
-# Note that this class takes it in count that
-# the given session object is prepared for it -
-# all preparations are done in WWD_Events.finishWizard methods.
-# <br/>
-# <br/>
-#
-# note on error handling: <br/>
-# on "catch" clauses I tries to decide whether the
-# exception is fatal or not. For fatal exception an error message
-# is displayed (or rather: the errorHandler is being called...)
-# and a false is returned.
-# In less-fatal errors, the errorHandler "should decide" which means,
-# the user is given the option to "OK" or to "Cancel" and depending
-# on that interaction I cary on.
-class Process(ProcessErrors):
-
- TASKS_PER_DOC = 5
- TASKS_PER_XSL = 2
- TASKS_PER_PUBLISH = 2
- TASKS_IN_PREPARE = 1
- TASKS_IN_EXPORT = 2
- TASKS_IN_GENERATE = 2
- TASKS_IN_PUBLISH = 2
- TASKS_IN_FINISHUP = 1
- settings = None
- xmsf = None
- errorHandler = None
- tempDir = None
- fileAccess = None
- ucb = None
- myTask = None
- #This is a cache for exporters, so I do not need to
- #instanciate the same exporter more than once.
- exporters = {}
- result = None
-
- def __init__(self, settings, xmsf, er):
- self.xmsf = xmsf
- self.settings = settings
- self.fileAccess = FileAccess(xmsf)
- self.errorHandler = er
-
- self.ucb = UCB(xmsf)
-
- self.taskSteps = self.getTaskSteps()
- self.myTask = Task(TASK, TASK_PREPARE, self.taskSteps)
-
- # @return to how many destinations should the
- # generated site be published.
- def countPublish(self):
- count = 0
- publishers = self.settings.cp_DefaultSession.cp_Publishing
- for e in publishers.childrenList:
- if e.cp_Publish:
- count += 1
- return count
-
- # @return the number of task steps that this
- # session should have
- def getTaskSteps(self):
- docs = self.settings.cp_DefaultSession.cp_Content.cp_Documents.getSize()
- xsl = 0
- try:
- layout = self.settings.cp_DefaultSession.getLayout()
- xsl = len(layout.getTemplates(self.xmsf))
- except Exception:
- traceback.print_exc()
-
- publish = self.countPublish()
- return \
- self.TASKS_IN_PREPARE + \
- self.TASKS_IN_EXPORT + docs * self.TASKS_PER_DOC + \
- self.TASKS_IN_GENERATE + xsl * self.TASKS_PER_XSL + \
- self.TASKS_IN_PUBLISH + publish * self.TASKS_PER_PUBLISH + \
- self.TASKS_IN_FINISHUP
-
- # does the job
- def runProcess(self):
- self.myTask.start()
- try:
- try:
- # I use here '&&' so if one of the
- # methods returns false, the next
- # will not be called.
- self.result = self.createTempDir(self.myTask) and self.export(self.myTask) and self.generate(self.tempDir, self.myTask) and self.publish(self.tempDir, self.myTask)
- finally:
- # cleanup must be called.
- self.result = self.result and self.cleanup(self.myTask)
- except Exception:
- traceback.print_exc()
- self.result = False
-
- if not self.result:
- # this is a bug protection.
- self.myTask.fail()
-
- while (self.myTask.getStatus() < self.myTask.getMax()):
- self.myTask.advance(True)
-
- # creates a temporary directory.
- # @param task
- # @return true should continue
- def createTempDir(self, task):
- try:
- self.tempDir = self.fileAccess.createNewDir(self.getSOTempDir(self.xmsf), "/wwiztemp")
- except Exception:
- traceback.print_exc()
- if self.tempDir is None:
- self.error(None, None, ProcessErrors.ERROR_MKDIR, ErrorHandler.ERROR_PROCESS_FATAL)
- return False
- else:
- task.advance(True)
- return True
-
- # @param xmsf
- # @return the staroffice /openoffice temporary directory
- def getSOTempDir(self, xmsf):
- try:
- return FileAccess.getOfficePath(self.xmsf, "Temp", "")
- except Exception:
- traceback.print_exc()
- return None
-
- # CLEANUP
-
- # delete the temporary directory
- # @return true should continue
- def cleanup(self, task):
- task.setSubtaskName(TASK_FINISH)
- b = self.fileAccess.delete(self.tempDir)
- if not b:
- self.error(None, None, ProcessErrors.ERROR_CLEANUP, ErrorHandler.ERROR_WARNING)
- task.advance(b)
- return b
-
- # This method is used to copy style files to a target
- # Directory: css and background.
- # Note that this method is static since it is
- # also used when displaying a "preview"
- def copyMedia(self, copy, settings, targetDir, task):
- # 1. .css
- sourceDir = FileAccess.connectURLs(settings.workPath, "styles")
- filename = settings.cp_DefaultSession.getStyle().cp_CssHref
- copy.copy2(sourceDir, filename, targetDir, "style.css")
-
- task.advance(True)
-
- # 2. background image
- background = settings.cp_DefaultSession.cp_Design.cp_BackgroundImage
- if (background is not None and background is not ""):
- sourceDir = FileAccess.getParentDir(background)
- filename = background[len(sourceDir):]
- copy.copy2(sourceDir, filename, targetDir + "/images", "background.gif")
-
- task.advance(True)
-
- # Copy "static" files (which are always the same,
- # thus not user-input-dependent) to a target directory.
- # Note that this method is static since it is
- # also used when displaying a "preview"
- # @param copy
- # @param settings
- # @param targetDir
- # @throws Exception
- @classmethod
- def copyStaticImages(self, copy, settings, targetDir):
- source = FileAccess.connectURLs(settings.workPath, "images")
- target = targetDir + "/images"
- copy.copy(source, target)
-
- # publish the given directory.
- # @param dir the source directory to publish from
- # @param task task tracking.
- # @return true if should continue
- def publish(self, folder, task):
- task.setSubtaskName(TASK_PUBLISH_PREPARE)
- configSet = self.settings.cp_DefaultSession.cp_Publishing
- try:
- self.copyMedia(self.ucb, self.settings, folder, task)
- self.copyStaticImages(self.ucb, self.settings, folder)
- task.advance(True)
- except Exception as ex:
- # error in copying media
- traceback.print_exc()
- self.error(ex, "", ProcessErrors.ERROR_PUBLISH_MEDIA, ErrorHandler.ERROR_PROCESS_FATAL)
- return False
- for p in configSet.childrenList:
- if p.cp_Publish:
- key = configSet.getKey(p)
- task.setSubtaskName(key)
- if key is ZIP_PUBLISHER:
- self.fileAccess.delete(p.cp_URL)
- if (not self.publish1(folder, p, self.ucb, task)):
- return False
- return True
-
- # publish the given directory to the
- # given target CGPublish.
- # @param dir the dir to copy from
- # @param publish the object that specifies the target
- # @param copy ucb encapsulation
- # @param task task tracking
- # @return true if should continue
- def publish1(self, folder, publish, copy, task):
- try:
- task.advance(True)
- url = publish.url
- copy.copy(folder, url)
- task.advance(True)
- return True
- except Exception as e:
- task.advance(False)
- traceback.print_exc()
- return self.error(e, publish, ProcessErrors.ERROR_PUBLISH, ErrorHandler.ERROR_NORMAL_IGNORE)
-
- # Generates the TOC pages for the current session.
- # @param targetDir generating to this directory.
- def generate(self, targetDir, task):
- result = False
- task.setSubtaskName(TASK_GENERATE_PREPARE)
-
-
- layout = self.settings.cp_DefaultSession.getLayout()
-
- try:
- # here I create the DOM of the TOC to pass to the XSL
- doc = self.settings.cp_DefaultSession.createDOM1()
- self.generate1(self.xmsf, layout, doc, self.fileAccess, targetDir, task)
- except Exception as ex:
- traceback.print_exc()
- self.error(ex, "", ProcessErrors.ERROR_GENERATE_XSLT, ErrorHandler.ERROR_PROCESS_FATAL)
- return False
-
- # copy files which are not xsl from layout directory to
- # website root.
- try:
- task.setSubtaskName(TASK_GENERATE_COPY)
-
- self.copyLayoutFiles(self.ucb, self.fileAccess, self.settings, layout, targetDir)
-
- task.advance(True)
-
- result = True
- except Exception as ex:
- task.advance(False)
- traceback.print_exc()
- return self.error(ex, None, ProcessErrors.ERROR_GENERATE_COPY, ErrorHandler.ERROR_NORMAL_ABORT)
- return result
-
- # copies layout files which are not .xsl files
- # to the target directory.
- # @param ucb UCB encapsulation object
- # @param fileAccess filaAccess encapsulation object
- # @param settings web wizard settings
- # @param layout the layout object
- # @param targetDir the target directory to copy to
- # @throws Exception
- @classmethod
- def copyLayoutFiles(self, ucb, fileAccess, settings, layout, targetDir):
- filesPath = fileAccess.getURL(FileAccess.connectURLs(settings.workPath, "layouts/"), layout.cp_FSName)
- ucb.copy1(filesPath, targetDir, ExtensionVerifier("xsl"))
-
- # generates the TOC page for the given layout.
- # This method might generate more than one file, depending
- # on how many .xsl files are in the
- # directory specifies by the given layout object.
- # @param xmsf
- # @param layout specifies the layout to use.
- # @param doc the DOM representation of the web wizard session
- # @param fileAccess encapsulation of FileAccess
- # @param targetPath target directory
- # @param task
- # @throws Exception
- @classmethod
- def generate1(self, xmsf, layout, doc, fileAccess, targetPath, task):
- # a map that contains xsl templates. the keys are the xsl file names.
- templates = layout.getTemplates(xmsf)
- self.node = doc
-
- task.advance1(True, TASK_GENERATE_XSL)
-
- # each template generates a page.
- for key in templates:
- temp = templates[key]
-
- # The target file name is like the xsl template filename
- # without the .xsl extension.
- fn = fileAccess.getPath(targetPath, key[:len(key) - 4])
-
- args = list(range(1))
- nv = NamedValue()
- nv.Name = "StylesheetURL"
- nv.Value = temp
- args[0] = nv
- arguments = list(range(1))
- arguments[0] = tuple(args)
-
- self.tf = Process.createTransformer(xmsf, arguments)
-
- self.node.normalize()
- task.advance(True)
-
- # we want to be notfied when the processing is done...
- self.tf.addListener(StreamListenerProcAdapter(self,
- self.streamTerminatedHandler,
- self.streamStartedHandler,
- self.streamClosedHandler,
- self.streamErrorHandler))
-
- # create pipe
- pipeout = xmsf.createInstance("com.sun.star.io.Pipe")
- pipein = pipeout
-
- # connect sax writer to pipe
- self.xSaxWriter = xmsf.createInstance( "com.sun.star.xml.sax.Writer" )
- self.xSaxWriter.setOutputStream(pipeout)
-
- # connect pipe to transformer
- self.tf.setInputStream(pipein)
-
- # connect transformer to output
- xOutputStream = fileAccess.xInterface.openFileWrite(fn)
- self.tf.setOutputStream(xOutputStream)
-
- self.tf.start()
- while (not self.tfCompleted):
- pass
- self.tf.terminate()
- task.advance(True)
-
-
- @classmethod
- def createTransformer(self, xmsf, args):
- tf = xmsf.createInstanceWithArguments("com.sun.star.xml.xslt.XSLT2Transformer",
- tuple(args))
- if (tf is None):
- # TODO: put a dialog telling about the need to install
- # xslt2-transformer extension here
- tf = xmsf.createInstanceWithArguments("com.sun.star.xml.xslt.XSLTTransformer",
- tuple(args))
- return tf
-
- def streamTerminatedHandler(self):
- parent.isTerminated = True
-
- def streamStartedHandler(self, parent):
- parent.tfCompleted = False
- parent.node.serialize(parent.xSaxWriter, tuple([StringPair()]))
-
- def streamErrorHandler(self, aException):
- print ("DEBUG !!! Stream 'error' event handler")
-
- def streamClosedHandler(self, parent):
- parent.tfCompleted = True
-
- # I broke the export method to two methods
- # in a time where a tree with more than one contents was planned.
- # I left it that way, because it may be used in the future.
- # @param task
- # @return
- def export(self, task):
- return self.export1(self.settings.cp_DefaultSession.cp_Content, self.tempDir, task)
-
- # This method could actually, with light modification, use recursion.
- # In the present situation, where we only use a "flat" list of
- # documents, instead of the original plan to use a tree,
- # the recursion is not implemented.
- # @param content the content ( directory-like, contains documents)
- # @param dir (target directory for exporting this content.
- # @param task
- # @return true if should continue
- def export1(self, content, folder, task):
- toPerform = 1
- contentDir = None
-
- try:
- task.setSubtaskName(TASK_EXPORT_PREPARE)
-
- # 1. create a content directory.
- # each content (at the moment there is only one :-( )
- # is created in its own directory.
- # faileure here is fatal.
- contentDir = self.fileAccess.createNewDir(folder, content.cp_Name);
- if (contentDir is None or contentDir is ""):
- raise IOException("Directory " + folder + " could not be created.")
-
- content.dirName = FileAccess.getFilename(contentDir)
-
- task.advance1(True, TASK_EXPORT_DOCUMENTS)
- toPerform -= 1
-
- # 2. export all documents and sub contents.
- # (at the moment, only documents, no subcontents)
- for item in content.cp_Documents.childrenList:
- try:
- #
- # In present this is always the case.
- # may be in the future, when
- # a tree is used, it will be a bit different.
- if (isinstance (item, CGDocument)):
- if (not self.export2(item, contentDir, task)):
- return False
- elif (not self.export2(item, contentDir, task)):
- # we never get here since we
- # did not implement sub-contents.
- return False
- except SecurityException as sx:
- # nonfatal
- traceback.print_exc()
- if (not self.error(sx, item, ProcessErrors.ERROR_EXPORT_SECURITY, ErrorHandler.ERROR_NORMAL_IGNORE)):
- return False
- self.result = False
- except IOException as iox:
- # nonfatal
- traceback.print_exc()
- return self.error(iox, content, ProcessErrors.ERROR_EXPORT_IO, ErrorHandler.ERROR_NORMAL_IGNORE)
- except SecurityException as se:
- # nonfatal
- traceback.print_exc()
- return self.error(se, content, ProcessErrors.ERROR_EXPORT_SECURITY, ErrorHandler.ERROR_NORMAL_IGNORE)
-
- self.failTask(task, toPerform)
- return True
-
- # exports a single document
- # @param doc the document to export
- # @param dir the target directory
- # @param task task tracking
- # @return true if should continue
- def export2(self, doc, folder, task):
- # first I check if the document was already validated...
- if (not doc.valid):
- try:
- doc.validate(self.xmsf, task)
- except Exception as ex:
- # fatal
- traceback.print_exc()
- self.error(ex, doc, ProcessErrors.ERROR_DOC_VALIDATE, ErrorHandler.ERROR_PROCESS_FATAL)
- return False
- # get the exporter specified for this document
- exp = doc.cp_Exporter
- exporter = self.settings.cp_Exporters.getElement(exp)
-
- try:
- # here I calculate the destination filename.
- # I take the original filename (docFilename), subtract the extension, (docExt) -> (fn)
- # and find an available filename which starts with
- # this filename, but with the new extension. (destExt)
- docFilename = FileAccess.getFilename(doc.cp_URL)
-
- docExt = FileAccess.getExtension(docFilename)
- # filename without extension
- #fn = doc.localFilename.substring(0, doc.localFilename.length() - docExt.length() - 1)
- fn = doc.localFilename[:len(doc.localFilename) - len(docExt) - 1]
-
- # the copyExporter does not change
- # the extension of the target...
- destExt = FileAccess.getExtension(docFilename) \
- if (exporter.cp_Extension is "") \
- else exporter.cp_Extension
-
- # if this filter needs to export to its own directory...
- # this is the case in, for example, impress html export
- if (exporter.cp_OwnDirectory):
- # +++
- folder = self.fileAccess.createNewDir(folder, fn)
- doc.dirName = FileAccess.getFilename(folder)
-
- # if two files with the same name
- # need to be exported ? So here
- # I get a new filename, so I do not
- # overwrite files...
- f = self.fileAccess.getNewFile(folder, fn, destExt)
-
-
- # set filename with extension.
- # this will be used by the exporter,
- # and to generate the TOC.
- doc.urlFilename = FileAccess.getFilename(f)
-
- task.advance(True)
-
- try:
- # export
- self.getExporter(exporter).export(doc, f, self.xmsf, task)
- task.advance(True)
- # getExporter(..) throws
- # IllegalAccessException, InstantiationException, ClassNotFoundException
- # export() throws Exception
- except Exception as ex:
- # nonfatal
- traceback.print_exc()
- if (not self.error(ex, doc, ProcessErrors.ERROR_EXPORT, ErrorHandler.ERROR_NORMAL_IGNORE)):
- return False
- except Exception as ex:
- # nonfatal
- traceback.print_exc()
- if (not self.error(ex, doc, ProcessErrors.ERROR_EXPORT_MKDIR, ErrorHandler.ERROR_NORMAL_ABORT)):
- return False
-
- return True
-
- # submit an error.
- # @param ex the exception
- # @param arg1 error argument
- # @param arg2 error argument 2
- # @param errType error type
- # @return the interaction result
- def error(self, ex, arg1, arg2, errType):
- self.result = False
- return self.errorHandler.error(ex, arg1, arg2, errType)
-
-
- # advances the given task in the given count of steps,
- # marked as failed.
- # @param task the task to advance
- # @param count the number of steps to advance
- def failTask(self, task, count):
- while (count > 0):
- task.advance(False)
- count -= 1
-
- # creates an instance of the exporter class
- # as specified by the
- # exporter object.
- # @param export specifies the exporter to be created
- # @return the Exporter instance
- # @throws ClassNotFoundException
- # @throws IllegalAccessException
- # @throws InstantiationException
- def createExporter(self, export):
- pkgname = ".".join(export.cp_ExporterClass.split(".")[3:])
- className = export.cp_ExporterClass.split(".")[-1]
- mod = importlib.import_module(pkgname)
- return getattr(mod, className)(export)
-
- # searches the an exporter for the given CGExporter object
- # in the cache.
- # If it's not there, creates it, stores it in the cache and
- # returns it.
- # @param export specifies the needed exporter.
- # @return an Exporter instance
- # @throws ClassNotFoundException thrown when using Class.forName(string)
- # @throws IllegalAccessException thrown when using Class.forName(string)
- # @throws InstantiationException thrown when using Class.forName(string)
- def getExporter(self, export):
- exp = self.exporters.get(export.cp_Name)
- if (exp is None):
- exp = self.createExporter(export)
- self.exporters[export.cp_Name] = exp
- return exp
-
- # @return true if everything went smooth, false
- # if error(s) accured.
- def getResult(self):
- return (self.myTask.getFailed() == 0) and self.result
diff --git a/wizards/com/sun/star/wizards/web/ProcessErrorHandler.py b/wizards/com/sun/star/wizards/web/ProcessErrorHandler.py
deleted file mode 100644
index 2b2d279428d5..000000000000
--- a/wizards/com/sun/star/wizards/web/ProcessErrorHandler.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-
-from .ProcessErrors import ProcessErrors
-from .AbstractErrorHandler import AbstractErrorHandler
-from .WebWizardConst import *
-
-# used to interact error occurring when generating the
-# web-site to the user.
-# This class renders the different errors,
-# replacing some strings from the resources with
-# content of the given arguments, depending on the error
-# that accured.
-class ProcessErrorHandler(AbstractErrorHandler, ProcessErrors):
-
- FILENAME = "%FILENAME"
- URL = "%URL"
- ERROR = "%ERROR"
- resources = None
-
- def __init__(self, xmsf, peer, res):
- super(ProcessErrorHandler, self).__init__(xmsf, peer)
- self.resources = res
-
- def getMessageFor(self, ex, obj, ix, errType):
- if ix == ProcessErrors.ERROR_MKDIR:
- return self.resources.resErrDocExport.replace(obj.localFilename, self.FILENAME)
- elif ix == ProcessErrors.ERROR_EXPORT_MKDIR:
- return self.resources.resErrMkDir.replace(obj.localFilename, self.FILENAME)
- elif ix == ProcessErrors.ERROR_DOC_VALIDATE:
- return self.resources.resErrDocInfo.replace(obj.localFilename, self.FILENAME)
- elif ix == ProcessErrors.ERROR_EXPORT_IO:
- return self.resources.resErrExportIO.replace(obj.localFilename, self.FILENAME)
- elif ix == ProcessErrors.ERROR_EXPORT_SECURITY:
- return self.resources.resErrSecurity.replace(obj.localFilename, self.FILENAME)
- elif ix == ProcessErrors.ERROR_GENERATE_XSLT:
- return self.resources.resErrTOC
- elif ix == ProcessErrors.ERROR_GENERATE_COPY:
- return self.resources.resErrTOCMedia
- elif ix == ProcessErrors.ERROR_PUBLISH:
- return self.resources.resErrPublish.replace(self.URL, obj.cp_URL)
- elif (ix == ProcessErrors.ERROR_EXPORT or ix == ProcessErrors.ERROR_PUBLISH_MEDIA):
- return self.resources.resErrPublishMedia
- elif ix == ProcessErrors.ERROR_CLEANUP:
- return self.resources.resErrUnexpected
- else:
- return self.resources.resErrUnknown.replace("%ERROR", "{0}/{1}/{2!s}".format(ex.__class__.__name__, obj.__class__.__name__, ix))
diff --git a/wizards/com/sun/star/wizards/web/ProcessErrors.py b/wizards/com/sun/star/wizards/web/ProcessErrors.py
deleted file mode 100644
index 7cd608f01f18..000000000000
--- a/wizards/com/sun/star/wizards/web/ProcessErrors.py
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-
-# Error IDs for errors that can occur
-# in the interaction with the Process class.
-class ProcessErrors:
-
- ERROR_MKDIR = 0
- ERROR_EXPORT = 1
- ERROR_EXPORT_MKDIR = 2
- ERROR_DOC_VALIDATE = 3
- ERROR_EXPORT_IO = 4
- ERROR_EXPORT_SECURITY = 5
- ERROR_GENERATE_XSLT = 6
- ERROR_GENERATE_COPY = 7
- ERROR_PUBLISH = 8
- ERROR_PUBLISH_MEDIA = 9
- ERROR_CLEANUP = 10
diff --git a/wizards/com/sun/star/wizards/web/ProcessStatusRenderer.py b/wizards/com/sun/star/wizards/web/ProcessStatusRenderer.py
deleted file mode 100644
index 722a1b687a19..000000000000
--- a/wizards/com/sun/star/wizards/web/ProcessStatusRenderer.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-
-
-from .WebWizardConst import *
-from ..common.IRenderer import IRenderer
-
-
-# receives status calls from the status dialog which
-# appears when the user clicks "create".
-# allocates strings from the resources to
-# display the current task status.
-# (renders the state to resource strings)
-class ProcessStatusRenderer(IRenderer):
-
- strings = {}
-
- def __init__(self, res):
- self.strings[TASK_EXPORT_DOCUMENTS] = res.resTaskExportDocs
- self.strings[TASK_EXPORT_PREPARE] = res.resTaskExportPrepare
- self.strings[TASK_GENERATE_COPY] = res.resTaskGenerateCopy
- self.strings[TASK_GENERATE_PREPARE] = res.resTaskGeneratePrepare
- self.strings[TASK_GENERATE_XSL] = res.resTaskGenerateXsl
- self.strings[TASK_PREPARE] = res.resTaskPrepare
- self.strings[LOCAL_PUBLISHER] = res.resTaskPublishLocal
- self.strings[ZIP_PUBLISHER] = res.resTaskPublishZip
- self.strings[FTP_PUBLISHER] = res.resTaskPublishFTP
-
- self.strings[TASK_PUBLISH_PREPARE] = res.resTaskPublishPrepare
- self.strings[TASK_FINISH] = res.resTaskFinish
-
- def render(self, object):
- return self.strings[object]
-
diff --git a/wizards/com/sun/star/wizards/web/StatusDialog.py b/wizards/com/sun/star/wizards/web/StatusDialog.py
deleted file mode 100644
index caecdd25ef33..000000000000
--- a/wizards/com/sun/star/wizards/web/StatusDialog.py
+++ /dev/null
@@ -1,172 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-import uno
-import traceback
-
-from ..ui.UnoDialog2 import UnoDialog2
-from ..common.PropertyNames import PropertyNames
-
-# Note on the argument resource:
-# This should be a String array containing the followin strings, in the
-# following order:
-# dialog title, cancel, close, counter prefix, counter midfix, counter postfix
-class StatusDialog(UnoDialog2):
-
- STANDARD_WIDTH = 240
- lblTaskName = None
- lblCounter = None
- progressBar = None
- btnCancel = None
- finished = False
- enableBreak = False
- closeOnFinish = True
- renderer = None
- finishedMethod = None
-
- def __init__(self, xmsf, width, taskName, displayCount, resources, hid):
- super(StatusDialog, self).__init__(xmsf)
-
- self.res = resources
- if not (len(self.res) == 6):
- # display a close button?
- raise ValueError("The resources argument should contain 6 Strings, see doc on constructor.")
-
- b = not (self.enableBreak or self.closeOnFinish)
-
- uno.invoke(self.xDialogModel, "setPropertyValues", (
- ("Closeable",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL, "Moveable",
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP, "Title",
- PropertyNames.PROPERTY_WIDTH),
- (False, 6 + 25 + (27 if b else 7), hid, True, "StatusDialog", 102, 52, 0,
- self.res[0], width)))
-
- tabstop = 1
-
- self.lblTaskName = self.insertLabel("lblTask",
- (PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH),
- (8, taskName, 6, 6, tabstop, int(width * 2 / 3)))
- tabstop += 1
- self.lblCounter = self.insertLabel("lblCounter",
- (PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH),
- (8, "", int(width * 2 / 3), 6, tabstop, int(width / 3) - 4))
- tabstop += 1
- self.progressBar = self.insertProgressBar("progress",
- (PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH),
- (10, 6, 16, tabstop, width - 12))
- tabstop += 1
-
- if b:
- self.btnCancel = self.insertButton("btnCancel", "performCancel", self,
- (PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH),
- (14, self.res[1], width / 2 - 20, 6 + 25 + 7, tabstop, 40))
- tabstop += 1
-
- def initProgressBar(self, t):
- self.progressBar.setRange(0, t.getMax())
- self.progressBar.setValue(0)
-
- def setStatus(self, status):
- if self.finished:
- return
- self.progressBar.setValue(status)
- #self.xReschedule.reschedule()
-
- def setLabel(self, s):
- self.lblTaskName.Text = s
- #self.xReschedule.reschedule()
-
- # change the max property of the status bar
- # @param max
- def setMax(self, maximum):
- if self.finished:
- return
- self.progressBar.Model.ProgressValueMax = maximum
-
- # initialize the status bar according
- # to the given event.
- def taskStarted(self, te):
- self.finished = False
- self.initProgressBar(te.getTask())
-
- #closes the dialog.
- def taskFinished(self, te):
- self.finished = True
- if self.closeOnFinish:
- self.parent.xUnoDialog.setEnable(True)
- try:
- self.xUnoDialog.setVisible(False)
- self.xUnoDialog.dispose()
- except Exception:
- traceback.print_exc()
- else:
- self.btnCancel.Model.Label = self.res[2]
-
- # changes the status display
- def taskStatusChanged(self, te):
- self.setMax(te.getTask().getMax())
- self.setStatus(te.getTask().getStatus())
-
- # changes the displayed text.
- # A renderer is used to render
- #the task's subtask name to a resource string.
- def subtaskNameChanged(self, te):
- if self.renderer is not None:
- self.setLabel(self.renderer.render(te.getTask().getSubtaskName()))
-
- # displays the status dialog
- # @param parent_ the parent dialog
- # @param task what to do
- def execute(self, parent_, task, title):
- try:
- self.parent = parent_
- self.xDialogModel.Title = title
- try:
- # TODO change this to another execute dialog method.
- task.addTaskListener(self)
- self.setMax(10)
- self.setStatus(0)
- self.setLabel(task.getSubtaskName())
- self.parent.xUnoDialog.setEnable(False)
- self.setVisible(self.parent)
- if self.finishedMethod is not None:
- self.finishedMethod.invoke()
- except Exception:
- traceback.print_exc()
- except Exception:
- traceback.print_exc()
-
- # not supported !
- def performCancel(self):
- #TODO - implement a thread thing here...
- self.xUnoDialog.setVisible(False)
-
- # @return the subTask renderer object
- def getRenderer(self):
- return self.renderer
-
- # @param renderer
- def setRenderer(self, renderer):
- self.renderer = renderer
-
- #sets a method to be invoced when the
- def setFinishedMethod(self, mi):
- self.finishedMethod = mi
diff --git a/wizards/com/sun/star/wizards/web/StylePreview.py b/wizards/com/sun/star/wizards/web/StylePreview.py
deleted file mode 100644
index cefd608120a2..000000000000
--- a/wizards/com/sun/star/wizards/web/StylePreview.py
+++ /dev/null
@@ -1,95 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-import traceback
-
-from ..common.FileAccess import FileAccess
-
-'''
-@author rpiterman
-the style preview, which is a OOo Document Preview in
-an Image Control.
-This class copies the files needed for this
-preview from the web wizard work directory
-to a given temporary directory, and updates them
-on request, according to the current style/background selection
-of the user.
-'''
-
-class StylePreview(object):
-
- '''
- copies the html file to the temp directory, and calculates the
- destination names of the background and css files.
- @param wwRoot is the root directory of the web wizard files (
- usually [oo]/share/template/[lang]/wizard/web
- '''
-
- def __init__(self, xmsf, wwRoot_):
- self.fileAccess = FileAccess(xmsf)
- self.tempDir = self.createTempDir(xmsf)
- self.htmlFilename = FileAccess.connectURLs(
- self.tempDir, "wwpreview.html")
- self.cssFilename = FileAccess.connectURLs(self.tempDir, "style.css")
- self.backgroundFilename = FileAccess.connectURLs(
- self.tempDir, "images/background.gif")
-
- self.wwRoot = wwRoot_
- self.fileAccess.copy(FileAccess.connectURLs(
- self.wwRoot, "preview.html"), self.htmlFilename)
-
- '''
- copies the given style and background files to the temporary
- directory.
- @param style
- @param background
- @throws Exception
- '''
-
- def refresh(self, style, background):
- css = FileAccess.connectURLs(self.wwRoot, "styles/" + style.cp_CssHref)
- if background is None or background == "":
- #delete the background image
- if self.fileAccess.exists(self.backgroundFilename, False):
- self.fileAccess.delete(self.backgroundFilename)
- else:
- # a solaris bug workaround
- # TODO
- #copy the background image to the temp directory.
- self.fileAccess.copy(background, self.backgroundFilename)
-
- #copy the actual css to the temp directory
- self.fileAccess.copy(css, self.cssFilename)
-
- def cleanup(self):
- try:
- self.fileAccess.delete(self.tempDir)
- except Exception:
- traceback.print_exc()
-
- '''
- creates a temporary directory.
- @param xmsf
- @return the url of the new directory.
- @throws Exception
- '''
-
- def createTempDir(self, xmsf):
- tempPath = FileAccess.getOfficePath2(xmsf, "Temp", "", "")
- s = self.fileAccess.createNewDir(tempPath, "wwiz")
- self.fileAccess.createNewDir(s, "images")
- return s
diff --git a/wizards/com/sun/star/wizards/web/TOCPreview.py b/wizards/com/sun/star/wizards/web/TOCPreview.py
deleted file mode 100644
index 339a796eb16a..000000000000
--- a/wizards/com/sun/star/wizards/web/TOCPreview.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from .Process import Process
-from ..ui.event.Task import Task
-from ..common.FileAccess import FileAccess
-from ..common.Properties import Properties
-from ..common.Desktop import Desktop
-from ..common.UCB import UCB
-
-# This class both copies necessary files to
-# a temporary directory, generates a temporary TOC page,
-# and opens the generated html document in a web browser,
-# by default "index.html" (unchangeable).
-# <br/>
-# Since the files are both static and dynamic (some are always the same,
-# while other change according to user choices)
-# I divide this tasks to two: all necessary
-# static files, which should not regularly update are copied upon
-# instantiation.
-# The TOC is generated in refresh(...);
-
-class TOCPreview:
-
- def __init__(self, xmsf_, settings, res, tempDir_, _xFrame):
- self.xFrame = _xFrame
- self.xmsf = xmsf_
- self.resources = res
- self.fileAccess = FileAccess(self.xmsf)
- self.tempDir = tempDir_
- self.loadArgs = self.loadArgs(FileAccess.connectURLs(self.tempDir, "/index.html"))
- self.openHyperlink = Desktop.getDispatchURL(self.xmsf, ".uno:OpenHyperlink")
- self.xDispatch = Desktop.getDispatcher(self.xmsf, self.xFrame, "_top", self.openHyperlink)
- self.ucb = UCB(self.xmsf)
-
- Process.copyStaticImages(self.ucb, settings, self.tempDir)
-
- def refresh(self, settings):
- doc = settings.cp_DefaultSession.createDOM1()
- layout = settings.cp_DefaultSession.getLayout()
- task = Task("", "", 10000);
- Process.generate1(self.xmsf, layout, doc, self.fileAccess, self.tempDir, task)
- Process.copyLayoutFiles(self.ucb, self.fileAccess, settings, layout, self.tempDir)
- self.xDispatch.dispatch(self.openHyperlink, tuple(self.loadArgs))
-
- def loadArgs(self, url):
- props = Properties()
- props["URL"] = url
- return props.getProperties1()
diff --git a/wizards/com/sun/star/wizards/web/TypeDetection.py b/wizards/com/sun/star/wizards/web/TypeDetection.py
deleted file mode 100644
index 48957b65ca95..000000000000
--- a/wizards/com/sun/star/wizards/web/TypeDetection.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-'''
-a document which will open in writer.
-'''
-WRITER_DOC = "writer"
-'''
-a document which will open in calc.
-'''
-CALC_DOC = "calc"
-'''
-a document which will open in impress.
-'''
-IMPRESS_DOC = "impress"
-'''
-a document which will open in draw.
-'''
-DRAW_DOC = "draw"
-'''
-an HTML document
-'''
-HTML_DOC = "html"
-'''
-a GIF or an JPG file.
-'''
-WEB_GRAPHICS = "graphics"
-'''
-a PDF document.
-'''
-PDF_DOC = "pdf"
-'''
-a Sound file (mp3/wav ect.)
-'''
-SOUND_FILE = "sound"
-'''
-a File which can not be handled by neither SO or a Web browser
-(exe, jar, zip ect.)
-'''
-NO_TYPE = "other"
diff --git a/wizards/com/sun/star/wizards/web/WWD_Events.py b/wizards/com/sun/star/wizards/web/WWD_Events.py
deleted file mode 100644
index 64875c64c7e4..000000000000
--- a/wizards/com/sun/star/wizards/web/WWD_Events.py
+++ /dev/null
@@ -1,943 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-import traceback
-
-from .WWD_Startup import WWD_Startup
-
-from .WebWizardConst import *
-from ..common.FileAccess import FileAccess
-from ..common.Configuration import Configuration
-from ..ui.event.ListModelBinder import ListModelBinder
-from ..ui.event.Task import Task
-from .data.CGDocument import CGDocument
-from .data.CGSession import CGSession
-from .ProcessStatusRenderer import ProcessStatusRenderer
-from .FTPDialog import FTPDialog
-from .ErrorHandler import ErrorHandler
-from .AbstractErrorHandler import AbstractErrorHandler
-from .ProcessErrorHandler import ProcessErrorHandler
-from .Process import Process
-from .BackgroundsDialog import BackgroundsDialog
-from .IconsDialog import IconsDialog
-from .TOCPreview import TOCPreview
-
-from com.sun.star.container import NoSuchElementException
-
-'''
-This class implements the ui-events of the
-web wizard.
-it is therefore sorted to steps.
-not much application-logic here - just plain
-methods which react to events.
-The only exception are the finish methods with the save
-session methods.
-'''
-
-class WWD_Events(WWD_Startup):
-
- '''
- He - my constructor !
- I add a window listener, which, when
- the window closes, deletes the temp directory.
- '''
-
- def __init__(self, xmsf):
- super(WWD_Events, self).__init__(xmsf)
- self.currentSession = ""
- self.exitOnCreate = True
- self.count = 0
- self.bgDialog = None
- self.iconsDialog = None
- self.docPreview = None
-
- def leaveStep(self, nOldStep, nNewStep):
- pass
-
- def enterStep(self, old, newStep):
- if old == 1:
- sessionToLoad = ""
- s = self.lstLoadSettings.Model.SelectedItems
- if len(s) == 0 or s[0] == 0:
- sessionToLoad = ""
- else:
- sessionToLoad = \
- self.settings.cp_SavedSessions.getElementAt(s[0]).cp_Name
-
- if sessionToLoad is not self.currentSession:
- self.loadSession(sessionToLoad)
-
- '''
- **************
- STEP 1
- **************
- '''
-
- '''
- Called from the Uno event dispatcher when the
- user selects a saved session.
- '''
- def sessionSelected(self):
- s = self.getModel(self.lstLoadSettings).SelectedItems
- self.setEnabled(self.btnDelSession, len(s) > 0 and s[0] > 0)
-
- '''
- Ha ! the session should be loaded :-)
- '''
-
- def loadSession(self, sessionToLoad):
- try:
- sd = self.getStatusDialog()
- task = Task("LoadDocs", "", 10)
- sd.execute(self, task, self.resources.resLoadingSession)
- task.start()
- self.setSelectedDoc([])
- self.lstDocuments.Model.SelectedItems = tuple([])
- self.lstDocuments.Model.StringItemList = tuple([])
- if sessionToLoad == "":
- view = Configuration.getConfigurationRoot(
- self.xMSF, CONFIG_PATH + "/DefaultSession", False)
- else:
- view = Configuration.getConfigurationRoot(
- self.xMSF, CONFIG_PATH + "/SavedSessions", False)
- view = Configuration.getNode(sessionToLoad, view)
-
- session = CGSession()
- session.setRoot(self.settings)
- session.readConfiguration(view, CONFIG_READ_PARAM)
- numDocs = session.cp_Content.cp_Documents.getSize()
- task.setMax(numDocs * 5 + 7)
- task.advance(True)
- if sessionToLoad == "":
- self.setSaveSessionName(session)
-
- self.mount(session, task, False, sd.xUnoDialog)
- self.checkSteps()
- self.currentSession = sessionToLoad
- while task.getStatus() <= task.getMax():
- task.advance(False)
- task.removeTaskListener(sd)
- except Exception as ex:
- self.unexpectedError(ex)
-
- try:
- self.refreshStylePreview()
- self.updateIconsetText()
- except Exception:
- traceback.print_exc()
-
- '''
- hmm. the user clicked the delete button.
- '''
-
- def delSession(self):
- selected = self.lstLoadSettings.Model.SelectedItems
- if selected.length == 0:
- return
-
- if selected[0] == 0:
- return
-
- confirm = AbstractErrorHandler.showMessage1(
- self.xMSF, self.xUnoDialog.Peer, self.resources.resDelSessionConfirm,
- ErrorHandler.ERROR_QUESTION_NO)
- if confirm:
- try:
- name = self.settings.cp_SavedSessions.getKey(selected[0])
- # first delete the session from the registry/configuration.
- Configuration.removeNode(
- self.xMSF, CONFIG_PATH + "/SavedSessions", name)
- # then delete WWD_Startup.settings.cp_SavedSessions
- self.settings.cp_SavedSessions.remove(selected[0])
- self.settings.savedSessions.remove(selected[0] - 1)
- nextSelected = [0]
- # We try to select the same item index again, if possible
- if self.settings.cp_SavedSessions.getSize() > selected[0]:
- nextSelected[0] = selected[0]
- else:
- # this will always be available because
- # the user can not remove item 0.
- nextSelected[0] = (short)(selected[0] - 1)
- # if the <none> session will
- # be selected, disable the remove button...
- if nextSelected[0] == 0:
- self.btnDelSession.Model.Enabled = False
- # select...
-
- self.lstLoadSettings.Model.SelectedItems = nextSelected
-
- except Exception as ex:
- traceback.print_exc()
- self.unexpectedError(ex)
-
- '''
- **************
- STEP 2
- **************
- '''
-
- '''
- A method used by the UnoDataAware attached
- to the Documents listbox.
- See the concept of the DataAware objects to undestand
- why it is there...
- '''
- def getSelectedDoc(self):
- return self.selectedDoc
-
- '''
- when the user clicks another document
- in the listbox, this method is called,
- and causes the display in
- the textboxes title, description, author and export format
- to change
- '''
-
- def setSelectedDoc(self, s):
- oldDoc = self.getDoc(self.selectedDoc)
- doc = self.getDoc(s)
- if doc is None:
- self.fillExportList([])
- #I try to avoid refreshing the export list if
- #the same type of document is chosen.
- elif oldDoc is None or oldDoc.appType != doc.appType:
- self.fillExportList(self.settings.getExporters(doc.appType))
-
- self.selectedDoc = list(s)
- if (doc is not None):
- self.mountList(doc, self.docAware)
- self.disableDocUpDown()
-
- '''
- The user clicks the "Add" button.
- This will open a "FileOpen" dialog,
- and, if the user chooses more than one file,
- will open a status dialog, when validating each document.
- '''
-
- def addDocument(self):
- try:
- files = self.getDocAddDialog().callOpenDialog(
- True, self.settings.cp_DefaultSession.cp_InDirectory)
- if files is None:
- return
-
- task = Task("", "", len(files) * 5)
- '''
- If more than a certain number
- of documents have been added,
- open the status dialog.
- '''
- if (len(files) > MIN_ADD_FILES_FOR_DIALOG):
- sd = self.getStatusDialog()
- sd.setLabel(self.resources.resValidatingDocuments)
- sd.execute(self, task, self.resources.prodName)
- oLoadDocs = self.LoadDocs(self.xMSF, self.xUnoDialog, files, task, self)
- oLoadDocs.loadDocuments()
- task.removeTaskListener(sd)
- else:
- '''
- When adding a single document, do not use a
- status dialog...
- '''
- oLoadDocs = self.LoadDocs(self.xMSF, self.xUnoDialog, files, task, self)
- oLoadDocs.loadDocuments()
- except Exception:
- traceback.print_exc()
-
- '''
- The user clicked delete.
- '''
-
- def removeDocument(self):
- if len(self.selectedDoc) == 0:
- return
-
- self.settings.cp_DefaultSession.cp_Content.cp_Documents.remove(
- self.selectedDoc[0])
- # update the selected document
- while self.selectedDoc[0] >= self.getDocsCount():
- self.selectedDoc[0] -= 1
- # if there are no documents...
- if self.selectedDoc[0] == -1:
- self.selectedDoc = []
- # update the list to show the right selection.
-
- self.docListDA.updateUI()
- # disables all the next steps, if the list of documents
- # is empty.
- self.checkSteps()
-
- '''
- doc up.
- '''
-
- def docUp(self):
- doc = self.settings.cp_DefaultSession.cp_Content.cp_Documents.getElementAt(
- self.selectedDoc[0])
- self.settings.cp_DefaultSession.cp_Content.cp_Documents.remove(
- self.selectedDoc[0])
- self.settings.cp_DefaultSession.cp_Content.cp_Documents.add(
- self.selectedDoc[0] - 1, doc)
- self.docListDA.updateUI()
- self.disableDocUpDown()
-
- '''
- doc down
- '''
-
- def docDown(self):
- doc = self.settings.cp_DefaultSession.cp_Content.cp_Documents.getElementAt(
- self.selectedDoc[0])
- self.settings.cp_DefaultSession.cp_Content.cp_Documents.remove(
- self.selectedDoc[0])
- self.settings.cp_DefaultSession.cp_Content.cp_Documents.add(
- (self.selectedDoc[0] + 1), doc)
- self.docListDA.updateUI()
- self.disableDocUpDown()
-
- '''
- **************
- STEP 5
- **************
- '''
-
- '''
- the user clicked the "backgrounds" button
- '''
-
- def chooseBackground(self):
- try:
- self.setEnabled(self.btnBackgrounds, False)
- if self.bgDialog is None:
- self.bgDialog = BackgroundsDialog(
- self.xMSF, self.settings.cp_BackgroundImages,
- self.resources)
- self.bgDialog.createWindowPeer(self.xUnoDialog.Peer)
-
- self.bgDialog.setSelected(
- self.settings.cp_DefaultSession.cp_Design.cp_BackgroundImage)
- i = self.bgDialog.executeDialogFromParent(self)
- if i == 1:
- #ok
- self.setBackground(self.bgDialog.getSelected())
- except Exception:
- traceback.print_exc()
- finally:
- self.setEnabled(self.btnBackgrounds, True)
-
- '''
- invoked when the BackgroundsDialog is "OKed".
- '''
-
- def setBackground(self, background):
- if background is None:
- background = ""
-
- self.settings.cp_DefaultSession.cp_Design.cp_BackgroundImage \
- = background
- self.refreshStylePreview()
-
- '''
- is called when the user clicks "Icon sets" button.
- '''
-
- def chooseIconset(self):
- try:
- self.setEnabled(self.btnIconSets, False)
- if self.iconsDialog is None:
- self.iconsDialog = IconsDialog(
- self.xMSF, self.settings.cp_IconSets,
- self.resources)
- self.iconsDialog.createWindowPeer(self.xUnoDialog.Peer)
-
- self.iconsDialog.setIconset(
- self.settings.cp_DefaultSession.cp_Design.cp_IconSet)
- i = self.iconsDialog.executeDialogFromParent(self)
- if i == 1:
- #ok
- self.setIconset(self.iconsDialog.getIconset())
- except Exception:
- traceback.print_exc()
- finally:
- self.setEnabled(self.btnIconSets, True)
-
- '''
- invoked when the Iconsets Dialog is OKed.
- '''
-
- def setIconset(self, icon):
- self.settings.cp_DefaultSession.cp_Design.cp_IconSet = icon
- self.updateIconsetText()
-
- '''
- **************
- STEP 7
- **************
- '''
-
- '''
- sets the publishing url of either a local/zip or ftp publisher.
- updates the ui....
- '''
- def setPublishUrl(self, publisher, url, number):
- if url is None:
- return None
-
- p = self.getPublisher(publisher)
- p.cp_URL = url
- p.cp_Publish = True
- self.updatePublishUI(number)
- p.overwriteApproved = True
- return p
-
- '''
- updates the ui of a certain publisher
- (the text box url)
- @param number
- '''
-
- def updatePublishUI(self, number):
- self.pubAware[number].updateUI()
- self.pubAware[number + 1].updateUI()
- self.checkPublish()
-
- '''
- The user clicks the local "..." button.
- '''
-
- def setPublishLocalDir(self):
- folder = self.showFolderDialog(
- "Local destination directory", "",
- self.settings.cp_DefaultSession.cp_OutDirectory)
- #if ok was pressed...
- self.setPublishUrl(LOCAL_PUBLISHER, folder, 0)
-
- '''
- The user clicks the "Configure" FTP button.
- '''
-
- def setFTPPublish(self):
- if self.showFTPDialog(self.getPublisher(FTP_PUBLISHER)):
- self.getPublisher(FTP_PUBLISHER).cp_Publish = True
- self.updatePublishUI(4)
-
- '''
- show the ftp dialog
- @param pub
- @return true if OK was pressed, otherwise false.
- '''
-
- def showFTPDialog(self, pub):
- try:
- return self.getFTPDialog(pub).execute(self) == 1
- except Exception:
- traceback.print_exc()
- return False
-
- '''
- the user clicks the zip "..." button.
- Choose a zip file...
- '''
-
- def setZipFilename(self):
- sd = self.getZipDialog()
- zipFile = sd.callStoreDialog(
- self.settings.cp_DefaultSession.cp_OutDirectory,
- self.resources.resDefaultArchiveFilename)
- self.setPublishUrl(ZIP_PUBLISHER, zipFile, 2)
- self.getPublisher(ZIP_PUBLISHER).overwriteApproved = True
-
- '''
- the user clicks the "Preview" button.
- '''
-
- def documentPreview(self):
- try:
- if self.docPreview is None:
- self.docPreview = TOCPreview(
- self.xMSF, self.settings, self.resources,
- self.stylePreview.tempDir, self.myFrame)
-
- self.docPreview.refresh(self.settings)
- except Exception as ex:
- self.unexpectedError(ex)
-
- '''
- **************
- FINISH
- **************
- '''
-
- '''
- This method checks if the given target's path,
- added the pathExtension argument, exists,
- and asks the user what to do about it.
- If the user says its all fine, then the target will
- be replaced.
- @return true if "create" should continue. false if "create" should abort.
- '''
- def publishTargetApproved(self):
- result = True
- # 1. check local publish target
- p = self.getPublisher(LOCAL_PUBLISHER)
- fileAccess = self.getFileAccess()
- # should publish ?
- if (p.cp_Publish):
- path = fileAccess.getPath(p.url, None)
- # target exists?
- if fileAccess.exists(p.url, False):
- #if it's a directory
- if fileAccess.isDirectory(p.url):
- #check if its empty
- files = fileAccess.listFiles(p.url, True)
- if len(files) > 0:
- '''
- it is not empty :-(
- it either a local publisher or an ftp
- (zip uses no directories as target...)
- '''
- message = self.resources.resLocalTragetNotEmpty.replace(
- "%FILENAME", path)
- result = AbstractErrorHandler.showMessage2(
- self.xMSF, self.xUnoDialog.Peer, message,
- ErrorHandler.MESSAGE_WARNING,
- ErrorHandler.BUTTONS_YES_NO, ErrorHandler.DEF_NO,
- ErrorHandler.RESULT_YES)
- if not result:
- return result
-
- else:
- #not a directory, but still exists
- message = self.resources.resLocalTargetExistsAsfile.replace(
- "%FILENAME", path)
- AbstractErrorHandler.showMessage1(
- self.xMSF, self.xUnoDialog.Peer, message,
- ErrorHandler.ERROR_PROCESS_FATAL)
- return False
-
- # try to write to the path...
- else:
- # the local target directory does not exist.
- message = self.resources.resLocalTargetCreate.replace(
- "%FILENAME", path)
- try:
- result = AbstractErrorHandler.showMessage1(
- self.xMSF, self.xUnoDialog.Peer, message,
- ErrorHandler.ERROR_QUESTION_YES)
- except Exception:
- traceback.print_exc()
-
- if not result:
- return result
- # try to create the directory...
-
- try:
- fileAccess.xInterface.createFolder(p.cp_URL)
- except Exception:
- message = self.resources.resLocalTargetCouldNotCreate.replace(
- "%FILENAME", path)
- AbstractErrorHandler.showMessage1(
- self.xMSF, self.xUnoDialog.Peer, message,
- ErrorHandler.ERROR_PROCESS_FATAL)
- return False
-
- # 2. Check ZIP
- # should publish ?
- p = self.getPublisher(ZIP_PUBLISHER)
- if p.cp_Publish:
- path = fileAccess.getPath(p.cp_URL, None)
- # target exists?
- if fileAccess.exists(p.cp_URL, False):
- #if it's a directory
- if fileAccess.isDirectory(p.cp_URL):
- message = self.resources.resZipTargetIsDir.replace(
- "%FILENAME", path)
- AbstractErrorHandler.showMessage1(
- self.xMSF, self.xUnoDialog.Peer, message,
- ErrorHandler.ERROR_PROCESS_FATAL)
- return False
- else:
- #not a directory, but still exists ( a file...)
- if not p.overwriteApproved:
- message = self.resources.resZipTargetExists.replace(
- "%FILENAME", path)
- result = AbstractErrorHandler.showMessage1(
- self.xMSF, self.xUnoDialog.Peer, message,
- ErrorHandler.ERROR_QUESTION_YES)
- if not result:
- return False
-
- # 3. check FTP
- p = self.getPublisher(FTP_PUBLISHER)
- # should publish ?
- if p.cp_Publish:
- path = fileAccess.getPath(p.cp_URL, None)
- # target exists?
- if fileAccess.exists(p.url, False):
- #if it's a directory
- if fileAccess.isDirectory(p.url):
- #check if its empty
- files = fileAccess.listFiles(p.url, True)
- if len(files) > 0:
- '''
- it is not empty :-(
- it either a local publisher or an ftp
- (zip uses no directories as target...)
- '''
- message = self.resources.resFTPTargetNotEmpty.replace(
- "%FILENAME", path)
- result = AbstractErrorHandler.showMessage1(
- self.xMSF, self.xUnoDialog.Peer, message,
- ErrorHandler.ERROR_QUESTION_CANCEL)
- if not result:
- return result
-
- else:
- #not a directory, but still exists (as a file)
- message = self.resources.resFTPTargetExistsAsfile.replace(
- "%FILENAME", path)
- AbstractErrorHandler.showMessage1(
- self.xMSF, self.xUnoDialog.Peer, message,
- ErrorHandler.ERROR_PROCESS_FATAL)
- return False
-
- # try to write to the path...
- else:
- # the ftp target directory does not exist.
- message = self.resources.resFTPTargetCreate.replace(
- "%FILENAME", path)
- result = AbstractErrorHandler.showMessage1(
- self.xMSF, self.xUnoDialog.Peer, message,
- ErrorHandler.ERROR_QUESTION_YES)
- if not result:
- return result
- # try to create the directory...
-
- try:
- fileAccess.mkdir(p.url)
- except Exception:
- message = self.resources.resFTPTargetCouldNotCreate.replace(
- "%FILENAME", path)
- AbstractErrorHandler.showMessage1(
- self.xMSF, self.xUnoDialog.Peer, message,
- ErrorHandler.ERROR_PROCESS_FATAL)
- return False
-
- return True
-
- '''
- return false if "create" should be aborted. true if everything is fine.
- '''
-
- def saveSession(self):
- try:
- node = None
- name = self.getSessionSaveName()
- #set documents index field.
- docs = self.settings.cp_DefaultSession.cp_Content.cp_Documents
- i = 0
- while i < docs.getSize():
- (docs.getElementAt(i)).cp_Index = i
- i += 1
- conf = Configuration.getConfigurationRoot(
- self.xMSF, CONFIG_PATH + "/SavedSessions", True)
- # first I check if a session with the given name exists
- try:
- node = Configuration.getNode(name, conf)
- if node is not None:
- if not AbstractErrorHandler.showMessage1(
- self.xMSF, self.xUnoDialog.Peer,
- self.resources.resSessionExists.replace("${NAME}", name),
- ErrorHandler.ERROR_NORMAL_IGNORE):
- return False #remove the old session
- Configuration.removeNode(conf, name)
- except NoSuchElementException:
- pass
-
- self.settings.cp_DefaultSession.cp_Index = 0
- node = Configuration.addConfigNode(conf, name)
- self.settings.cp_DefaultSession.cp_Name = name
- self.settings.cp_DefaultSession.writeConfiguration(
- node, CONFIG_READ_PARAM)
- self.settings.cp_SavedSessions.reindexSet(conf, name, "cp_Index")
- Configuration.commit(conf)
- # now I reload the sessions to actualize the list/combo
- # boxes load/save sessions.
- self.settings.cp_SavedSessions.clear()
- confView = Configuration.getConfigurationRoot(
- self.xMSF, CONFIG_PATH + "/SavedSessions", False)
- self.settings.cp_SavedSessions.readConfiguration(
- confView, CONFIG_READ_PARAM)
- self.settings.cp_LastSavedSession = name
- self.currentSession = name
- # now save the name of the last saved session...
- self.settings.cp_LastSavedSession = name
- # TODO add the <none> session...
- self.prepareSessionLists()
- ListModelBinder.fillList(
- self.lstLoadSettings, self.settings.cp_SavedSessions.childrenList, None)
- ListModelBinder.fillComboBox(
- self.cbSaveSettings, self.settings.savedSessions.childrenList, None)
- self.selectSession()
- self.currentSession = self.settings.cp_LastSavedSession
- return True
- except Exception:
- traceback.print_exc()
- return False
-
- def targetStringFor(self, publisher):
- p = self.getPublisher(publisher)
- if p.cp_Publish:
- return "\n" + self.getFileAccess().getPath(p.cp_URL, None)
- else:
- return ""
-
- '''
- this method will be called when the Status Dialog
- is hidden.
- It checks if the "Process" was successful, and if so,
- it closes the wizard dialog.
- '''
-
- def finishWizardFinished(self):
- if self.process.getResult():
- targets = self.targetStringFor(LOCAL_PUBLISHER) + \
- self.targetStringFor(ZIP_PUBLISHER) + \
- self.targetStringFor(FTP_PUBLISHER)
- message = self.resources.resFinishedSuccess.replace(
- "%FILENAME", targets)
- AbstractErrorHandler.showMessage1(
- self.xMSF, self.xUnoDialog.Peer, message, ErrorHandler.ERROR_MESSAGE)
- if self.exitOnCreate:
- self.xUnoDialog.endExecute()
-
- else:
- AbstractErrorHandler.showMessage1(
- self.xMSF, self.xUnoDialog.Peer, self.resources.resFinishedNoSuccess,
- ErrorHandler.ERROR_WARNING)
-
- def cancel(self):
- self.xUnoDialog.endExecute()
-
- '''
- the user clicks the finish/create button.
- '''
-
- def finishWizard(self):
- return self.finishWizard1(True)
-
- '''
- finish the wizard
- @param exitOnCreate_ should the wizard close after
- a successful create.
- Default is true,
- I have a hidden feature which enables false here
- '''
-
- def finishWizard1(self, exitOnCreate_):
- self.exitOnCreate = exitOnCreate_
- '''
- First I check if ftp password was set, if not - the ftp dialog pops up
- This may happen when a session is loaded, since the
- session saves the ftp url and username, but not the password.
- '''
- p = self.getPublisher(FTP_PUBLISHER)
- # if ftp is checked, and no proxies are set, and password is empty...
- if p.cp_Publish and not self.proxies and (p.password is None or p.password == ""):
- if self.showFTPDialog(p):
- self.updatePublishUI(2)
- #now continue...
- return self.finishWizard2()
-
- else:
- return self.finishWizard2()
-
- '''
- this method is only called
- if ftp-password was eather set, or
- the user entered one in the FTP Dialog which
- popped up when clicking "Create".
- '''
-
- def finishWizard2(self):
- p = self.getPublisher(LOCAL_PUBLISHER)
- p.url = p.cp_URL
-
- '''
- zip publisher is using another url form...
- '''
- p = self.getPublisher(ZIP_PUBLISHER)
- #replace the '%' with '%25'
- url1 = p.cp_URL.replace("%", "%25")
- #replace all '/' with '%2F'
- url1 = url1.replace("/", "%2F")
- p.url = "vnd.sun.star.zip://" + url1 + "/"
-
- '''
- and now ftp...
- '''
- p = self.getPublisher(FTP_PUBLISHER)
- p.url = FTPDialog.getFullURL1(p)
-
- ''' first we check the publishing targets. If they exist we warn and
- ask what to do. a False here means the user said "cancel"
- (or rather:clicked)
- '''
- if not self.publishTargetApproved():
- return False
- '''
- In order to save the session correctly,
- I return the value of the ftp publisher cp_Publish
- property to its original value...
- '''
- if self.proxies:
- p.cp_Publish = self.ftp
-
- #if the "save settings" checkbox is on...
- if self.isSaveSession():
- # if canceled by user
- if not self.saveSession():
- return False
- else:
- self.settings.cp_LastSavedSession = ""
-
- try:
- conf = Configuration.getConfigurationRoot(self.xMSF, CONFIG_PATH, True)
- Configuration.set(
- self.settings.cp_LastSavedSession, "LastSavedSession", conf)
- Configuration.commit(conf)
- except Exception:
- traceback.print_exc()
-
- '''
- again, if proxies are on, I disable ftp before the creation process
- starts.
- '''
- if self.proxies:
- p.cp_Publish = False
- '''
- There is currently a bug, which crashes office when
- writing folders to an existing zip file, after deleting
- its content, so I "manually" delete it here...
- '''
-
- p = self.getPublisher(ZIP_PUBLISHER)
- if self.getFileAccess().exists(p.cp_URL, False):
- self.getFileAccess().delete(p.cp_URL)
-
- try:
- eh = ProcessErrorHandler(self.xMSF, self.xUnoDialog.Peer, self.resources)
- self.process = Process(self.settings, self.xMSF, eh)
- pd = self.getStatusDialog()
- pd.setRenderer(ProcessStatusRenderer (self.resources))
- pd.execute(self, self.process.myTask, self.resources.prodName)
- #process,
- self.process.runProcess()
- self.finishWizardFinished()
- self.process.myTask.removeTaskListener(pd)
- return True
- except Exception:
- traceback.print_exc()
-
- '''
- is called on the WindowHidden event,
- deletes the temporary directory.
- '''
-
- def cleanup(self):
- try:
- self.dpStylePreview.dispose()
- self.stylePreview.cleanup()
-
- if self.bgDialog is not None:
- self.bgDialog.xUnoDialog.dispose()
-
- if self.iconsDialog is not None:
- self.iconsDialog.xUnoDialog.dispose()
-
- if self.ftpDialog is not None:
- self.ftpDialog.xUnoDialog.dispose()
-
- self.xUnoDialog.dispose()
- self.myFrame.close(False);
-
- #if ProcessStatusRenderer is not None:
- # ProcessStatusRenderer.close(False)
-
- except Exception:
- traceback.print_exc()
-
- class LoadDocs(object):
-
- def __init__(self, xmsf, xC_, files_, task_, parent_):
- self.xMSF = xmsf
- self.xC = xC_
- self.files = files_
- self.parent = parent_
- self.task = task_
-
- def loadDocuments(self):
- offset = self.parent.selectedDoc[0] + 1 if (len(self.parent.selectedDoc) > 0) else self.parent.getDocsCount()
-
- #Number of documents failed to validate.
- failed = 0
-
- # store the directory
- self.parent.settings.cp_DefaultSession.cp_InDirectory = \
- FileAccess.getParentDir(self.files[0])
-
- '''
- Here i go through each file, and validate it.
- If it's ok, I add it to the ListModel/ConfigSet
- '''
-
- for i in range(0, len(self.files)):
- doc = CGDocument()
- doc.setRoot(self.parent.settings)
-
- doc.cp_URL = self.files[i]
-
- '''
- so - i check each document and if it is ok I add it.
- The failed variable is used only to calculate the place to add -
- Error reporting to the user is (or should (-: )
- done in the checkDocument(...) method
- '''
- if self.parent.checkDocument(doc, self.task, self.xC):
- index = offset + i - failed
- self.parent.settings.cp_DefaultSession.cp_Content.cp_Documents.add(index, doc)
- else:
- failed += 1
-
- # if any documents where added,
- # set the first one to be the current-selected document.
- if len(self.files) > failed:
- self.parent.setSelectedDoc([offset])
-
- # update the ui...
- self.parent.docListDA.updateUI()
- # this enables/disables the next steps.
- # when no documents in the list, all next steps are disabled
- self.parent.checkSteps()
- '''
- a small insurance that the status dialog will
- really close...
- '''
-
- while (self.task.getStatus() < self.task.getMax()):
- self.task.advance(False)
diff --git a/wizards/com/sun/star/wizards/web/WWD_General.py b/wizards/com/sun/star/wizards/web/WWD_General.py
deleted file mode 100644
index 96d72e92c919..000000000000
--- a/wizards/com/sun/star/wizards/web/WWD_General.py
+++ /dev/null
@@ -1,305 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-import traceback
-
-from .WebWizardDialog import WebWizardDialog
-from .StatusDialog import StatusDialog
-from .AbstractErrorHandler import AbstractErrorHandler
-from .ErrorHandler import ErrorHandler
-from .WebWizardConst import *
-from .WWHID import *
-from .FTPDialog import FTPDialog
-from ..common.SystemDialog import SystemDialog
-from ..common.FileAccess import FileAccess
-from ..common.HelpIds import HelpIds
-from ..common.PropertyNames import PropertyNames
-from ..ui.event.ListModelBinder import ListModelBinder
-
-'''
-This class implements general methods, used by different sub-classes
-(either WWD_Sturtup, or WWD_Events) or both.
-'''
-
-class WWD_General(WebWizardDialog):
-
- def __init__(self, xmsf):
- super(WWD_General, self).__init__(xmsf)
- self.xStringSubstitution = SystemDialog.createStringSubstitution(xmsf)
- self.settings = None
- self.folderDialog = None
- self.ftpDialog = None
- self.zipDialog = None
- self.docAddDialog = None
- self.fileAccess = None
- self.proxies = None
-
- def getStatusDialog(self):
- statusDialog = StatusDialog(
- self.xMSF, StatusDialog.STANDARD_WIDTH,
- self.resources.resLoadingSession, False,
- [self.resources.prodName, "", "", "", "", ""],
- HelpIds.getHelpIdString(HID0_STATUS_DIALOG))
- try:
- statusDialog.createWindowPeer(self.xUnoDialog.Peer)
- except Exception:
- traceback.print_exc()
-
- return statusDialog
-
- '''
- File Dialog methods
- '''
-
- def getDocAddDialog(self):
- self.docAddDialog = SystemDialog.createOpenDialog(self.xMSF)
- for i in range(self.settings.cp_Filters.getSize()):
- f = self.settings.cp_Filters.getElementAt(i)
- if f is not None:
- self.docAddDialog.addFilter(
- f.cp_Name.replace("%PRODNAME", self.resources.prodName),
- f.cp_Filter, i == 0)
- return self.docAddDialog
-
- def getZipDialog(self):
- if self.zipDialog is None:
- self.zipDialog = SystemDialog.createStoreDialog(self.xMSF)
- self.zipDialog.addFilter(self.resources.resZipFiles, "*.zip", True)
-
- return self.zipDialog
-
- def getFTPDialog(self, pub):
- if self.ftpDialog is None:
- try:
- self.ftpDialog = FTPDialog(self.xMSF, pub, self.oWizardResource)
- self.ftpDialog.createWindowPeer(self.xUnoDialog.getPeer())
- except Exception:
- traceback.print_exc()
- return self.ftpDialog
-
- def showFolderDialog(self, title, description, folder):
- if self.folderDialog is None:
- self.folderDialog = SystemDialog.createFolderDialog(self.xMSF)
- return self.folderDialog.callFolderDialog(title, description, folder)
-
- def getFileAccess(self):
- if (self.fileAccess is None):
- try:
- self.fileAccess = FileAccess(self.xMSF)
- except Exception:
- traceback.print_exc()
- return self.fileAccess
-
- '''
- returns the document specified
- by the given short array.
- @param s
- @return
- '''
-
- def getDoc(self, s):
- if (len(s) == 0):
- return None
- elif (self.settings.cp_DefaultSession.cp_Content.cp_Documents.getSize() <= s[0]):
- return None
- else:
- return self.settings.cp_DefaultSession.cp_Content.cp_Documents.getElementAt(s[0])
-
- '''
- how many documents are in the list?
- @return the number of documents in the docs list.
- '''
-
- def getDocsCount(self):
- return self.settings.cp_DefaultSession.cp_Content.cp_Documents.getSize()
-
- '''
- fills the export listbox.
- @param listContent
- '''
-
- def fillExportList(self, listContent):
- ListModelBinder.fillList(self.lstDocTargetType, listContent, None)
-
- '''
- returns a publisher object for the given name
- @param name one of the WebWizardConst constants : FTP
- @return
- '''
-
- def getPublisher(self, name):
- return self.settings.cp_DefaultSession.cp_Publishing.getElement(name)
-
- '''
- @return true if the checkbox "save session" is checked.
- '''
-
- def isSaveSession(self):
- return int(self.chkSaveSettings.Model.State == 1)
-
- '''
- @return the name to save the session (step 7)
- '''
-
- def getSessionSaveName(self):
- return self.cbSaveSettings.Model.Text
-
- '''
- This method checks the status of the wizards and
- enables or disables the 'next' and the 'create' button.
- '''
-
- def checkSteps(self):
- '''
- first I check the document list.
- If it is empty, then step3 and on are disabled.
- '''
- if self.checkDocList():
- self.changeLocalDirState(self.chkLocalDir.Model.State)
- self.changeZipState(self.chkZip.Model.State)
- self.checkPublish()
-
- '''
- enables/disables the steps 3 to 7)
- @param enabled true = enabled, false = disabled.
- '''
-
- def enableSteps(self, enabled):
- if not enabled and not self.isStepEnabled(3):
- #disable steps 3-7
- return
-
- for i in range(3,8):
- self.setStepEnabled(i, enabled, True)
- '''
- in this place i just disable the finish button.
- later, in the checkPublish, which is only performed if
- this one is true, it will be enabled (if the check
- is positive)
- '''
-
- if not enabled:
- self.enableFinishButton(False)
-
- '''
- Checks if the documents list is
- empty. If it is, disables the steps 3-7, and the
- create button.
- @return
- '''
-
- def checkDocList(self):
- if self.settings.cp_DefaultSession.cp_Content.cp_Documents.getSize() \
- == 0:
- self.enableSteps(False)
- return False
- else:
- self.enableSteps(True)
- return True
-
- '''
- check if the save-settings input is ok.
- (eather the checkbox is unmarked, or,
- if it is marked, a session name exists.
- '''
-
- def checkSaveSession(self):
- return (not self.isSaveSession() or not self.getSessionSaveName() == "")
-
- '''
- @return false if this publisher is not active, or, if it
- active, returns true if the url is not empty...
- if the url is empty, throws an exception
- '''
-
- def checkPublish2(self, s, text, _property):
- p = self.getPublisher(s)
- if p.cp_Publish:
- url = getattr(text.Model, _property)
- if url is None or url == "":
- return False
- else:
- return True
- else:
- return False
-
- '''
-
- @return false either if publishing input is wrong or there
- are no publishing targets chosen. returns true when at least
- one target is chosen, *and* all
- which are chosen are legal.
- If proxies are on, ftp publisher is ignored.
- '''
-
- def checkPublish_(self):
- return \
- self.checkPublish2(LOCAL_PUBLISHER, self.txtLocalDir, "Text") \
- or (not self.proxies and self.checkPublish2(
- FTP_PUBLISHER, self.lblFTP, PropertyNames.PROPERTY_LABEL) \
- or self.checkPublish2(ZIP_PUBLISHER, self.txtZip, "Text")) \
- and self.checkSaveSession()
-
- '''
- This method checks if the publishing
- input is ok, and enables and disables
- the 'create' button.
- public because it is called from
- an event listener object.
- '''
-
- def checkPublish(self):
- self.enableFinishButton(self.checkPublish_())
-
- def chkLocalDirItemChanged(self):
- self.changeLocalDirState(self.chkLocalDir.Model.State)
- self.checkPublish()
-
- def chkZipItemChanged(self):
- self.changeZipState(self.chkZip.Model.State)
- self.checkPublish()
-
- def changeLocalDirState(self, enable):
- self.btnLocalDir.Model.Enabled = enable
-
- def changeZipState(self, enable):
- self.btnZip.Model.Enabled = enable
-
- '''
- shows a message box "Unexpected Error... " :-)
- @param ex
- '''
-
- def unexpectedError(self, ex):
- traceback.print_exc()
- peer = self.xUnoDialog.getPeer()
- AbstractErrorHandler.showMessage1(
- self.xMSF, peer, self.resources.resErrUnexpected,
- ErrorHandler.ERROR_PROCESS_FATAL)
-
- '''
- substitutes path variables with the corresponding values.
- @param path a path, which might contain OOo path variables.
- @return the path, after substituting path variables.
- '''
-
- def substitute(self, path):
- try:
- return self.xStringSubstitution.substituteVariables(path, False)
- except Exception:
- traceback.print_exc()
- return path
diff --git a/wizards/com/sun/star/wizards/web/WWD_Startup.py b/wizards/com/sun/star/wizards/web/WWD_Startup.py
deleted file mode 100644
index 2c235104459f..000000000000
--- a/wizards/com/sun/star/wizards/web/WWD_Startup.py
+++ /dev/null
@@ -1,664 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-import traceback
-
-from .WWD_General import WWD_General
-from .WebWizardConst import *
-from .StylePreview import StylePreview
-from ..common.Configuration import Configuration
-from ..common.FileAccess import FileAccess
-from ..document.OfficeDocument import OfficeDocument
-from .data.CGSettings import CGSettings
-from .data.CGDocument import CGDocument
-from .data.CGSessionName import CGSessionName
-from ..ui.event.ListModelBinder import ListModelBinder
-from ..ui.event.UnoDataAware import UnoDataAware
-from ..ui.event.RadioDataAware import RadioDataAware
-from ..ui.event.SimpleDataAware import SimpleDataAware
-from ..ui.event.CommonListener import ItemListenerProcAdapter
-from ..ui.event.CommonListener import TerminateListenerProcAdapter
-from ..ui.DocumentPreview import DocumentPreview
-from ..ui.event.DataAware import DataAware
-from ..ui.event.Task import Task
-
-'''
-Web Wizard Dialog implementation: Startup.
-This class contains the startup implementation and session mounting methods.
-<h2> Data Aware Concept </h2>
-<p> I use DataAware objects, which synchronize
-UI and Data. A DataAware object a kind of interface
-between a Value and a UI element.
-</P>
-<p>
-A Value is either a JavaBean property with
-a Getter and a Setter or a public class Member.
-</P>
-When the UI Control changes, the Value changes correspondingly.
-This depends on WWD_General.settings a Listener which calls the updateData()
-method od the DataAware object.
-When the Value changes, the UI Control changes respopndingly.
-This also depends on WWD_General.settings a Listener which calls the updateUI
-method of the DataAware object.
-</P>
-<P>
-here I use only UI Listeners, and keep calling
-the updateUI() method whenever I change the Value.
-</P>
-To contain the Data, I use the Configuration Data Objects
-which read themselves out of the Configuration. they are all located under
-the data package.
-<p/>
-Different groups of DataAware objects are grouped into vectors.
-Each group (all elements of a vector) uses the same DataObject,
-so when I change the underlying dataObject, I change the whole vector's
-DataObject, thus actualizing UI.<br/>
-This is what happens when a session loads: I Load the session into
-a tree of DataObjects, and change the DataAware's DataObject. <br/>
-One could also look at this as a kind of "View-Model" relationship.
-The controls are the View, The DataObjects are the Model, containing the
-Data rad directly from the configuration, and the DataAware objects
-are the controller inbetween.
-
-@author rpiterman
-'''
-
-class WWD_Startup(WWD_General):
-
- '''
- He - my constructor !
- I call/do here in this order: <br/>
- Check if ftp http proxy is set, and warn user he can not use
- ftp if it is.<br/>
- draw NaviBar and steps 1 to 7, incl. Step X,
- which is the Layouts ImageList on step 3.<br/>
- load the WWD_General.settings from the configuration. <br/>
- set the default save session name to the first
- available one (sessionX or something like that). <br/>
- set the Layouts ImageList ListModel, and call
- its "create()" method. <br/>
- check the content (documents) specified in the default session.<br/>
- fill the list boxes (saved sessions, styles, combobox save session). <br/>
- make data aware. <br/>
- updateUI (refreshes the display to correspond to the data in
- the default session.)<br/>
- fill the documents listbox. <br/>
- if proxies are set, disable the ftp controls in step 7.
- '''
-
- def __init__(self, xmsf):
- super(WWD_Startup, self).__init__(xmsf)
- self.selectedDoc = []
- self.ftp = True
- self.sda = None
- self.docAware = []
- self.designAware = []
- self.genAware = []
- self.pubAware = []
- self.proxies = self.getOOProxies()
- soTemplateDir = FileAccess.getOfficePath2(
- xmsf, "Template", "share", "/wizard")
- exclamationURL = FileAccess.connectURLs(
- soTemplateDir, "../wizard/bitmap/caution_16.png")
- self.drawNaviBar()
- self.buildStep1()
- self.buildStep2()
- self.buildStep3()
- self.buildStep4()
- self.buildStep5()
- self.buildStep6()
- self.buildStep7(self.proxies, exclamationURL)
- self.txtLocalDir.Model.Enabled = False
- self.txtZip.Model.Enabled = False
- self.buildStepX()
- self.xMSF = xmsf
- self.terminateListener = TerminateListenerProcAdapter(self)
- self.myFrame = OfficeDocument.createNewFrame(xmsf, self.terminateListener)
- doc = OfficeDocument.createNewDocument(
- self.myFrame, "swriter", False, True)
- self.loadSettings(doc)
- self.setSaveSessionName(self.settings.cp_DefaultSession)
- self.ilLayouts.listModel = self.settings.cp_Layouts
- self.ilLayouts.create(self)
- #COMMENTED
- self.checkContent(self.settings.cp_DefaultSession.cp_Content, Task("", "", 99999), self.xUnoDialog)
- #saved sessions, styles, combobox save session.
- # also set the chosen saved session...
- self.fillLists()
- self.makeDataAware()
-
- self.updateUI()
-
- # fill the documents listbox.
- self.fillDocumentList(self.settings.cp_DefaultSession.cp_Content)
-
- if self.proxies:
- self.btnFTP.Model.Enabled = False
- self.chkFTP.Model.Enabled = False
-
- '''
- return true if http proxies or other proxies
- which do not enable ftp to function correctly are set.
- @return true if (http) proxies are on.
- @throws Exception
- '''
-
- def getOOProxies(self):
- node = Configuration.getConfigurationRoot(
- self.xMSF, "org.openoffice.Inet/Settings", False)
- i = int(node.getByName("ooInetProxyType"))
- if i== 0:
- #no proxies
- return False
- elif i == 2:
- #http proxies
- return True
- else:
- return True
-
- '''
- calculates the first available session name,
- and sets the current session name to it.
- The combobox text in step 7 will be updated
- automatically when updateUI() is called.
- '''
-
- def setSaveSessionName(self, session):
- maxValue = 0
- length = self.resources.resSessionName
- # traverse between the sessions and find the one that
- # has the biggest number.
- for i in range(self.settings.cp_SavedSessions.getSize()):
- sessionName = \
- self.settings.cp_SavedSessions.getElementAt(i).cp_Name
- if sessionName.startswith(self.resources.resSessionName):
- maxValue = max(maxValue, int(sessionName[length:]))
-
- '''
- fills the road map, and sets the necessary properties,
- like MaxStep, Complete, Interactive-
- Disables the finbihButton.
- '''
-
- def insertRoadmap(self):
-
- self.insertRoadMapItems(
- self.resources.RoadmapLabels,
- [True, True, False, False, False, False, False])
- self.setRoadmapInteractive(True)
- self.setRoadmapComplete(True)
- self.setCurrentRoadmapItemID(1)
- self.nMaxStep = 7
- self.enableFinishButton(False)
-
- '''
- This method goes through all
- the DataAware vectors and objects and
- calls their updateUI() method.
- In response, the UI is synchronized to
- the state of the corresponding data objects.
- '''
- def updateUI(self):
- DataAware.updateUIs(self.designAware)
- DataAware.updateUIs(self.genAware)
- DataAware.updateUIs(self.pubAware)
- self.sessionNameDA.updateUI()
-
- '''
- create the peer, add roadmap,
- add roadmap items, add style-preview,
- disable the steps 3 to 7 if no documents are
- on the list, and... show the dialog!
- '''
-
- def show(self):
- try:
- xContainerWindow = self.myFrame.getComponentWindow()
- self.createWindowPeer(xContainerWindow)
- self.addRoadmap()
- self.insertRoadmap()
- self.addStylePreview()
- self.checkSteps()
- self.executeDialogFromComponent(self.myFrame)
- self.removeTerminateListener()
- except Exception:
- traceback.print_exc()
-
- '''
- initializes the style preview.
- '''
-
- def addStylePreview(self):
- try:
- self.dpStylePreview = DocumentPreview(self.xMSF, self.imgPreview)
- self.stylePreview = StylePreview(
- self.xMSF, self.settings.workPath)
- style = self.settings.cp_DefaultSession.getStyle()
- bg = self.settings.cp_DefaultSession.cp_Design.cp_BackgroundImage
- self.stylePreview.refresh(style, bg)
- self.dpStylePreview.setDocument(
- self.stylePreview.htmlFilename, DocumentPreview.PREVIEW_MODE)
- except Exception:
- traceback.print_exc()
-
- '''
- Loads the web wizard WWD_General.settings from the registry.
- '''
-
- def loadSettings(self, document):
- try:
- # instanciate
- self.settingsResources = \
- [self.resources.resPages, self.resources.resSlides,
- self.resources.resCreatedTemplate,
- self.resources.resUpdatedTemplate,
- self.resources.resSizeTemplate]
-
- self.settings = CGSettings(
- self.xMSF, self.settingsResources, document)
- # get configuration view
- confRoot = Configuration.getConfigurationRoot(
- self.xMSF, CONFIG_PATH, True)
- # read
- self.settings.readConfiguration(
- confRoot, CONFIG_READ_PARAM)
- configSet = self.settings.cp_DefaultSession.cp_Publishing
- # now if path variables are used in publisher paths, they
- # are getting replaced here...
- for i in range(configSet.getSize()):
- p = configSet.getElementAt(i)
- try:
- p.cp_URL = self.substitute(p.cp_URL)
- except Exception:
- traceback.print_exc()
-
- # initialize the WWD_General.settings.
- self.settings.configure(self.xMSF)
- # set resource needed for web page.
- # sort the styles alphabetically
- #COMMENTED - FIXME: to be implemented
- #self.settings.cp_Styles.sort(None)
- self.prepareSessionLists()
- if self.proxies:
- self.ftp = self.getPublisher(FTP_PUBLISHER).cp_Publish
- self.getPublisher(FTP_PUBLISHER).cp_Publish = False
-
- except Exception:
- traceback.print_exc()
-
- def prepareSessionLists(self):
- # now copy the sessions list...
- sessions = self.settings.cp_SavedSessions.childrenList
-
- self.settings.savedSessions.clear()
- for index,item in enumerate(sessions):
- self.settings.savedSessions.add(index, item)
- # add an empty session to the saved session
- # list which appears in step 1
- sn = CGSessionName()
- sn.cp_Name = self.resources.resSessionNameNone
- self.settings.cp_SavedSessions.add(0, sn)
-
- '''
- fills the saved session list, the styles list,
- and save session combo box.
- Also set the selected "load" session to the last session
- which was saved.
- '''
-
- def fillLists(self):
- # fill the saved session list.
-
- ListModelBinder.fillList(self.lstLoadSettings,
- self.settings.cp_SavedSessions.childrenList, None)
- # set the selected session to load. (step 1)
- self.selectSession()
- # fill the styles list.
- ListModelBinder.fillList(self.lstStyles,
- self.settings.cp_Styles.childrenList, None)
- # fill the save session combobox (step 7)
- ListModelBinder.fillComboBox(self.cbSaveSettings,
- self.settings.savedSessions.childrenList, None)
-
- def selectSession(self):
- selectedSession = 0
- if self.settings.cp_LastSavedSession is not None \
- and not self.settings.cp_LastSavedSession == "":
- ses = self.settings.cp_SavedSessions.getElement(
- self.settings.cp_LastSavedSession)
- if ses is not None:
- selectedSession = \
- self.settings.cp_SavedSessions.getIndexOf(ses)
-
- self.lstLoadSettings.Model.SelectedItems = (selectedSession,)
-
- def designItemChanged(self, itemEvent):
- self.sda.updateData()
-
- '''
- attaches to each ui-data-control (like checkbox, groupbox or
- textbox, no buttons though), a DataObject's JavaBean Property,
- or class member.
- '''
-
- def makeDataAware(self):
- #page 1
- ListModelBinder(self.lstLoadSettings, self.settings.cp_SavedSessions)
-
- #page 2 : document properties
- self.docListDA = UnoDataAware.attachListBox(
- self, "SelectedDoc", self.lstDocuments, False)
- self.docListDA.disableObjects = \
- [self.lnDocsInfo, self.btnRemoveDoc, self.lblDocTitle,
- self.txtDocTitle, self.lblDocInfo, self.txtDocInfo,
- self.lblDocAuthor, self.txtDocAuthor, self.lblDocExportFormat,
- self.lstDocTargetType]
- self.docListDA.updateUI()
- doc = CGDocument #dummy
- self.docsBinder = ListModelBinder(self.lstDocuments,
- self.settings.cp_DefaultSession.cp_Content.cp_Documents)
- self.docAware.append(UnoDataAware.attachEditControl(
- doc, "cp_Title", self.txtDocTitle, True))
- self.docAware.append(UnoDataAware.attachEditControl(
- doc, "cp_Description", self.txtDocInfo, True))
- self.docAware.append(UnoDataAware.attachEditControl(
- doc, "cp_Author", self.txtDocAuthor, True))
- self.docAware.append(UnoDataAware.attachListBox(
- doc, "Exporter", self.lstDocTargetType, False))
-
- #page 3 : Layout
- design = self.settings.cp_DefaultSession.cp_Design
- self.sda = SimpleDataAware(design, "Layout", self.ilLayouts, "Selected")
- self.ilLayouts.addItemListener(ItemListenerProcAdapter(self.designItemChanged))
- self.designAware.append(self.sda);
-
- #page 4 : layout 2
- self.designAware.append(UnoDataAware.attachCheckBox(
- design, "cp_DisplayDescription", self.chbDocDesc, True))
- self.designAware.append(UnoDataAware.attachCheckBox(
- design, "cp_DisplayAuthor", self.chbDocAuthor, True))
- self.designAware.append(UnoDataAware.attachCheckBox(
- design, "cp_DisplayCreateDate", self.chkDocCreated, True))
- self.designAware.append(UnoDataAware.attachCheckBox(
- design, "cp_DisplayUpdateDate", self.chkDocChanged, True))
- self.designAware.append(UnoDataAware.attachCheckBox(
- design, "cp_DisplayFilename", self.chkDocFilename, True))
- self.designAware.append(UnoDataAware.attachCheckBox(
- design, "cp_DisplayFileFormat", self.chkDocFormat, True))
- self.designAware.append(UnoDataAware.attachCheckBox(
- design, "cp_DisplayFormatIcon", self.chkDocFormatIcon, True))
- self.designAware.append(UnoDataAware.attachCheckBox(
- design, "cp_DisplayPages", self.chkDocPages, True))
- self.designAware.append(UnoDataAware.attachCheckBox(
- design, "cp_DisplaySize", self.chkDocSize, True))
- self.designAware.append(RadioDataAware.attachRadioButtons(
- self.settings.cp_DefaultSession.cp_Design,
- "cp_OptimizeDisplaySize",
- (self.optOptimize640x480, self.optOptimize800x600,
- self.optOptimize1024x768), True))
- #page 5 : Style
- '''
- note : on style change, i do not call here refresh ,but rather on
- a special method which will perform some display, background and Iconsets changes.
- '''
- self.designAware.append(UnoDataAware.attachListBox(
- self.settings.cp_DefaultSession.cp_Design,
- "Style", self.lstStyles, False))
- #page 6 : site general props
- self.genAware.append(UnoDataAware.attachEditControl(
- self.settings.cp_DefaultSession.cp_GeneralInfo,
- "cp_Title", self.txtSiteTitle, True))
- self.genAware.append(UnoDataAware.attachEditControl(
- self.settings.cp_DefaultSession.cp_GeneralInfo,
- "cp_Description", self.txtSiteDesc, True))
- self.genAware.append(UnoDataAware.attachDateControl(
- self.settings.cp_DefaultSession.cp_GeneralInfo,
- "cp_CreationDate", self.dateSiteCreated, False))
- self.genAware.append(UnoDataAware.attachDateControl(
- self.settings.cp_DefaultSession.cp_GeneralInfo,
- "cp_UpdateDate", self.dateSiteUpdate, False))
- self.genAware.append(UnoDataAware.attachEditControl(
- self.settings.cp_DefaultSession.cp_GeneralInfo,
- "cp_Email", self.txtEmail, True))
- self.genAware.append(UnoDataAware.attachEditControl(
- self.settings.cp_DefaultSession.cp_GeneralInfo,
- "cp_Copyright", self.txtCopyright, True))
- #page 7 : publishing
- self.pubAware_(
- LOCAL_PUBLISHER, self.chkLocalDir, self.txtLocalDir, False)
- self.pubAware_(
- ZIP_PUBLISHER, self.chkZip, self.txtZip, False)
- self.pubAware_(
- FTP_PUBLISHER, self.chkFTP, self.lblFTP, True)
- self.sessionNameDA = UnoDataAware.attachEditControl(
- self.settings.cp_DefaultSession, "cp_Name",
- self.cbSaveSettings, True)
-
- '''
- A help method to attach a Checkbox and a TextBox to
- a CGPublish object properties/class members,
- @param publish
- @param checkbox
- @param textbox
- '''
-
- def pubAware_(self, publish, checkbox, textbox, isLabel):
- p = self.settings.cp_DefaultSession.cp_Publishing.getElement(publish)
- uda = UnoDataAware.attachCheckBox(p, "cp_Publish", checkbox, True)
- self.pubAware.append(uda)
- if isLabel:
- aux = UnoDataAware.attachLabel(p, "cp_URL", textbox, False)
- else:
- aux = UnoDataAware.attachEditControl(p, "cp_URL", textbox, False)
- self.pubAware.append(aux)
-
- '''
- Session load methods
- (are used both on the start of the wizard and
- when the user loads a session)
-
- Is called when a new session/settings is
- loaded. <br/>
- Checks the documents (validate), fills the
- documents listbox, and changes the
- DataAware data objects to the
- new session's objects.<br/>
- Task advances 4 times in the mount method,
- and ??? times for each document in the session.
- '''
-
- def mount(self, session, task, refreshStyle, xC):
- '''
- This checks the documents. If the user
- chooses to cancel, the session is not loaded.
- '''
- self.checkContent(session.cp_Content, task, xC)
- self.settings.cp_DefaultSession = session
- self.fillDocumentList(session.cp_Content)
- task.advance(True)
- self.mountList(session.cp_Design, self.designAware)
- self.mountList(session.cp_GeneralInfo, self.genAware)
- task.advance(True)
- self.mountDataAware(session.cp_Publishing.getElement(LOCAL_PUBLISHER), 0)
- self.mountDataAware(session.cp_Publishing.getElement(ZIP_PUBLISHER), 1)
- self.mountDataAware(session.cp_Publishing.getElement(FTP_PUBLISHER), 2)
- task.advance(True)
- self.sessionNameDA.setDataObject(session, True)
- self.chkSaveSettings.Model.State = 1
- self.docListDA.updateUI()
- task.advance(True)
- if refreshStyle:
- self.refreshStylePreview()
- self.updateIconsetText()
-
- '''
- used to mount the publishing objects. This is somehow cryptic -
- there are 6 DataAware objects, 2 for each Publishing Object (CGPublish).
- All 6 reside on one Vector (pubAware).
- Since, otherwise than other DataAware objects, different
- Objects on the same Vector need different DataObjectBinding,
- I use this method...
- @param data the CGPublish object
- @param i the number of the object (0 = local, 1 = zip, 2 = ftp)
- '''
-
- def mountDataAware(self, data, i):
- self.pubAware[i * 2].setDataObject(data, True)
- self.pubAware[i * 2 + 1].setDataObject(data, True)
-
- '''
- Fills the documents listbox.
- @param root the CGContent object
- that contains the documents (a ListModel)
- '''
-
- def fillDocumentList(self, root):
- ListModelBinder.fillList(self.lstDocuments, root.cp_Documents.childrenList, None)
- self.docsBinder.setListModel(root.cp_Documents)
- self.disableDocUpDown()
-
- '''
- changes the DataAwares Objects' (in
- the given list) DataObject to the
- @param data
- @param list
- '''
-
- def mountList(self, data, _list):
- for i in _list:
- i.setDataObject(data, True)
-
- '''
- Checks if the document specified by the given CGDocument
- object (cp_URL) exists. Calls also the validate(...) method
- of this document.
- If the document does not exist, it asks the user whether
- to specify a new URL, or forget about this document.
- @param doc the document to check.
- @param task while loading a session, a status is
- displayed, using the Task object to monitor progress.
- @return true if the document is ok (a file exists in the given url).
- '''
-
- def checkDocument(self, doc, task, xC):
- doc.validate(self.xMSF, task)
- return True
- '''except IOError:
- relocate = SystemDialog.showMessageBox(
- self.xMSF, xC.Peer, "WarningBox",
- VclWindowPeerAttribute.YES_NO + VclWindowPeerAttribute.DEF_NO,
- getFileAccess().getPath(doc.cp_URL, "") + "\n\n" + \
- self.resources.resSpecifyNewFileLocation)
- if relocate == 2:
- _file = getDocAddDialog().callOpenDialog(
- False, FileAccess.getParentDir(doc.cp_URL))
- if _file is None:
- return False
- else:
- doc.cp_URL = _file[0]
- return checkDocument(doc, task, xC)
-
- else:
- return False
-
- except IllegalArgumentException, iaex:
- #file is a directory
- SystemDialog.showMessage(
- self.xMSF, xControl.Peer,
- self.resources.resErrIsDirectory.replace(
- "%FILENAME", getFileAccess().getPath(doc.cp_URL, "")),
- ErrorHandler.ERROR_PROCESS_FATAL)
- return False
- except Exception:
- #something went wrong.
- traceback.print_exc()
- SystemDialog.showMessage(
- self.xMSF, xControl.Peer,
- self.resources.resErrDocValidate.replace(
- "%FILENAME", getFileAccess().getPath(doc.cp_URL, "")),
- ErrorHandler.ERROR_PROCESS_FATAL)
- return False
- '''
-
- '''
- Checks the documents contained in this content.
- @param content
- @param task
- '''
-
- def checkContent(self, content, task, xC):
- i = 0
- while i < content.cp_Documents.getSize():
- if not self.checkDocument(content.cp_Documents.getElementAt(i), task, xC):
- # I use here 'i--' since, when the document is removed
- # an index change accures
- content.cp_Documents.remove(i)
- i -= 1
- i += 1
-
- '''
- Disables/enables the docUpDown buttons (step 2)
- according to the currently selected document
- (no doc selected - both disabled, last doc selected,
- down disabled and so on...)
- '''
-
- def disableDocUpDown(self):
- try:
- self.btnDocUp.Model.Enabled = False if (len(self.selectedDoc) == 0) else (False if (self.selectedDoc[0] == 0) else True)
- self.btnDocDown.Model.Enabled = False if (len(self.selectedDoc) == 0) else (True if (self.selectedDoc[0] + 1 < self.settings.cp_DefaultSession.cp_Content.cp_Documents.getSize()) else False)
- except Exception:
- traceback.print_exc()
-
- def updateBackgroundText(self):
- bg = \
- self.settings.cp_DefaultSession.cp_Design.cp_BackgroundImage
- if bg is None or bg == "":
- bg = self.resources.resBackgroundNone
- else:
- bg = FileAccess.getPathFilename(self.getFileAccess().getPath(bg, None))
-
- self.txtBackground.Model.Label = bg
-
- def updateIconsetText(self):
- iconset = self.settings.cp_DefaultSession.cp_Design.cp_IconSet
- if iconset is None or iconset == "":
- iconsetName = self.resources.resIconsetNone
- else:
- IconSet = self.settings.cp_IconSets.getElement(iconset)
- if IconSet is None:
- iconsetName = self.resources.resIconsetNone
- else:
- iconsetName = IconSet.cp_Name
-
- self.txtIconset.Model.Label = iconsetName
-
- '''
- refreshes the style preview.
- I also call here "updateBackgroundtext", because always
- when the background is changed, this method
- has to be called, so I am walking on the safe side here...
- '''
-
- def refreshStylePreview(self):
- try:
- self.updateBackgroundText()
- self.stylePreview.refresh(self.settings.cp_DefaultSession.getStyle(),
- self.settings.cp_DefaultSession.cp_Design.cp_BackgroundImage)
- self.dpStylePreview.reload(self.xMSF)
- except Exception:
- traceback.print_exc()
diff --git a/wizards/com/sun/star/wizards/web/WWHID.py b/wizards/com/sun/star/wizards/web/WWHID.py
deleted file mode 100644
index acb3ef43e2d8..000000000000
--- a/wizards/com/sun/star/wizards/web/WWHID.py
+++ /dev/null
@@ -1,154 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-HID0_WEBWIZARD = 34200 + 0
-HID0_WEBWIZARD = 34200 + 0
-HID0_HELP = 34200 + 1
-HID0_NEXT = 34200 + 2
-HID0_PREV = 34200 + 3
-HID0_CREATE = 34200 + 4
-HID0_CANCEL = 34200 + 5
-HID0_STATUS_DIALOG = 34200 + 6 #step 1
-HID1_LST_SESSIONS = 34200 + 7
-HID1_BTN_DEL_SES = 34200 + 9 #step 2
-HID2_LST_DOCS = 34200 + 10
-HID2_BTN_ADD_DOC = 34200 + 11
-HID2_BTN_REM_DOC = 34200 + 12
-HID2_BTN_DOC_UP = 34200 + 13
-HID2_BTN_DOC_DOWN = 34200 + 14
-HID2_TXT_DOC_TITLE = 34200 + 15
-HID2_TXT_DOC_DESC = 34200 + 16
-HID2_TXT_DOC_AUTHOR = 34200 + 17
-HID2_LST_DOC_EXPORT = 34200 + 18
-HID2_STATUS_ADD_DOCS = 34200 + 19 #step 3
-HID3_IL_LAYOUTS_IMG1 = 34200 + 20
-HID3_IL_LAYOUTS_IMG2 = 34200 + 21
-HID3_IL_LAYOUTS_IMG3 = 34200 + 22
-HID3_IL_LAYOUTS_IMG4 = 34200 + 23
-HID3_IL_LAYOUTS_IMG5 = 34200 + 24
-HID3_IL_LAYOUTS_IMG6 = 34200 + 25
-HID3_IL_LAYOUTS_IMG7 = 34200 + 26
-HID3_IL_LAYOUTS_IMG8 = 34200 + 27
-HID3_IL_LAYOUTS_IMG9 = 34200 + 28
-HID3_IL_LAYOUTS_IMG10 = 34200 + 29
-HID3_IL_LAYOUTS_IMG11 = 34200 + 30
-HID3_IL_LAYOUTS_IMG12 = 34200 + 31
-HID3_IL_LAYOUTS_IMG13 = 34200 + 32
-HID3_IL_LAYOUTS_IMG14 = 34200 + 33
-HID3_IL_LAYOUTS_IMG15 = 34200 + 34 #step 4
-HID4_CHK_DISPLAY_FILENAME = 34200 + 35
-HID4_CHK_DISPLAY_DESCRIPTION = 34200 + 36
-HID4_CHK_DISPLAY_AUTHOR = 34200 + 37
-HID4_CHK_DISPLAY_CR_DATE = 34200 + 38
-HID4_CHK_DISPLAY_UP_DATE = 34200 + 39
-HID4_CHK_DISPLAY_FORMAT = 34200 + 40
-HID4_CHK_DISPLAY_F_ICON = 34200 + 41
-HID4_CHK_DISPLAY_PAGES = 34200 + 42
-HID4_CHK_DISPLAY_SIZE = 34200 + 43
-HID4_GRP_OPTIMAIZE_640 = 34200 + 44
-HID4_GRP_OPTIMAIZE_800 = 34200 + 45
-HID4_GRP_OPTIMAIZE_1024 = 34200 + 46 #step 5
-HID5_LST_STYLES = 34200 + 47
-HID5_BTN_BACKGND = 34200 + 48
-HID5_BTN_ICONS = 34200 + 49 #step 6
-HID6_TXT_SITE_TITLE = 34200 + 50
-HID6_TXT_SITE_ICON = 34200 + 51
-HID6_BTN_SITE_ICON = 34200 + 52
-HID6_TXT_SITE_DESC = 34200 + 53
-HID6_TXT_SITE_KEYWRDS = 34200 + 54
-HID6_DATE_SITE_CREATED = 34200 + 55
-HID6_DATE_SITE_UPDATED = 34200 + 56
-HID6_NUM_SITE_REVISTS = 34200 + 57
-HID6_TXT_SITE_EMAIL = 34200 + 58
-HID6_TXT_SITE_COPYRIGHT = 34200 + 59 #step 7
-HID7_BTN_PREVIEW = 34200 + 60
-HID7_CHK_PUBLISH_LOCAL = 34200 + 61
-HID7_TXT_LOCAL = 34200 + 62
-HID7_BTN_LOCAL = 34200 + 63
-HID7_CHK_PUBLISH_ZIP = 34200 + 64
-HID7_TXT_ZIP = 34200 + 65
-HID7_BTN_ZIP = 34200 + 66
-HID7_CHK_PUBLISH_FTP = 34200 + 67
-HID7_BTN_FTP = 34200 + 69
-HID7_CHK_SAVE = 34200 + 70
-HID7_TXT_SAVE = 34200 + 71 #web wizard backgrounds dialog
-HID_BG = 34200 + 90
-HID_BG_BTN_OTHER = 34200 + 91
-HID_BG_BTN_NONE = 34200 + 92
-HID_BG_BTN_OK = 34200 + 93
-HID_BG_BTN_CANCEL = 34200 + 94
-HID_BG_BTN_BACK = 34200 + 95
-HID_BG_BTN_FW = 34200 + 96
-HID_BG_BTN_IMG1 = 34200 + 97
-HID_BG_BTN_IMG2 = 34200 + 98
-HID_BG_BTN_IMG3 = 34200 + 99
-HID_BG_BTN_IMG4 = 34200 + 100
-HID_BG_BTN_IMG5 = 34200 + 101
-HID_BG_BTN_IMG6 = 34200 + 102
-HID_BG_BTN_IMG7 = 34200 + 103
-HID_BG_BTN_IMG8 = 34200 + 104
-HID_BG_BTN_IMG9 = 34200 + 105
-HID_BG_BTN_IMG10 = 34200 + 106
-HID_BG_BTN_IMG11 = 34200 + 107
-HID_BG_BTN_IMG12 = 34200 + 108 #web wizard icons sets dialog
-HID_IS = 41000 + 0
-HID_IS_ICONSETS = 41000 + 1
-HID_IS_BTN_NONE = 41000 + 2
-HID_IS_BTN_OK = 41000 + 3
-HID_IS_BTN_IMG1 = 41000 + 5
-HID_IS_BTN_IMG2 = 41000 + 6
-HID_IS_BTN_IMG3 = 41000 + 7
-HID_IS_BTN_IMG4 = 41000 + 8
-HID_IS_BTN_IMG5 = 41000 + 9
-HID_IS_BTN_IMG6 = 41000 + 10
-HID_IS_BTN_IMG7 = 41000 + 11
-HID_IS_BTN_IMG8 = 41000 + 12
-HID_IS_BTN_IMG9 = 41000 + 13
-HID_IS_BTN_IMG10 = 41000 + 14
-HID_IS_BTN_IMG11 = 41000 + 15
-HID_IS_BTN_IMG12 = 41000 + 16
-HID_IS_BTN_IMG13 = 41000 + 17
-HID_IS_BTN_IMG14 = 41000 + 18
-HID_IS_BTN_IMG15 = 41000 + 19
-HID_IS_BTN_IMG16 = 41000 + 20
-HID_IS_BTN_IMG17 = 41000 + 21
-HID_IS_BTN_IMG18 = 41000 + 22
-HID_IS_BTN_IMG19 = 41000 + 23
-HID_IS_BTN_IMG20 = 41000 + 24
-HID_IS_BTN_IMG21 = 41000 + 25
-HID_IS_BTN_IMG22 = 41000 + 26
-HID_IS_BTN_IMG23 = 41000 + 27
-HID_IS_BTN_IMG24 = 41000 + 28
-HID_IS_BTN_IMG25 = 41000 + 29
-HID_IS_BTN_IMG26 = 41000 + 30
-HID_IS_BTN_IMG27 = 41000 + 31
-HID_IS_BTN_IMG28 = 41000 + 32
-HID_IS_BTN_IMG29 = 41000 + 33
-HID_IS_BTN_IMG30 = 41000 + 34
-HID_IS_BTN_IMG31 = 41000 + 35
-HID_IS_BTN_IMG32 = 41000 + 36
-
-# web wizard ftp dialog
-HID_FTP = 41000 + 40
-HID_FTP_SERVER = 41000 + 41
-HID_FTP_USERNAME = 41000 + 42
-HID_FTP_PASS = 41000 + 43
-HID_FTP_TEST = 41000 + 44
-HID_FTP_TXT_PATH = 41000 + 45
-HID_FTP_BTN_PATH = 41000 + 46
-HID_FTP_OK = 41000 + 47
-HID_FTP_CANCEL = 41000 + 48
diff --git a/wizards/com/sun/star/wizards/web/WebConfigSet.py b/wizards/com/sun/star/wizards/web/WebConfigSet.py
deleted file mode 100644
index 4e97abc14101..000000000000
--- a/wizards/com/sun/star/wizards/web/WebConfigSet.py
+++ /dev/null
@@ -1,247 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-import traceback
-from ..common.ConfigGroup import ConfigGroup
-from ..common.Configuration import Configuration
-from ..ui.event.EventListenerList import EventListenerList
-from ..ui.event.ListDataEvent import ListDataEvent
-from ..ui.event.ListDataListener import ListDataListener
-
-class WebConfigSet(ConfigGroup):
- '''
- After reading the configuration set items,
- the ConfigSet checks this field.
- If it is true, it will remove any nulls from
- the vector.
- subclasses can change this field in the constructor
- to avoid this "deletion" of nulls.
- '''
-
- def __init__(self, childType):
- self.childClass = childType
- self.childrenMap = {}
- self.childrenList = []
- self.noNulls = True
- self.listenerList = None
-
- def add(self, name, o):
- oldO = None
- if (name in self.childrenMap):
- oldO = self.childrenMap[name]
- self.childrenMap[name] = o
- try:
- i = int(name)
- self.childrenList.insert(i, o)
- self.fireListDataListenerIntervalAdded(i, i);
- except ValueError:
- if (hasattr(o, "cp_Index")):
- i = o.cp_Index
- oldSize = self.getSize()
- while (self.getSize() <= i):
- self.childrenList.append(None)
- self.childrenList[i] = o
- if oldSize > i:
- oldSize = i
- self.fireListDataListenerIntervalAdded(oldSize, i);
- else:
- if (oldO is not None):
- i = self.childrenList.index(oldO)
- self.childrenList[i] = o
- else:
- self.childrenList.append(o)
- self.fireListDataListenerIntervalAdded(self.getSize() - 1, self.getSize() - 1);
-
-
- def writeConfiguration(self, configView, param):
- names = self.childrenMap.keys()
- #first I remove all the children from the configuration.
- children = configView.ElementNames
- if children:
- for i in children:
- try:
- Configuration.removeNode(configView, i)
- except Exception:
- traceback.print_exc()
-
- # and add them new.
- for i in names:
- try:
- child = self.getElement(i)
- childView = Configuration.addConfigNode(configView, i)
- child.writeConfiguration(childView, param)
- except Exception:
- traceback.print_exc()
-
- def readConfiguration(self, configurationView, param):
- names = configurationView.ElementNames
- if names:
- for i in names:
- try:
- child = self.childClass()
- child.setRoot(self.root)
- child.readConfiguration(
- configurationView.getByName(i), param)
- self.add(i, child)
- except Exception:
- traceback.print_exc()
- #remove any nulls from the list
- if self.noNulls:
- i = 0
- while i < len(self.childrenList):
- if self.childrenList[i] is None:
- del self.childrenList[i]
- i -= 1
- i += 1
-
- def remove1(self, obj):
- key = self.getKey(obj)
- del self.childrenMap[key]
- i = self.childrenList.index(obj)
- self.childrenList.remove(obj)
- self.fireListDataListenerIntervalRemoved(i, i)
-
- def remove(self, i):
- o = self.getElementAt(i)
- self.remove1(o)
-
- def clear(self):
- self.childrenMap.clear()
- del self.childrenList[:]
-
- def update(self, i):
- self.fireListDataListenerContentsChanged(i, i)
-
- def createDOM(self, parent):
- items = self.childrenList
- i = 0
- while i < len(items):
- item = items[i]
- if hasattr(item, "createDOM"):
- item.createDOM(parent)
- i += 1
- return parent
-
- def getKey(self, _object):
- for k,v in self.childrenMap.items():
- if v is _object:
- return k
- return None
-
- def getElementAt(self, i):
- return self.childrenList[i]
-
- def getElement(self, o):
- try:
- return self.childrenMap[o]
- except KeyError:
- return None
-
- def getSize(self):
- return len(self.childrenList)
-
- def getIndexOf(self, item):
- return self.childrenList.index(item)
-
- '''
- Set members might include a property
- which orders them.
- This method reindexes the given member to be
- the index number 0
- Do not forget to call commit() after calling this method.
- @param confView
- @param memebrName
- '''
-
- def reindexSet(self, confView, memberName, indexPropertyName):
- '''
- First I read all memebrs of the set,
- except the one that should be number 0
- to a vector, ordered by there index property
- '''
- names = Configuration.getChildrenNames(confView)
- v = []
- member = None
- index = 0
- i = 0
- while i < len(names):
- if not names[i] == memberName:
- member = Configuration.getNode(names[i], confView)
- index = Configuration.getInt(indexPropertyName, member)
- while index >= v.size():
- v.append(None)
- v[index] = member
- '''
- Now I reindex them
- '''
- i += 1
- index = 1
- i = 0
- while i < len(v):
- member = v[i]
- if member != None:
- Configuration.set((index + 1), indexPropertyName, member)
- i += 1
-
- def sort(self, comparator):
- self.childrenList.sort(comparator)
-
-
- # Registers ListDataListener to receive events.
- # @param listener The listener to register.
- def addListDataListener(self, listener):
- if (self.listenerList is None):
- self.listenerList = EventListenerList()
- self.listenerList.add(listener)
-
- # Removes ListDataListener from the list of listeners.
- # @param listener The listener to remove.
- def removeListDataListener(self, listener):
- self.listenerList.remove(listener)
-
- # Notifies all registered listeners about the event.
- #
- # @param event The event to be fired
- def fireListDataListenerIntervalAdded(self, i0, i1):
- event = ListDataEvent(self, ListDataEvent.INTERVAL_ADDED, i0, i1)
- if (self.listenerList is None):
- return
- for listener in self.listenerList.getListenerList():
- if isinstance(listener, ListDataListener):
- listener.intervalAdded(event)
-
- # Notifies all registered listeners about the event.
- #
- # @param event The event to be fired
- def fireListDataListenerIntervalRemoved(self, i0, i1):
- event = ListDataEvent(self, ListDataEvent.INTERVAL_REMOVED, i0, i1)
- if (self.listenerList is None):
- return
- for listener in self.listenerList.getListenerList():
- if isinstance(listener, ListDataListener):
- listener.intervalRemoved(event)
-
- # Notifies all registered listeners about the event.
- #
- # @param event The event to be fired
- def fireListDataListenerContentsChanged(self, i0, i1):
- event = ListDataEvent(self, ListDataEvent.CONTENTS_CHANGED, i0, i1)
- if (self.listenerList is None):
- return
- for listener in self.listenerList.getListenerList():
- if isinstance(listener, ListDataListener):
- listener.contentsChanged(event)
diff --git a/wizards/com/sun/star/wizards/web/WebWizardConst.py b/wizards/com/sun/star/wizards/web/WebWizardConst.py
deleted file mode 100644
index 363ecd80d05a..000000000000
--- a/wizards/com/sun/star/wizards/web/WebWizardConst.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-LSTLOADSETTINGS_ITEM_CHANGED = "sessionSelected" # "lstLoadSettingsItemChanged"
-LSTLOADSETTINGS_ITEM_CHANGED = "sessionSelected" # "lstLoadSettingsItemChanged"
-BTNLOADSESSION_ACTION_PERFORMED = "loadSession" # "btnLoadSessionActionPerformed"
-BTNDELSESSION_ACTION_PERFORMED = "delSession" # "btnDelSessionActionPerformed"
-BTNADDDOC_ACTION_PERFORMED = "addDocument" # "btnAddDocActionPerformed"
-BTNREMOVEDOC_ACTION_PERFORMED = "removeDocument" # "btnRemoveDocActionPerformed"
-BTNDOCUP_ACTION_PERFORMED = "docUp" # "btnDocUpActionPerformed"
-BTNDOCDOWN_ACTION_PERFORMED = "docDown" # "btnDocDownActionPerformed"
-LSTSTYLES_ITEM_CHANGED = "refreshStylePreview" # "lstStylesItemChanged"
-BTNBACKGROUNDS_ACTION_PERFORMED = "chooseBackground" # "btnBackgroundsActionPerformed"
-BTNICONSETS_ACTION_PERFORMED = "chooseIconset" # "btnIconSetsActionPerformed"
-BTNFAVICON_ACTION_PERFORMED = "chooseFavIcon" # "btnFavIconActionPerformed"
-BTNPREVIEW_ACTION_PERFORMED = "documentPreview" # "btnPreviewActionPerformed"
-BTNFTP_ACTION_PERFORMED = "setFTPPublish" # "btnFTPActionPerformed"
-CHKLOCALDIR_ITEM_CHANGED = "chkLocalDirItemChanged" # "chkLocalDirItemChanged"
-CHKZIP_ITEM_CHANGED = "chkZipItemChanged"
-CHKSAVESETTINGS_ITEM_CHANGED = "checkPublish" # "chkSaveSettingsItemChanged"
-TXTSAVESETTINGS_TEXT_CHANGED = "checkPublish" # "txtSaveSettingsTextChanged"
-BTNLOCALDIR_ACTION_PERFORMED = "setPublishLocalDir" # "btnLocalDirActionPerformed"
-BTNZIP_ACTION_PERFORMED = "setZipFilename" # "btnZipActionPerformed"
-CONFIG_PATH = "/org.openoffice.Office.WebWizard/WebWizard"
-CONFIG_READ_PARAM = "cp_"
-TASK = "WWIZ"
-TASK_PREPARE = "t-prep"
-LOCAL_PUBLISHER = "local"
-FTP_PUBLISHER = "ftp"
-ZIP_PUBLISHER = "zip"
-TASK_EXPORT = "t_exp"
-TASK_EXPORT_PREPARE = "t_exp_prep"
-TASK_EXPORT_DOCUMENTS = "t_exp_docs"
-TASK_GENERATE_PREPARE = "t_gen_prep"
-TASK_GENERATE_XSL = "t_gen_x"
-TASK_GENERATE_COPY = "t_gen_cp"
-TASK_PUBLISH_PREPARE = "t_pub_prep"
-TASK_FINISH = "t_fin"
-
-'''
-when the user adds more than this number
-of documents to the list, a status dialog opens.
-'''
-MIN_ADD_FILES_FOR_DIALOG = 1
diff --git a/wizards/com/sun/star/wizards/web/WebWizardDialog.py b/wizards/com/sun/star/wizards/web/WebWizardDialog.py
deleted file mode 100644
index 4921c328ea4e..000000000000
--- a/wizards/com/sun/star/wizards/web/WebWizardDialog.py
+++ /dev/null
@@ -1,712 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ..ui.WizardDialog import WizardDialog, uno, PropertyNames
-from .WebWizardDialogResources import WebWizardDialogResources
-from .WebWizardConst import *
-from .WWHID import *
-from ..ui.ControlScroller import HelpIds
-from ..ui.ImageList import ImageList
-from com.sun.star.awt import Size
-from com.sun.star.awt.FontUnderline import SINGLE
-from com.sun.star.awt.FontFamily import ROMAN
-from com.sun.star.awt.FontSlant import ITALIC
-from com.sun.star.awt.ImageAlign import LEFT
-
-class WebWizardDialog(WizardDialog):
- PROPNAMES_LBL = (PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH)
- PROPNAMES_CHKBOX = (PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STATE,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH)
- PROPNAMES_BUTTON = (PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH)
- PROPNAMES_TXT = (PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH)
- PROPNAMES_TXT_2 = (PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y, "ReadOnly",
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH)
- PROPNAMES_TITLE = ("FontDescriptor",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_MULTILINE,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH)
-
- def __init__(self, xmsf):
- super(WebWizardDialog, self).__init__(xmsf, HID0_WEBWIZARD)
-
- #Load Resources
- self.resources = WebWizardDialogResources(xmsf, self.oWizardResource)
-
- #set dialog properties...
- self.setDialogProperties( True, 210, True, 102, 52, 1, 6,
- self.resources.resWebWizardDialog_title, 330)
-
- self.fontDescriptor4 = \
- uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
- self.fontDescriptor5 = \
- uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
- self.fontDescriptor6 = \
- uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
- self.fontDescriptor7 = \
- uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
-
- self.fontDescriptor4.Weight = 150
- self.fontDescriptor5.Name = "Angsana New"
- self.fontDescriptor5.Height = 16
- self.fontDescriptor5.StyleName = "Regular"
- self.fontDescriptor5.Family = ROMAN
- self.fontDescriptor5.Weight = 100
- self.fontDescriptor6.Name = "Andalus"
- self.fontDescriptor6.Height = 22
- self.fontDescriptor6.StyleName = "Bold Italic"
- self.fontDescriptor6.Weight = 150
- self.fontDescriptor6.Slant = ITALIC
- self.fontDescriptor7.Name = "OpenSymbol"
- self.fontDescriptor7.Height = 9
- self.fontDescriptor7.StyleName = "Regular"
- self.fontDescriptor7.Weight = 100
-
- def buildStep1(self):
- tabIndex = 100
- self.insertLabel("lbIntroTitle", WebWizardDialog.PROPNAMES_TITLE,
- (self.fontDescriptor4, 16, self.resources.reslbIntroTitle_value,
- True, "lbIntroTitle", 91, 8, 1, tabIndex + 1, 232))
- self.insertLabel("lblIntroduction",
- (PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_MULTILINE,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (119, self.resources.reslblIntroduction_value, True,
- "lblIntroduction", 97, 28, 1, tabIndex + 1, 226))
- self.insertFixedLine("lnLoadSettings", WebWizardDialog.PROPNAMES_TXT,
- (2, "", "lnLoadSettings", 91, 147, 1, tabIndex + 1, 234))
- self.lblLoadSettings = self.insertLabel("lblLoadSettings",
- (PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_MULTILINE,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (8, self.resources.reslblLoadSettings_value, True,
- "lblLoadSettings", 97, 153, 1, tabIndex + 1, 226))
- self.lstLoadSettings = self.insertListBox(
- "lstLoadSettings", None, LSTLOADSETTINGS_ITEM_CHANGED,("Dropdown",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL, "LineCount",
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (True, 12, HelpIds.getHelpIdString(HID1_LST_SESSIONS), 14,
- "lstLoadSettings", 97, 165, 1, tabIndex + 1, 173), self)
- self.btnDelSession = self.insertButton(
- "btnDelSession", BTNDELSESSION_ACTION_PERFORMED,
- (PropertyNames.PROPERTY_ENABLED,
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL, "ImageAlign",
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (False, 14, HelpIds.getHelpIdString(HID1_BTN_DEL_SES), LEFT,
- self.resources.resbtnDelSession_value, "btnDelSession",
- 274, 164, 1, tabIndex + 1, 50), self)
-
- def buildStep2(self):
- tabIndex = 200
- self.lblContentTitle = self.insertLabel(
- "lblContentTitle", WebWizardDialog.PROPNAMES_TITLE,
- (self.fontDescriptor4, 16, self.resources.reslblContentTitle_value,
- True, "lblContentTitle", 91, 8, 2, tabIndex + 1, 232))
- self.lblSiteContent = self.insertLabel(
- "lblSiteContent", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblSiteContent_value,
- "lblSiteContent", 97, 28, 2, tabIndex + 1, 105))
- self.lstDocuments = self.insertListBox(
- "lstDocuments", None, None,
- (PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL,
- "LineCount",
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (123, HelpIds.getHelpIdString(HID2_LST_DOCS),
- 9, "lstDocuments", 97, 38, 2, tabIndex + 1, 103), self)
- self.btnAddDoc = self.insertButton(
- "btnAddDoc", BTNADDDOC_ACTION_PERFORMED,
- WebWizardDialog.PROPNAMES_BUTTON,
- (14, HelpIds.getHelpIdString(HID2_BTN_ADD_DOC),
- self.resources.resbtnAddDoc_value, "btnAddDoc", 97, 165, 2,
- tabIndex + 1, 50), self)
- self.btnRemoveDoc = self.insertButton(
- "btnRemoveDoc", BTNREMOVEDOC_ACTION_PERFORMED,
- WebWizardDialog.PROPNAMES_BUTTON,
- (14, HelpIds.getHelpIdString(HID2_BTN_REM_DOC),
- self.resources.resbtnRemoveDoc_value, "btnRemoveDoc", 150, 165,
- 2, tabIndex + 1, 50), self)
- self.btnDocUp = self.insertButton(
- "btnDocUp", BTNDOCUP_ACTION_PERFORMED,
- ("FontDescriptor",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (self.fontDescriptor7, 14, HelpIds.getHelpIdString(HID2_BTN_DOC_UP),
- self.resources.resbtnDocUp_value, "btnDocUp",
- 205, 87, 2, tabIndex + 1, 18), self)
- self.btnDocDown = self.insertButton(
- "btnDocDown", BTNDOCDOWN_ACTION_PERFORMED,(
- "FontDescriptor",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (self.fontDescriptor7, 14, HelpIds.getHelpIdString(HID2_BTN_DOC_DOWN),
- self.resources.resbtnDocDown_value, "btnDocDown", 205,
- 105, 2, tabIndex + 1, 18), self)
- self.lblDocExportFormat = self.insertLabel(
- "lblDocExportFormat", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblDocExportFormat_value,
- "lblDocExportFormat", 235, 28, 2, tabIndex + 1, 89))
- self.lstDocTargetType = self.insertListBox("lstDocTargetType", None, None,
- ("Dropdown",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL, "LineCount",
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (True, 12, HelpIds.getHelpIdString(HID2_LST_DOC_EXPORT), 14,
- "lstDocTargetType", 235, 38, 2, tabIndex + 1, 89), self)
- self.lnDocsInfo = self.insertFixedLine(
- "lnDocsInfo", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslnDocsInfo_value, "lnDocsInfo",
- 235, 66, 2, tabIndex + 1, 90))
- self.lblDocTitle = self.insertLabel(
- "lblDocTitle", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblDocTitle_value, "lblDocTitle",
- 235, 78, 2, tabIndex + 1, 89))
- self.txtDocTitle = self.insertTextField(
- "txtDocTitle", None, WebWizardDialog.PROPNAMES_TXT,
- (12, HelpIds.getHelpIdString(HID2_TXT_DOC_TITLE), "txtDocTitle",
- 235, 88, 2, tabIndex + 1, 89), self)
- self.lblDocInfo = self.insertLabel(
- "lblDocInfo", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblDocInfo_value, "lblDocInfo",
- 235, 103, 2, tabIndex + 1, 89))
- self.txtDocInfo = self.insertTextField(
- "txtDocInfo", None,(PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL,
- PropertyNames.PROPERTY_MULTILINE,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (40, HelpIds.getHelpIdString(HID2_TXT_DOC_DESC), True,
- "txtDocInfo", 235, 113, 2, tabIndex + 1, 89), self)
- self.lblDocAuthor = self.insertLabel(
- "lblDocAuthor", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblDocAuthor_value, "lblDocAuthor",
- 235, 155, 2, tabIndex + 1, 89))
- self.txtDocAuthor = self.insertTextField(
- "txtDocAuthor", None, WebWizardDialog.PROPNAMES_TXT,
- (12, HelpIds.getHelpIdString(HID2_TXT_DOC_AUTHOR),
- "txtDocAuthor", 235, 165, 2, tabIndex + 1, 89), self)
-
- def buildStep3(self):
- self.insertLabel("lblLayoutTitle", WebWizardDialog.PROPNAMES_TITLE,
- (self.fontDescriptor4, 16, self.resources.reslblLayoutTitle_value,
- True, "lblLayoutTitle", 91, 8, 3, 29, 232))
- self.lblLayouts = self.insertLabel("lblLayouts",
- WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblLayouts_value, "lblLayouts",
- 97, 28, 3, 30, 206))
-
- def buildStep4(self):
- self.insertLabel("lblLayout2Title", WebWizardDialog.PROPNAMES_TITLE,
- (self.fontDescriptor4, 16, self.resources.reslblLayout2Title_value,
- True, "lblLayout2Title", 91, 8, 4, 33, 232))
- self.lnDisplay = self.insertLabel("lblDisplay",
- (PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_MULTILINE,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (16, self.resources.reslblDisplay_value, True,
- "lblDisplay", 97, 28, 4, 34, 226))
- self.chkDocFilename = self.insertCheckBox("chkDocFilename", None,
- WebWizardDialog.PROPNAMES_CHKBOX,
- (8, HelpIds.getHelpIdString(HID4_CHK_DISPLAY_FILENAME),
- self.resources.reschkDocFilename_value, "chkDocFilename",
- 103, 50, 0, 4, 35, 99), self)
- self.chbDocDesc = self.insertCheckBox(
- "chbDocDesc", None, WebWizardDialog.PROPNAMES_CHKBOX,
- (8, HelpIds.getHelpIdString(HID4_CHK_DISPLAY_DESCRIPTION),
- self.resources.reschbDocDesc_value, "chbDocDesc",
- 103, 60, 0, 4, 36, 99), self)
- self.chbDocAuthor = self.insertCheckBox(
- "chbDocAuthor", None, WebWizardDialog.PROPNAMES_CHKBOX,
- (8, HelpIds.getHelpIdString(HID4_CHK_DISPLAY_AUTHOR),
- self.resources.reschbDocAuthor_value, "chbDocAuthor",
- 103, 70, 0, 4, 37, 99), self)
- self.chkDocCreated = self.insertCheckBox(
- "chkDocCreated", None, WebWizardDialog.PROPNAMES_CHKBOX,
- (8, HelpIds.getHelpIdString(HID4_CHK_DISPLAY_CR_DATE),
- self.resources.reschkDocCreated_value, "chkDocCreated",
- 103, 80, 0, 4, 38, 99), self)
- self.chkDocChanged = self.insertCheckBox(
- "chkDocChanged", None, WebWizardDialog.PROPNAMES_CHKBOX,
- (8, HelpIds.getHelpIdString(HID4_CHK_DISPLAY_UP_DATE),
- self.resources.reschkDocChanged_value, "chkDocChanged",
- 103, 90, 0, 4, 39, 99), self)
- self.chkDocFormat = self.insertCheckBox(
- "chkDocFormat", None, WebWizardDialog.PROPNAMES_CHKBOX,
- (8, HelpIds.getHelpIdString(HID4_CHK_DISPLAY_FORMAT),
- self.resources.reschkDocFormat_value, "chkDocFormat",
- 200, 50, 0, 4, 40, 110), self)
- self.chkDocFormatIcon = self.insertCheckBox(
- "chkDocFormatIcon", None, WebWizardDialog.PROPNAMES_CHKBOX,
- (8, HelpIds.getHelpIdString(HID4_CHK_DISPLAY_F_ICON),
- self.resources.reschkDocFormatIcon_value, "chkDocFormatIcon",
- 200, 60, 0, 4, 41, 110), self)
- self.chkDocPages = self.insertCheckBox(
- "chkDocPages", None, WebWizardDialog.PROPNAMES_CHKBOX,
- (8, HelpIds.getHelpIdString(HID4_CHK_DISPLAY_PAGES),
- self.resources.reschkDocPages_value, "chkDocPages",
- 200,70, 0, 4, 42, 110), self)
- self.chkDocSize = self.insertCheckBox(
- "chkDocSize", None, WebWizardDialog.PROPNAMES_CHKBOX,
- (8, HelpIds.getHelpIdString(HID4_CHK_DISPLAY_SIZE),
- self.resources.reschkDocSize_value, "chkDocSize",
- 200, 80, 0, 4, 43, 110), self)
- self.insertLabel("lblOptimizeFor", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblOptimizeFor_value, "lblOptimizeFor",
- 97, 113, 4, 44, 226))
- self.optOptimize640x480 = self.insertRadioButton(
- "optOptimize640x480", None, WebWizardDialog.PROPNAMES_BUTTON,
- (10, HelpIds.getHelpIdString(HID4_GRP_OPTIMAIZE_640),
- self.resources.resoptOptimize640x480_value,
- "optOptimize640x480", 103, 133, 4, 45, 44), self)
- self.optOptimize800x600 = self.insertRadioButton(
- "optOptimize800x600", None, WebWizardDialog.PROPNAMES_BUTTON,
- (10, HelpIds.getHelpIdString(HID4_GRP_OPTIMAIZE_800),
- self.resources.resoptOptimize800x600_value,
- "optOptimize800x600", 103, 146, 4, 46, 44), self)
- self.optOptimize1024x768 = self.insertRadioButton(
- "optOptimize1024x768", None, WebWizardDialog.PROPNAMES_BUTTON,
- (10, HelpIds.getHelpIdString(HID4_GRP_OPTIMAIZE_1024),
- self.resources.resoptOptimize1024x768_value,
- "optOptimize1024x768", 103, 158, 4, 47, 44), self)
-
- def buildStep5(self):
- self.lblStyleTitle = self.insertLabel(
- "lblStyleTitle", WebWizardDialog.PROPNAMES_TITLE,
- (self.fontDescriptor4, 16, self.resources.reslblStyleTitle_value,
- True, "lblStyleTitle", 91, 8, 5, 50, 232))
- self.lblStyle = self.insertLabel(
- "lblStyle", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblStyle_value,
- "lblStyle", 97, 28, 5, 51, 80))
- self.lstStyles = self.insertListBox(
- "lstStyles", None, LSTSTYLES_ITEM_CHANGED,(
- "Dropdown",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL, "LineCount",
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (True, 12, HelpIds.getHelpIdString(HID5_LST_STYLES),
- 14, "lstStyles", 179, 26, 5, 52, 145), self)
- self.insertLabel("lblBackground", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblBackground, "lblBackground",
- 97, 46, 5, 51, 70))
- self.txtBackground = self.insertLabel("txtBackground",
- ("Border",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (1, 12, self.resources.resBackgroundNone,
- "txtBackground", 179, 44, 5, 52, 90))
- self.btnBackgrounds = self.insertButton(
- "btnBackgrounds", BTNBACKGROUNDS_ACTION_PERFORMED,
- WebWizardDialog.PROPNAMES_BUTTON,
- (14, HelpIds.getHelpIdString(HID5_BTN_BACKGND),
- self.resources.resBtnChooseBackground, "btnBackgrounds",
- 274, 43, 5, 53, 50), self)
- self.insertLabel("lblIconset", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblIconset, "lblIconset", 97, 64, 5, 51, 70))
- self.txtIconset = self.insertLabel("txtIconset",
- ("Border",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (1, 12, self.resources.resIconsetNone, "txtIconset",
- 179, 62, 5, 52, 90))
- self.btnIconSets = self.insertButton(
- "btnIconSets", BTNICONSETS_ACTION_PERFORMED,
- WebWizardDialog.PROPNAMES_BUTTON,
- (14, HelpIds.getHelpIdString(HID5_BTN_ICONS),
- self.resources.resBtnChooseIconset, "btnIconSets",
- 274, 61, 5, 54, 50), self)
- self.insertLabel("lblIconsetInfo",
- (PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_MULTILINE,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (16, self.resources.reslblIconSetInfo, True, "lblIconsetInfo",
- 179, 78, 5, 51, 145))
- self.imgPreview = self.insertImage("imgPreview",
- ("BackgroundColor",
- PropertyNames.PROPERTY_ENABLED,
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_IMAGEURL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y, "ScaleImage",
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (0, False, 78, "", "imgPreview", 91, 100, False, 5, 55, 232))
-
- def buildStep6(self):
- tabIndex = 60
- self.insertLabel("lblTitleGeneralPage",
- WebWizardDialog.PROPNAMES_TITLE,
- (self.fontDescriptor4, 8,
- self.resources.reslblTitleGeneralPage_value, True,
- "lblTitleGeneralPage", 90, 9, 6, tabIndex + 1, 232))
- self.insertLabel("lblSiteTitle", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblSiteTitle_value, "lblSiteTitle",
- 97, 28, 6, tabIndex + 1, 80))
- self.txtSiteTitle = self.insertTextField(
- "txtSiteTitle", None, WebWizardDialog.PROPNAMES_TXT,
- (12, HelpIds.getHelpIdString(HID6_TXT_SITE_TITLE),
- "txtSiteTitle", 179, 26, 6, tabIndex + 1, 145), self)
- self.insertFixedLine(
- "FixedLineMetaData", WebWizardDialog.PROPNAMES_LBL,
- (9, self.resources.reslblMetaData, "FixedLineMetaData",
- 97, 56, 6, tabIndex + 1, 228))
- self.insertLabel("lblSiteDesc", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblSiteDesc_value, "lblSiteDesc",
- 103, 72, 6, tabIndex + 1, 80))
- self.txtSiteDesc = self.insertTextField(
- "txtSiteDesc", None, WebWizardDialog.PROPNAMES_TXT,
- (12, HelpIds.getHelpIdString(HID6_TXT_SITE_DESC), "txtSiteDesc",
- 179, 70, 6, tabIndex + 1, 145), self)
- self.insertLabel(
- "lblEmail", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblEmail_value, "lblEmail",
- 103, 90, 6, tabIndex + 1, 80))
- self.txtEmail = self.insertTextField(
- "txtEmail", None, WebWizardDialog.PROPNAMES_TXT,
- (12, HelpIds.getHelpIdString(HID6_TXT_SITE_EMAIL), "txtEmail",
- 179, 87, 6, tabIndex + 1, 145), self)
- self.insertLabel("lblCopyright", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblCopyright_value, "lblCopyright",
- 103, 108, 6, tabIndex + 1, 80))
- self.txtCopyright = self.insertTextField(
- "txtCopyright", None, WebWizardDialog.PROPNAMES_TXT,
- (12, HelpIds.getHelpIdString(HID6_TXT_SITE_COPYRIGHT),
- "txtCopyright", 179, 106, 6, tabIndex + 1, 145), self)
- self.insertLabel("lblSiteCreated", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblSiteCreated_value, "lblSiteCreated",
- 103, 126, 6, tabIndex + 1, 80))
- self.dateSiteCreated = self.insertDateField("dateSiteCreated", None,
- ("Dropdown",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (True, 12, HelpIds.getHelpIdString(HID6_DATE_SITE_CREATED),
- "dateSiteCreated", 179, 124, 6, tabIndex + 1, 60), self)
- self.insertLabel("lblSiteUpdated", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblSiteUpdated_value, "lblSiteUpdated",
- 103, 144, 6, tabIndex + 1, 80))
- self.dateSiteUpdate = self.insertDateField("dateSiteUpdate", None,
- ("Dropdown",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (True, 12, HelpIds.getHelpIdString(HID6_DATE_SITE_UPDATED),
- "dateSiteUpdate", 179, 142, 6, tabIndex + 1, 60), self)
-
- def buildStep7(self, disableFTP, exclamationURL):
- tabIndex = 700
- self.lblTitlePublish = self.insertLabel(
- "lblTitlePublish", WebWizardDialog.PROPNAMES_TITLE,
- (self.fontDescriptor4, 16, self.resources.reslblTitlePublish_value,
- True, "lblTitlePublish", 91, 8, 7, tabIndex + 1, 232))
- self.FixedLine1 = self.insertFixedLine(
- "FixedLine1", WebWizardDialog.PROPNAMES_LBL,
- (9, self.resources.resFixedLine1_value, "FixedLine1",
- 97, 28, 7, tabIndex + 1, 228))
- self.btnPreview = self.insertButton(
- "btnPreview", BTNPREVIEW_ACTION_PERFORMED,
- WebWizardDialog.PROPNAMES_BUTTON,
- (14, HelpIds.getHelpIdString(HID7_BTN_PREVIEW),
- self.resources.resbtnPreview_value, "btnPreview",
- 103, 40, 7, tabIndex + 1, 50), self)
- self.insertFixedLine(
- "lblCreateSite", WebWizardDialog.PROPNAMES_LBL,
- (9, self.resources.reslblCreateSite_value, "lblCreateSite",
- 97, 56, 7, tabIndex + 1, 228))
- self.chkLocalDir = self.insertCheckBox(
- "chkLocalDir", CHKLOCALDIR_ITEM_CHANGED,
- WebWizardDialog.PROPNAMES_CHKBOX,
- (8, HelpIds.getHelpIdString(HID7_CHK_PUBLISH_LOCAL),
- self.resources.reschkLocalDir_value, "chkLocalDir",
- 103, 68, 0, 7, tabIndex + 1, 215), self)
- self.txtLocalDir = self.insertTextField(
- "txtLocalDir", None, WebWizardDialog.PROPNAMES_TXT,
- (12, HelpIds.getHelpIdString(HID7_TXT_LOCAL), "txtLocalDir",
- 113, 78, 7, tabIndex + 1, 190), self)
- self.btnLocalDir = self.insertButton(
- "btnLocalDir", BTNLOCALDIR_ACTION_PERFORMED,
- WebWizardDialog.PROPNAMES_BUTTON,
- (14, HelpIds.getHelpIdString(HID7_BTN_LOCAL),
- self.resources.resbtnLocalDir_value, "btnLocalDir",
- 308, 77, 7, tabIndex + 1, 16), self)
- self.chkZip = self.insertCheckBox(
- "chkZip", CHKZIP_ITEM_CHANGED,
- WebWizardDialog.PROPNAMES_CHKBOX,
- (9, HelpIds.getHelpIdString(HID7_CHK_PUBLISH_ZIP),
- self.resources.reschkZip_value, "chkZip", 103, 96, 0, 7,
- tabIndex + 1, 215), self)
- self.txtZip = self.insertTextField(
- "txtZip", None, WebWizardDialog.PROPNAMES_TXT,
- (12, HelpIds.getHelpIdString(HID7_TXT_ZIP), "txtZip",
- 113, 108, 7, tabIndex + 1, 190), self)
- self.btnZip = self.insertButton(
- "btnZip", BTNZIP_ACTION_PERFORMED,
- WebWizardDialog.PROPNAMES_BUTTON,
- (14, HelpIds.getHelpIdString(HID7_BTN_ZIP),
- self.resources.resbtnZip_value, "btnZip", 308, 107, 7,
- tabIndex + 1, 16), self)
- self.chkFTP = self.insertCheckBox(
- "chkFTP", None, WebWizardDialog.PROPNAMES_CHKBOX,
- (8, HelpIds.getHelpIdString(HID7_CHK_PUBLISH_FTP),
- self.resources.reschkFTP_value, "chkFTP", 103, 124, 0, 7,
- tabIndex + 1, 215), self)
- if disableFTP:
- FTP_STEP = 99
- else:
- FTP_STEP = 7
-
- self.lblFTP = self.insertLabel(
- "lblFTP", ("Border",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (1, 12, "txtFTP", 113, 134, FTP_STEP, tabIndex + 1, 156))
- self.btnFTP = self.insertButton(
- "btnFTP", BTNFTP_ACTION_PERFORMED,
- WebWizardDialog.PROPNAMES_BUTTON,
- (14, HelpIds.getHelpIdString(HID7_BTN_FTP),
- self.resources.resbtnFTP_value, "btnFTP", 274, 133,
- FTP_STEP, tabIndex + 1, 50), self)
- if disableFTP:
- self.insertImage(
- "imgFTPDisabled",("BackgroundColor", "Border",
- PropertyNames.PROPERTY_ENABLED,
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_IMAGEURL,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y, "ScaleImage",
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (-1, 0, False, 10, exclamationURL, "imgFTPDisabled", 115,
- 135, False, 7, tabIndex + 1, 8))
- self.insertLabel(
- "lblFTPDisabled",("BackgroundColor",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_LABEL,
- PropertyNames.PROPERTY_MULTILINE,
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (-1, 8, self.resources.reslblFTPDisabled, True,
- "lblFTPDisabled", 125, 136, 7, tabIndex + 1, 226))
-
- self.insertFixedLine(
- "lnSaveSetting", WebWizardDialog.PROPNAMES_TXT,
- (2, "", "lnSaveSetting", 97, 151, 7, tabIndex + 1, 228))
- self.chkSaveSettings = self.insertCheckBox(
- "chkSaveSettings", CHKSAVESETTINGS_ITEM_CHANGED,
- WebWizardDialog.PROPNAMES_CHKBOX,
- (9, HelpIds.getHelpIdString(HID7_CHK_SAVE),
- self.resources.reschkSaveSettings_value, "chkSaveSettings",
- 97, 157, 1, 7, tabIndex + 1, 215), self)
- self.insertLabel(
- "lblSaveSettings", WebWizardDialog.PROPNAMES_LBL,
- (8, self.resources.reslblSaveSettings_value, "lblSaveSettings",
- 107, 169, 7, tabIndex + 1, 45))
- self.cbSaveSettings = self.insertComboBox(
- "txtSaveSettings", TXTSAVESETTINGS_TEXT_CHANGED,
- TXTSAVESETTINGS_TEXT_CHANGED, TXTSAVESETTINGS_TEXT_CHANGED,
- ("Autocomplete", "Dropdown",
- PropertyNames.PROPERTY_HEIGHT,
- PropertyNames.PROPERTY_HELPURL, "LineCount",
- PropertyNames.PROPERTY_NAME,
- PropertyNames.PROPERTY_POSITION_X,
- PropertyNames.PROPERTY_POSITION_Y,
- PropertyNames.PROPERTY_STEP,
- PropertyNames.PROPERTY_TABINDEX,
- PropertyNames.PROPERTY_WIDTH),
- (True, True, 12, HelpIds.getHelpIdString(HID7_TXT_SAVE),
- 14, "txtSaveSettings", 179, 167, 7, tabIndex + 1, 145), self)
-
- '''
- builds the layouts image list.
- '''
-
- def buildStepX(self):
- self.ilLayouts = ImageList()
- self.ilLayouts.pos = Size (97, 38)
- self.ilLayouts.imageSize = Size (34, 30)
- self.ilLayouts.cols = 5
- self.ilLayouts.rows = 3
- self.ilLayouts.step = 3
- self.ilLayouts.showButtons = False
- self.ilLayouts.renderer = self.LayoutRenderer()
- self.ilLayouts.scaleImages = False
- self.ilLayouts.tabIndex = 31
- self.ilLayouts.helpURL = HID3_IL_LAYOUTS_IMG1
-
-
- '''
- renders the images and titles of
- the layouts
- @author rpiterman
- '''
-
- class LayoutRenderer:
-
- def getImageUrl(self, listItem):
- oResId = None
- if listItem is not None:
- oResId = listItem.getImageUrl()
- return oResId
-
- def render(self, listItem):
- return "" if (listItem is None) else listItem.cp_Name
diff --git a/wizards/com/sun/star/wizards/web/WebWizardDialogResources.py b/wizards/com/sun/star/wizards/web/WebWizardDialogResources.py
deleted file mode 100644
index 3465dd69413d..000000000000
--- a/wizards/com/sun/star/wizards/web/WebWizardDialogResources.py
+++ /dev/null
@@ -1,308 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-import traceback
-from ..common.Configuration import Configuration
-from ..common.Properties import Properties
-from ..document.OfficeDocument import OfficeDocument
-
-class WebWizardDialogResources(object):
-
- RID_WEBWIZARDDIALOG_START = 4000
- RID_COMMON_START = 500
- RID_DB_COMMON_START = 1000
- RID_WEBWIZARDROADMAP_START = 4121
-
- def __init__(self, xmsf, oWizardResource):
- try:
- #python 3
- self.resbtnDocUp_value = chr(8743)
- self.resbtnDocDown_value = chr(8744)
- except ValueError:
- #python 2
- self.resbtnDocUp_value = unichr(8743)
- self.resbtnDocDown_value = unichr(8744)
-
- self.resWebWizardDialog_title = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 1)
- self.reslblIntroduction_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 2)
- self.resbtnDelSession_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 4)
- self.reslbIntroTitle_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 5)
- self.reslblContentTitle_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 6)
- self.reslnDocsInfo_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 8)
- self.reslblDocTitle_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 9)
- self.reslblDocInfo_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 10)
- self.reslblDocAuthor_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 11)
- self.reslblDocExportFormat_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 12)
- self.reslblTitleGeneralPage_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 13)
- self.reslblSiteTitle_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 14)
- self.reslblSiteDesc_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 16)
- self.reslblSiteCreated_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 18)
- self.reslblEmail_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 20)
- self.reslblCopyright_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 21)
- self.reslblSiteUpdated_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 22)
- self.resbtnPreview_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 24)
- self.reslblTitlePublish_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 25)
- self.reslblCreateSite_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 26)
- self.reschkLocalDir_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 27)
- self.resbtnLocalDir_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 28)
- self.reschkFTP_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 29)
-
- self.resbtnFTP_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 31)
- self.reschkZip_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 32)
- self.resbtnZip_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 33)
- self.reschkSaveSettings_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 34)
- self.reslblSaveSettings_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 35)
- self.reslblLoadSettings_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 36)
- self.reslblSiteContent_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 37)
- self.resbtnAddDoc_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 38)
- self.resbtnRemoveDoc_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 39)
- self.reslblLayoutTitle_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 40)
- self.reslblStyleTitle_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 41)
- self.reslblStyle_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 42)
-
- self.reslblLayouts_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 48)
-
- self.reschbDocDesc_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 50)
- self.reschbDocAuthor_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 51)
- self.reschkDocCreated_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 52)
- self.reschkDocChanged_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 53)
- self.reschkDocFilename_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 54)
- self.reschkDocFormat_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 55)
- self.reschkDocFormatIcon_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 56)
- self.reschkDocPages_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 57)
- self.reschkDocSize_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 58)
- self.resFixedLine1_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 59)
- self.reslblLayout2Title_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 60)
- self.reslblDisplay_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 61)
- self.reslblOptimizeFor_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 62)
- self.resoptOptimize640x480_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 64)
- self.resoptOptimize800x600_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 65)
- self.resoptOptimize1024x768_value = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 66)
-
- self.resStatusDialogTitle = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 70)
- self.resCounter = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 71)
- self.resPublishDir = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 72)
- self.resFTPTargetExistsAsfile = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 73)
- self.resLocalTargetExistsAsfile = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 74)
- self.resZipTargetExists = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 75)
- self.resFTPTargetNotEmpty = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 76)
- self.resLocalTragetNotEmpty = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 77)
- self.resSessionExists = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 78)
- self.resTaskExportDocs = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 79)
- self.resTaskExportPrepare = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 80)
- self.resTaskGenerateCopy = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 81)
- self.resTaskGeneratePrepare = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 82)
- self.resTaskGenerateXsl = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 83)
- self.resTaskPrepare = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 84)
- self.resTaskPublishPrepare = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 86)
- self.resTaskPublishLocal = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 87)
- self.resTaskPublishFTP = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 88)
- self.resTaskPublishZip = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 89)
- self.resTaskFinish = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 90)
-
- self.resImages = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 94)
- self.resAllFiles = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 95)
- self.resZipFiles = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 96)
- self.resBackgroundsDialog = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 98)
- self.resBackgroundsDialogCaption = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 99)
- self.resIconsDialog = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 100)
- self.resIconsDialogCaption = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 101)
- self.resOther = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 102)
- self.resDeselect = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 103)
- self.resFinishedSuccess = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 104)
- self.resFinishedNoSuccess = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 105)
- self.resErrTOC = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 106)
- self.resErrTOCMedia = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 107)
- self.resErrDocInfo = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 108)
- self.resErrDocExport = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 109)
- self.resErrMkDir = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 110)
- self.resErrSecurity = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 111)
- self.resErrExportIO = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 112)
- self.resErrPublishMedia = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 113)
- self.resErrPublish = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 114)
- self.resErrUnknown = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 115)
- self.resErrDocValidate = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 116)
- self.resErrIsDirectory = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 117)
- self.resLoadingSession = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 118)
- self.resErrUnexpected = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 119)
- self.resValidatingDocuments = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 120)
- self.resDefaultArchiveFilename = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 121)
- self.resDelSessionConfirm = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 130)
- self.resPages = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 131)
- self.resSlides = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 132)
- self.resCreatedTemplate = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 133)
- self.resUpdatedTemplate = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 134)
- self.resSessionName = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 135)
- self.reslblBackground = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 136)
- self.reslblIconset = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 137)
- self.reslblIconSetInfo = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 138)
- self.reslblMetaData = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 139)
- self.resBtnChooseBackground = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 140)
- self.resBtnChooseIconset = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 141)
- self.resSessionNameNone = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 142)
- self.reslblFTPDisabled = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 143)
- self.resBackgroundNone = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 144)
- self.resIconsetNone = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 145)
- self.resFTPTargetCouldNotCreate = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 146)
- self.resFTPTargetCreate = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 147)
- self.resZipTargetIsDir = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 148)
- self.resLocalTargetCouldNotCreate = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 149)
- self.resLocalTargetCreate = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 150)
- self.resSizeTemplate = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 151)
- self.resSpecifyNewFileLocation = oWizardResource.getResText(
- WebWizardDialogResources.RID_WEBWIZARDDIALOG_START + 152)
- self.resClose = oWizardResource.getResText(
- WebWizardDialogResources.RID_COMMON_START + 17)
- self.resCancel = oWizardResource.getResText(
- WebWizardDialogResources.RID_COMMON_START + 11)
- self.resOK = oWizardResource.getResText(
- WebWizardDialogResources.RID_COMMON_START + 18)
- self.resHelp = oWizardResource.getResText(
- WebWizardDialogResources.RID_COMMON_START + 15)
-
-
- self.RoadmapLabels = oWizardResource.getResArray(
- WebWizardDialogResources.RID_WEBWIZARDROADMAP_START + 1 , 7)
-
- try:
- self.prodName = Configuration.getProductName(xmsf)
- self.resGifFiles = Properties.getPropertyValue(
- OfficeDocument.getTypeMediaDescriptor(
- xmsf, "gif_Graphics_Interchange"), "UIName")
- except Exception as ex:
- traceback.print_exc()
diff --git a/wizards/com/sun/star/wizards/web/__init__.py b/wizards/com/sun/star/wizards/web/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/wizards/com/sun/star/wizards/web/__init__.py
+++ /dev/null
diff --git a/wizards/com/sun/star/wizards/web/data/CGArgument.py b/wizards/com/sun/star/wizards/web/data/CGArgument.py
deleted file mode 100644
index 9a66144de647..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGArgument.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ...common.ConfigGroup import ConfigGroup
-
-class CGArgument(ConfigGroup):
-
- def __init__(self):
- self.cp_Value = str()
diff --git a/wizards/com/sun/star/wizards/web/data/CGContent.py b/wizards/com/sun/star/wizards/web/data/CGContent.py
deleted file mode 100644
index 94a668a82ecf..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGContent.py
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ...common.ConfigGroup import ConfigGroup
-from ..WebConfigSet import WebConfigSet
-from ...common.XMLHelper import XMLHelper
-from .CGDocument import CGDocument
-
-class CGContent(ConfigGroup):
-
- def __init__(self):
- self.cp_Index = -1
- self.dirName = str()
- self.cp_Name = str()
- self.cp_Description = str()
- self.cp_Documents = WebConfigSet(CGDocument)
- self.cp_Contents = WebConfigSet(CGContent)
-
- def createDOM(self, parent):
- myElement = XMLHelper.addElement(
- parent, "content",
- ["name", "directory-name", "description", "directory"],
- [self.cp_Name, self.dirName, self.cp_Description, self.dirName])
- self.cp_Documents.createDOM(myElement)
- return myElement
diff --git a/wizards/com/sun/star/wizards/web/data/CGDesign.py b/wizards/com/sun/star/wizards/web/data/CGDesign.py
deleted file mode 100644
index 7e0dff05c998..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGDesign.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ...common.ConfigGroup import ConfigGroup
-
-class CGDesign(ConfigGroup):
-
- def __init__(self):
- self.cp_Layout = str()
- self.cp_Style = str()
- self.cp_BackgroundImage = str()
- self.cp_IconSet = str()
- self.cp_DisplayTitle = bool()
- self.cp_DisplayDescription = bool()
- self.cp_DisplayAuthor = bool()
- self.cp_DisplayCreateDate = bool()
- self.cp_DisplayUpdateDate = bool()
- self.cp_DisplayFilename = bool()
- self.cp_DisplayFileFormat = bool()
- self.cp_DisplayFormatIcon = bool()
- self.cp_DisplayPages = bool()
- self.cp_DisplaySize = bool()
- self.cp_OptimizeDisplaySize = int()
-
- def createDOM(self, parent):
- return XMLHelper.addElement(parent, "design", (0,), (0,))
-
- def getStyle(self):
- style = self.root.cp_Styles.getElement(self.cp_Style)
- return [self.root.cp_Styles.getIndexOf(style)]
-
- def setStyle(self, newStyle):
- o = self.root.cp_Styles.getElementAt(newStyle[0])
- self.cp_Style = self.root.cp_Styles.getKey(o)
-
- def getLayout(self):
- layout = self.root.cp_Layouts.getElement(self.cp_Layout)
- return layout.cp_Index
-
- def setLayout(self, layoutIndex):
- layout = self.root.cp_Layouts.getElementAt(layoutIndex)
- self.cp_Layout = self.root.cp_Layouts.getKey(layout)
diff --git a/wizards/com/sun/star/wizards/web/data/CGDocument.py b/wizards/com/sun/star/wizards/web/data/CGDocument.py
deleted file mode 100644
index 59ec90dc9b6d..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGDocument.py
+++ /dev/null
@@ -1,316 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from os import sep as separator
-from ...common.ConfigGroup import ConfigGroup
-from ...document.OfficeDocument import OfficeDocument
-from ...common.Properties import Properties
-from ...common.PropertyNames import PropertyNames
-from ...common.FileAccess import FileAccess
-from ...common.XMLHelper import XMLHelper
-from ..TypeDetection import *
-from ...common.Desktop import Desktop
-
-from com.sun.star.document.MacroExecMode import NEVER_EXECUTE
-from com.sun.star.document.UpdateDocMode import NO_UPDATE
-
-'''
-About the member fields Title, Description and Author:
-There is an ambiguity in handling these fields.
-On the one hand, the user can set those fields to a custom value,
-relevant only for the web-wizard.
-On the other-hand, the web-wizard can read those fields automatically
-from SO documents.
-In order to avoid conflict by saving, I use two fields: "cp_title", which
-should be read from the configuration (saved session), and "title" which is
-the value read from the document.
-The *cp_title* "overrides" *title*, if exists. if not, *title* is used.
-The same is valid for *description* and *author*.
-@author rpiterman
-'''
-
-class CGDocument(ConfigGroup):
-
- PAGE_TYPE_PAGE = 1
- PAGE_TYPE_SLIDE = 2
-
- def __init__(self, url = "", xmsf = None, task = None):
- self.cp_URL = ""
- self.cp_Exporter = None
- self.cp_Index = -1
- self.cp_Title = ""
- self.cp_Description = ""
- self.cp_Author = ""
- self.localFilename = ""
- self.urlFilename = ""
- self.title = ""
- self.description = ""
- self.author = ""
- self.dirName = ""
- self.createdDate = None
- self.updatedDate = None
- self.sizeBytes = -1
- self.pages = -1
- self.valid = False
- self.appType = ""
- if (xmsf is None):
- return
- self.cp_URL = self.getSettings().getFileAccess(xmsf).getURL(url)
- if (task is None):
- task = Task("", "", 5)
- self.validate(xmsf, task)
-
- def getSettings(self):
- return self.root
-
- '''
- the task will advance 5 times during validate.
- @param xmsf
- @param task
- @throws Exception
- '''
-
- def validate(self, xmsf, task):
- if not self.getSettings().getFileAccess(xmsf).exists(self.cp_URL, False):
- raise FileNotFoundException (
- "The given URL does not point to a file")
-
- if self.getSettings().getFileAccess(xmsf).isDirectory(self.cp_URL):
- raise IllegalArgumentException ("The given URL points to a directory") #create a TypeDetection service
-
- self.mediaDescriptor = OfficeDocument.getFileMediaDecriptor(
- xmsf, self.cp_URL)
- task.advance(True)
- #1
- self.analyzeFileType(self.mediaDescriptor)
- task.advance(True)
- #2
- path = self.getSettings().getFileAccess(xmsf).getPath(self.cp_URL, "")
- self.localFilename = FileAccess.getFilename(path, separator)
- '''
- if the type is a star office convertible document
- We try to open the document to get some properties
- '''
- xProps = None
- task.advance(True)
- #3
- if self.isSOOpenable:
- # for documents which are openable through SO,
- # use DocumentProperties service.
- desktop = Desktop.getDesktop(xmsf)
- props = []
- props.append(Properties.createProperty("Hidden", True))
- props.append(Properties.createProperty(
- "MacroExecutionMode", NEVER_EXECUTE))
- props.append(Properties.createProperty(
- "UpdateDocMode", NO_UPDATE))
- component = desktop.loadComponentFromURL(
- self.cp_URL, "_default", 0, tuple(props))
- xProps = component.DocumentProperties
-
- task.advance(True)
- #4
- #now use the object to read some document properties.
- if xProps is not None:
- self.title = xProps.Title
- self.description = xProps.Description
- self.author = xProps.Author
- self.createdDate = xProps.CreationDate
- self.updatedDate = xProps.ModificationDate
- else:
-
- #get some information from OS.
- self.title = self.localFilename
- self.updatedDate = \
- self.getSettings().getFileAccess(xmsf).getLastModified(self.cp_URL)
-
- task.advance(True)
- #5
- if self.cp_Title == "":
- self.cp_Title = self.title
-
- if self.cp_Title == "":
- self.cp_Title = self.localFilename
-
- if self.cp_Description == "":
- self.cp_Description = self.description
-
- if self.cp_Author == "":
- self.cp_Author = self.author
-
- if self.cp_Exporter is None or self.cp_Exporter == "":
- exp = self.getSettings().getExporters(self.appType)
- self.cp_Exporter = \
- self.getSettings().cp_Exporters.getKey(exp[0])
-
- '''
- Analyzes a type-detection string, returned from the TypeDetection service,
- and sets the appType, isSOOpenable and isSODocument members.
- '''
-
- def analyzeFileType(self, mediaDesc):
- if mediaDesc is None:
- media = ""
- else:
- media = Properties.getPropertyValue(
- self.mediaDescriptor, PropertyNames.PROPERTY_NAME)
- self.appType = self.getDocType(media)
- self.isSOOpenable = (self.appType == WRITER_DOC or self.appType == CALC_DOC or self.appType == IMPRESS_DOC or self.appType == DRAW_DOC) or self.appType == HTML_DOC
- parts = media.split("_")
- if len(parts) < 2:
- self.isSODocument = False
- else:
- self.isSODocument = self.isSOOpenable and (parts[1].startswith("Star"))
-
- '''
- @param media is the media description string returned by an UNO TypeDetection object.
- @return one of the constants in the interface
-
- '''
-
- def getDocType(self, media):
- if media == "":
- return NO_TYPE
- elif media.startswith("generic_HTML"):
- return HTML_DOC
- elif media.startswith("writer"):
- return WRITER_DOC
- elif media.startswith("calc"):
- return CALC_DOC
- elif media.startswith("draw"):
- return DRAW_DOC
- elif media.startswith("impress"):
- return IMPRESS_DOC
- elif media.startswith("pdf"):
- return PDF_DOC
- elif media.startswith("gif") or media.startswith("jpg"):
- return WEB_GRAPHICS
- elif media.startswith("wav"):
- return SOUND_FILE
- else:
- return NO_TYPE
-
- def createDOM(self, parent):
- d = self.getSettings().cp_DefaultSession.cp_Design
- exp = self.getSettings().cp_Exporters.getElement(self.cp_Exporter)
- return XMLHelper.addElement(parent, "document",
- ["title", "description", "author", "format", "filename",
- "create-date", "update-date", "pages", "size", "icon",
- "dir", "fn"],
- [self.cp_Title if (d.cp_DisplayTitle) else "",
- self.cp_Description if (d.cp_DisplayDescription) else "",
- self.cp_Author if (d.cp_DisplayAuthor) else "",
- self.getTargetTypeName(exp) if (d.cp_DisplayFileFormat) else "",
- self.localFilename if (d.cp_DisplayFilename) else "",
- self.createDate() if (d.cp_DisplayCreateDate) else "",
- self.updateDate() if (d.cp_DisplayUpdateDate) else "",
- "" + self.getPages() if (d.cp_DisplayPages and (self.pages > -1)) else "", #TODO when do i calculate pages?
- self.sizeKB() if (d.cp_DisplaySize) else "", #TODO when do i calculate size?
- self.getIcon(exp) if (d.cp_DisplayFormatIcon) else "",
- self.dirName, self.urlFilename])
-
- def updateDate(self):
- if self.updatedDate is None:
- return ""
-
- return self.getSettings().formatter.formatCreated(self.updatedDate)
-
- def createDate(self):
- if self.createdDate is None:
- return ""
-
- return self.getSettings().formatter.formatCreated(self.createdDate)
-
- def sizeKB(self):
- if self.sizeBytes == -1:
- return ""
- else:
- return self.getSettings().formatter.formatFileSize(self.sizeBytes)
-
- def getPages(self):
- if self.pages == -1:
- return ""
- else:
- return self.pagesTemplate().replace("%NUMBER", "" + self.pages)
-
- def pagesTemplate(self):
- pagesType = \
- self.getSettings().cp_Exporters.getElement(self.cp_Exporter).cp_PageType
- if pagesType == PAGE_TYPE_PAGE:
- return \
- self.getSettings().resources[CGSettings.RESOURCE_PAGES_TEMPLATE]
- elif pagesType == PAGE_TYPE_SLIDE:
- return \
- self.getSettings().resources[CGSettings.RESOURCE_SLIDES_TEMPLATE]
- else:
- return ""
-
- def getTargetTypeName(self, exp):
- if exp.targetTypeName == "":
- return Properties.getPropertyValue(self.mediaDescriptor, "UIName")
- else:
- return exp.targetTypeName
-
- def getIcon(self, exporter):
- if exporter.cp_Icon == "":
- return self.getIcon1(self.appType)
- else:
- return exporter.cp_Icon
-
- def getIcon1(self, appType):
- return appType + ".gif"
-
- '''
- This method is used by the DataAware model
- and returns the index of the exporter of
- this document, <b>in the list of the
- exporters available for this type of document</b>
- @return
- '''
-
- def getExporter(self):
- return [self.getExporterIndex()]
-
- '''
- @see getExporter()
- '''
-
- def setExporter(self, exporter_):
- exp = self.getSettings().getExporters(self.appType)[exporter_[0]]
- self.cp_Exporter = self.getSettings().cp_Exporters.getKey(exp)
-
- '''
- @see getExporter()
- @return
- '''
-
- def getExporterIndex(self):
- if self.cp_Exporter is None:
- return 0
-
- exporter = self.getSettings().cp_Exporters.getElement(self.cp_Exporter)
- exporters = self.getSettings().getExporters(self.appType)
- i = 0
- while i < len(exporters):
- if exporters[i] == exporter:
- return i
-
- i += 1
- return -1
-
- def toString(self):
- return self.localFilename
diff --git a/wizards/com/sun/star/wizards/web/data/CGExporter.py b/wizards/com/sun/star/wizards/web/data/CGExporter.py
deleted file mode 100644
index daddbcbd21f2..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGExporter.py
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ..WebConfigSet import WebConfigSet
-from ...common.ConfigGroup import ConfigGroup
-from .CGArgument import CGArgument
-
-class CGExporter(ConfigGroup):
-
- def __init__(self):
- self.cp_Index = -1
- self.cp_Name = str()
- self.cp_ExporterClass = str()
- self.cp_OwnDirectory = bool()
- self.cp_SupportsFilename = bool()
- self.cp_DefaultFilename = str()
- self.cp_Extension = str()
- self.cp_SupportedMimeTypes = str()
- self.cp_Icon = str()
- self.cp_TargetType = str()
- self.cp_Binary = bool()
- self.cp_PageType = int()
- self.targetTypeName = ""
- self.cp_Arguments = WebConfigSet(CGArgument)
-
- def toString(self):
- return self.cp_Name
-
- def supports(self, mime):
- return self.cp_SupportedMimeTypes == "" or \
- self.cp_SupportedMimeTypes.find(mime) > -1
diff --git a/wizards/com/sun/star/wizards/web/data/CGFilter.py b/wizards/com/sun/star/wizards/web/data/CGFilter.py
deleted file mode 100644
index 8862caeb7d48..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGFilter.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ...common.ConfigGroup import ConfigGroup
-
-class CGFilter(ConfigGroup):
- cp_Index = -1
- cp_Name = str()
- cp_Filter = str()
diff --git a/wizards/com/sun/star/wizards/web/data/CGGeneralInfo.py b/wizards/com/sun/star/wizards/web/data/CGGeneralInfo.py
deleted file mode 100644
index e814ec41b7d6..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGGeneralInfo.py
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ...common.ConfigGroup import ConfigGroup
-from ...common.XMLHelper import XMLHelper
-
-class CGGeneralInfo(ConfigGroup):
-
- def __init__(self):
- self.cp_Title = str()
- self.cp_Description = str()
- self.cp_Author = str()
- self.cp_CreationDate = int()
- self.cp_UpdateDate = int()
- self.cp_Email = str()
- self.cp_Copyright = str()
-
- def createDOM(self, parent):
- return XMLHelper.addElement(
- parent, "general-info",
- ["title", "author", "description", "creation-date",
- "update-date", "email", "copyright"],
- [self.cp_Title, self.cp_Author, self.cp_Description,
- str(self.cp_CreationDate), str(self.cp_UpdateDate),
- self.cp_Email, self.cp_Copyright])
diff --git a/wizards/com/sun/star/wizards/web/data/CGIconSet.py b/wizards/com/sun/star/wizards/web/data/CGIconSet.py
deleted file mode 100644
index c63f4274bd10..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGIconSet.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ...common.ConfigGroup import ConfigGroup
-
-class CGIconSet(ConfigGroup):
-
- def __init__(self):
- self.cp_Index = -1
- self.cp_FNPrefix = str()
- self.cp_FNPostfix = str()
- self.cp_Name = str()
diff --git a/wizards/com/sun/star/wizards/web/data/CGImage.py b/wizards/com/sun/star/wizards/web/data/CGImage.py
deleted file mode 100644
index 0d747eea196b..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGImage.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ...common.ConfigGroup import ConfigGroup
-
-class CGImage(ConfigGroup):
- cp_Href = str()
diff --git a/wizards/com/sun/star/wizards/web/data/CGLayout.py b/wizards/com/sun/star/wizards/web/data/CGLayout.py
deleted file mode 100644
index cc5b8fbe29eb..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGLayout.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ...common.ConfigGroup import ConfigGroup
-from ...common.FileAccess import FileAccess
-from ...ui.UIConsts import UIConsts
-
-class CGLayout(ConfigGroup):
-
- def __init__(self):
- self.cp_Index = -1
- self.cp_Name = str()
- self.cp_FSName = str()
-
- def getSettings(self):
- return self.root
-
- def createTemplates(self, xmsf):
- self.templates = {}
-
- fa = FileAccess(xmsf)
- stylesheetPath = fa.getURL(
- self.getSettings().workPath, "layouts/" + self.cp_FSName)
- files = fa.listFiles(stylesheetPath, False)
- i = 0
- while i < len(files):
- ext = FileAccess.getExtension(files[i])
- fileName = FileAccess.getFilename(files[i])
- if ext == "xsl":
- self.templates[fileName] = files[i]
- i += 1
-
- def getImageUrl(self):
- ResId = UIConsts.RID_IMG_WEB + (self.cp_Index * 2)
- return ResId
-
- def getTemplates(self, xmsf):
- self.createTemplates(xmsf)
- return self.templates
diff --git a/wizards/com/sun/star/wizards/web/data/CGPublish.py b/wizards/com/sun/star/wizards/web/data/CGPublish.py
deleted file mode 100644
index 47bd6e525824..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGPublish.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ...common.ConfigGroup import ConfigGroup
-
-'''
-A Class which describes the publishing arguments
-in a session.
-Each session can contain different publishers, which are configured
-through such a CGPublish object.
-'''
-
-class CGPublish(ConfigGroup):
-
- def __init__(self):
- self.cp_Publish = bool()
- self.cp_URL = str()
- self.cp_Username = str()
- self.password = str()
- self.overwriteApproved = bool()
- self.url = str()
-
- def setURL(self, path):
- try:
- self.cp_URL = self.root.getFileAccess().getURL(path)
- self.overwriteApproved = False
- except Exception as ex:
- ex.printStackTrace()
-
- def getURL(self):
- try:
- return self.root.getFileAccess().getPath(self.cp_URL, None)
- except Exception as e:
- e.printStackTrace()
- return ""
diff --git a/wizards/com/sun/star/wizards/web/data/CGSession.py b/wizards/com/sun/star/wizards/web/data/CGSession.py
deleted file mode 100644
index 52d660bde5a9..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGSession.py
+++ /dev/null
@@ -1,83 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ...common.ConfigGroup import ConfigGroup
-from ..WebConfigSet import WebConfigSet
-from ...common.XMLHelper import XMLHelper
-from .CGContent import CGContent
-from .CGDesign import CGDesign
-from .CGGeneralInfo import CGGeneralInfo
-from .CGPublish import CGPublish
-
-from com.sun.star.beans import StringPair
-
-class CGSession(ConfigGroup):
-
- def __init__(self):
- self.cp_Index = -1
- self.cp_InDirectory = str()
- self.cp_OutDirectory = str()
- self.cp_Name = str()
- self.cp_Content = CGContent()
- self.cp_Design = CGDesign()
- self.cp_GeneralInfo = CGGeneralInfo()
- self.cp_Publishing = WebConfigSet(CGPublish)
- self.valid = False
-
- def createDOM(self, doc):
- root = XMLHelper.addElement(doc, "session",
- ["name", "screen-size"],
- [self.cp_Name, self.getScreenSize()])
- self.cp_GeneralInfo.createDOM(root)
- self.cp_Content.createDOM(root)
- return root
-
- def serializeNode(self, node):
- xBuffer = self.root.xmsf.createInstance("com.sun.star.io.Pipe")
- xTextInputStream = self.root.xmsf.createInstance("com.sun.star.io.TextInputStream")
- xSaxWriter = self.root.xmsf.createInstance( "com.sun.star.xml.sax.Writer" )
- xSaxWriter.setOutputStream(xBuffer)
- xTextInputStream.setInputStream(xBuffer)
- node.serialize(xSaxWriter, tuple([StringPair()]))
- result = ""
- while (not xTextInputStream.isEOF()):
- sLine = xTextInputStream.readLine()
- if (not sLine == "") and (not sLine.startswith("<?xml")):
- result = result + sLine + "\n"
-
- def getScreenSize(self):
- tmp_switch_var1 = self.cp_Design.cp_OptimizeDisplaySize
- if tmp_switch_var1 == 0:
- return "640"
- elif tmp_switch_var1 == 1:
- return "800"
- elif tmp_switch_var1 == 2:
- return "1024"
- else:
- return "800"
-
- def getLayout(self):
- return self.root.cp_Layouts.getElement(self.cp_Design.cp_Layout)
-
- def getStyle(self):
- return self.root.cp_Styles.getElement(self.cp_Design.cp_Style)
-
- def createDOM1(self):
- factory = self.root.xmsf.createInstance("com.sun.star.xml.dom.DocumentBuilder")
- doc = factory.newDocument()
- self.createDOM(doc)
- return doc
diff --git a/wizards/com/sun/star/wizards/web/data/CGSessionName.py b/wizards/com/sun/star/wizards/web/data/CGSessionName.py
deleted file mode 100644
index 13a5267ed500..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGSessionName.py
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ...common.ConfigGroup import ConfigGroup
-
-class CGSessionName(ConfigGroup):
-
- def __init__(self):
- self.cp_Index = -1
- self.cp_Name = str()
-
- def toString(self):
- return self.cp_Name
diff --git a/wizards/com/sun/star/wizards/web/data/CGSettings.py b/wizards/com/sun/star/wizards/web/data/CGSettings.py
deleted file mode 100644
index 308dab71dc7d..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGSettings.py
+++ /dev/null
@@ -1,169 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-import traceback
-from datetime import date as dateTimeObject
-
-from ...common.FileAccess import FileAccess
-from ...common.ConfigGroup import ConfigGroup
-from ...common.NumberFormatter import NumberFormatter
-from ...common.Properties import Properties
-from ..WebConfigSet import WebConfigSet
-from .CGExporter import CGExporter
-from .CGLayout import CGLayout
-from .CGStyle import CGStyle
-from .CGIconSet import CGIconSet
-from .CGImage import CGImage
-from .CGFilter import CGFilter
-from .CGSessionName import CGSessionName
-from .CGSession import CGSession
-
-from com.sun.star.i18n.NumberFormatIndex import DATE_SYS_DMMMYYYY
-from com.sun.star.i18n.NumberFormatIndex import NUMBER_1000DEC2
-
-class CGSettings(ConfigGroup):
-
- RESOURCE_PAGES_TEMPLATE = 0
- RESOURCE_SLIDES_TEMPLATE = 1
- RESOURCE_CREATED_TEMPLATE = 2
- RESOURCE_UPDATED_TEMPLATE = 3
- RESOURCE_SIZE_TEMPLATE = 4
-
- def __init__(self, xmsf_, resources_, document):
- self.cp_WorkDir = str()
- self.cp_Exporters = WebConfigSet(CGExporter)
- self.cp_Layouts = WebConfigSet(CGLayout)
- self.cp_Styles = WebConfigSet(CGStyle)
- self.cp_IconSets = WebConfigSet(CGIconSet)
- self.cp_BackgroundImages = WebConfigSet(CGImage)
- self.cp_SavedSessions = WebConfigSet(CGSessionName)
- self.cp_Filters = WebConfigSet(CGFilter)
- self.savedSessions = WebConfigSet(CGSessionName)
- self.cp_DefaultSession = CGSession()
- self.cp_LastSavedSession = str()
- self.fileAccess = None
- self.workPath = None
- self.xmsf = xmsf_
- try:
- self.soTemplateDir = FileAccess.getOfficePath2(self.xmsf, "Config", "", "");
- self.soGalleryDir = FileAccess.getOfficePath2(self.xmsf, "Gallery", "share", "");
- self.setRoot(self)
- self.formatter = self.Formatter(self.xmsf, document, resources_)
- self.resources = resources_
- self.exportersMap = {}
- except Exception:
- traceback.print_exc()
-
- def getExporters(self, mime):
- exps = self.exportersMap.get(mime)
- if exps is None:
- exps = self.createExporters(mime)
- self.exportersMap[mime] = exps
- return exps
-
- def createExporters(self, mime):
- exporters = self.cp_Exporters.childrenList
- v = []
- for i in exporters:
- if i.supports(mime):
- try:
- v.append(i)
- except Exception:
- traceback.print_exc()
- return v
-
- '''
- call after read.
- @param xmsf
- @param document the background document. used for date/number formatting.
- '''
-
- def configure(self, xmsf):
- self.workPath = FileAccess.connectURLs(self.soTemplateDir, self.cp_WorkDir)
- self.calcExportersTargetTypeNames(xmsf)
-
- def calcExportersTargetTypeNames(self, xmsf):
- typeDetect = xmsf.createInstance("com.sun.star.document.TypeDetection")
- for i in range(self.cp_Exporters.getSize()):
- self.calcExporterTargetTypeName(typeDetect, self.cp_Exporters.getElementAt(i))
-
- def calcExporterTargetTypeName(self, typeDetect, exporter):
- if (exporter is None):
- return
- if not (exporter.cp_TargetType == "" or exporter.cp_TargetType is None):
- targetTypeName = Properties.getPropertyValue(
- typeDetect.getByName(exporter.cp_TargetType), "UIName")
- exporter.cp_targetTypeName = targetTypeName
-
- def getFileAccess(self, xmsf = None):
- if xmsf is None:
- xmsf = self.xmsf
- if self.fileAccess is None:
- self.fileAccess = FileAccess(xmsf)
- return self.fileAccess
-
- class Formatter(object):
- class DateUtils(object):
-
- def __init__(self, xmsf, document):
- self.formatSupplier = document
- formatSettings = self.formatSupplier.getNumberFormatSettings()
- date = formatSettings.NullDate
- self.calendar = dateTimeObject(date.Year, date.Month, date.Day)
- self.formatter = NumberFormatter.createNumberFormatter(xmsf, self.formatSupplier)
-
- '''
- @param format a constant of the enumeration NumberFormatIndex
- @return
- '''
- def getFormat(self, f):
- return NumberFormatter.getNumberFormatterKey(self.formatSupplier, f)
-
- '''
- @param date a VCL date in form of 20041231
- @return a document relative date
- '''
- def format(self, formatIndex, date):
- dateTime = dateTimeObject(date.Year, date.Month, date.Day)
- difference = dateTime - self.calendar
- return self.formatter.convertNumberToString(formatIndex, difference.days)
-
- def getFormatter(self):
- return self.formatter
-
- def __init__(self, xmsf, document, resources):
- self.dateUtils = self.DateUtils(xmsf, document)
- self.dateFormat = self.dateUtils.getFormat(DATE_SYS_DMMMYYYY)
- self.numberFormat = self.dateUtils.getFormat(NUMBER_1000DEC2)
- self.resources = resources
-
- def formatCreated(self, date):
- sDate = self.dateUtils.format(self.dateFormat, date)
- return self.resources[CGSettings.RESOURCE_CREATED_TEMPLATE].replace(
- "%DATE", sDate)
-
- def formatUpdated(self, date):
- sDate = self.dateUtils.format(self.dateFormat, date);
- return self.resources[CGSettings.RESOURCE_UPDATED_TEMPLATE].replace(
- "%DATE", sDate)
-
- def formatFileSize(self, size):
- sizeInKB = size / float(1024)
- sSize = self.dateUtils.getFormatter().convertNumberToString(
- self.numberFormat, sizeInKB)
- return self.resources[CGSettings.RESOURCE_SIZE_TEMPLATE].replace(
- "%NUMBER", sSize)
diff --git a/wizards/com/sun/star/wizards/web/data/CGStyle.py b/wizards/com/sun/star/wizards/web/data/CGStyle.py
deleted file mode 100644
index 27e33c62bf38..000000000000
--- a/wizards/com/sun/star/wizards/web/data/CGStyle.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ...common.ConfigGroup import ConfigGroup
-
-class CGStyle(ConfigGroup):
- cp_Index = -1
- cp_Name = str()
- cp_CssHref = str()
- cp_BackgroundImage = str()
- cp_IconSet = str()
-
- def toString(self):
- return self.cp_Name
-
- def getBackgroundUrl(self):
- if CGStyle.cp_BackgroundImage is None \
- or CGStyle.cp_BackgroundImage == "":
- return None
- else:
- return CGStyle.cp_BackgroundImage
diff --git a/wizards/com/sun/star/wizards/web/data/TypeDetection.py b/wizards/com/sun/star/wizards/web/data/TypeDetection.py
deleted file mode 100644
index 48957b65ca95..000000000000
--- a/wizards/com/sun/star/wizards/web/data/TypeDetection.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-'''
-a document which will open in writer.
-'''
-WRITER_DOC = "writer"
-'''
-a document which will open in calc.
-'''
-CALC_DOC = "calc"
-'''
-a document which will open in impress.
-'''
-IMPRESS_DOC = "impress"
-'''
-a document which will open in draw.
-'''
-DRAW_DOC = "draw"
-'''
-an HTML document
-'''
-HTML_DOC = "html"
-'''
-a GIF or an JPG file.
-'''
-WEB_GRAPHICS = "graphics"
-'''
-a PDF document.
-'''
-PDF_DOC = "pdf"
-'''
-a Sound file (mp3/wav ect.)
-'''
-SOUND_FILE = "sound"
-'''
-a File which can not be handled by neither SO or a Web browser
-(exe, jar, zip ect.)
-'''
-NO_TYPE = "other"
diff --git a/wizards/com/sun/star/wizards/web/data/__init__.py b/wizards/com/sun/star/wizards/web/data/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/wizards/com/sun/star/wizards/web/data/__init__.py
+++ /dev/null
diff --git a/wizards/com/sun/star/wizards/web/export/AbstractExporter.py b/wizards/com/sun/star/wizards/web/export/AbstractExporter.py
deleted file mode 100644
index 575911f31767..000000000000
--- a/wizards/com/sun/star/wizards/web/export/AbstractExporter.py
+++ /dev/null
@@ -1,103 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-import traceback
-
-from .Exporter import Exporter
-from ..TypeDetection import *
-from ...common.Desktop import Desktop
-from ...common.Properties import Properties
-from ...common.FileAccess import FileAccess
-from ...document.OfficeDocument import OfficeDocument
-from ...text.TextDocument import TextDocument
-
-from com.sun.star.lang import IllegalArgumentException
-from com.sun.star.document.MacroExecMode import NEVER_EXECUTE
-from com.sun.star.document.UpdateDocMode import NO_UPDATE
-
-class AbstractExporter(Exporter):
-
- exporter = None
- fileAccess = None
-
- def __init__(self, exporter_):
- self.exporter = exporter_
-
- def storeToURL(self, officeDocument, props, targetUrl, filterName, filterData):
- props = Properties()
- props["FilterName"] = filterName
- if (len(filterData) > 0):
- props["FilterData"] = filterData
- o = props.getProperties1()
- officeDocument.storeToURL(targetUrl, tuple(o))
-
- def storeToURL1(self, officeDocument, targetUrl, filterName, filterData):
- self.storeToURL(officeDocument, Properties(), targetUrl, filterName, filterData)
-
- def storeToURL2(self, officeDocument, targetUrl, filterName):
- self.storeToURL(officeDocument, Properties(), targetUrl, filterName, [])
-
- def getArgument(self, name, p):
- return p.cp_Arguments.getElement(name).cp_Value
-
- def openDocument(self, doc, xmsf):
- document = None
- # open the document.
- try:
- desktop = Desktop.getDesktop(xmsf)
- props = list(range(3))
- props[0] = Properties.createProperty("Hidden", True)
- props[1] = Properties.createProperty("MacroExecutionMode", NEVER_EXECUTE)
- props[2] = Properties.createProperty("UpdateDocMode", NO_UPDATE)
- document = desktop.loadComponentFromURL(doc.cp_URL, "_blank", 0, tuple(props))
- except IllegalArgumentException:
- traceback.print_exc()
- # try to get the number of pages in the document
- try:
- self.pageCount(doc, document)
- except Exception:
- traceback.print_exc()
- # Here i do nothing since pages is not *so* important.
- return document
-
- def closeDocument(self, doc, xmsf):
- try:
- doc.close(False)
- except Exception:
- traceback.print_exc()
-
- def pageCount(self, doc, document):
- if (doc.appType == WRITER_DOC):
- doc.pages = TextDocument.getPageCount(document)
- elif (doc.appType == IMPRESS_DOC):
- doc.pages = OfficeDocument.getSlideCount(document)
- elif (doc.appType == DRAW_DOC):
- doc.pages = OfficeDocument.getSlideCount(document)
-
- def getFileAccess(self, xmsf):
- if (self.fileAccess == None):
- try:
- self.fileAccess = FileAccess(xmsf)
- except Exception:
- traceback.print_exc()
- return self.fileAccess
-
- def calcFileSize(self, doc, url, xmsf):
- # if the exporter exports to a
- # binary format, get the size of the destination.
- if (self.exporter.cp_Binary):
- doc.sizeBytes = self.getFileAccess(xmsf).getSize(url)
diff --git a/wizards/com/sun/star/wizards/web/export/ConfiguredExporter.py b/wizards/com/sun/star/wizards/web/export/ConfiguredExporter.py
deleted file mode 100644
index 8e7906518ede..000000000000
--- a/wizards/com/sun/star/wizards/web/export/ConfiguredExporter.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ..data.CGArgument import CGArgument
-from ..data.CGExporter import CGExporter
-from .FilterExporter import FilterExporter
-
-class ConfiguredExporter(FilterExporter):
-
- # (non-Javadoc)
- # @see com.sun.star.wizards.web.export.Exporter#init(com.sun.star.wizards.web.data.CGExporter)
- def __init(exporter):
- super(ConfiguredExporter, self).__init__(exporter)
- for key in exporter.cp_Arguments.childrenMap.keys():
- if (not key == "Filter"):
- value = exporter.cp_Arguments.getElement(key)
- self.props[key] = self.cast(value.cp_Value)
-
- def cast(s):
- s1 = s[1]
- c = s[0]
- if (c == "$"):
- return s1
- elif (c == "%"):
- return int(s1)
- elif (c == "#"):
- return int(s1)
- elif (c == "&"):
- return float(s1)
- elif (c == "f"):
- if (s == "false"):
- return False
- elif (c == "t"):
- if (s == "true"):
- return True
- return None
diff --git a/wizards/com/sun/star/wizards/web/export/CopyExporter.py b/wizards/com/sun/star/wizards/web/export/CopyExporter.py
deleted file mode 100644
index 73503aa3a75e..000000000000
--- a/wizards/com/sun/star/wizards/web/export/CopyExporter.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-import traceback
-
-from .AbstractExporter import AbstractExporter
-from ...common.FileAccess import FileAccess
-
-class CopyExporter(AbstractExporter):
-
- # @see com.sun.star.wizards.web.export.Exporter#export(java.lang.Object, java.io.File, com.sun.star.wizards.web.data.CGSettings, com.sun.star.lang.XMultiServiceFactory)
- def export(self, source, target, xmsf, task):
- try:
- task.advance(True)
-
- # this will open the document, and calculate the pages/slides number
- # in it.
- if (self.exporter.cp_PageType > 0):
- self.closeDocument(self.openDocument(source, xmsf), xmsf)
-
- task.advance(True)
-
- newTarget = FileAccess.connectURLs(
- FileAccess.getParentDir(target), source.urlFilename)
-
- b = self.getFileAccess(xmsf).copy(source.cp_URL, newTarget)
-
- task.advance(True)
-
- self.calcFileSize(source, newTarget, xmsf)
-
- return b
- except Exception:
- traceback.print_exc()
- return False
diff --git a/wizards/com/sun/star/wizards/web/export/Exporter.py b/wizards/com/sun/star/wizards/web/export/Exporter.py
deleted file mode 100644
index 5f5c7ecee0c3..000000000000
--- a/wizards/com/sun/star/wizards/web/export/Exporter.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from ..abc import abstractmethod
-
-class Exporter:
-
- # This method exports a document with a specified filter.<br/>
- # The method is responsible for exporting the given source document
- # to the given target directory.
- # The exporter *must* also set the given CGDocument sizeBytes field to the
- # size of the converted document, *if* the target document is
- # of a binary format.
- # always use source.urlFilename as destination filename.
- # @param source is a CGDocument object.
- # @param targetDirectory contains the URL of a directory to which the file should be exported to.
- # @param xmsf this is a basic multiServiceFactory.
- # @param task - a task monitoring object. This should advance
- # (call task.advance(true) ) 3 times, while exporting.
- @abstractmethod
- def export(self, source, targetDirectory, xmsf, task):
- pass
-
- @abstractmethod
- def init(self, exporter):
- pass
diff --git a/wizards/com/sun/star/wizards/web/export/FilterExporter.py b/wizards/com/sun/star/wizards/web/export/FilterExporter.py
deleted file mode 100644
index 87ed287fc370..000000000000
--- a/wizards/com/sun/star/wizards/web/export/FilterExporter.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-from .AbstractExporter import AbstractExporter
-from ...common.Properties import Properties
-
-from com.sun.star.io import IOException
-
-# An exporter which is configured with a filter name, and
-# uses the specified filter to export documents.
-class FilterExporter(AbstractExporter):
-
- filterName = ""
- props = Properties()
-
- def __init__(self, exporter_):
- super(FilterExporter, self).__init__(exporter_)
- self.filterName = self.getArgument("Filter", exporter_)
-
- # (non-Javadoc)
- # @see com.sun.star.wizards.web.export.Exporter#export(java.lang.Object, java.io.File, com.sun.star.wizards.web.data.CGSettings, com.sun.star.lang.XMultiServiceFactory)
- def export(self, source, target, xmsf, task):
- result = True
- document = None
-
- try:
- document = self.openDocument(source, xmsf)
- task.advance(True)
- self.storeToURL1(document, target, self.filterName, self.props.getProperties1())
- task.advance(True)
- except IOException as iox:
- iox.printStackTrace(System.err)
- result = False
- raise iox
- finally:
- self.closeDocument(document, xmsf)
- self.calcFileSize(source, target, xmsf)
- task.advance(True);
- return result
diff --git a/wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.py b/wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.py
deleted file mode 100644
index f05458dbcdef..000000000000
--- a/wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-import com.sun.star.io.IOException;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.wizards.common.PropertyNames;
-import com.sun.star.wizards.ui.event.Task;
-import com.sun.star.wizards.web.data.CGDocument;
-import com.sun.star.wizards.web.data.CGSession;
-
-from .ConfiguredExporter import ConfiguredExporter
-
-class ImpressHTMLExporter(ConfiguredExporter):
-
- SMALL_IMAGE = 512
- MEDIUM_IMAGE = 640
- LARGE_IMAGE = 800
-
- def export(source, targetDirectory, xmsf, task):
-
- # here set some filter specific properties.
- # other properties, which are not dependent on
- # user input are set through the exporter
- # configuration.
-
- session = self.getSession(source)
-
- self.props["Author"] = source.cp_Author
- self.props["Email"] = session.cp_GeneralInfo.cp_Email
- self.props["HomepageURL"] = self.getHomepageURL(session)
- self.props["UserText"] = self.source.cp_Title
-
- props[PropertyNames.PROPERTY_WIDTH] = self.getImageWidth(session)
-
- props["UseButtonSet"] = int(session.cp_Design.cp_IconSet)
-
-
- # now export
- return super(ImpressHTMLExporter, self).export(source, targetDirectory, xmsf, task)
-
-
- def getHomepageURL(session):
- return "../" + "../index.html" if (exporter.cp_OwnDirectory) else "index.html"
-
- def getImageWidth(session):
- size = session.cp_Design.cp_OptimizeDisplaySize
- if (size == 0):
- return self.SMALL_IMAGE
- elif (size == 1):
- return self.MEDIUM_IMAGE
- elif (size == 2):
- return self.LARGE_IMAGE
- return self.MEDIUM_IMAGE
-
- def getSession(doc):
- return doc.getSettings().cp_DefaultSession
diff --git a/wizards/com/sun/star/wizards/web/export/__init__.py b/wizards/com/sun/star/wizards/web/export/__init__.py
deleted file mode 100644
index 8b137891791f..000000000000
--- a/wizards/com/sun/star/wizards/web/export/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/wizards/com/sun/star/wizards/web/web.component b/wizards/com/sun/star/wizards/web/web.component
deleted file mode 100644
index 64e325fa6e3b..000000000000
--- a/wizards/com/sun/star/wizards/web/web.component
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- -->
-
-<component loader="com.sun.star.loader.Python"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.wizards.web.CallWizard">
- <service name="com.sun.star.task.Job"/>
- </implementation>
-</component>