summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards/common
diff options
context:
space:
mode:
Diffstat (limited to 'wizards/com/sun/star/wizards/common')
-rw-r--r--wizards/com/sun/star/wizards/common/ConfigGroup.py73
-rw-r--r--wizards/com/sun/star/wizards/common/ConfigNode.py15
-rw-r--r--wizards/com/sun/star/wizards/common/Configuration.py293
-rw-r--r--wizards/com/sun/star/wizards/common/DebugHelper.py10
-rw-r--r--wizards/com/sun/star/wizards/common/Desktop.py293
-rw-r--r--wizards/com/sun/star/wizards/common/FileAccess.py789
-rw-r--r--wizards/com/sun/star/wizards/common/HelpIds.py1013
-rw-r--r--wizards/com/sun/star/wizards/common/Helper.py242
-rw-r--r--wizards/com/sun/star/wizards/common/Listener.py111
-rw-r--r--wizards/com/sun/star/wizards/common/NoValidPathException.py9
-rw-r--r--wizards/com/sun/star/wizards/common/PropertyNames.py15
-rw-r--r--wizards/com/sun/star/wizards/common/PropertySetHelper.py242
-rw-r--r--wizards/com/sun/star/wizards/common/Resource.java.orig140
-rw-r--r--wizards/com/sun/star/wizards/common/Resource.py66
-rw-r--r--wizards/com/sun/star/wizards/common/SystemDialog.py237
-rw-r--r--wizards/com/sun/star/wizards/common/__init__.py1
-rw-r--r--wizards/com/sun/star/wizards/common/prova.py7
17 files changed, 3556 insertions, 0 deletions
diff --git a/wizards/com/sun/star/wizards/common/ConfigGroup.py b/wizards/com/sun/star/wizards/common/ConfigGroup.py
new file mode 100644
index 000000000000..02ba16cb63c2
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/ConfigGroup.py
@@ -0,0 +1,73 @@
+from ConfigNode import *
+import traceback
+
+class ConfigGroup(ConfigNode):
+
+ def writeConfiguration(self, configurationView, param):
+ for i in dir(self):
+ if i.startswith(param):
+ try:
+ self.writeField(i, configurationView, param)
+ except Exception, ex:
+ print "Error writing field:" + i
+ traceback.print_exc()
+
+ def writeField(self, field, configView, prefix):
+ propertyName = field.getName().substring(prefix.length())
+ fieldType = field.getType()
+ if ConfigNode.isAssignableFrom(fieldType):
+ childView = Configuration.addConfigNode(configView, propertyName)
+ child = field.get(this)
+ child.writeConfiguration(childView, prefix)
+ elif fieldType.isPrimitive():
+ Configuration.set(convertValue(field), propertyName, configView)
+ elif isinstance(fieldType,str):
+ Configuration.set(field.get(this), propertyName, configView)
+
+ '''
+ convert the primitive type value of the
+ given Field object to the corresponding
+ Java Object value.
+ @param field
+ @return the value of the field as a Object.
+ @throws IllegalAccessException
+ '''
+
+ def convertValue(self, field):
+ if field.getType().equals(Boolean.TYPE):
+ return field.getBoolean(this)
+
+ if field.getType().equals(Integer.TYPE):
+ return field.getInt(this)
+
+ if field.getType().equals(Short.TYPE):
+ return field.getShort(this)
+
+ if field.getType().equals(Float.TYPE):
+ return field.getFloat(this)
+
+ if (field.getType().equals(Double.TYPE)):
+ return field.getDouble(this)
+ return None
+ #and good luck with it :-) ...
+
+ def readConfiguration(self, configurationView, param):
+ for i in dir(self):
+ if i.startswith(param):
+ try:
+ self.readField( i, configurationView, param)
+ except Exception, ex:
+ print "Error reading field: " + i
+ traceback.print_exc()
+
+ def readField(self, field, configView, prefix):
+ propertyName = field[len(prefix):]
+ child = getattr(self, field)
+ fieldType = type(child)
+ if type(ConfigNode) == fieldType:
+ child.setRoot(self.root)
+ child.readConfiguration(Configuration.getNode(propertyName, configView), prefix)
+ field.set(this, Configuration.getString(propertyName, configView))
+
+ def setRoot(self, newRoot):
+ self.root = newRoot
diff --git a/wizards/com/sun/star/wizards/common/ConfigNode.py b/wizards/com/sun/star/wizards/common/ConfigNode.py
new file mode 100644
index 000000000000..d97ac1b646c4
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/ConfigNode.py
@@ -0,0 +1,15 @@
+from abc import ABCMeta, abstractmethod
+
+class ConfigNode(object):
+
+ @abstractmethod
+ def readConfiguration(self, configurationView, param):
+ pass
+
+ @abstractmethod
+ def writeConfiguration(self, configurationView, param):
+ pass
+
+ @abstractmethod
+ def setRoot(self, root):
+ pass
diff --git a/wizards/com/sun/star/wizards/common/Configuration.py b/wizards/com/sun/star/wizards/common/Configuration.py
new file mode 100644
index 000000000000..adf7e8a7f6e4
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/Configuration.py
@@ -0,0 +1,293 @@
+from PropertyNames import PropertyNames
+from com.sun.star.uno import Exception as UnoException
+from Helper import *
+import traceback
+import uno
+'''
+This class gives access to the OO configuration api.
+It contains 4 get and 4 set convenience methods for getting and settings properties
+in the configuration. <br/>
+For the get methods, two parameters must be given: name and parent, where name is the
+name of the property, parent is a HierarchyElement (::com::sun::star::configuration::HierarchyElement)<br/>
+The get and set methods support hieryrchical property names like "options/gridX". <br/>
+NOTE: not yet supported, but sometime later,
+If you will ommit the "parent" parameter, then the "name" parameter must be in hierarchy form from
+the root of the registry.
+'''
+
+class Configuration(object):
+
+ @classmethod
+ def getInt(self, name, parent):
+ o = getNode(name, parent)
+ if AnyConverter.isVoid(o):
+ return 0
+
+ return AnyConverter.toInt(o)
+
+ @classmethod
+ def getShort(self, name, parent):
+ o = getNode(name, parent)
+ if AnyConverter.isVoid(o):
+ return 0
+
+ return AnyConverter.toShort(o)
+
+ @classmethod
+ def getFloat(self, name, parent):
+ o = getNode(name, parent)
+ if AnyConverter.isVoid(o):
+ return 0
+
+ return AnyConverter.toFloat(o)
+
+ @classmethod
+ def getDouble(self, name, parent):
+ o = getNode(name, parent)
+ if AnyConverter.isVoid(o):
+ return 0
+
+ return AnyConverter.toDouble(o)
+
+ @classmethod
+ def getString(self, name, parent):
+ o = getNode(name, parent)
+ if AnyConverter.isVoid(o):
+ return ""
+
+ return o
+
+ @classmethod
+ def getBoolean(self, name, parent):
+ o = getNode(name, parent)
+ if AnyConverter.isVoid(o):
+ return False
+
+ return AnyConverter.toBoolean(o)
+
+ @classmethod
+ def getNode(self, name, parent):
+ return parent.getByName(name)
+
+ @classmethod
+ def set(self, value, name, parent):
+ parent.setHierarchicalPropertyValue(name, value)
+
+ '''
+ @param name
+ @param parent
+ @return
+ @throws Exception
+ '''
+
+ @classmethod
+ def getConfigurationNode(self, name, parent):
+ return parent.getByName(name)
+
+ @classmethod
+ def getConfigurationRoot(self, xmsf, sPath, updateable):
+ oConfigProvider = xmsf.createInstance("com.sun.star.configuration.ConfigurationProvider")
+ if updateable:
+ sView = "com.sun.star.configuration.ConfigurationUpdateAccess"
+ else:
+ sView = "com.sun.star.configuration.ConfigurationAccess"
+
+ aPathArgument = uno.createUnoStruct('com.sun.star.beans.PropertyValue')
+ aPathArgument.Name = "nodepath"
+ aPathArgument.Value = sPath
+ aModeArgument = uno.createUnoStruct('com.sun.star.beans.PropertyValue')
+ if updateable:
+ aModeArgument.Name = "lazywrite"
+ aModeArgument.Value = False
+
+
+ return oConfigProvider.createInstanceWithArguments(sView,(aPathArgument,aModeArgument,))
+
+ @classmethod
+ def getChildrenNames(self, configView):
+ return configView.getElementNames()
+
+ @classmethod
+ def getProductName(self, xMSF):
+ try:
+ oProdNameAccess = self.getConfigurationRoot(xMSF, "org.openoffice.Setup/Product", False)
+ ProductName = Helper.getUnoObjectbyName(oProdNameAccess, "ooName")
+ return ProductName
+ except UnoException:
+ traceback.print_exc()
+ return None
+
+ @classmethod
+ def getOfficeLocaleString(self, xMSF):
+ sLocale = ""
+ try:
+ aLocLocale = Locale.Locale()
+ oMasterKey = self.getConfigurationRoot(xMSF, "org.openoffice.Setup/L10N/", False)
+ sLocale = (String)
+ Helper.getUnoObjectbyName(oMasterKey, "ooLocale")
+ except UnoException, exception:
+ traceback.print_exc()
+
+ return sLocale
+
+ @classmethod
+ def getOfficeLocale(self, xMSF):
+ aLocLocale = Locale.Locale()
+ sLocale = getOfficeLocaleString(xMSF)
+ sLocaleList = JavaTools.ArrayoutofString(sLocale, "-")
+ aLocLocale.Language = sLocaleList[0]
+ if sLocaleList.length > 1:
+ aLocLocale.Country = sLocaleList[1]
+
+ return aLocLocale
+
+ @classmethod
+ def getOfficeLinguistic(self, xMSF):
+ try:
+ oMasterKey = self.getConfigurationRoot(xMSF, "org.openoffice.Setup/L10N/", False)
+ sLinguistic = Helper.getUnoObjectbyName(oMasterKey, "ooLocale")
+ return sLinguistic
+ except UnoException, exception:
+ traceback.print_exc()
+ return None
+
+ '''
+ This method creates a new configuration node and adds it
+ to the given view. Note that if a node with the given name
+ already exists it will be completely removed from
+ the configuration.
+ @param configView
+ @param name
+ @return the new created configuration node.
+ @throws com.sun.star.lang.WrappedTargetException
+ @throws ElementExistException
+ @throws NoSuchElementException
+ @throws com.sun.star.uno.Exception
+ '''
+
+ @classmethod
+ def addConfigNode(self, configView, name):
+ if configView == None:
+ return configView.getByName(name)
+ else:
+ # the new element is the result !
+ newNode = configView.createInstance()
+ # insert it - this also names the element
+ xNameContainer.insertByName(name, newNode)
+ return newNode
+
+ @classmethod
+ def removeNode(self, configView, name):
+
+ if configView.hasByName(name):
+ configView.removeByName(name)
+
+ @classmethod
+ def commit(self, configView):
+ configView.commitChanges()
+
+ @classmethod
+ def updateConfiguration(self, xmsf, path, name, node, param):
+ view = Configuration.self.getConfigurationRoot(xmsf, path, True)
+ addConfigNode(path, name)
+ node.writeConfiguration(view, param)
+ view.commitChanges()
+
+ @classmethod
+ def removeNode(self, xmsf, path, name):
+ view = Configuration.self.getConfigurationRoot(xmsf, path, True)
+ removeNode(view, name)
+ view.commitChanges()
+
+ @classmethod
+ def getNodeDisplayNames(self, _xNameAccessNode):
+ snames = None
+ return getNodeChildNames(_xNameAccessNode, PropertyNames.PROPERTY_NAME)
+
+ @classmethod
+ def getNodeChildNames(self, xNameAccessNode, _schildname):
+ snames = None
+ try:
+ snames = xNameAccessNode.getElementNames()
+ sdisplaynames = range(snames.length)
+ i = 0
+ while i < snames.length:
+ oContent = Helper.getUnoPropertyValue(xNameAccessNode.getByName(snames[i]), _schildname)
+ if not AnyConverter.isVoid(oContent):
+ sdisplaynames[i] = (String)
+ Helper.getUnoPropertyValue(xNameAccessNode.getByName(snames[i]), _schildname)
+ else:
+ sdisplaynames[i] = snames[i]
+
+ i += 1
+ return sdisplaynames
+ except UnoException, e:
+ traceback.print_exc()
+ return snames
+
+ @classmethod
+ def getChildNodebyIndex(self, _xNameAccess, _index):
+ try:
+ snames = _xNameAccess.getElementNames()
+ oNode = _xNameAccess.getByName(snames[_index])
+ return oNode
+ except UnoException, e:
+ traceback.print_exc()
+ return None
+
+ @classmethod
+ def getChildNodebyName(self, _xNameAccessNode, _SubNodeName):
+ try:
+ if _xNameAccessNode.hasByName(_SubNodeName):
+ return _xNameAccessNode.getByName(_SubNodeName)
+
+ except UnoException, e:
+ traceback.print_exc()
+
+ return None
+
+ @classmethod
+ def getChildNodebyDisplayName(self, _xNameAccessNode, _displayname):
+ snames = None
+ return getChildNodebyDisplayName(_xNameAccessNode, _displayname, PropertyNames.PROPERTY_NAME)
+
+ @classmethod
+ def getChildNodebyDisplayName(self, _xNameAccessNode, _displayname, _nodename):
+ snames = None
+ try:
+ snames = _xNameAccessNode.getElementNames()
+ sdisplaynames = range(snames.length)
+ i = 0
+ while i < snames.length:
+ curdisplayname = Helper.getUnoPropertyValue(_xNameAccessNode.getByName(snames[i]), _nodename)
+ if curdisplayname.equals(_displayname):
+ return _xNameAccessNode.getByName(snames[i])
+
+ i += 1
+ except UnoException, e:
+ traceback.print_exc()
+
+ return None
+
+ @classmethod
+ def getChildNodebyDisplayName(self, _xMSF, _aLocale, _xNameAccessNode, _displayname, _nodename, _nmaxcharcount):
+ snames = None
+ try:
+ snames = _xNameAccessNode.getElementNames()
+ sdisplaynames = range(snames.length)
+ i = 0
+ while i < snames.length:
+ curdisplayname = Helper.getUnoPropertyValue(_xNameAccessNode.getByName(snames[i]), _nodename)
+ if (_nmaxcharcount > 0) and (_nmaxcharcount < curdisplayname.length()):
+ curdisplayname = curdisplayname.substring(0, _nmaxcharcount)
+
+ curdisplayname = Desktop.removeSpecialCharacters(_xMSF, _aLocale, curdisplayname)
+ if curdisplayname.equals(_displayname):
+ return _xNameAccessNode.getByName(snames[i])
+
+ i += 1
+ except UnoException, e:
+ traceback.print_exc()
+
+ return None
+
diff --git a/wizards/com/sun/star/wizards/common/DebugHelper.py b/wizards/com/sun/star/wizards/common/DebugHelper.py
new file mode 100644
index 000000000000..75016033a533
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/DebugHelper.py
@@ -0,0 +1,10 @@
+class DebugHelper(object):
+
+ @classmethod
+ def exception(self, ex):
+ raise NotImplementedError
+
+ @classmethod
+ def writeInfo(self, msg):
+ raise NotImplementedError
+
diff --git a/wizards/com/sun/star/wizards/common/Desktop.py b/wizards/com/sun/star/wizards/common/Desktop.py
new file mode 100644
index 000000000000..a08f12c4f947
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/Desktop.py
@@ -0,0 +1,293 @@
+import uno
+import traceback
+from com.sun.star.frame.FrameSearchFlag import ALL, PARENT
+from com.sun.star.util import URL
+from com.sun.star.i18n.KParseTokens import ANY_LETTER_OR_NUMBER, ASC_UNDERSCORE
+from NoValidPathException import *
+from com.sun.star.uno import Exception as UnoException
+
+
+class Desktop(object):
+
+ @classmethod
+ def getDesktop(self, xMSF):
+ xDesktop = None
+ if xMSF is not None:
+ try:
+ xDesktop = xMSF.createInstance( "com.sun.star.frame.Desktop")
+ except UnoException, exception:
+ traceback.print_exc()
+ else:
+ print "Can't create a desktop. null pointer !"
+
+ return xDesktop
+
+ @classmethod
+ def getActiveFrame(self, xMSF):
+ xDesktop = self.getDesktop(xMSF)
+ return xDesktop.getActiveFrame()
+
+ @classmethod
+ def getActiveComponent(self, _xMSF):
+ xFrame = self.getActiveFrame(_xMSF)
+ return xFrame.getController().getModel()
+
+ @classmethod
+ def getActiveTextDocument(self, _xMSF):
+ xComponent = getActiveComponent(_xMSF)
+ return xComponent #Text
+
+ @classmethod
+ def getActiveSpreadsheetDocument(self, _xMSF):
+ xComponent = getActiveComponent(_xMSF)
+ return xComponent
+
+ @classmethod
+ def getDispatcher(self, xMSF, xFrame, _stargetframe, oURL):
+ try:
+ oURLArray = range(1)
+ oURLArray[0] = oURL
+ xDispatch = xFrame.queryDispatch(oURLArray[0], _stargetframe, ALL)
+ return xDispatch
+ except UnoException, e:
+ e.printStackTrace(System.out)
+
+ return None
+
+ @classmethod
+ def getDispatchURL(self, xMSF, _sURL):
+ try:
+ oTransformer = xMSF.createInstance("com.sun.star.util.URLTransformer")
+ oURL = range(1)
+ oURL[0] = com.sun.star.util.URL.URL()
+ oURL[0].Complete = _sURL
+ xTransformer.parseStrict(oURL)
+ return oURL[0]
+ except UnoException, e:
+ e.printStackTrace(System.out)
+
+ return None
+
+ @classmethod
+ def dispatchURL(self, xMSF, sURL, xFrame, _stargetframe):
+ oURL = getDispatchURL(xMSF, sURL)
+ xDispatch = getDispatcher(xMSF, xFrame, _stargetframe, oURL)
+ dispatchURL(xDispatch, oURL)
+
+ @classmethod
+ def dispatchURL(self, xMSF, sURL, xFrame):
+ dispatchURL(xMSF, sURL, xFrame, "")
+
+ @classmethod
+ def dispatchURL(self, _xDispatch, oURL):
+ oArg = range(0)
+ _xDispatch.dispatch(oURL, oArg)
+
+ @classmethod
+ def connect(self, connectStr):
+ localContext = uno.getComponentContext()
+ resolver = localContext.ServiceManager.createInstanceWithContext(
+ "com.sun.star.bridge.UnoUrlResolver", localContext )
+ ctx = resolver.resolve( connectStr )
+ orb = ctx.ServiceManager
+ return orb
+
+ @classmethod
+ def checkforfirstSpecialCharacter(self, _xMSF, _sString, _aLocale):
+ try:
+ nStartFlags = ANY_LETTER_OR_NUMBER + ASC_UNDERSCORE
+ ocharservice = _xMSF.createInstance("com.sun.star.i18n.CharacterClassification")
+ aResult = ocharservice.parsePredefinedToken(KParseType.IDENTNAME, _sString, 0, _aLocale, nStartFlags, "", nStartFlags, " ")
+ return aResult.EndPos
+ except UnoException, e:
+ e.printStackTrace(System.out)
+ return -1
+
+ @classmethod
+ def removeSpecialCharacters(self, _xMSF, _aLocale, _sname):
+ snewname = _sname
+ i = 0
+ while i < snewname.length():
+ i = Desktop.checkforfirstSpecialCharacter(_xMSF, snewname, _aLocale)
+ if i < snewname.length():
+ sspecialchar = snewname.substring(i, i + 1)
+ snewname = JavaTools.replaceSubString(snewname, "", sspecialchar)
+
+ return snewname
+
+ '''
+ Checks if the passed Element Name already exists in the ElementContainer. If yes it appends a
+ suffix to make it unique
+ @param xElementContainer
+ @param sElementName
+ @return a unique Name ready to be added to the container.
+ '''
+
+ @classmethod
+ def getUniqueName(self, xElementContainer, sElementName):
+ bElementexists = True
+ i = 1
+ sIncSuffix = ""
+ BaseName = sElementName
+ while bElementexists == True:
+ bElementexists = xElementContainer.hasByName(sElementName)
+ if bElementexists == True:
+ i += 1
+ sElementName = BaseName + str(i)
+
+ if i > 1:
+ sIncSuffix = str(i)
+
+ return sElementName + sIncSuffix
+
+ '''
+ Checks if the passed Element Name already exists in the list If yes it appends a
+ suffix to make it unique
+ @param _slist
+ @param _sElementName
+ @param _sSuffixSeparator
+ @return a unique Name not being in the passed list.
+ '''
+
+ @classmethod
+ def getUniqueNameList(self, _slist, _sElementName, _sSuffixSeparator):
+ a = 2
+ scompname = _sElementName
+ bElementexists = True
+ if _slist == None:
+ return _sElementName
+
+ if _slist.length == 0:
+ return _sElementName
+
+ while bElementexists == True:
+ i = 0
+ while i < _slist.length:
+ if JavaTools.FieldInList(_slist, scompname) == -1:
+ return scompname
+
+ i += 1
+ scompname = _sElementName + _sSuffixSeparator + (a + 1)
+ return ""
+
+ '''
+ @deprecated use Configuration.getConfigurationRoot() with the same parameters instead
+ @param xMSF
+ @param KeyName
+ @param bForUpdate
+ @return
+ '''
+
+ @classmethod
+ def getRegistryKeyContent(self, xMSF, KeyName, bForUpdate):
+ try:
+ aNodePath = range(1)
+ oConfigProvider = xMSF.createInstance("com.sun.star.configuration.ConfigurationProvider")
+ aNodePath[0] = uno.createUnoStruct('com.sun.star.beans.PropertyValue')
+ aNodePath[0].Name = "nodepath"
+ aNodePath[0].Value = KeyName
+ if bForUpdate:
+ return oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess", aNodePath)
+ else:
+ return oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aNodePath)
+
+ except UnoException, exception:
+ exception.printStackTrace(System.out)
+ return None
+
+class OfficePathRetriever:
+
+ def OfficePathRetriever(self, xMSF):
+ try:
+ TemplatePath = FileAccess.getOfficePath(xMSF, "Template", "share", "/wizard")
+ UserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", "")
+ BitmapPath = FileAccess.combinePaths(xMSF, TemplatePath, "/../wizard/bitmap")
+ WorkPath = FileAccess.getOfficePath(xMSF, "Work", "", "")
+ except NoValidPathException, nopathexception:
+ pass
+
+ @classmethod
+ def getTemplatePath(self, _xMSF):
+ sTemplatePath = ""
+ try:
+ sTemplatePath = FileAccess.getOfficePath(_xMSF, "Template", "share", "/wizard")
+ except NoValidPathException, nopathexception:
+ pass
+ return sTemplatePath
+
+ @classmethod
+ def getUserTemplatePath(self, _xMSF):
+ sUserTemplatePath = ""
+ try:
+ sUserTemplatePath = FileAccess.getOfficePath(_xMSF, "Template", "user", "")
+ except NoValidPathException, nopathexception:
+ pass
+ return sUserTemplatePath
+
+ @classmethod
+ def getBitmapPath(self, _xMSF):
+ sBitmapPath = ""
+ try:
+ sBitmapPath = FileAccess.combinePaths(_xMSF, getTemplatePath(_xMSF), "/../wizard/bitmap")
+ except NoValidPathException, nopathexception:
+ pass
+
+ return sBitmapPath
+
+ @classmethod
+ def getWorkPath(self, _xMSF):
+ sWorkPath = ""
+ try:
+ sWorkPath = FileAccess.getOfficePath(_xMSF, "Work", "", "")
+
+ except NoValidPathException, nopathexception:
+ pass
+
+ return sWorkPath
+
+ @classmethod
+ def createStringSubstitution(self, xMSF):
+ xPathSubst = None
+ try:
+ xPathSubst = xMSF.createInstance("com.sun.star.util.PathSubstitution")
+ except com.sun.star.uno.Exception, e:
+ e.printStackTrace()
+
+ if xPathSubst != None:
+ return xPathSubst
+ else:
+ return None
+
+ '''This method searches (and hopefully finds...) a frame
+ with a componentWindow.
+ It does it in three phases:
+ 1. Check if the given desktop argument has a componentWindow.
+ If it is null, the myFrame argument is taken.
+ 2. Go up the tree of frames and search a frame with a component window.
+ 3. Get from the desktop all the components, and give the first one
+ which has a frame.
+ @param xMSF
+ @param myFrame
+ @param desktop
+ @return
+ @throws NoSuchElementException
+ @throws WrappedTargetException
+ '''
+
+ @classmethod
+ def findAFrame(self, xMSF, myFrame, desktop):
+ if desktop == None:
+ desktop = myFrame
+ #we go up in the tree...
+
+ while desktop != None and desktop.getComponentWindow() == None:
+ desktop = desktop.findFrame("_parent", FrameSearchFlag.PARENT)
+ if desktop == None:
+ e = Desktop.getDesktop(xMSF).getComponents().createEnumeration()
+ while e.hasMoreElements():
+ xModel = (e.nextElement()).getObject()
+ xFrame = xModel.getCurrentController().getFrame()
+ if xFrame != None and xFrame.getComponentWindow() != None:
+ return xFrame
+
+ return desktop
diff --git a/wizards/com/sun/star/wizards/common/FileAccess.py b/wizards/com/sun/star/wizards/common/FileAccess.py
new file mode 100644
index 000000000000..95f8646b1927
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/FileAccess.py
@@ -0,0 +1,789 @@
+import traceback
+from NoValidPathException import *
+from com.sun.star.ucb import CommandAbortedException
+from com.sun.star.uno import Exception as UnoException
+import types
+
+'''
+This class delivers static convenience methods
+to use with ucb SimpleFileAccess service.
+You can also instanciate the class, to encapsulate
+some functionality of SimpleFileAccess. The instance
+keeps a reference to an XSimpleFileAccess and an
+XFileIdentifierConverter, saves the permanent
+overhead of quering for those interfaces, and delivers
+conveneince methods for using them.
+These Convenince methods include mainly Exception-handling.
+'''
+
+class FileAccess(object):
+ '''
+ @param xMSF
+ @param sPath
+ @param sAddPath
+ '''
+
+ @classmethod
+ def addOfficePath(self, xMSF, sPath, sAddPath):
+ xSimpleFileAccess = None
+ ResultPath = getOfficePath(xMSF, sPath, xSimpleFileAccess)
+ # As there are several conventions about the look of Url (e.g. with " " or with "%20") you cannot make a
+ # simple String comparison to find out, if a path is already in "ResultPath"
+ PathList = JavaTools.ArrayoutofString(ResultPath, ";")
+ MaxIndex = PathList.length - 1
+ CompAddPath = JavaTools.replaceSubString(sAddPath, "", "/")
+ i = 0
+ while i <= MaxIndex:
+ CurPath = JavaTools.convertfromURLNotation(PathList[i])
+ CompCurPath = JavaTools.replaceSubString(CurPath, "", "/")
+ if CompCurPath.equals(CompAddPath):
+ return
+
+ i += 1
+ ResultPath += ";" + sAddPath
+ return
+
+ @classmethod
+ def deleteLastSlashfromUrl(self, _sPath):
+ if _sPath.endswith("/"):
+ return _sPath[:-1]
+ else:
+ return _sPath
+
+ '''
+ Further information on arguments value see in OO Developer Guide,
+ chapter 6.2.7
+ @param xMSF
+ @param sPath
+ @param xSimpleFileAccess
+ @return the respective path of the office application. A probable following "/" at the end is trimmed.
+ '''
+
+ @classmethod
+ def getOfficePath(self, xMSF, sPath, xSimpleFileAccess):
+ try:
+ ResultPath = ""
+ xInterface = xMSF.createInstance("com.sun.star.util.PathSettings")
+ ResultPath = str(Helper.getUnoPropertyValue(xInterface, sPath))
+ ResultPath = self.deleteLastSlashfromUrl(ResultPath)
+ return ResultPath
+ except UnoException, exception:
+ traceback.print_exc()
+ return ""
+
+ '''
+ Further information on arguments value see in OO Developer Guide,
+ chapter 6.2.7
+ @param xMSF
+ @param sPath
+ @param sType use "share" or "user". Set to "" if not needed eg for the WorkPath;
+ In the return Officepath a possible slash at the end is cut off
+ @param sSearchDir
+ @return
+ @throws NoValidPathException
+ '''
+
+ @classmethod
+ def getOfficePath2(self, xMSF, sPath, sType, sSearchDir):
+ #This method currently only works with sPath="Template"
+ bexists = False
+ try:
+ xPathInterface = xMSF.createInstance("com.sun.star.util.PathSettings")
+ ResultPath = ""
+ ReadPaths = ()
+ xUcbInterface = xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")
+ Template_writable = xPathInterface.getPropertyValue(sPath + "_writable")
+ Template_internal = xPathInterface.getPropertyValue(sPath + "_internal")
+ Template_user = xPathInterface.getPropertyValue(sPath + "_user")
+ if type(Template_internal) is not types.InstanceType:
+ if isinstance(Template_internal,tuple):
+ ReadPaths = ReadPaths + Template_internal
+ else:
+ ReadPaths = ReadPaths + (Template_internal,)
+ if type(Template_user) is not types.InstanceType:
+ if isinstance(Template_user,tuple):
+ ReadPaths = ReadPaths + Template_user
+ else:
+ ReadPaths = ReadPaths + (Template_internal,)
+ ReadPaths = ReadPaths + (Template_writable,)
+ if sType.lower() == "user":
+ ResultPath = Template_writable
+ bexists = True
+ else:
+ #find right path using the search sub path
+ for i in ReadPaths:
+ tmpPath = i + sSearchDir
+ if xUcbInterface.exists(tmpPath):
+ ResultPath = i
+ bexists = True
+ break
+
+ ResultPath = self.deleteLastSlashfromUrl(ResultPath)
+ except UnoException, exception:
+ traceback.print_exc()
+ ResultPath = ""
+
+ if not bexists:
+ raise NoValidPathException (xMSF, "");
+
+ return ResultPath
+
+ @classmethod
+ def getOfficePaths(self, xMSF, _sPath, sType, sSearchDir):
+ #This method currently only works with sPath="Template"
+ aPathList = []
+ Template_writable = ""
+ try:
+ xPathInterface = xMSF.createInstance("com.sun.star.util.PathSettings")
+ Template_writable = xPathInterface.getPropertyValue(_sPath + "_writable")
+ Template_internal = xPathInterface.getPropertyValue(_sPath + "_internal")
+ Template_user = xPathInterface.getPropertyValue(_sPath + "_user")
+ i = 0
+ while i < len(Template_internal):
+ sPath = Template_internal[i]
+ if sPath.startsWith("vnd."):
+ # if there exists a language in the directory, we try to add the right language
+ sPathToExpand = sPath.substring("vnd.sun.star.Expand:".length())
+ xExpander = Helper.getMacroExpander(xMSF)
+ sPath = xExpander.expandMacros(sPathToExpand)
+
+ sPath = checkIfLanguagePathExists(xMSF, sPath)
+ aPathList.add(sPath)
+ i += 1
+ i = 0
+ while i < Template_user.length:
+ aPathList.add(Template_user[i])
+ i += 1
+ aPathList.add(Template_writable)
+
+ except UnoException, exception:
+ traceback.print_exc()
+ return aPathList
+
+ @classmethod
+ def checkIfLanguagePathExists(self, _xMSF, _sPath):
+ try:
+ defaults = _xMSF.createInstance("com.sun.star.text.Defaults")
+ aLocale = Helper.getUnoStructValue(defaults, "CharLocale")
+ if aLocale == None:
+ java.util.Locale.getDefault()
+ aLocale = com.sun.star.lang.Locale.Locale()
+ aLocale.Country = java.util.Locale.getDefault().getCountry()
+ aLocale.Language = java.util.Locale.getDefault().getLanguage()
+ aLocale.Variant = java.util.Locale.getDefault().getVariant()
+
+ sLanguage = aLocale.Language
+ sCountry = aLocale.Country
+ sVariant = aLocale.Variant
+ # de-DE-Bayrisch
+ aLocaleAll = StringBuffer.StringBuffer()
+ aLocaleAll.append(sLanguage).append('-').append(sCountry).append('-').append(sVariant)
+ sPath = _sPath + "/" + aLocaleAll.toString()
+ xInterface = _xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")
+ if xInterface.exists(sPath):
+ # de-DE
+ return sPath
+
+ aLocaleLang_Country = StringBuffer.StringBuffer()
+ aLocaleLang_Country.append(sLanguage).append('-').append(sCountry)
+ sPath = _sPath + "/" + aLocaleLang_Country.toString()
+ if xInterface.exists(sPath):
+ # de
+ return sPath
+
+ aLocaleLang = StringBuffer.StringBuffer()
+ aLocaleLang.append(sLanguage)
+ sPath = _sPath + "/" + aLocaleLang.toString()
+ if xInterface.exists(sPath):
+ # the absolute default is en-US or en
+ return sPath
+
+ sPath = _sPath + "/en-US"
+ if xInterface.exists(sPath):
+ return sPath
+
+ sPath = _sPath + "/en"
+ if xInterface.exists(sPath):
+ return sPath
+
+ except com.sun.star.uno.Exception, e:
+ pass
+
+ return _sPath
+
+ @classmethod
+ def combinePaths2(self, xMSF, _aFirstPath, _sSecondPath):
+ i = 0
+ while i < _aFirstPath.size():
+ sOnePath = _aFirstPath.get(i)
+ sOnePath = addPath(sOnePath, _sSecondPath)
+ if isPathValid(xMSF, sOnePath):
+ _aFirstPath.add(i, sOnePath)
+ _aFirstPath.remove(i + 1)
+ else:
+ _aFirstPath.remove(i)
+ i -= 1
+
+ i += 1
+
+ @classmethod
+ def isPathValid(self, xMSF, _sPath):
+ bExists = False
+ try:
+ xUcbInterface = xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")
+ bExists = xUcbInterface.exists(_sPath)
+ except Exception, exception:
+ traceback.print_exc()
+
+ return bExists
+
+ @classmethod
+ def combinePaths(self, xMSF, _sFirstPath, _sSecondPath):
+ bexists = False
+ ReturnPath = ""
+ try:
+ xUcbInterface = xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")
+ ReturnPath = _sFirstPath + _sSecondPath
+ bexists = xUcbInterface.exists(ReturnPath)
+ except Exception, exception:
+ traceback.print_exc()
+ return ""
+
+ if not bexists:
+ raise NoValidPathException (xMSF, "");
+
+ return ReturnPath
+
+ @classmethod
+ def createSubDirectory(self, xMSF, xSimpleFileAccess, Path):
+ sNoDirCreation = ""
+ try:
+ oResource = Resource.Resource_unknown(xMSF, "ImportWizard", "imp")
+ if oResource != None:
+ sNoDirCreation = oResource.getResText(1050)
+ sMsgDirNotThere = oResource.getResText(1051)
+ sQueryForNewCreation = oResource.getResText(1052)
+ OSPath = JavaTools.convertfromURLNotation(Path)
+ sQueryMessage = JavaTools.replaceSubString(sMsgDirNotThere, OSPath, "%1")
+ sQueryMessage = sQueryMessage + (char)
+ 13 + sQueryForNewCreation
+ icreate = SystemDialog.showMessageBox(xMSF, "QueryBox", VclWindowPeerAttribute.YES_NO, sQueryMessage)
+ if icreate == 2:
+ xSimpleFileAccess.createFolder(Path)
+ return True
+
+ return False
+ except CommandAbortedException, exception:
+ sMsgNoDir = JavaTools.replaceSubString(sNoDirCreation, Path, "%1")
+ SystemDialog.showMessageBox(xMSF, "ErrorBox", VclWindowPeerAttribute.OK, sMsgNoDir)
+ return False
+ except com.sun.star.uno.Exception, unoexception:
+ sMsgNoDir = JavaTools.replaceSubString(sNoDirCreation, Path, "%1")
+ SystemDialog.showMessageBox(xMSF, "ErrorBox", VclWindowPeerAttribute.OK, sMsgNoDir)
+ return False
+
+ # checks if the root of a path exists. if the parameter xWindowPeer is not null then also the directory is
+ # created when it does not exists and the user
+
+ @classmethod
+ def PathisValid(self, xMSF, Path, sMsgFilePathInvalid, baskbeforeOverwrite):
+ try:
+ SubDirPath = ""
+ bSubDirexists = True
+ NewPath = Path
+ xInterface = xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")
+ if baskbeforeOverwrite:
+ if xInterface.exists(Path):
+ oResource = Resource.Resource_unknown(xMSF, "ImportWizard", "imp")
+ sFileexists = oResource.getResText(1053)
+ NewString = JavaTools.convertfromURLNotation(Path)
+ sFileexists = JavaTools.replaceSubString(sFileexists, NewString, "<1>")
+ sFileexists = JavaTools.replaceSubString(sFileexists, String.valueOf(13), "<CR>")
+ iLeave = SystemDialog.showMessageBox(xMSF, "QueryBox", VclWindowPeerAttribute.YES_NO, sFileexists)
+ if iLeave == 3:
+ return False
+
+ DirArray = JavaTools.ArrayoutofString(Path, "/")
+ MaxIndex = DirArray.length - 1
+ if MaxIndex > 0:
+ i = MaxIndex
+ while i >= 0:
+ SubDir = DirArray[i]
+ SubLen = SubDir.length()
+ NewLen = NewPath.length()
+ RestLen = NewLen - SubLen
+ if RestLen > 0:
+ NewPath = NewPath.substring(0, NewLen - SubLen - 1)
+ if i == MaxIndex:
+ SubDirPath = NewPath
+
+ bexists = xSimpleFileAccess.exists(NewPath)
+ if bexists:
+ LowerCasePath = NewPath.toLowerCase()
+ bexists = (((LowerCasePath.equals("file:#/")) or (LowerCasePath.equals("file:#")) or (LowerCasePath.equals("file:/")) or (LowerCasePath.equals("file:"))) == False)
+
+ if bexists:
+ if bSubDirexists == False:
+ bSubDiriscreated = createSubDirectory(xMSF, xSimpleFileAccess, SubDirPath)
+ return bSubDiriscreated
+
+ return True
+ else:
+ bSubDirexists = False
+
+ i -= 1
+
+ SystemDialog.showMessageBox(xMSF, "ErrorBox", VclWindowPeerAttribute.OK, sMsgFilePathInvalid)
+ return False
+ except com.sun.star.uno.Exception, exception:
+ traceback.print_exc()
+ SystemDialog.showMessageBox(xMSF, "ErrorBox", VclWindowPeerAttribute.OK, sMsgFilePathInvalid)
+ return False
+
+ '''
+ searches a directory for files which start with a certain
+ prefix, and returns their URLs and document-titles.
+ @param xMSF
+ @param FilterName the prefix of the filename. a "-" is added to the prefix !
+ @param FolderName the folder (URL) to look for files...
+ @return an array with two array members. The first one, with document titles,
+ the second with the corresponding URLs.
+ @deprecated please use the getFolderTitles() with ArrayList
+ '''
+
+ @classmethod
+ def getFolderTitles(self, xMSF, FilterName, FolderName):
+ LocLayoutFiles = [[2],[]]
+ try:
+ TitleVector = None
+ NameVector = None
+ xDocInterface = xMSF.createInstance("com.sun.star.document.DocumentProperties")
+ xInterface = xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")
+ nameList = xInterface.getFolderContents(FolderName, False)
+ TitleVector = []
+ NameVector = [len(nameList)]
+ if FilterName == None or FilterName == "":
+ FilterName = None
+ else:
+ FilterName = FilterName + "-"
+ fileName = ""
+ for i in nameList:
+ fileName = self.getFilename(i)
+ if FilterName == None or fileName.startswith(FilterName):
+ xDocInterface.loadFromMedium(i, tuple())
+ NameVector.append(i)
+ TitleVector.append(xDocInterface.Title)
+
+ LocLayoutFiles[1] = NameVector
+ LocLayoutFiles[0] = TitleVector
+ #COMMENTED
+ #JavaTools.bubblesortList(LocLayoutFiles)
+ except Exception, exception:
+ traceback.print_exc()
+
+ return LocLayoutFiles
+
+ '''
+ We search in all given path for a given file
+ @param _sPath
+ @param _sPath2
+ @return
+ '''
+
+ @classmethod
+ def addPath(self, _sPath, _sPath2):
+ if not _sPath.endsWith("/"):
+ _sPath += "/"
+
+ if _sPath2.startsWith("/"):
+ _sPath2 = _sPath2.substring(1)
+
+ sNewPath = _sPath + _sPath2
+ return sNewPath
+
+ @classmethod
+ def getPathFromList(self, xMSF, _aList, _sFile):
+ sFoundFile = ""
+ try:
+ xInterface = xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")
+ i = 0
+ while i < _aList.size():
+ sPath = _aList.get(i)
+ sPath = addPath(sPath, _sFile)
+ if xInterface.exists(sPath):
+ sFoundFile = sPath
+
+ i += 1
+ except com.sun.star.uno.Exception, e:
+ pass
+
+ return sFoundFile
+
+ @classmethod
+ def getTitle(self, xMSF, _sFile):
+ sTitle = ""
+ try:
+ xDocInterface = xMSF.createInstance("com.sun.star.document.DocumentProperties")
+ noArgs = []
+ xDocInterface.loadFromMedium(_sFile, noArgs)
+ sTitle = xDocInterface.getTitle()
+ except Exception, e:
+ traceback.print_exc()
+
+ return sTitle
+
+ @classmethod
+ def getFolderTitles2(self, xMSF, _sStartFilterName, FolderName, _sEndFilterName=""):
+ LocLayoutFiles = [[2],[]]
+ if FolderName.size() == 0:
+ raise NoValidPathException (None, "Path not given.");
+
+ TitleVector = []
+ URLVector = []
+ xInterface = None
+ try:
+ xInterface = xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")
+ except com.sun.star.uno.Exception, e:
+ traceback.print_exc()
+ raise NoValidPathException (None, "Internal error.");
+
+ j = 0
+ while j < FolderName.size():
+ sFolderName = FolderName.get(j)
+ try:
+ nameList = xInterface.getFolderContents(sFolderName, False)
+ if _sStartFilterName == None or _sStartFilterName.equals(""):
+ _sStartFilterName = None
+ else:
+ _sStartFilterName = _sStartFilterName + "-"
+
+ fileName = ""
+ i = 0
+ while i < nameList.length:
+ fileName = self.getFilename(i)
+ if _sStartFilterName == None or fileName.startsWith(_sStartFilterName):
+ if _sEndFilterName.equals(""):
+ sTitle = getTitle(xMSF, nameList[i])
+ elif fileName.endsWith(_sEndFilterName):
+ fileName = fileName.replaceAll(_sEndFilterName + "$", "")
+ sTitle = fileName
+ else:
+ # no or wrong (start|end) filter
+ continue
+
+ URLVector.add(nameList[i])
+ TitleVector.add(sTitle)
+
+ i += 1
+ except CommandAbortedException, exception:
+ traceback.print_exc()
+ except com.sun.star.uno.Exception, e:
+ pass
+
+ j += 1
+ LocNameList = [URLVector.size()]
+ LocTitleList = [TitleVector.size()]
+ # LLA: we have to check if this works
+ URLVector.toArray(LocNameList)
+
+ TitleVector.toArray(LocTitleList)
+
+ LocLayoutFiles[1] = LocNameList
+ LocLayoutFiles[0] = LocTitleList
+
+ #COMMENTED
+ #JavaTools.bubblesortList(LocLayoutFiles);
+ return LocLayoutFiles
+
+ def __init__(self, xmsf):
+ #get a simple file access...
+ self.fileAccess = xmsf.createInstance("com.sun.star.ucb.SimpleFileAccess")
+ #get the file identifier converter
+ self.filenameConverter = xmsf.createInstance("com.sun.star.ucb.FileContentProvider")
+
+ def getURL(self, parentPath, childPath):
+ parent = self.filenameConverter.getSystemPathFromFileURL(parentPath)
+ f = File.File_unknown(parent, childPath)
+ r = self.filenameConverter.getFileURLFromSystemPath(parentPath, f.getAbsolutePath())
+ return r
+
+ def getURL(self, path):
+ f = File.File_unknown(path)
+ r = self.filenameConverter.getFileURLFromSystemPath(path, f.getAbsolutePath())
+ return r
+
+ def getPath(self, parentURL, childURL):
+ string = ""
+ if childURL is not None and childURL is not "":
+ string = "/" + childURL
+ return self.filenameConverter.getSystemPathFromFileURL(parentURL + string)
+
+ '''
+ @author rpiterman
+ @param filename
+ @return the extension of the given filename.
+ '''
+
+ @classmethod
+ def getExtension(self, filename):
+ p = filename.indexOf(".")
+ if p == -1:
+ return ""
+ else:
+ while p > -1:
+ filename = filename.substring(p + 1)
+ p = filename.indexOf(".")
+
+ return filename
+
+ '''
+ @author rpiterman
+ @param s
+ @return
+ '''
+
+ def mkdir(self, s):
+ try:
+ self.fileAccess.createFolder(s)
+ return True
+ except CommandAbortedException, cax:
+ traceback.print_exc()
+ except com.sun.star.uno.Exception, ex:
+ traceback.print_exc()
+
+ return False
+
+ '''
+ @author rpiterman
+ @param filename
+ @param def what to return in case of an exception
+ @return true if the given file exists or not.
+ if an exception accures, returns the def value.
+ '''
+
+ def exists(self, filename, defe):
+ try:
+ return self.fileAccess.exists(filename)
+ except CommandAbortedException, cax:
+ pass
+ except com.sun.star.uno.Exception, ex:
+ pass
+
+ return defe
+
+ '''
+ @author rpiterman
+ @param filename
+ @return
+ '''
+
+ def isDirectory(self, filename):
+ try:
+ return self.fileAccess.isFolder(filename)
+ except CommandAbortedException, cax:
+ pass
+ except com.sun.star.uno.Exception, ex:
+ pass
+
+ return False
+
+ '''
+ lists the files in a given directory
+ @author rpiterman
+ @param dir
+ @param includeFolders
+ @return
+ '''
+
+ def listFiles(self, dir, includeFolders):
+ try:
+ return self.fileAccess.getFolderContents(dir, includeFolders)
+ except CommandAbortedException, cax:
+ pass
+ except com.sun.star.uno.Exception, ex:
+ pass
+
+ return range(0)
+
+ '''
+ @author rpiterman
+ @param file
+ @return
+ '''
+
+ def delete(self, file):
+ try:
+ self.fileAccess.kill(file)
+ return True
+ except CommandAbortedException, cax:
+ traceback.print_exc()
+ except com.sun.star.uno.Exception, ex:
+ traceback.print_exc()
+
+ return False
+
+
+ '''
+ return the filename out of a system-dependent path
+ @param path
+ @return
+ '''
+
+ @classmethod
+ def getPathFilename(self, path):
+ return self.getFilename(path, File.separator)
+
+ '''
+ @author rpiterman
+ @param path
+ @param pathSeparator
+ @return
+ '''
+
+ @classmethod
+ def getFilename(self, path, pathSeparator = "/"):
+ return path.split(pathSeparator)[-1]
+
+ @classmethod
+ def getBasename(self, path, pathSeparator):
+ filename = self.getFilename(path, pathSeparator)
+ sExtension = getExtension(filename)
+ basename = filename.substring(0, filename.length() - (sExtension.length() + 1))
+ return basename
+
+ '''
+ @author rpiterman
+ @param source
+ @param target
+ @return
+ '''
+
+ def copy(self, source, target):
+ try:
+ self.fileAccess.copy(source, target)
+ return True
+ except CommandAbortedException, cax:
+ pass
+ except com.sun.star.uno.Exception, ex:
+ pass
+
+ return False
+
+ def getLastModified(self, url):
+ try:
+ return self.fileAccess.getDateTimeModified(url)
+ except CommandAbortedException, cax:
+ pass
+ except com.sun.star.uno.Exception, ex:
+ pass
+
+ return None
+
+ '''
+ @param url
+ @return the parent dir of the given url.
+ if the path points to file, gives the directory in which the file is.
+ '''
+
+ @classmethod
+ def getParentDir(self, url):
+ if url.endsWith("/"):
+ return getParentDir(url.substring(0, url.length() - 1))
+
+ pos = url.indexOf("/", pos + 1)
+ lastPos = 0
+ while pos > -1:
+ lastPos = pos
+ pos = url.indexOf("/", pos + 1)
+ return url.substring(0, lastPos)
+
+ def createNewDir(self, parentDir, name):
+ s = getNewFile(parentDir, name, "")
+ if mkdir(s):
+ return s
+ else:
+ return None
+
+ def getNewFile(self, parentDir, name, extension):
+ i = 0
+ tmp_do_var2 = True
+ while tmp_do_var2:
+ filename = filename(name, extension, (i + 1))
+ u = getURL(parentDir, filename)
+ url = u
+ tmp_do_var2 = exists(url, True)
+ return url
+
+ @classmethod
+ def filename(self, name, ext, i):
+ stringI = ""
+ stringExt = ""
+ if i is not 0:
+ stringI = str(i)
+ if ext is not "":
+ stringExt = "." + ext
+
+ return name + stringI + StringExt
+
+ def getSize(self, url):
+ try:
+ return self.fileAccess.getSize(url)
+ except Exception, ex:
+ return -1
+
+ @classmethod
+ def connectURLs(self, urlFolder, urlFilename):
+ stringFolder = ""
+ stringFileName = urlFilename
+ if not urlFolder.endsWith("/"):
+ stringFolder = "/"
+ if urlFilename.startsWith("/"):
+ stringFileName = urlFilename.substring(1)
+ return urlFolder + stringFolder + stringFileName
+
+ @classmethod
+ def getDataFromTextFile(self, _xMSF, _filepath):
+ sFileData = None
+ try:
+ oDataVector = []
+ oSimpleFileAccess = _xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")
+ if oSimpleFileAccess.exists(_filepath):
+ xInputStream = oSimpleFileAccess.openFileRead(_filepath)
+ oTextInputStream = _xMSF.createInstance("com.sun.star.io.TextInputStream")
+ oTextInputStream.setInputStream(xInputStream)
+ while not oTextInputStream.isEOF():
+ oDataVector.addElement(oTextInputStream.readLine())
+ oTextInputStream.closeInput()
+ sFileData = [oDataVector.size()]
+ oDataVector.toArray(sFileData)
+
+ except Exception, e:
+ traceback.print_exc()
+
+ return sFileData
+
+ '''
+ shortens a filename to a user displayable representation.
+ @param path
+ @param maxLength
+ @return
+ '''
+
+ @classmethod
+ def getShortFilename(self, path, maxLength):
+ firstPart = 0
+ if path.length() > maxLength:
+ if path.startsWith("/"):
+ # unix
+ nextSlash = path.indexOf("/", 1) + 1
+ firstPart = Math.min(nextSlash, (maxLength - 3) / 2)
+ else:
+ #windows
+ firstPart = Math.min(10, (maxLength - 3) / 2)
+
+ s1 = path.substring(0, firstPart)
+ s2 = path.substring(path.length() - (maxLength - (3 + firstPart)))
+ return s1 + "..." + s2
+ else:
+ return path
+
diff --git a/wizards/com/sun/star/wizards/common/HelpIds.py b/wizards/com/sun/star/wizards/common/HelpIds.py
new file mode 100644
index 000000000000..ff939c3faf33
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/HelpIds.py
@@ -0,0 +1,1013 @@
+class HelpIds:
+ array1 = [
+ "HID:WIZARDS_HID0_WEBWIZARD", # HID:34200
+ "HID:WIZARDS_HID0_HELP", # HID:34201
+ "HID:WIZARDS_HID0_NEXT", # HID:34202
+ "HID:WIZARDS_HID0_PREV", # HID:34203
+ "HID:WIZARDS_HID0_CREATE", # HID:34204
+ "HID:WIZARDS_HID0_CANCEL", # HID:34205
+ "HID:WIZARDS_HID0_STATUS_DIALOG", # HID:34206
+ "HID:WIZARDS_HID1_LST_SESSIONS", # HID:34207
+ "",
+ "HID:WIZARDS_HID1_BTN_DEL_SES", # HID:34209
+ "HID:WIZARDS_HID2_LST_DOCS", # HID:34210
+ "HID:WIZARDS_HID2_BTN_ADD_DOC", # HID:34211
+ "HID:WIZARDS_HID2_BTN_REM_DOC", # HID:34212
+ "HID:WIZARDS_HID2_BTN_DOC_UP", # HID:34213
+ "HID:WIZARDS_HID2_BTN_DOC_DOWN", # HID:34214
+ "HID:WIZARDS_HID2_TXT_DOC_TITLE", # HID:34215
+ "HID:WIZARDS_HID2_TXT_DOC_DESC", # HID:34216
+ "HID:WIZARDS_HID2_TXT_DOC_AUTHOR", # HID:34217
+ "HID:WIZARDS_HID2_LST_DOC_EXPORT", # HID:34218
+ "HID:WIZARDS_HID2_STATUS_ADD_DOCS", # HID:34219
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG1", # HID:34220
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG2", # HID:34221
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG3", # HID:34222
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG4", # HID:34223
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG5", # HID:34224
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG6", # HID:34225
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG7", # HID:34226
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG8", # HID:34227
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG9", # HID:34228
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG10", # HID:34229
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG11", # HID:34230
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG12", # HID:34231
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG13", # HID:34232
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG14", # HID:34233
+ "HID:WIZARDS_HID3_IL_LAYOUTS_IMG15", # HID:34234
+ "HID:WIZARDS_HID4_CHK_DISPLAY_FILENAME", # HID:34235
+ "HID:WIZARDS_HID4_CHK_DISPLAY_DESCRIPTION", # HID:34236
+ "HID:WIZARDS_HID4_CHK_DISPLAY_AUTHOR", # HID:34237
+ "HID:WIZARDS_HID4_CHK_DISPLAY_CR_DATE", # HID:34238
+ "HID:WIZARDS_HID4_CHK_DISPLAY_UP_DATE", # HID:34239
+ "HID:WIZARDS_HID4_CHK_DISPLAY_FORMAT", # HID:34240
+ "HID:WIZARDS_HID4_CHK_DISPLAY_F_ICON", # HID:34241
+ "HID:WIZARDS_HID4_CHK_DISPLAY_PAGES", # HID:34242
+ "HID:WIZARDS_HID4_CHK_DISPLAY_SIZE", # HID:34243
+ "HID:WIZARDS_HID4_GRP_OPTIMAIZE_640", # HID:34244
+ "HID:WIZARDS_HID4_GRP_OPTIMAIZE_800", # HID:34245
+ "HID:WIZARDS_HID4_GRP_OPTIMAIZE_1024", # HID:34246
+ "HID:WIZARDS_HID5_LST_STYLES", # HID:34247
+ "HID:WIZARDS_HID5_BTN_BACKGND", # HID:34248
+ "HID:WIZARDS_HID5_BTN_ICONS", # HID:34249
+ "HID:WIZARDS_HID6_TXT_SITE_TITLE", # HID:34250
+ "",
+ "",
+ "HID:WIZARDS_HID6_TXT_SITE_DESC", # HID:34253
+ "",
+ "HID:WIZARDS_HID6_DATE_SITE_CREATED", # HID:34255
+ "HID:WIZARDS_HID6_DATE_SITE_UPDATED", # HID:34256
+ "",
+ "HID:WIZARDS_HID6_TXT_SITE_EMAIL", # HID:34258
+ "HID:WIZARDS_HID6_TXT_SITE_COPYRIGHT", # HID:34259
+ "HID:WIZARDS_HID7_BTN_PREVIEW", # HID:34260
+ "HID:WIZARDS_HID7_CHK_PUBLISH_LOCAL", # HID:34261
+ "HID:WIZARDS_HID7_TXT_LOCAL", # HID:34262
+ "HID:WIZARDS_HID7_BTN_LOCAL", # HID:34263
+ "HID:WIZARDS_HID7_CHK_PUBLISH_ZIP", # HID:34264
+ "HID:WIZARDS_HID7_TXT_ZIP", # HID:34265
+ "HID:WIZARDS_HID7_BTN_ZIP", # HID:34266
+ "HID:WIZARDS_HID7_CHK_PUBLISH_FTP", # HID:34267
+ "HID:WIZARDS_HID7_TXT_FTP", # HID:34268
+ "HID:WIZARDS_HID7_BTN_FTP", # HID:34269
+ "HID:WIZARDS_HID7_CHK_SAVE", # HID:34270
+ "HID:WIZARDS_HID7_TXT_SAVE", # HID:34271
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_BG", # HID:34290
+ "HID:WIZARDS_HID_BG_BTN_OTHER", # HID:34291
+ "HID:WIZARDS_HID_BG_BTN_NONE", # HID:34292
+ "HID:WIZARDS_HID_BG_BTN_OK", # HID:34293
+ "HID:WIZARDS_HID_BG_BTN_CANCEL", # HID:34294
+ "HID:WIZARDS_HID_BG_BTN_BACK", # HID:34295
+ "HID:WIZARDS_HID_BG_BTN_FW", # HID:34296
+ "HID:WIZARDS_HID_BG_BTN_IMG1", # HID:34297
+ "HID:WIZARDS_HID_BG_BTN_IMG2", # HID:34298
+ "HID:WIZARDS_HID_BG_BTN_IMG3", # HID:34299
+ "HID:WIZARDS_HID_BG_BTN_IMG4", # HID:34300
+ "HID:WIZARDS_HID_BG_BTN_IMG5", # HID:34301
+ "HID:WIZARDS_HID_BG_BTN_IMG6", # HID:34302
+ "HID:WIZARDS_HID_BG_BTN_IMG7", # HID:34303
+ "HID:WIZARDS_HID_BG_BTN_IMG8", # HID:34304
+ "HID:WIZARDS_HID_BG_BTN_IMG9", # HID:34305
+ "HID:WIZARDS_HID_BG_BTN_IMG10", # HID:34306
+ "HID:WIZARDS_HID_BG_BTN_IMG11", # HID:34307
+ "HID:WIZARDS_HID_BG_BTN_IMG12", # HID:34308
+ "HID:WIZARDS_HID_BG_BTN_IMG13", # HID:34309
+ "HID:WIZARDS_HID_BG_BTN_IMG14", # HID:34300
+ "HID:WIZARDS_HID_BG_BTN_IMG15", # HID:34311
+ "HID:WIZARDS_HID_BG_BTN_IMG16", # HID:34312
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGREPORT_DIALOG", # HID:34320
+ "",
+ "HID:WIZARDS_HID_DLGREPORT_0_CMDPREV", # HID:34322
+ "HID:WIZARDS_HID_DLGREPORT_0_CMDNEXT", # HID:34323
+ "HID:WIZARDS_HID_DLGREPORT_0_CMDFINISH", # HID:34324
+ "HID:WIZARDS_HID_DLGREPORT_0_CMDCANCEL", # HID:34325
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGREPORT_1_LBTABLES", # HID:34330
+ "HID:WIZARDS_HID_DLGREPORT_1_FIELDSAVAILABLE", # HID:34331
+ "HID:WIZARDS_HID_DLGREPORT_1_CMDMOVESELECTED", # HID:34332
+ "HID:WIZARDS_HID_DLGREPORT_1_CMDMOVEALL", # HID:34333
+ "HID:WIZARDS_HID_DLGREPORT_1_CMDREMOVESELECTED", # HID:34334
+ "HID:WIZARDS_HID_DLGREPORT_1_CMDREMOVEALL", # HID:34335
+ "HID:WIZARDS_HID_DLGREPORT_1_FIELDSSELECTED", # HID:34336
+ "HID:WIZARDS_HID_DLGREPORT_1_CMDMOVEUP", # HID:34337
+ "HID:WIZARDS_HID_DLGREPORT_1_CMDMOVEDOWN", # HID:34338
+ "",
+ "HID:WIZARDS_HID_DLGREPORT_2_GROUPING", # HID:34340
+ "HID:WIZARDS_HID_DLGREPORT_2_CMDGROUP", # HID:34341
+ "HID:WIZARDS_HID_DLGREPORT_2_CMDUNGROUP", # HID:34342
+ "HID:WIZARDS_HID_DLGREPORT_2_PREGROUPINGDEST", # HID:34343
+ "HID:WIZARDS_HID_DLGREPORT_2_CMDMOVEUPGROUP", # HID:34344
+ "HID:WIZARDS_HID_DLGREPORT_2_CMDMOVEDOWNGROUP", # HID:34345
+ "HID:WIZARDS_HID_DLGREPORT_3_SORT1", # HID:34346
+ "HID:WIZARDS_HID_DLGREPORT_3_OPTASCEND1", # HID:34347
+ "HID:WIZARDS_HID_DLGREPORT_3_OPTDESCEND1", # HID:34348
+ "HID:WIZARDS_HID_DLGREPORT_3_SORT2", # HID:34349
+ "HID:WIZARDS_HID_DLGREPORT_3_OPTASCEND2", # HID:34350
+ "HID:WIZARDS_HID_DLGREPORT_3_OPTDESCEND2", # HID:34351
+ "HID:WIZARDS_HID_DLGREPORT_3_SORT3", # HID:34352
+ "HID:WIZARDS_HID_DLGREPORT_3_OPTASCEND3", # HID:34353
+ "HID:WIZARDS_HID_DLGREPORT_3_OPTDESCEND3", # HID:34354
+ "HID:WIZARDS_HID_DLGREPORT_3_SORT4", # HID:34355
+ "HID:WIZARDS_HID_DLGREPORT_3_OPTASCEND4", # HID:34356
+ "HID:WIZARDS_HID_DLGREPORT_3_OPTDESCEND4", # HID:34357
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGREPORT_4_TITLE", # HID:34362
+ "HID:WIZARDS_HID_DLGREPORT_4_DATALAYOUT", # HID:34363
+ "HID:WIZARDS_HID_DLGREPORT_4_PAGELAYOUT", # HID:34364
+ "HID:WIZARDS_HID_DLGREPORT_4_LANDSCAPE", # HID:34365
+ "HID:WIZARDS_HID_DLGREPORT_4_PORTRAIT", # HID:34366
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGREPORT_5_OPTDYNTEMPLATE", # HID:34370
+ "HID:WIZARDS_HID_DLGREPORT_5_OPTSTATDOCUMENT", # HID:34371
+ "HID:WIZARDS_HID_DLGREPORT_5_TXTTEMPLATEPATH", # HID:34372
+ "HID:WIZARDS_HID_DLGREPORT_5_CMDTEMPLATEPATH", # HID:34373
+ "HID:WIZARDS_HID_DLGREPORT_5_OPTEDITTEMPLATE", # HID:34374
+ "HID:WIZARDS_HID_DLGREPORT_5_OPTUSETEMPLATE", # HID:34375
+ "HID:WIZARDS_HID_DLGREPORT_5_TXTDOCUMENTPATH", # HID:34376
+ "HID:WIZARDS_HID_DLGREPORT_5_CMDDOCUMENTPATH", # HID:34377
+ "HID:WIZARDS_HID_DLGREPORT_5_CHKLINKTODB", # HID:34378
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGREPORT_6_TXTTITLE_1", # HID:34381
+ "HID:WIZARDS_HID_DLGREPORT_6_TXTTITLE_2", # HID:34382
+ "HID:WIZARDS_HID_DLGREPORT_6_TXTTITLE_3", # HID:34383
+ "HID:WIZARDS_HID_DLGREPORT_6_TXTTITLE_4", # HID:34384
+ "HID:WIZARDS_HID_DLGREPORT_6_TXTTITLE_5", # HID:34385
+ "HID:WIZARDS_HID_DLGREPORT_6_TXTTITLE_6", # HID:34386
+ "HID:WIZARDS_HID_DLGREPORT_6_TXTTITLE_7", # HID:34387
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGFORM_DIALOG", # HID:34400
+ "",
+ "HID:WIZARDS_HID_DLGFORM_CMDPREV", # HID:34402
+ "HID:WIZARDS_HID_DLGFORM_CMDNEXT", # HID:34403
+ "HID:WIZARDS_HID_DLGFORM_CMDFINISH", # HID:34404
+ "HID:WIZARDS_HID_DLGFORM_CMDCANCEL", # HID:34405
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGFORM_MASTER_LBTABLES", # HID:34411
+ "HID:WIZARDS_HID_DLGFORM_MASTER_FIELDSAVAILABLE", # HID:34412
+ "HID:WIZARDS_HID_DLGFORM_MASTER_CMDMOVESELECTED", # HID:34413
+ "HID:WIZARDS_HID_DLGFORM_MASTER_CMDMOVEALL", # HID:34414
+ "HID:WIZARDS_HID_DLGFORM_MASTER_CMDREMOVESELECTED", # HID:34415
+ "HID:WIZARDS_HID_DLGFORM_MASTER_CMDREMOVEALL", # HID:34416
+ "HID:WIZARDS_HID_DLGFORM_MASTER_FIELDSSELECTED", # HID:34417
+ "HID:WIZARDS_HID_DLGFORM_MASTER_CMDMOVEUP", # HID:34418
+ "HID:WIZARDS_HID_DLGFORM_MASTER_CMDMOVEDOWN", # HID:34419
+ "",
+ "HID:WIZARDS_HID_DLGFORM_CHKCREATESUBFORM", # HID:34421
+ "HID:WIZARDS_HID_DLGFORM_OPTONEXISTINGRELATION", # HID:34422
+ "HID:WIZARDS_HID_DLGFORM_OPTSELECTMANUALLY", # HID:34423
+ "HID:WIZARDS_HID_DLGFORM_lstRELATIONS", # HID:34424
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGFORM_SUB_LBTABLES", # HID:34431
+ "HID:WIZARDS_HID_DLGFORM_SUB_FIELDSAVAILABLE", # HID:34432
+ "HID:WIZARDS_HID_DLGFORM_SUB_CMDMOVESELECTED", # HID:34433
+ "HID:WIZARDS_HID_DLGFORM_SUB_CMDMOVEALL", # HID:34434
+ "HID:WIZARDS_HID_DLGFORM_SUB_CMDREMOVESELECTED", # HID:34435
+ "HID:WIZARDS_HID_DLGFORM_SUB_CMDREMOVEALL", # HID:34436
+ "HID:WIZARDS_HID_DLGFORM_SUB_FIELDSSELECTED", # HID:34437
+ "HID:WIZARDS_HID_DLGFORM_SUB_CMDMOVEUP", # HID:34438
+ "HID:WIZARDS_HID_DLGFORM_SUB_CMDMOVEDOWN", # HID:34439
+ "",
+ "HID:WIZARDS_HID_DLGFORM_LINKER_LSTSLAVELINK1", # HID:34441
+ "HID:WIZARDS_HID_DLGFORM_LINKER_LSTMASTERLINK1", # HID:34442
+ "HID:WIZARDS_HID_DLGFORM_LINKER_LSTSLAVELINK2", # HID:34443
+ "HID:WIZARDS_HID_DLGFORM_LINKER_LSTMASTERLINK2", # HID:34444
+ "HID:WIZARDS_HID_DLGFORM_LINKER_LSTSLAVELINK3", # HID:34445
+ "HID:WIZARDS_HID_DLGFORM_LINKER_LSTMASTERLINK3", # HID:34446
+ "HID:WIZARDS_HID_DLGFORM_LINKER_LSTSLAVELINK4", # HID:34447
+ "HID:WIZARDS_HID_DLGFORM_LINKER_LSTMASTERLINK4", # HID:34448
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGFORM_CMDALIGNLEFT", # HID:34451
+ "HID:WIZARDS_HID_DLGFORM_CMDALIGNRIGHT", # HID:34452
+ "HID:WIZARDS_HID_DLGFORM_CMDLEFTLABELED", # HID:34453
+ "HID:WIZARDS_HID_DLGFORM_CMDTOPLABELED", # HID:34454
+ "HID:WIZARDS_HID_DLGFORM_CMDTABLESTYLE", # HID:34455
+ "HID:WIZARDS_HID_DLGFORM_CMDTOPJUSTIFIED", # HID:34456
+ "HID:WIZARDS_HID_DLGFORM_CMDLEFTLABELED2", # HID:34457
+ "HID:WIZARDS_HID_DLGFORM_CMDTOPLABELED2", # HID:34458
+ "HID:WIZARDS_HID_DLGFORM_CMDTABLESTYLE2", # HID:34459
+ "HID:WIZARDS_HID_DLGFORM_CMDTOPJUSTIFIED2", # HID:34460
+ "HID:WIZARDS_HID_DLGFORM_OPTNEWDATAONLY", # HID:34461
+ "HID:WIZARDS_HID_DLGFORM_OPTDISPLAYALLDATA", # HID:34462
+ "HID:WIZARDS_HID_DLGFORM_CHKNOMODIFICATION", # HID:34463
+ "HID:WIZARDS_HID_DLGFORM_CHKNODELETION", # HID:34464
+ "HID:WIZARDS_HID_DLGFORM_CHKNOADDITION", # HID:34465
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGFORM_LSTSTYLES", # HID:34471
+ "HID:WIZARDS_HID_DLGFORM_CMDNOBORDER", # HID:34472
+ "HID:WIZARDS_HID_DLGFORM_CMD3DBORDER", # HID:34473
+ "HID:WIZARDS_HID_DLGFORM_CMDSIMPLEBORDER", # HID:34474
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGFORM_TXTPATH", # HID:34481
+ "HID:WIZARDS_HID_DLGFORM_OPTWORKWITHFORM", # HID:34482
+ "HID:WIZARDS_HID_DLGFORM_OPTMODIFYFORM", # HID:34483
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGNEWSLTR_DIALOG", # HID:34500
+ "HID:WIZARDS_HID_DLGNEWSLTR_OPTSTANDARDLAYOUT", # HID:34501
+ "HID:WIZARDS_HID_DLGNEWSLTR_OPTPARTYLAYOUT", # HID:34502
+ "HID:WIZARDS_HID_DLGNEWSLTR_OPTBROCHURELAYOUT", # HID:34503
+ "HID:WIZARDS_HID_DLGNEWSLTR_OPTSINGLESIDED", # HID:34504
+ "HID:WIZARDS_HID_DLGNEWSLTR_OPTDOUBLESIDED", # HID:34505
+ "HID:WIZARDS_HID_DLGNEWSLTR_CMDGOON", # HID:34506
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGDEPOT_DIALOG_SELLBUY", # HID:34520
+ "HID:WIZARDS_HID_DLGDEPOT_0_TXTSTOCKID_SELLBUY", # HID:34521
+ "HID:WIZARDS_HID_DLGDEPOT_0_TXTQUANTITY", # HID:34522
+ "HID:WIZARDS_HID_DLGDEPOT_0_TXTRATE", # HID:34523
+ "HID:WIZARDS_HID_DLGDEPOT_0_TXTDATE", # HID:34524
+ "HID:WIZARDS_HID_DLGDEPOT_0_TXTCOMMISSION", # HID:34525
+ "HID:WIZARDS_HID_DLGDEPOT_0_TXTFIX", # HID:34526
+ "HID:WIZARDS_HID_DLGDEPOT_0_TXTMINIMUM", # HID:34527
+ "HID:WIZARDS_HID_DLGDEPOT_0_CMDCANCEL_SELLBUY", # HID:34528
+ "HID:WIZARDS_HID_DLGDEPOT_0_CMDGOON_SELLBUY", # HID:34529
+ "HID:WIZARDS_HID_DLGDEPOT_1_LSTSELLSTOCKS", # HID:34530
+ "HID:WIZARDS_HID_DLGDEPOT_2_LSTBUYSTOCKS", # HID:34531
+ "HID:WIZARDS_HID_DLGDEPOT_DIALOG_SPLIT", # HID:34532
+ "HID:WIZARDS_HID_DLGDEPOT_0_LSTSTOCKNAMES", # HID:34533
+ "HID:WIZARDS_HID_DLGDEPOT_0_TXTSTOCKID_SPLIT", # HID:34534
+ "HID:WIZARDS_HID_DLGDEPOT_0_CMDCANCEL_SPLIT", # HID:34535
+ "HID:WIZARDS_HID_DLGDEPOT_0_CMDGOON_SPLIT", # HID:34536
+ "HID:WIZARDS_HID_DLGDEPOT_1_OPTPERSHARE", # HID:34537
+ "HID:WIZARDS_HID_DLGDEPOT_1_OPTTOTAL", # HID:34538
+ "HID:WIZARDS_HID_DLGDEPOT_1_TXTDIVIDEND", # HID:34539
+ "HID:WIZARDS_HID_DLGDEPOT_2_TXTOLDRATE", # HID:34540
+ "HID:WIZARDS_HID_DLGDEPOT_2_TXTNEWRATE", # HID:34541
+ "HID:WIZARDS_HID_DLGDEPOT_2_TXTDATE", # HID:34542
+ "HID:WIZARDS_HID_DLGDEPOT_3_TXTSTARTDATE", # HID:34543
+ "HID:WIZARDS_HID_DLGDEPOT_3_TXTENDDATE", # HID:34544
+ "HID:WIZARDS_HID_DLGDEPOT_3_OPTDAILY", # HID:34545
+ "HID:WIZARDS_HID_DLGDEPOT_3_OPTWEEKLY", # HID:34546
+ "HID:WIZARDS_HID_DLGDEPOT_DIALOG_HISTORY", # HID:34547
+ "HID:WIZARDS_HID_DLGDEPOT_LSTMARKETS", # HID:34548
+ "HID:WIZARDS_HID_DLGDEPOT_0_CMDCANCEL_HISTORY", # HID:34549
+ "HID:WIZARDS_HID_DLGDEPOT_0_CMDGOON_HISTORY", # HID:34550
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGIMPORT_DIALOG", # HID:34570
+ "HID:WIZARDS_HID_DLGIMPORT_0_CMDHELP", # HID:34571
+ "HID:WIZARDS_HID_DLGIMPORT_0_CMDCANCEL", # HID:34572
+ "HID:WIZARDS_HID_DLGIMPORT_0_CMDPREV", # HID:34573
+ "HID:WIZARDS_HID_DLGIMPORT_0_CMDNEXT", # HID:34574
+ "HID:WIZARDS_HID_DLGIMPORT_0_OPTSODOCUMENTS", # HID:34575
+ "HID:WIZARDS_HID_DLGIMPORT_0_OPTMSDOCUMENTS", # HID:34576
+ "HID:WIZARDS_HID_DLGIMPORT_0_CHKLOGFILE", # HID:34577
+ "HID:WIZARDS_HID_DLGIMPORT_2_CHKWORD", # HID:34578
+ "HID:WIZARDS_HID_DLGIMPORT_2_CHKEXCEL", # HID:34579
+ "HID:WIZARDS_HID_DLGIMPORT_2_CHKPOWERPOINT", # HID:34580
+ "HID:WIZARDS_HID_DLGIMPORT_2_CBTEMPLATE", # HID:34581
+ "HID:WIZARDS_HID_DLGIMPORT_2_CBTEMPLATERECURSE", # HID:34582
+ "HID:WIZARDS_HID_DLGIMPORT_2_LBTEMPLATEPATH", # HID:34583
+ "HID:WIZARDS_HID_DLGIMPORT_2_EDTEMPLATEPATH", # HID:34584
+ "HID:WIZARDS_HID_DLGIMPORT_2_CMDTEMPLATEPATHSELECT", # HID:34585
+ "HID:WIZARDS_HID_DLGIMPORT_2_CBDOCUMENT", # HID:34586
+ "HID:WIZARDS_HID_DLGIMPORT_2_CBDOCUMENTRECURSE", # HID:34587
+ "HID:WIZARDS_HID_DLGIMPORT_2_LBDOCUMENTPATH", # HID:34588
+ "HID:WIZARDS_HID_DLGIMPORT_2_EDDOCUMENTPATH", # HID:34589
+ "HID:WIZARDS_HID_DLGIMPORT_2_CMDDOCUMENTPATHSELECT", # HID:34590
+ "HID:WIZARDS_HID_DLGIMPORT_2_LBEXPORTDOCUMENTPATH", # HID:34591
+ "HID:WIZARDS_HID_DLGIMPORT_2_EDEXPORTDOCUMENTPATH", # HID:34592
+ "HID:WIZARDS_HID_DLGIMPORT_2_CMDEXPORTPATHSELECT", # HID:34593
+ "",
+ "HID:WIZARDS_HID_DLGIMPORT_3_TBSUMMARY", # HID:34595
+ "HID:WIZARDS_HID_DLGIMPORT_0_CHKWRITER", # HID:34596
+ "HID:WIZARDS_HID_DLGIMPORT_0_CHKCALC", # HID:34597
+ "HID:WIZARDS_HID_DLGIMPORT_0_CHKIMPRESS", # HID:34598
+ "HID:WIZARDS_HID_DLGIMPORT_0_CHKMATHGLOBAL", # HID:34599
+ "HID:WIZARDS_HID_DLGIMPORT_2_CMDTEMPLATEPATHSELECT2", # HID:34600
+ "HID:WIZARDS_HID_DLGIMPORT_2_CMDDOCUMENTPATHSELECT2", # HID:34601
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGCORRESPONDENCE_DIALOG", # HID:34630
+ "HID:WIZARDS_HID_DLGCORRESPONDENCE_CANCEL", # HID:34631
+ "HID:WIZARDS_HID_DLGCORRESPONDENCE_OPTIONAGENDA1", # HID:34632
+ "HID:WIZARDS_HID_DLGCORRESPONDENCE_OPTIONAGENDA2", # HID:34633
+ "HID:WIZARDS_HID_DLGCORRESPONDENCE_AGENDAOKAY", # HID:34634
+ "HID:WIZARDS_HID_DLGCORRESPONDENCE_OPTIONLETTER1", # HID:34635
+ "HID:WIZARDS_HID_DLGCORRESPONDENCE_OPTIONLETTER2", # HID:34636
+ "HID:WIZARDS_HID_DLGCORRESPONDENCE_LETTEROKAY", # HID:34637
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGSTYLES_DIALOG", # HID:34650
+ "HID:WIZARDS_HID_DLGSTYLES_LISTBOX", # HID:34651
+ "HID:WIZARDS_HID_DLGSTYLES_CANCEL", # HID:34652
+ "HID:WIZARDS_HID_DLGSTYLES_OKAY", # HID:34653
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGCONVERT_DIALOG", # HID:34660
+ "HID:WIZARDS_HID_DLGCONVERT_CHECKBOX1", # HID:34661
+ "HID:WIZARDS_HID_DLGCONVERT_OPTIONBUTTON1", # HID:34662
+ "HID:WIZARDS_HID_DLGCONVERT_OPTIONBUTTON2", # HID:34663
+ "HID:WIZARDS_HID_DLGCONVERT_OPTIONBUTTON3", # HID:34664
+ "HID:WIZARDS_HID_DLGCONVERT_OPTIONBUTTON4", # HID:34665
+ "HID:WIZARDS_HID_DLGCONVERT_LISTBOX1", # HID:34666
+ "HID:WIZARDS_HID_DLGCONVERT_OBFILE", # HID:34667
+ "HID:WIZARDS_HID_DLGCONVERT_OBDIR", # HID:34668
+ "HID:WIZARDS_HID_DLGCONVERT_COMBOBOX1", # HID:34669
+ "HID:WIZARDS_HID_DLGCONVERT_TBSOURCE", # HID:34670
+ "HID:WIZARDS_HID_DLGCONVERT_CHECKRECURSIVE", # HID:34671
+ "HID:WIZARDS_HID_DLGCONVERT_TBTARGET", # HID:34672
+ "HID:WIZARDS_HID_DLGCONVERT_CBCANCEL", # HID:34673
+ "HID:WIZARDS_HID_DLGCONVERT_CBHELP", # HID:34674
+ "HID:WIZARDS_HID_DLGCONVERT_CBBACK", # HID:34675
+ "HID:WIZARDS_HID_DLGCONVERT_CBGOON", # HID:34676
+ "HID:WIZARDS_HID_DLGCONVERT_CBSOURCEOPEN", # HID:34677
+ "HID:WIZARDS_HID_DLGCONVERT_CBTARGETOPEN", # HID:34678
+ "HID:WIZARDS_HID_DLGCONVERT_CHKPROTECT", # HID:34679
+ "HID:WIZARDS_HID_DLGCONVERT_CHKTEXTDOCUMENTS", # HID:34680
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGPASSWORD_CMDGOON", # HID:34690
+ "HID:WIZARDS_HID_DLGPASSWORD_CMDCANCEL", # HID:34691
+ "HID:WIZARDS_HID_DLGPASSWORD_CMDHELP", # HID:34692
+ "HID:WIZARDS_HID_DLGPASSWORD_TXTPASSWORD", # HID:34693
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_DIALOG", # HID:34700
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_1_PREVIEW", # HID:34701
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_1_OPYEAR", # HID:34702
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_1_OPMONTH", # HID:34703
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_1_EDYEAR", # HID:34704
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_1_EDMONTH", # HID:34705
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_1_SPINYEAR", # HID:34706
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_1_SPINMONTH", # HID:34707
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_1_CMBSTATE", # HID:34708
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_2_LBOWNDATA", # HID:34709
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_2_CMDINSERT", # HID:34710
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_2_CMDDELETE", # HID:34711
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_2_EDEVENT", # HID:34712
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_2_CHKEVENT", # HID:34713
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_2_EDEVENTDAY", # HID:34714
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_2_SPINEVENTDAY", # HID:34715
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_2_EDEVENTMONTH", # HID:34716
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_2_SPINEVENTMONTH", # HID:34717
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_2_EDEVENTYEAR", # HID:34718
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_2_SPINEVENTYEAR", # HID:34719
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_0_CMDOWNDATA", # HID:34720
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_0_CMDCANCEL", # HID:34721
+ "HID:WIZARDS_HID_DLGHOLIDAYCAL_0_CMDOK" # HID:34722
+ ]
+ array2 = ["HID:WIZARDS_HID_LTRWIZ_OPTBUSINESSLETTER", # HID:40769
+ "HID:WIZARDS_HID_LTRWIZ_OPTPRIVOFFICIALLETTER", # HID:40770
+ "HID:WIZARDS_HID_LTRWIZ_OPTPRIVATELETTER", # HID:40771
+ "HID:WIZARDS_HID_LTRWIZ_LSTBUSINESSSTYLE", # HID:40772
+ "HID:WIZARDS_HID_LTRWIZ_CHKBUSINESSPAPER", # HID:40773
+ "HID:WIZARDS_HID_LTRWIZ_LSTPRIVOFFICIALSTYLE", # HID:40774
+ "HID:WIZARDS_HID_LTRWIZ_LSTPRIVATESTYLE", # HID:40775
+ "HID:WIZARDS_HID_LTRWIZ_CHKPAPERCOMPANYLOGO", # HID:40776
+ "HID:WIZARDS_HID_LTRWIZ_NUMLOGOHEIGHT", # HID:40777
+ "HID:WIZARDS_HID_LTRWIZ_NUMLOGOX", # HID:40778
+ "HID:WIZARDS_HID_LTRWIZ_NUMLOGOWIDTH", # HID:40779
+ "HID:WIZARDS_HID_LTRWIZ_NUMLOGOY", # HID:40780
+ "HID:WIZARDS_HID_LTRWIZ_CHKPAPERCOMPANYADDRESS", # HID:40781
+ "HID:WIZARDS_HID_LTRWIZ_NUMADDRESSHEIGHT", # HID:40782
+ "HID:WIZARDS_HID_LTRWIZ_NUMADDRESSX", # HID:40783
+ "HID:WIZARDS_HID_LTRWIZ_NUMADDRESSWIDTH", # HID:40784
+ "HID:WIZARDS_HID_LTRWIZ_NUMADDRESSY", # HID:40785
+ "HID:WIZARDS_HID_LTRWIZ_CHKCOMPANYRECEIVER", # HID:40786
+ "HID:WIZARDS_HID_LTRWIZ_CHKPAPERFOOTER", # HID:40787
+ "HID:WIZARDS_HID_LTRWIZ_NUMFOOTERHEIGHT", # HID:40788
+ "HID:WIZARDS_HID_LTRWIZ_LSTLETTERNORM", # HID:40789
+ "HID:WIZARDS_HID_LTRWIZ_CHKUSELOGO", # HID:40790
+ "HID:WIZARDS_HID_LTRWIZ_CHKUSEADDRESSRECEIVER", # HID:40791
+ "HID:WIZARDS_HID_LTRWIZ_CHKUSESIGNS", # HID:40792
+ "HID:WIZARDS_HID_LTRWIZ_CHKUSESUBJECT", # HID:40793
+ "HID:WIZARDS_HID_LTRWIZ_CHKUSESALUTATION", # HID:40794
+ "HID:WIZARDS_HID_LTRWIZ_LSTSALUTATION", # HID:40795
+ "HID:WIZARDS_HID_LTRWIZ_CHKUSEBENDMARKS", # HID:40796
+ "HID:WIZARDS_HID_LTRWIZ_CHKUSEGREETING", # HID:40797
+ "HID:WIZARDS_HID_LTRWIZ_LSTGREETING", # HID:40798
+ "HID:WIZARDS_HID_LTRWIZ_CHKUSEFOOTER", # HID:40799
+ "HID:WIZARDS_HID_LTRWIZ_OPTSENDERPLACEHOLDER", # HID:40800
+ "HID:WIZARDS_HID_LTRWIZ_OPTSENDERDEFINE", # HID:40801
+ "HID:WIZARDS_HID_LTRWIZ_TXTSENDERNAME", # HID:40802
+ "HID:WIZARDS_HID_LTRWIZ_TXTSENDERSTREET", # HID:40803
+ "HID:WIZARDS_HID_LTRWIZ_TXTSENDERPOSTCODE", # HID:40804
+ "HID:WIZARDS_HID_LTRWIZ_TXTSENDERSTATE_TEXT", # HID:40805
+ "HID:WIZARDS_HID_LTRWIZ_TXTSENDERCITY", # HID:40806
+ "HID:WIZARDS_HID_LTRWIZ_OPTRECEIVERPLACEHOLDER", # HID:40807
+ "HID:WIZARDS_HID_LTRWIZ_OPTRECEIVERDATABASE", # HID:40808
+ "HID:WIZARDS_HID_LTRWIZ_TXTFOOTER", # HID:40809
+ "HID:WIZARDS_HID_LTRWIZ_CHKFOOTERNEXTPAGES", # HID:40810
+ "HID:WIZARDS_HID_LTRWIZ_CHKFOOTERPAGENUMBERS", # HID:40811
+ "HID:WIZARDS_HID_LTRWIZ_TXTTEMPLATENAME", # HID:40812
+ "HID:WIZARDS_HID_LTRWIZ_OPTCREATELETTER", # HID:40813
+ "HID:WIZARDS_HID_LTRWIZ_OPTMAKECHANGES", # HID:40814
+ "HID:WIZARDS_HID_LTRWIZ_TXTPATH", # HID:40815
+ "HID:WIZARDS_HID_LTRWIZ_CMDPATH", # HID:40816
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_LTRWIZARD", # HID:40820
+ "HID:WIZARDS_HID_LTRWIZARD_HELP", # HID:40821
+ "HID:WIZARDS_HID_LTRWIZARD_BACK", # HID:40822
+ "HID:WIZARDS_HID_LTRWIZARD_NEXT", # HID:40823
+ "HID:WIZARDS_HID_LTRWIZARD_CREATE", # HID:40824
+ "HID:WIZARDS_HID_LTRWIZARD_CANCEL", # HID:40825
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTTABLES", # HID:40850
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTFIELDS", # HID:40851
+ "HID:WIZARDS_HID_QUERYWIZARD_CMDMOVESELECTED", # HID:40852
+ "HID:WIZARDS_HID_QUERYWIZARD_CMDMOVEALL", # HID:40853
+ "HID:WIZARDS_HID_QUERYWIZARD_CMDREMOVESELECTED", # HID:40854
+ "HID:WIZARDS_HID_QUERYWIZARD_CMDREMOVEALL", # HID:40855
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTSELFIELDS", # HID:40856
+ "HID:WIZARDS_HID_QUERYWIZARD_CMDMOVEUP", # HID:40857
+ "HID:WIZARDS_HID_QUERYWIZARD_CMDMOVEDOWN", # HID:40858
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_QUERYWIZARD_SORT1", # HID:40865
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTASCEND1", # HID:40866
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTDESCEND1", # HID:40867
+ "HID:WIZARDS_HID_QUERYWIZARD_SORT2", # HID:40868
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTASCEND2", # HID:40869
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTDESCEND2", # HID:40870
+ "HID:WIZARDS_HID_QUERYWIZARD_SORT3", # HID:40871
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTASCEND3", # HID:40872
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTDESCEND3", # HID:40873
+ "HID:WIZARDS_HID_QUERYWIZARD_SORT4", # HID:40874
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTASCEND4", # HID:40875
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTDESCEND4", # HID:40876
+ "",
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTMATCHALL", # HID:40878
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTMATCHANY", # HID:40879
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTFIELDNAME_1", # HID:40880
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTOPERATOR_1", # HID:40881
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTVALUE_1", # HID:40882
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTFIELDNAME_2", # HID:40883
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTOPERATOR_2", # HID:40884
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTVALUE_2", # HID:40885
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTFIELDNAME_3", # HID:40886
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTOPERATOR_3", # HID:40887
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTVALUE_3", # HID:40888
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTAGGREGATEDETAILQUERY", # HID:40895
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTAGGREGATESUMMARYQUERY", # HID:40896
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTAGGREGATEFUNCTION_1", # HID:40897
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTAGGREGATEFIELDS_1", # HID:40898
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTAGGREGATEFUNCTION_2", # HID:40899
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTAGGREGATEFIELDS_2", # HID:40900
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTAGGREGATEFUNCTION_3", # HID:40901
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTAGGREGATEFIELDS_3", # HID:40902
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTAGGREGATEFUNCTION_4", # HID:40903
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTAGGREGATEFIELDS_4", # HID:40904
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTAGGREGATEFUNCTION_5", # HID:40905
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTAGGREGATEFIELDS_5", # HID:40906
+ "HID:WIZARDS_HID_QUERYWIZARD_BTNAGGREGATEPLUS", # HID:40907
+ "HID:WIZARDS_HID_QUERYWIZARD_BTNAGGREGATEMINUS", # HID:40908
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTFILTERFIELDS", # HID:40915
+ "HID:WIZARDS_HID_QUERYWIZARD_CMDFILTERMOVESELECTED", # HID:40916
+ "HID:WIZARDS_HID_QUERYWIZARD_CMDFILTERREMOVESELECTED", # HID:40917
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTFILTERSELFIELDS", # HID:40918
+ "HID:WIZARDS_HID_QUERYWIZARD_CMDFILTERMOVEUP", # HID:40919
+ "HID:WIZARDS_HID_QUERYWIZARD_CMDFILTERMOVEDOWN", # HID:40920
+ "",
+ "",
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTGROUPMATCHALL", # HID:40923
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTGROUPMATCHANY", # HID:40924
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTFILTERFIELDNAME_1", # HID:40925
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTFILTEROPERATOR_1", # HID:40926
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTFILTERVALUE_1", # HID:40927
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTFILTERFIELDNAME_2", # HID:40928
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTFILTEROPERATOR_2", # HID:40929
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTFILTERVALUE_2", # HID:40930
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTFILTERFIELDNAME_3", # HID:40931
+ "HID:WIZARDS_HID_QUERYWIZARD_LSTFILTEROPERATOR_3", # HID:40932
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTFILTERVALUE_3", # HID:40933
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTTITLE_1", # HID:40940
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTTITLE_2", # HID:40941
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTTITLE_3", # HID:40942
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTTITLE_4", # HID:40943
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTTITLE_5", # HID:40944
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTTITLE_6", # HID:40945
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTTITLE_7", # HID:40946
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTQUERYTITLE", # HID:40955
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTDISPLAYQUERY", # HID:40956
+ "HID:WIZARDS_HID_QUERYWIZARD_OPTMODIFYQUERY", # HID:40957
+ "HID:WIZARDS_HID_QUERYWIZARD_TXTSUMMARY", # HID:40958
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_QUERYWIZARD", # HID:40970
+ "",
+ "HID:WIZARDS_HID_QUERYWIZARD_BACK", # HID:40972
+ "HID:WIZARDS_HID_QUERYWIZARD_NEXT", # HID:40973
+ "HID:WIZARDS_HID_QUERYWIZARD_CREATE", # HID:40974
+ "HID:WIZARDS_HID_QUERYWIZARD_CANCEL", # HID:40975
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_IS", # HID:41000
+ "", "HID:WIZARDS_HID_IS_BTN_NONE", # HID:41002
+ "HID:WIZARDS_HID_IS_BTN_OK", # HID:41003
+ "HID:WIZARDS_HID_IS_BTN_CANCEL", # HID:41004
+ "HID:WIZARDS_HID_IS_BTN_IMG1", # HID:41005
+ "HID:WIZARDS_HID_IS_BTN_IMG2", # HID:41006
+ "HID:WIZARDS_HID_IS_BTN_IMG3", # HID:41007
+ "HID:WIZARDS_HID_IS_BTN_IMG4", # HID:41008
+ "HID:WIZARDS_HID_IS_BTN_IMG5", # HID:41009
+ "HID:WIZARDS_HID_IS_BTN_IMG6", # HID:41010
+ "HID:WIZARDS_HID_IS_BTN_IMG7", # HID:41011
+ "HID:WIZARDS_HID_IS_BTN_IMG8", # HID:41012
+ "HID:WIZARDS_HID_IS_BTN_IMG9", # HID:41013
+ "HID:WIZARDS_HID_IS_BTN_IMG10", # HID:41014
+ "HID:WIZARDS_HID_IS_BTN_IMG11", # HID:41015
+ "HID:WIZARDS_HID_IS_BTN_IMG12", # HID:41016
+ "HID:WIZARDS_HID_IS_BTN_IMG13", # HID:41017
+ "HID:WIZARDS_HID_IS_BTN_IMG14", # HID:41018
+ "HID:WIZARDS_HID_IS_BTN_IMG15", # HID:41019
+ "HID:WIZARDS_HID_IS_BTN_IMG16", # HID:41020
+ "HID:WIZARDS_HID_IS_BTN_IMG17", # HID:41021
+ "HID:WIZARDS_HID_IS_BTN_IMG18", # HID:41022
+ "HID:WIZARDS_HID_IS_BTN_IMG19", # HID:41023
+ "HID:WIZARDS_HID_IS_BTN_IMG20", # HID:41024
+ "HID:WIZARDS_HID_IS_BTN_IMG21", # HID:41025
+ "HID:WIZARDS_HID_IS_BTN_IMG22", # HID:41026
+ "HID:WIZARDS_HID_IS_BTN_IMG23", # HID:41027
+ "HID:WIZARDS_HID_IS_BTN_IMG24", # HID:41028
+ "HID:WIZARDS_HID_IS_BTN_IMG25", # HID:41029
+ "HID:WIZARDS_HID_IS_BTN_IMG26", # HID:41030
+ "HID:WIZARDS_HID_IS_BTN_IMG27", # HID:41031
+ "HID:WIZARDS_HID_IS_BTN_IMG28", # HID:41032
+ "HID:WIZARDS_HID_IS_BTN_IMG29", # HID:41033
+ "HID:WIZARDS_HID_IS_BTN_IMG30", # HID:41034
+ "HID:WIZARDS_HID_IS_BTN_IMG31", # HID:41035
+ "HID:WIZARDS_HID_IS_BTN_IMG32", # HID:41036
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_FTP", # HID:41040
+ "HID:WIZARDS_HID_FTP_SERVER", # HID:41041
+ "HID:WIZARDS_HID_FTP_USERNAME", # HID:41042
+ "HID:WIZARDS_HID_FTP_PASS", # HID:41043
+ "HID:WIZARDS_HID_FTP_TEST", # HID:41044
+ "HID:WIZARDS_HID_FTP_TXT_PATH", # HID:41045
+ "HID:WIZARDS_HID_FTP_BTN_PATH", # HID:41046
+ "HID:WIZARDS_HID_FTP_OK", # HID:41047
+ "HID:WIZARDS_HID_FTP_CANCEL", # HID:41048
+ "",
+ "",
+ "HID:WIZARDS_HID_AGWIZ", # HID:41051
+ "HID:WIZARDS_HID_AGWIZ_HELP", # HID:41052
+ "HID:WIZARDS_HID_AGWIZ_NEXT", # HID:41053
+ "HID:WIZARDS_HID_AGWIZ_PREV", # HID:41054
+ "HID:WIZARDS_HID_AGWIZ_CREATE", # HID:41055
+ "HID:WIZARDS_HID_AGWIZ_CANCEL", # HID:41056
+ "HID:WIZARDS_HID_AGWIZ_1_LIST_PAGEDESIGN", # HID:41057
+ "HID:WIZARDS_HID_AGWIZ_1_CHK_MINUTES", # HID:41058
+ "HID:WIZARDS_HID_AGWIZ_2_TXT_TIME", # HID:41059
+ "HID:WIZARDS_HID_AGWIZ_2_TXT_DATE", # HID:41060
+ "HID:WIZARDS_HID_AGWIZ_2_TXT_TITLE", # HID:41061
+ "HID:WIZARDS_HID_AGWIZ_2_TXT_LOCATION", # HID:41062
+ "HID:WIZARDS_HID_AGWIZ_3_CHK_MEETING_TYPE", # HID:41063
+ "HID:WIZARDS_HID_AGWIZ_3_CHK_READ", # HID:41064
+ "HID:WIZARDS_HID_AGWIZ_3_CHK_BRING", # HID:41065
+ "HID:WIZARDS_HID_AGWIZ_3_CHK_NOTES", # HID:41066
+ "HID:WIZARDS_HID_AGWIZ_4_CHK_CALLED_BY", # HID:41067
+ "HID:WIZARDS_HID_AGWIZ_4_CHK_FACILITATOR", # HID:41068
+ "HID:WIZARDS_HID_AGWIZ_4_CHK_NOTETAKER", # HID:41069
+ "HID:WIZARDS_HID_AGWIZ_4_CHK_TIMEKEEPER", # HID:41070
+ "HID:WIZARDS_HID_AGWIZ_4_CHK_ATTENDEES", # HID:41071
+ "HID:WIZARDS_HID_AGWIZ_4_CHK_OBSERVERS", # HID:41072
+ "HID:WIZARDS_HID_AGWIZ_4_CHK_RESOURCEPERSONS", # HID:41073
+ "HID:WIZARDS_HID_AGWIZ_6_TXT_TEMPLATENAME", # HID:41074
+ "HID:WIZARDS_HID_AGWIZ_6_TXT_TEMPLATEPATH", # HID:41075
+ "HID:WIZARDS_HID_AGWIZ_6_BTN_TEMPLATEPATH", # HID:41076
+ "HID:WIZARDS_HID_AGWIZ_6_OPT_CREATEAGENDA", # HID:41077
+ "HID:WIZARDS_HID_AGWIZ_6_OPT_MAKECHANGES", # HID:41078
+ "HID:WIZARDS_HID_AGWIZ_5_BTN_INSERT", # HID:41079
+ "HID:WIZARDS_HID_AGWIZ_5_BTN_REMOVE", # HID:41080
+ "HID:WIZARDS_HID_AGWIZ_5_BTN_UP", # HID:41081
+ "HID:WIZARDS_HID_AGWIZ_5_BTN_DOWN", # HID:41082
+ "HID:WIZARDS_HID_AGWIZ_5_SCROLL_BAR", # HID:41083
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_TOPIC_1", # HID:41084
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_RESPONSIBLE_1", # HID:41085
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_MINUTES_1", # HID:41086
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_TOPIC_2", # HID:41087
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_RESPONSIBLE_2", # HID:41088
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_MINUTES_2", # HID:41089
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_TOPIC_3", # HID:41090
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_RESPONSIBLE_3", # HID:41091
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_MINUTES_3", # HID:41092
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_TOPIC_4", # HID:41093
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_RESPONSIBLE_4", # HID:41094
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_MINUTES_4", # HID:41095
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_TOPIC_5", # HID:41096
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_RESPONSIBLE_5", # HID:41097
+ "HID:WIZARDS_HID_AGWIZ_5_TXT_MINUTES_5", # HID:41098
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_FAXWIZ_OPTBUSINESSFAX", # HID:41120
+ "HID:WIZARDS_HID_FAXWIZ_LSTBUSINESSSTYLE", # HID:41121
+ "HID:WIZARDS_HID_FAXWIZ_OPTPRIVATEFAX", # HID:41122
+ "HID:WIZARDS_HID_LSTPRIVATESTYLE", # HID:41123
+ "HID:WIZARDS_HID_IMAGECONTROL3", # HID:41124
+ "HID:WIZARDS_HID_CHKUSELOGO", # HID:41125
+ "HID:WIZARDS_HID_CHKUSEDATE", # HID:41126
+ "HID:WIZARDS_HID_CHKUSECOMMUNICATIONTYPE", # HID:41127
+ "HID:WIZARDS_HID_LSTCOMMUNICATIONTYPE", # HID:41128
+ "HID:WIZARDS_HID_CHKUSESUBJECT", # HID:41129
+ "HID:WIZARDS_HID_CHKUSESALUTATION", # HID:41130
+ "HID:WIZARDS_HID_LSTSALUTATION", # HID:41131
+ "HID:WIZARDS_HID_CHKUSEGREETING", # HID:41132
+ "HID:WIZARDS_HID_LSTGREETING", # HID:41133
+ "HID:WIZARDS_HID_CHKUSEFOOTER", # HID:41134
+ "HID:WIZARDS_HID_OPTSENDERPLACEHOLDER", # HID:41135
+ "HID:WIZARDS_HID_OPTSENDERDEFINE", # HID:41136
+ "HID:WIZARDS_HID_TXTSENDERNAME", # HID:41137
+ "HID:WIZARDS_HID_TXTSENDERSTREET", # HID:41138
+ "HID:WIZARDS_HID_TXTSENDERPOSTCODE", # HID:41139
+ "HID:WIZARDS_HID_TXTSENDERSTATE", # HID:41140
+ "HID:WIZARDS_HID_TXTSENDERCITY", # HID:41141
+ "HID:WIZARDS_HID_TXTSENDERFAX", # HID:41142
+ "HID:WIZARDS_HID_OPTRECEIVERPLACEHOLDER", # HID:41143
+ "HID:WIZARDS_HID_OPTRECEIVERDATABASE", # HID:41144
+ "HID:WIZARDS_HID_TXTFOOTER", # HID:41145
+ "HID:WIZARDS_HID_CHKFOOTERNEXTPAGES", # HID:41146
+ "HID:WIZARDS_HID_CHKFOOTERPAGENUMBERS", # HID:41147
+ "HID:WIZARDS_HID_TXTTEMPLATENAME", # HID:41148
+ "HID:WIZARDS_HID_FILETEMPLATEPATH", # HID:41149
+ "HID:WIZARDS_HID_OPTCREATEFAX", # HID:41150
+ "HID:WIZARDS_HID_OPTMAKECHANGES", # HID:41151
+ "HID:WIZARDS_HID_IMAGECONTROL2", # HID:41152
+ "HID:WIZARDS_HID_FAXWIZ_TXTPATH", # HID:41153
+ "HID:WIZARDS_HID_FAXWIZ_CMDPATH", # HID:41154
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_FAXWIZARD", # HID:41180
+ "HID:WIZARDS_HID_FAXWIZARD_HELP", # HID:41181
+ "HID:WIZARDS_HID_FAXWIZARD_BACK", # HID:41182
+ "HID:WIZARDS_HID_FAXWIZARD_NEXT", # HID:41183
+ "HID:WIZARDS_HID_FAXWIZARD_CREATE", # HID:41184
+ "HID:WIZARDS_HID_FAXWIZARD_CANCEL", # HID:41185
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGTABLE_DIALOG", # HID:41200
+ "",
+ "HID:WIZARDS_HID_DLGTABLE_CMDPREV", # HID:41202
+ "HID:WIZARDS_HID_DLGTABLE_CMDNEXT", # HID:41203
+ "HID:WIZARDS_HID_DLGTABLE_CMDFINISH", # HID:41204
+ "HID:WIZARDS_HID_DLGTABLE_CMDCANCEL", # HID:41205
+ "HID:WIZARDS_HID_DLGTABLE_OPTBUSINESS", # HID:41206
+ "HID:WIZARDS_HID_DLGTABLE_OPTPRIVATE", # HID:41207
+ "HID:WIZARDS_HID_DLGTABLE_LBTABLES", # HID:41208
+ "HID:WIZARDS_HID_DLGTABLE_FIELDSAVAILABLE", # HID:41209
+ "HID:WIZARDS_HID_DLGTABLE_CMDMOVESELECTED", # HID:41210
+ "HID:WIZARDS_HID_DLGTABLE_CMDMOVEALL", # HID:41211
+ "HID:WIZARDS_HID_DLGTABLE_CMDREMOVESELECTED", # HID:41212
+ "HID:WIZARDS_HID_DLGTABLE_CMDREMOVEALL", # HID:41213
+ "HID:WIZARDS_HID_DLGTABLE_FIELDSSELECTED", # HID:41214
+ "HID:WIZARDS_HID_DLGTABLE_CMDMOVEUP", # HID:41215
+ "HID:WIZARDS_HID_DLGTABLE_CMDMOVEDOWN", # HID:41216
+ "",
+ "",
+ "",
+ "HID:WIZARDS_HID_DLGTABLE_LB_SELFIELDNAMES", # HID:41220
+ "HID:WIZARDS_HID_DLGTABLE_CMDMOVEFIELDUP", # HID:41221
+ "HID:WIZARDS_HID_DLGTABLE_CMDMOVEFIELDDOWN", # HID:41222
+ "HID:WIZARDS_HID_DLGTABLE_CMDMINUS", # HID:41223
+ "HID:WIZARDS_HID_DLGTABLE_CMDPLUS", # HID:41224
+ "HID:WIZARDS_HID_DLGTABLE_COLNAME", # HID:41225
+ "HID:WIZARDS_HID_DLGTABLE_COLMODIFIER", # HID:41226
+ "HID:WIZARDS_HID_DLGTABLE_CHK_USEPRIMEKEY", # HID:41227
+ "HID:WIZARDS_HID_DLGTABLE_OPT_PK_AUTOMATIC", # HID:41228
+ "HID:WIZARDS_HID_DLGTABLE_CK_PK_AUTOVALUE_AUTOMATIC", # HID:41229
+ "HID:WIZARDS_HID_DLGTABLE_OPT_PK_SINGLE", # HID:41230
+ "HID:WIZARDS_HID_DLGTABLE_LB_PK_FIELDNAME", # HID:41231
+ "HID:WIZARDS_HID_DLGTABLE_CK_PK_AUTOVALUE", # HID:41232
+ "HID:WIZARDS_HID_DLGTABLE_OPT_PK_SEVERAL", # HID:41233
+ "HID:WIZARDS_HID_DLGTABLE_FIELDS_PK_AVAILABLE", # HID:41234
+ "HID:WIZARDS_HID_DLGTABLE_CMDMOVE_PK_SELECTED", # HID:41235
+ "HID:WIZARDS_HID_DLGTABLE_CMDREMOVE_PK_SELECTED", # HID:41236
+ "HID:WIZARDS_HID_DLGTABLE_FIELDS_PK_SELECTED", # HID:41237
+ "HID:WIZARDS_HID_DLGTABLE_CMDMOVEUP_PK_SELECTED", # HID:41238
+ "HID:WIZARDS_HID_DLGTABLE_CMDMOVEDOWN_PK_SELECTED", # HID:41239
+ "HID:WIZARDS_HID_DLGTABLE_TXT_NAME", # HID:41240
+ "HID:WIZARDS_HID_DLGTABLE_OPT_MODIFYTABLE", # HID:41241
+ "HID:WIZARDS_HID_DLGTABLE_OPT_WORKWITHTABLE", # HID:41242
+ "HID:WIZARDS_HID_DLGTABLE_OPT_STARTFORMWIZARD", # HID:41243
+ "HID:WIZARDS_HID_DLGTABLE_LST_CATALOG", # HID:41244
+ "HID:WIZARDS_HID_DLGTABLE_LST_SCHEMA" # HID:41245
+ ]
+
+ @classmethod
+ def getHelpIdString(self, nHelpId):
+ if nHelpId >= 34200 and nHelpId <= 34722:
+ return HelpIds.array1[nHelpId - 34200]
+ elif nHelpId >= 40769 and nHelpId <= 41245:
+ return HelpIds.array2[nHelpId - 40769]
+ else:
+ return None
+
diff --git a/wizards/com/sun/star/wizards/common/Helper.py b/wizards/com/sun/star/wizards/common/Helper.py
new file mode 100644
index 000000000000..908aa78a1b2b
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/Helper.py
@@ -0,0 +1,242 @@
+import uno
+import locale
+import traceback
+from com.sun.star.uno import Exception as UnoException
+from com.sun.star.uno import RuntimeException
+
+#TEMPORAL
+import inspect
+
+class Helper(object):
+
+ DAY_IN_MILLIS = (24 * 60 * 60 * 1000)
+
+ def convertUnoDatetoInteger(self, DateValue):
+ oCal = java.util.Calendar.getInstance()
+ oCal.set(DateValue.Year, DateValue.Month, DateValue.Day)
+ dTime = oCal.getTime()
+ lTime = dTime.getTime()
+ lDate = lTime / (3600 * 24000)
+ return lDate
+
+ @classmethod
+ def setUnoPropertyValue(self, xPSet, PropertyName, PropertyValue):
+ try:
+ if xPSet.getPropertySetInfo().hasPropertyByName(PropertyName):
+ #xPSet.setPropertyValue(PropertyName, PropertyValue)
+ uno.invoke(xPSet,"setPropertyValue", (PropertyName,PropertyValue))
+ else:
+ selementnames = xPSet.getPropertySetInfo().getProperties()
+ raise ValueError("No Such Property: '" + PropertyName + "'");
+
+ except UnoException, exception:
+ print type(PropertyValue)
+ traceback.print_exc()
+
+ @classmethod
+ def getUnoObjectbyName(self, xName, ElementName):
+ try:
+ if xName.hasByName(ElementName) == True:
+ return xName.getByName(ElementName)
+ else:
+ raise RuntimeException();
+
+ except UnoException, exception:
+ traceback.print_exc()
+ return None
+
+ @classmethod
+ def getPropertyValue(self, CurPropertyValue, PropertyName):
+ MaxCount = len(CurPropertyValue)
+ i = 0
+ while i < MaxCount:
+ if CurPropertyValue[i] is not None:
+ if CurPropertyValue[i].Name.equals(PropertyName):
+ return CurPropertyValue[i].Value
+
+ i += 1
+ raise RuntimeException()
+
+ @classmethod
+ def getPropertyValuefromAny(self, CurPropertyValue, PropertyName):
+ try:
+ if CurPropertyValue is not None:
+ MaxCount = len(CurPropertyValue)
+ i = 0
+ while i < MaxCount:
+ if CurPropertyValue[i] is not None:
+ aValue = CurPropertyValue[i]
+ if aValue is not None and aValue.Name.equals(PropertyName):
+ return aValue.Value
+
+ i += 1
+ return None
+ except UnoException, exception:
+ traceback.print_exc()
+ return None
+
+ @classmethod
+ def getUnoPropertyValue(self, xPSet, PropertyName):
+ try:
+ if xPSet is not None:
+ oObject = xPSet.getPropertyValue(PropertyName)
+ if oObject is not None:
+ return oObject
+ return None
+
+ except UnoException, exception:
+ traceback.print_exc()
+ return None
+
+ @classmethod
+ def getUnoArrayPropertyValue(self, xPSet, PropertyName):
+ try:
+ if xPSet is not None:
+ oObject = xPSet.getPropertyValue(PropertyName)
+ if isinstance(oObject,list):
+ return getArrayValue(oObject)
+
+ except UnoException, exception:
+ traceback.print_exc()
+
+ return None
+
+ @classmethod
+ def getUnoStructValue(self, xPSet, PropertyName):
+ try:
+ if xPSet is not None:
+ if xPSet.getPropertySetInfo().hasPropertyByName(PropertyName) == True:
+ oObject = xPSet.getPropertyValue(PropertyName)
+ return oObject
+
+ return None
+ except UnoException, exception:
+ traceback.print_exc()
+ return None
+
+ @classmethod
+ def setUnoPropertyValues(self, xMultiPSetLst, PropertyNames, PropertyValues):
+ try:
+ if xMultiPSetLst is not None:
+ uno.invoke(xMultiPSetLst, "setPropertyValues", (PropertyNames, PropertyValues))
+ else:
+ i = 0
+ while i < len(PropertyNames):
+ self.setUnoPropertyValue(xMultiPSetLst, PropertyNames[i], PropertyValues[i])
+ i += 1
+
+ except Exception, e:
+ curframe = inspect.currentframe()
+ calframe = inspect.getouterframes(curframe, 2)
+ #print "caller name:", calframe[1][3]
+ traceback.print_exc()
+
+ '''
+ checks if the value of an object that represents an array is null.
+ check beforehand if the Object is really an array with "AnyConverter.IsArray(oObject)
+ @param oValue the paramter that has to represent an object
+ @return a null reference if the array is empty
+ '''
+
+ @classmethod
+ def getArrayValue(self, oValue):
+ try:
+ #VetoableChangeSupport Object
+ oPropList = list(oValue)
+ nlen = len(oPropList)
+ if nlen == 0:
+ return None
+ else:
+ return oPropList
+
+ except UnoException, exception:
+ traceback.print_exc()
+ return None
+
+ def getComponentContext(_xMSF):
+ # Get the path to the extension and try to add the path to the class loader
+ aHelper = PropertySetHelper(_xMSF);
+ aDefaultContext = aHelper.getPropertyValueAsObject("DefaultContext");
+ return aDefaultContext;
+
+ def getMacroExpander(_xMSF):
+ xComponentContext = self.getComponentContext(_xMSF);
+ aSingleton = xComponentContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander");
+ return aSingleton;
+
+ class DateUtils(object):
+
+ @classmethod
+ def DateUtils_XMultiServiceFactory_Object(self, xmsf, document):
+ tmp = DateUtils()
+ tmp.DateUtils_body_XMultiServiceFactory_Object(xmsf, document)
+ return tmp
+
+ def DateUtils_body_XMultiServiceFactory_Object(self, xmsf, docMSF):
+ defaults = docMSF.createInstance("com.sun.star.text.Defaults")
+ l = Helper.getUnoStructValue(defaults, "CharLocale")
+ jl = locale.setlocale(l.Language, l.Country, l.Variant)
+ self.calendar = Calendar.getInstance(jl)
+ self.formatSupplier = document
+ formatSettings = self.formatSupplier.getNumberFormatSettings()
+ date = Helper.getUnoPropertyValue(formatSettings, "NullDate")
+ self.calendar.set(date.Year, date.Month - 1, date.Day)
+ self.docNullTime = getTimeInMillis()
+ self.formatter = NumberFormatter.createNumberFormatter(xmsf, self.formatSupplier)
+
+ '''
+ @param format a constant of the enumeration NumberFormatIndex
+ @return
+ '''
+
+ def getFormat(self, format):
+ return NumberFormatter.getNumberFormatterKey(self.formatSupplier, format)
+
+ def getFormatter(self):
+ return self.formatter
+
+ def getTimeInMillis(self):
+ dDate = self.calendar.getTime()
+ return dDate.getTime()
+
+ '''
+ @param date a VCL date in form of 20041231
+ @return a document relative date
+ '''
+
+ def getDocumentDateAsDouble(self, date):
+ self.calendar.clear()
+ self.calendar.set(date / 10000, (date % 10000) / 100 - 1, date % 100)
+ date1 = getTimeInMillis()
+ '''
+ docNullTime and date1 are in millis, but
+ I need a day...
+ '''
+
+ daysDiff = (date1 - self.docNullTime) / DAY_IN_MILLIS + 1
+ return daysDiff
+
+ def getDocumentDateAsDouble(self, date):
+ return getDocumentDateAsDouble(date.Year * 10000 + date.Month * 100 + date.Day)
+
+ def getDocumentDateAsDouble(self, javaTimeInMillis):
+ self.calendar.clear()
+ JavaTools.setTimeInMillis(self.calendar, javaTimeInMillis)
+ date1 = getTimeInMillis()
+
+ '''
+ docNullTime and date1 are in millis, but
+ I need a day...
+ '''
+
+ daysDiff = (date1 - self.docNullTime) / DAY_IN_MILLIS + 1
+ return daysDiff
+
+ def format(self, formatIndex, date):
+ return self.formatter.convertNumberToString(formatIndex, getDocumentDateAsDouble(date))
+
+ def format(self, formatIndex, date):
+ return self.formatter.convertNumberToString(formatIndex, getDocumentDateAsDouble(date))
+
+ def format(self, formatIndex, javaTimeInMillis):
+ return self.formatter.convertNumberToString(formatIndex, getDocumentDateAsDouble(javaTimeInMillis))
diff --git a/wizards/com/sun/star/wizards/common/Listener.py b/wizards/com/sun/star/wizards/common/Listener.py
new file mode 100644
index 000000000000..238f22cac1a9
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/Listener.py
@@ -0,0 +1,111 @@
+#**********************************************************************
+#
+# Danny.OOo.Listeners.ListenerProcAdapters.py
+#
+# A module to easily work with OpenOffice.org.
+#
+#**********************************************************************
+# Copyright (c) 2003-2004 Danny Brewer
+# d29583@groovegarden.com
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See: http://www.gnu.org/licenses/lgpl.html
+#
+#**********************************************************************
+# If you make changes, please append to the change log below.
+#
+# Change Log
+# Danny Brewer Revised 2004-06-05-01
+#
+#**********************************************************************
+
+# OOo's libraries
+import uno
+import unohelper
+
+#--------------------------------------------------
+# An ActionListener adapter.
+# This object implements com.sun.star.awt.XActionListener.
+# When actionPerformed is called, this will call an arbitrary
+# python procedure, passing it...
+# 1. the oActionEvent
+# 2. any other parameters you specified to this object's constructor (as a tuple).
+from com.sun.star.awt import XActionListener
+class ActionListenerProcAdapter( unohelper.Base, XActionListener ):
+ def __init__( self, oProcToCall, tParams=() ):
+ self.oProcToCall = oProcToCall # a python procedure
+ self.tParams = tParams # a tuple
+
+ # oActionEvent is a com.sun.star.awt.ActionEvent struct.
+ def actionPerformed( self, oActionEvent ):
+ if callable( self.oProcToCall ):
+ apply( self.oProcToCall, (oActionEvent,) + self.tParams )
+
+
+#--------------------------------------------------
+# An ItemListener adapter.
+# This object implements com.sun.star.awt.XItemListener.
+# When itemStateChanged is called, this will call an arbitrary
+# python procedure, passing it...
+# 1. the oItemEvent
+# 2. any other parameters you specified to this object's constructor (as a tuple).
+from com.sun.star.awt import XItemListener
+class ItemListenerProcAdapter( unohelper.Base, XItemListener ):
+ def __init__( self, oProcToCall, tParams=() ):
+ self.oProcToCall = oProcToCall # a python procedure
+ self.tParams = tParams # a tuple
+
+ # oItemEvent is a com.sun.star.awt.ItemEvent struct.
+ def itemStateChanged( self, oItemEvent ):
+ if callable( self.oProcToCall ):
+ apply( self.oProcToCall, (oItemEvent,) + self.tParams )
+
+
+#--------------------------------------------------
+# An TextListener adapter.
+# This object implements com.sun.star.awt.XTextistener.
+# When textChanged is called, this will call an arbitrary
+# python procedure, passing it...
+# 1. the oTextEvent
+# 2. any other parameters you specified to this object's constructor (as a tuple).
+from com.sun.star.awt import XTextListener
+class TextListenerProcAdapter( unohelper.Base, XTextListener ):
+ def __init__( self, oProcToCall, tParams=() ):
+ self.oProcToCall = oProcToCall # a python procedure
+ self.tParams = tParams # a tuple
+
+ # oTextEvent is a com.sun.star.awt.TextEvent struct.
+ def textChanged( self, oTextEvent ):
+ if callable( self.oProcToCall ):
+ apply( self.oProcToCall, (oTextEvent,) + self.tParams )
+
+#--------------------------------------------------
+# An Window adapter.
+# This object implements com.sun.star.awt.XWindowListener.
+# When textChanged is called, this will call an arbitrary
+# python procedure, passing it...
+# 1. the oTextEvent
+# 2. any other parameters you specified to this object's constructor (as a tuple).
+from com.sun.star.awt import XWindowListener
+class WindowListenerProcAdapter( unohelper.Base, XWindowListener ):
+ def __init__( self, oProcToCall, tParams=() ):
+ self.oProcToCall = oProcToCall # a python procedure
+ self.tParams = tParams # a tuple
+
+ # oTextEvent is a com.sun.star.awt.TextEvent struct.
+ def windowResized(self, actionEvent):
+ if callable( self.oProcToCall ):
+ apply( self.oProcToCall, (actionEvent,) + self.tParams )
diff --git a/wizards/com/sun/star/wizards/common/NoValidPathException.py b/wizards/com/sun/star/wizards/common/NoValidPathException.py
new file mode 100644
index 000000000000..96902883e5af
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/NoValidPathException.py
@@ -0,0 +1,9 @@
+class NoValidPathException(Exception):
+
+ def __init__(self, xMSF, _sText):
+ super(NoValidPathException,self).__init__(_sText)
+ # TODO: NEVER open a dialog in an exception
+ from SystemDialog import SystemDialog
+ if xMSF:
+ SystemDialog.showErrorBox(xMSF, "dbwizres", "dbw", 521) #OfficePathnotavailable
+
diff --git a/wizards/com/sun/star/wizards/common/PropertyNames.py b/wizards/com/sun/star/wizards/common/PropertyNames.py
new file mode 100644
index 000000000000..c1dde18522f3
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/PropertyNames.py
@@ -0,0 +1,15 @@
+class PropertyNames:
+ PROPERTY_ENABLED = "Enabled"
+ PROPERTY_HEIGHT = "Height"
+ PROPERTY_HELPURL = "HelpURL"
+ PROPERTY_POSITION_X = "PositionX"
+ PROPERTY_POSITION_Y = "PositionY"
+ PROPERTY_LABEL = "Label"
+ PROPERTY_MULTILINE = "MultiLine"
+ PROPERTY_NAME = "Name"
+ PROPERTY_STEP = "Step"
+ PROPERTY_WIDTH = "Width"
+ PROPERTY_TABINDEX = "TabIndex"
+ PROPERTY_STATE = "State"
+ PROPERTY_IMAGEURL = "ImageURL"
+
diff --git a/wizards/com/sun/star/wizards/common/PropertySetHelper.py b/wizards/com/sun/star/wizards/common/PropertySetHelper.py
new file mode 100644
index 000000000000..4960b5380e1c
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/PropertySetHelper.py
@@ -0,0 +1,242 @@
+from DebugHelper import *
+
+class PropertySetHelper(object):
+
+ @classmethod
+ def __init__(self, _aObj):
+ if not _aObj:
+ return
+
+ self.m_xPropertySet = _aObj
+
+ def getHashMap(self):
+ if self.m_aHashMap == None:
+ self.m_aHashMap = HashMap < String, Object >.Object()
+
+ return self.m_aHashMap
+
+ '''
+ set a property, don't throw any exceptions, they will only write down as a hint in the helper debug output
+ @param _sName name of the property to set
+ @param _aValue property value as object
+ '''
+
+ def setPropertyValueDontThrow(self, _sName, _aValue):
+ try:
+ setPropertyValue(_sName, _aValue)
+ except Exception, e:
+ DebugHelper.writeInfo("Don't throw the exception with property name(" + _sName + " ) : " + e.getMessage())
+
+ '''
+ set a property,
+ @param _sName name of the property to set
+ @param _aValue property value as object
+ @throws java.lang.Exception
+ '''
+
+ def setPropertyValue(self, _sName, _aValue):
+ if self.m_xPropertySet != None:
+ try:
+ self.m_xPropertySet.setPropertyValue(_sName, _aValue)
+ except com.sun.star.beans.UnknownPropertyException, e:
+ DebugHelper.writeInfo(e.getMessage())
+ DebugHelper.exception(e)
+ except com.sun.star.beans.PropertyVetoException, e:
+ DebugHelper.writeInfo(e.getMessage())
+ DebugHelper.exception(e)
+ except ValueError, e:
+ DebugHelper.writeInfo(e.getMessage())
+ DebugHelper.exception(e)
+ except com.sun.star.lang.WrappedTargetException, e:
+ DebugHelper.writeInfo(e.getMessage())
+ DebugHelper.exception(e)
+
+ else:
+ // DebugHelper.writeInfo("PropertySetHelper.setProperty() can't get XPropertySet");
+ getHashMap().put(_sName, _aValue)
+
+ '''
+ get a property and convert it to a int value
+ @param _sName the string name of the property
+ @param _nDefault if an error occur, return this value
+ @return the int value of the property
+ '''
+
+ def getPropertyValueAsInteger(self, _sName, _nDefault):
+ aObject = None
+ nValue = _nDefault
+ if self.m_xPropertySet != None:
+ try:
+ aObject = self.m_xPropertySet.getPropertyValue(_sName)
+ except com.sun.star.beans.UnknownPropertyException, e:
+ DebugHelper.writeInfo(e.getMessage())
+ except com.sun.star.lang.WrappedTargetException, e:
+ DebugHelper.writeInfo(e.getMessage())
+
+ if aObject != None:
+ try:
+ nValue = NumericalHelper.toInt(aObject)
+ except ValueError, e:
+ DebugHelper.writeInfo("can't convert a object to integer.")
+
+ return nValue
+
+ '''
+ get a property and convert it to a short value
+ @param _sName the string name of the property
+ @param _nDefault if an error occur, return this value
+ @return the int value of the property
+ '''
+
+ def getPropertyValueAsShort(self, _sName, _nDefault):
+ aObject = None
+ nValue = _nDefault
+ if self.m_xPropertySet != None:
+ try:
+ aObject = self.m_xPropertySet.getPropertyValue(_sName)
+ except com.sun.star.beans.UnknownPropertyException, e:
+ DebugHelper.writeInfo(e.getMessage())
+ except com.sun.star.lang.WrappedTargetException, e:
+ DebugHelper.writeInfo(e.getMessage())
+
+ if aObject != None:
+ try:
+ nValue = NumericalHelper.toShort(aObject)
+ except ValueError, e:
+ DebugHelper.writeInfo("can't convert a object to short.")
+
+ return nValue
+
+ '''
+ get a property and convert it to a double value
+ @param _sName the string name of the property
+ @param _nDefault if an error occur, return this value
+ @return the int value of the property
+ '''
+
+ def getPropertyValueAsDouble(self, _sName, _nDefault):
+ aObject = None
+ nValue = _nDefault
+ if self.m_xPropertySet != None:
+ try:
+ aObject = self.m_xPropertySet.getPropertyValue(_sName)
+ except com.sun.star.beans.UnknownPropertyException, e:
+ DebugHelper.writeInfo(e.getMessage())
+ except com.sun.star.lang.WrappedTargetException, e:
+ DebugHelper.writeInfo(e.getMessage())
+
+ if aObject == None:
+ if getHashMap().containsKey(_sName):
+ aObject = getHashMap().get(_sName)
+
+ if aObject != None:
+ try:
+ nValue = NumericalHelper.toDouble(aObject)
+ except ValueError, e:
+ DebugHelper.writeInfo("can't convert a object to integer.")
+
+ return nValue
+
+ '''
+ get a property and convert it to a boolean value
+ @param _sName the string name of the property
+ @param _bDefault if an error occur, return this value
+ @return the boolean value of the property
+ '''
+
+ def getPropertyValueAsBoolean(self, _sName, _bDefault):
+ aObject = None
+ bValue = _bDefault
+ if self.m_xPropertySet != None:
+ try:
+ aObject = self.m_xPropertySet.getPropertyValue(_sName)
+ except com.sun.star.beans.UnknownPropertyException, e:
+ DebugHelper.writeInfo(e.getMessage())
+ DebugHelper.writeInfo("UnknownPropertyException caught: Name:=" + _sName)
+ except com.sun.star.lang.WrappedTargetException, e:
+ DebugHelper.writeInfo(e.getMessage())
+
+ if aObject != None:
+ try:
+ bValue = NumericalHelper.toBoolean(aObject)
+ except ValueError, e:
+ DebugHelper.writeInfo("can't convert a object to boolean.")
+
+ return bValue
+
+ '''
+ get a property and convert it to a string value
+ @param _sName the string name of the property
+ @param _sDefault if an error occur, return this value
+ @return the string value of the property
+ '''
+
+ def getPropertyValueAsString(self, _sName, _sDefault):
+ aObject = None
+ sValue = _sDefault
+ if self.m_xPropertySet != None:
+ try:
+ aObject = self.m_xPropertySet.getPropertyValue(_sName)
+ except com.sun.star.beans.UnknownPropertyException, e:
+ DebugHelper.writeInfo(e.getMessage())
+ except com.sun.star.lang.WrappedTargetException, e:
+ DebugHelper.writeInfo(e.getMessage())
+
+ if aObject != None:
+ try:
+ sValue = AnyConverter.toString(aObject)
+ except ValueError, e:
+ DebugHelper.writeInfo("can't convert a object to string.")
+
+ return sValue
+
+ '''
+ get a property and don't convert it
+ @param _sName the string name of the property
+ @return the object value of the property without any conversion
+ '''
+
+ def getPropertyValueAsObject(self, _sName):
+ aObject = None
+ if self.m_xPropertySet != None:
+ try:
+ aObject = self.m_xPropertySet.getPropertyValue(_sName)
+ except com.sun.star.beans.UnknownPropertyException, e:
+ DebugHelper.writeInfo(e.getMessage())
+ except com.sun.star.lang.WrappedTargetException, e:
+ DebugHelper.writeInfo(e.getMessage())
+
+ return aObject
+
+ '''
+ Debug helper, to show all properties which are available in the given object.
+ @param _xObj the object of which the properties should shown
+ '''
+
+ @classmethod
+ def showProperties(self, _xObj):
+ aHelper = PropertySetHelper.PropertySetHelper_unknown(_xObj)
+ aHelper.showProperties()
+
+ '''
+ Debug helper, to show all properties which are available in the current object.
+ '''
+
+ def showProperties(self):
+ sName = ""
+ if self.m_xPropertySet != None:
+ XServiceInfo xServiceInfo = (XServiceInfo)
+ UnoRuntime.queryInterface(XServiceInfo.class, self.m_xPropertySet)
+ if xServiceInfo != None:
+ sName = xServiceInfo.getImplementationName()
+
+ xInfo = self.m_xPropertySet.getPropertySetInfo()
+ aAllProperties = xInfo.getProperties()
+ DebugHelper.writeInfo("Show all properties of Implementation of :'" + sName + "'")
+ i = 0
+ while i < aAllProperties.length:
+ DebugHelper.writeInfo(" - " + aAllProperties[i].Name)
+ i += 1
+ else:
+ DebugHelper.writeInfo("The given object don't support XPropertySet interface.")
+
diff --git a/wizards/com/sun/star/wizards/common/Resource.java.orig b/wizards/com/sun/star/wizards/common/Resource.java.orig
new file mode 100644
index 000000000000..c7eb3e483db7
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/Resource.java.orig
@@ -0,0 +1,140 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package com.sun.star.wizards.common;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.IllegalArgumentException;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.script.XInvocation;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.uno.XInterface;
+import com.sun.star.uno.UnoRuntime;
+
+public class Resource
+{
+
+ XMultiServiceFactory xMSF;
+ String Module;
+ XIndexAccess xStringIndexAccess;
+ XIndexAccess xStringListIndexAccess;
+
+ /** Creates a new instance of Resource
+ * @param _xMSF
+ * @param _Unit
+ * @param _Module
+ */
+ public Resource(XMultiServiceFactory _xMSF, String _Unit /* unused */, String _Module)
+ {
+ this.xMSF = _xMSF;
+ this.Module = _Module;
+ try
+ {
+ Object[] aArgs = new Object[1];
+ aArgs[0] = this.Module;
+ XInterface xResource = (XInterface) xMSF.createInstanceWithArguments(
+ "org.libreoffice.resource.ResourceIndexAccess",
+ aArgs);
+ if (xResource == null)
+ throw new Exception("could not initialize ResourceIndexAccess");
+ XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(
+ XNameAccess.class,
+ xResource);
+ if (xNameAccess == null)
+ throw new Exception("ResourceIndexAccess is no XNameAccess");
+ this.xStringIndexAccess = (XIndexAccess)UnoRuntime.queryInterface(
+ XIndexAccess.class,
+ xNameAccess.getByName("String"));
+ this.xStringListIndexAccess = (XIndexAccess)UnoRuntime.queryInterface(
+ XIndexAccess.class,
+ xNameAccess.getByName("StringList"));
+ if(this.xStringListIndexAccess == null)
+ throw new Exception("could not initialize xStringListIndexAccess");
+ if(this.xStringIndexAccess == null)
+ throw new Exception("could not initialize xStringIndexAccess");
+ }
+ catch (Exception exception)
+ {
+ exception.printStackTrace();
+ showCommonResourceError(xMSF);
+ }
+ }
+
+ public String getResText(int nID)
+ {
+ try
+ {
+ return (String)this.xStringIndexAccess.getByIndex(nID);
+ }
+ catch (Exception exception)
+ {
+ exception.printStackTrace();
+ throw new java.lang.IllegalArgumentException("Resource with ID not " + String.valueOf(nID) + "not found");
+ }
+ }
+
+ public PropertyValue[] getStringList(int nID)
+ {
+ try
+ {
+ return (PropertyValue[])this.xStringListIndexAccess.getByIndex(nID);
+ }
+ catch (Exception exception)
+ {
+ exception.printStackTrace();
+ throw new java.lang.IllegalArgumentException("Resource with ID not " + String.valueOf(nID) + "not found");
+ }
+ }
+
+ public String[] getResArray(int nID, int iCount)
+ {
+ try
+ {
+ String[] ResArray = new String[iCount];
+ for (int i = 0; i < iCount; i++)
+ {
+ ResArray[i] = getResText(nID + i);
+ }
+ return ResArray;
+ }
+ catch (Exception exception)
+ {
+ exception.printStackTrace(System.out);
+ throw new java.lang.IllegalArgumentException("Resource with ID not" + String.valueOf(nID) + "not found");
+ }
+ }
+
+ public static void showCommonResourceError(XMultiServiceFactory xMSF)
+ {
+ String ProductName = Configuration.getProductName(xMSF);
+ String sError = "The files required could not be found.\nPlease start the %PRODUCTNAME Setup and choose 'Repair'.";
+ sError = JavaTools.replaceSubString(sError, ProductName, "%PRODUCTNAME");
+ SystemDialog.showMessageBox(xMSF, "ErrorBox", com.sun.star.awt.VclWindowPeerAttribute.OK, sError);
+ }
+}
diff --git a/wizards/com/sun/star/wizards/common/Resource.py b/wizards/com/sun/star/wizards/common/Resource.py
new file mode 100644
index 000000000000..e6b37999255c
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/Resource.py
@@ -0,0 +1,66 @@
+from com.sun.star.awt.VclWindowPeerAttribute import OK
+import traceback
+
+class Resource(object):
+ '''
+ Creates a new instance of Resource
+ @param _xMSF
+ @param _Unit
+ @param _Module
+ '''
+
+ @classmethod
+ def __init__(self, _xMSF, _Module):
+ self.xMSF = _xMSF
+ self.Module = _Module
+ try:
+ xResource = self.xMSF.createInstanceWithArguments("org.libreoffice.resource.ResourceIndexAccess", (self.Module,))
+ if xResource is None:
+ raise Exception ("could not initialize ResourceIndexAccess")
+
+ self.xStringIndexAccess = xResource.getByName("String")
+ self.xStringListIndexAccess = xResource.getByName("StringList")
+
+ if self.xStringListIndexAccess is None:
+ raise Exception ("could not initialize xStringListIndexAccess")
+
+ if self.xStringIndexAccess is None:
+ raise Exception ("could not initialize xStringIndexAccess")
+
+ except Exception, exception:
+ traceback.print_exc()
+ self.showCommonResourceError(self.xMSF)
+
+ def getResText(self, nID):
+ try:
+ return self.xStringIndexAccess.getByIndex(nID)
+ except Exception, exception:
+ traceback.print_exc()
+ raise ValueError("Resource with ID not " + str(nID) + " not found");
+
+ def getStringList(self, nID):
+ try:
+ return self.xStringListIndexAccess.getByIndex(nID)
+ except Exception, exception:
+ traceback.print_exc()
+ raise ValueError("Resource with ID not " + str(nID) + " not found");
+
+ def getResArray(self, nID, iCount):
+ try:
+ ResArray = range(iCount)
+ i = 0
+ while i < iCount:
+ ResArray[i] = getResText(nID + i)
+ i += 1
+ return ResArray
+ except Exception, exception:
+ traceback.print_exc()
+ raise ValueError("Resource with ID not" + str(nID) + " not found");
+
+
+ def showCommonResourceError(self, xMSF):
+ ProductName = Configuration.getProductName(xMSF)
+ sError = "The files required could not be found.\nPlease start the %PRODUCTNAME Setup and choose 'Repair'."
+ sError = JavaTools.replaceSubString(sError, ProductName, "%PRODUCTNAME")
+ SystemDialog.showMessageBox(xMSF, "ErrorBox", OK, sError)
+
diff --git a/wizards/com/sun/star/wizards/common/SystemDialog.py b/wizards/com/sun/star/wizards/common/SystemDialog.py
new file mode 100644
index 000000000000..b88aadfafaa6
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/SystemDialog.py
@@ -0,0 +1,237 @@
+import uno
+import traceback
+from Configuration import Configuration
+from Resource import Resource
+from Desktop import Desktop
+
+from com.sun.star.ui.dialogs.TemplateDescription import FILESAVE_AUTOEXTENSION, FILEOPEN_SIMPLE
+from com.sun.star.ui.dialogs.ExtendedFilePickerElementIds import CHECKBOX_AUTOEXTENSION
+from com.sun.star.awt import WindowDescriptor
+from com.sun.star.awt.WindowClass import MODALTOP
+from com.sun.star.uno import Exception as UnoException
+from com.sun.star.lang import IllegalArgumentException
+from com.sun.star.awt.VclWindowPeerAttribute import OK
+
+
+class SystemDialog(object):
+
+ '''
+ @param xMSF
+ @param ServiceName
+ @param type according to com.sun.star.ui.dialogs.TemplateDescription
+ '''
+
+ def __init__(self, xMSF, ServiceName, Type):
+ try:
+ self.xMSF = xMSF
+ self.systemDialog = xMSF.createInstance(ServiceName)
+ self.xStringSubstitution = self.createStringSubstitution(xMSF)
+ listAny = [uno.Any("short",Type)]
+ if self.systemDialog != None:
+ self.systemDialog.initialize(listAny)
+
+ except UnoException, exception:
+ traceback.print_exc()
+
+ def createStoreDialog(self, xmsf):
+ return SystemDialog(xmsf, "com.sun.star.ui.dialogs.FilePicker", FILESAVE_AUTOEXTENSION)
+
+ def createOpenDialog(self, xmsf):
+ return SystemDialog(xmsf, "com.sun.star.ui.dialogs.FilePicker", FILEOPEN_SIMPLE)
+
+ def createFolderDialog(self, xmsf):
+ return SystemDialog(xmsf, "com.sun.star.ui.dialogs.FolderPicker", 0)
+
+ def createOfficeFolderDialog(self, xmsf):
+ return SystemDialog(xmsf, "com.sun.star.ui.dialogs.OfficeFolderPicker", 0)
+
+ def subst(self, path):
+ try:
+ s = self.xStringSubstitution.substituteVariables(path, False)
+ return s
+ except Exception, ex:
+ traceback.print_exc()
+ return path
+
+ '''
+ ATTENTION a BUG : TFILESAVE_AUTOEXTENSIONhe extension calculated
+ here gives the last 3 chars of the filename - what
+ if the extension is of 4 or more chars?
+ @param DisplayDirectory
+ @param DefaultName
+ @param sDocuType
+ @return
+ '''
+
+ def callStoreDialog(self, DisplayDirectory, DefaultName, sDocuType):
+ sExtension = DefaultName.substring(DefaultName.length() - 3, DefaultName.length())
+ addFilterToDialog(sExtension, sDocuType, True)
+ return callStoreDialog(DisplayDirectory, DefaultName)
+
+ '''
+ @param displayDir
+ @param defaultName
+ given url to a local path.
+ @return
+ '''
+
+ def callStoreDialog(self, displayDir, defaultName):
+ self.sStorePath = None
+ try:
+ self.systemDialog.setValue(CHECKBOX_AUTOEXTENSION, 0, True)
+ self.systemDialog.setDefaultName(defaultName)
+ self.systemDialog.setDisplayDirectory(subst(displayDir))
+ if execute(self.systemDialog):
+ sPathList = self.systemDialog.getFiles()
+ self.sStorePath = sPathList[0]
+
+ except UnoException, exception:
+ traceback.print_exc()
+
+ return self.sStorePath
+
+ def callFolderDialog(self, title, description, displayDir):
+ try:
+ self.systemDialog.setDisplayDirectoryxPropertyValue(subst(displayDir))
+ except IllegalArgumentException, iae:
+ traceback.print_exc()
+ raise AttributeError(iae.getMessage());
+
+ self.systemDialog.setTitle(title)
+ self.systemDialog.setDescription(description)
+ if execute(self.systemDialog):
+ return self.systemDialog.getDirectory()
+ else:
+ return None
+
+ def execute(self, execDialog):
+ return execDialog.execute() == 1
+
+ def callOpenDialog(self, multiSelect, displayDirectory):
+ try:
+ self.systemDialog.setMultiSelectionMode(multiSelect)
+ self.systemDialog.setDisplayDirectory(subst(displayDirectory))
+ if execute(self.systemDialog):
+ return self.systemDialog.getFiles()
+
+ except UnoException, exception:
+ traceback.print_exc()
+
+ return None
+
+ def addFilterToDialog(self, sExtension, filterName, setToDefault):
+ try:
+ #get the localized filtername
+ uiName = getFilterUIName(filterName)
+ pattern = "*." + sExtension
+ #add the filter
+ addFilter(uiName, pattern, setToDefault)
+ except Exception, exception:
+ traceback.print_exc()
+
+ def addFilter(self, uiName, pattern, setToDefault):
+ try:
+ self.systemDialog.appendFilter(uiName, pattern)
+ if setToDefault:
+ self.systemDialog.setCurrentFilter(uiName)
+
+ except Exception, ex:
+ traceback.print_exc()
+
+ '''
+ converts the name returned from getFilterUIName_(...) so the
+ product name is correct.
+ @param filterName
+ @return
+ '''
+
+ def getFilterUIName(self, filterName):
+ prodName = Configuration.getProductName(self.xMSF)
+ s = [[getFilterUIName_(filterName)]]
+ s[0][0] = JavaTools.replaceSubString(s[0][0], prodName, "%productname%")
+ return s[0][0]
+
+ '''
+ note the result should go through conversion of the product name.
+ @param filterName
+ @return the UI localized name of the given filter name.
+ '''
+
+ def getFilterUIName_(self, filterName):
+ try:
+ oFactory = self.xMSF.createInstance("com.sun.star.document.FilterFactory")
+ oObject = Helper.getUnoObjectbyName(oFactory, filterName)
+ xPropertyValue = list(oObject)
+ MaxCount = xPropertyValue.length
+ i = 0
+ while i < MaxCount:
+ aValue = xPropertyValue[i]
+ if aValue != None and aValue.Name.equals("UIName"):
+ return str(aValue.Value)
+
+ i += 1
+ raise NullPointerException ("UIName property not found for Filter " + filterName);
+ except UnoException, exception:
+ traceback.print_exc()
+ return None
+
+ @classmethod
+ def showErrorBox(self, xMSF, ResName, ResPrefix, ResID,AddTag=None, AddString=None):
+ ProductName = Configuration.getProductName(xMSF)
+ oResource = Resource(xMSF, ResPrefix)
+ sErrorMessage = oResource.getResText(ResID)
+ sErrorMessage = sErrorMessage.replace( ProductName, "%PRODUCTNAME")
+ sErrorMessage = sErrorMessage.replace(str(13), "<BR>")
+ if AddTag and AddString:
+ sErrorMessage = sErrorMessage.replace( AddString, AddTag)
+ return self.showMessageBox(xMSF, "ErrorBox", OK, sErrorMessage)
+
+ '''
+ example:
+ (xMSF, "ErrorBox", com.sun.star.awt.VclWindowPeerAttribute.OK, "message")
+
+ @param windowServiceName one of the following strings:
+ "ErrorBox", "WarningBox", "MessBox", "InfoBox", "QueryBox".
+ There are other values possible, look
+ under src/toolkit/source/awt/vcltoolkit.cxx
+ @param windowAttribute see com.sun.star.awt.VclWindowPeerAttribute
+ @return 0 = cancel, 1 = ok, 2 = yes, 3 = no(I'm not sure here)
+ other values check for yourself ;-)
+ '''
+ @classmethod
+ def showMessageBox(self, xMSF, windowServiceName, windowAttribute, MessageText, peer=None):
+
+ if MessageText is None:
+ return 0
+
+ iMessage = 0
+ try:
+ # If the peer is null we try to get one from the desktop...
+ if peer is None:
+ xFrame = Desktop.getActiveFrame(xMSF)
+ peer = xFrame.getComponentWindow()
+
+ xToolkit = xMSF.createInstance("com.sun.star.awt.Toolkit")
+ oDescriptor = WindowDescriptor()
+ oDescriptor.WindowServiceName = windowServiceName
+ oDescriptor.Parent = peer
+ oDescriptor.Type = MODALTOP
+ oDescriptor.WindowAttributes = windowAttribute
+ xMsgPeer = xToolkit.createWindow(oDescriptor)
+ xMsgPeer.setMessageText(MessageText)
+ iMessage = xMsgPeer.execute()
+ xMsgPeer.dispose()
+ except Exception:
+ traceback.print_exc()
+
+ return iMessage
+
+ @classmethod
+ def createStringSubstitution(self, xMSF):
+ xPathSubst = None
+ try:
+ xPathSubst = xMSF.createInstance("com.sun.star.util.PathSubstitution")
+ return xPathSubst
+ except UnoException, e:
+ traceback.print_exc()
+ return None
diff --git a/wizards/com/sun/star/wizards/common/__init__.py b/wizards/com/sun/star/wizards/common/__init__.py
new file mode 100644
index 000000000000..1e42b88e42ec
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/__init__.py
@@ -0,0 +1 @@
+"""Common"""
diff --git a/wizards/com/sun/star/wizards/common/prova.py b/wizards/com/sun/star/wizards/common/prova.py
new file mode 100644
index 000000000000..1219ba9aff7b
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/prova.py
@@ -0,0 +1,7 @@
+from PropertyNames import PropertyNames
+
+class prova:
+
+ def Imprimir(self):
+ print PropertyNames.PROPERTY_STEP
+