[ABANDONED] Pack and register the Web wizard.

2013-03-28 Thread Javier Fernandez (via Code Review)
Javier Fernandez has abandoned this change.

Change subject: Pack and register the Web wizard.
..


Patch Set 3: Abandoned

This patch should not be integrated on master until we have decided to replace 
completely the java version.

-- 
To view, visit https://gerrit.libreoffice.org/3027
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I8e43d228e842f24b054afc6bf59040667a6703d5
Gerrit-PatchSet: 3
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com
Gerrit-Reviewer: Fridrich Strba fridr...@documentfoundation.org

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file IRenderer.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2987

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/87/2987/1

Init: Added new file IRenderer.py

Change-Id: Ifa203647da815ca66171fad96e04bad8a0f4b0eb
---
A wizards/com/sun/star/wizards/common/IRenderer.py
1 file changed, 28 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/common/IRenderer.py 
b/wizards/com/sun/star/wizards/common/IRenderer.py
new file mode 100644
index 000..6086665
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/IRenderer.py
@@ -0,0 +1,28 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+
+from abc import abstractmethod
+
+# A General interface which gives a string
+# that represents the rendered argument object.
+# Can be used to reference resources, internationalizartion
+# a.s.o
+class IRenderer:
+
+@abstractmethod
+def render(object):
+  pass

-- 
To view, visit https://gerrit.libreoffice.org/2987
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa203647da815ca66171fad96e04bad8a0f4b0eb
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file UCB.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2988

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/88/2988/1

Init: Added new file UCB.py

Change-Id: I4f25ee62a1f090dd6f494108849f038656b5e9fa
---
A wizards/com/sun/star/wizards/common/UCB.py
1 file changed, 194 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/common/UCB.py 
b/wizards/com/sun/star/wizards/common/UCB.py
new file mode 100644
index 000..a7c3ff1
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/UCB.py
@@ -0,0 +1,194 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+
+import uno
+import traceback
+
+from abc import abstractmethod
+
+from ..common.FileAccess import FileAccess
+
+from com.sun.star.beans import Property
+
+from com.sun.star.ucb import Command
+from com.sun.star.ucb import GlobalTransferCommandArgument
+from com.sun.star.ucb.NameClash import OVERWRITE
+from com.sun.star.ucb import OpenCommandArgument2
+from com.sun.star.ucb.OpenMode import ALL
+from com.sun.star.ucb.TransferCommandOperation import COPY
+#from com.sun.star.ucb import XCommandProcessor
+#from com.sun.star.ucb import XContentAccess
+#from com.sun.star.ucb import XContentIdentifier
+from com.sun.star.ucb import XContentIdentifierFactory
+from com.sun.star.ucb import XContentProvider
+#from com.sun.star.ucb import XDynamicResultSet
+#from com.sun.star.uno import UnoRuntime
+
+
+# This class is used to copy the content of a folder to
+# another folder.
+# There is an incosistency with argument order.
+# It should be always: dir,filename.
+class UCB(object):
+
+ucb = None
+fa = None
+xmsf = None
+
+def __init__(self, xmsf):
+self.ucb = 
xmsf.createInstanceWithArguments(com.sun.star.ucb.UniversalContentBroker, ())
+self.fa = FileAccess(xmsf)
+self.xmsf = xmsf
+
+def deleteDirContent(self, folder):
+if (not self.fa.exists(folder, True)):
+  return
+l = self.listFiles(folder, None)
+for i in range(len(l)):
+self.delete(FileAccess.connectURLs(folder, l[i]))
+
+def delete(self, filename):
+# System.out.println(UCB.delete( + filename)
+self.executeCommand(self.getContent(filename),delete, True)
+
+def copy(self, sourceDir, targetDir):
+self.copy1(sourceDir,targetDir, None)
+
+def copy1(self, sourceDir, targetDir, verifier):
+files = self.listFiles(sourceDir, verifier)
+for i in range(len(files)):
+  self.copy2(sourceDir, files[i], targetDir)
+
+def copy2(self, sourceDir, filename, targetDir, targetName):
+#sourceDir = 
file:///home/javi/intel-libreoffice/install/share/config/ + sourceDir[7:]
+print (WARNING !!! copy2 - sourcedir, filenName :, sourceDir, 
filename)
+print (WARNING !!! copy2 - targetDir, targetName :, targetDir, 
targetName)
+if (not self.fa.exists(targetDir, True)):
+  self.fa.xInterface.createFolder(targetDir)
+self.executeCommand(self.ucb, globalTransfer, 
self.copyArg(sourceDir, filename, targetDir, targetName))
+
+# @deprecated
+# @param sourceDir
+# @param filename
+# @param targetDir
+# @throws Exception
+def copy3(self, sourceDir, filename, targetDir):
+self.copy2(sourceDir, filename, targetDir, )
+
+# target name can be PropertyNames.EMPTY_STRING, in which case the name 
stays lige the source name
+# @param sourceDir
+# @param sourceFilename
+# @param targetDir
+# @param targetFilename
+# @return
+def copyArg(self, sourceDir, sourceFilename, targetDir, targetFilename):
+aArg = GlobalTransferCommandArgument()
+aArg.Operation = COPY
+aArg.SourceURL = self.fa.getURL(sourceDir, sourceFilename)
+aArg.TargetURL = targetDir
+aArg.NewTitle = targetFilename
+# fail, if object with same name exists in target folder
+aArg.NameClash = OVERWRITE
+return aArg
+
+def executeCommand(self, xContent, aCommandName, aArgument):
+aCommand  = Command()
+aCommand.Name = aCommandName
+aCommand.Handle   = -1 # not available
+aCommand.Argument = aArgument
+

[PATCH] Init: Added new file XMLHelper.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2989

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/89/2989/1

Init: Added new file XMLHelper.py

Change-Id: I145965230232150e91233ed1cd9ba623c19955f0
---
A wizards/com/sun/star/wizards/common/XMLHelper.py
1 file changed, 34 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/common/XMLHelper.py 
b/wizards/com/sun/star/wizards/common/XMLHelper.py
new file mode 100644
index 000..7ea3de3
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/XMLHelper.py
@@ -0,0 +1,34 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+class XMLHelper:
+
+@classmethod
+def addElement(self, parent, name, attNames, attValues):
+doc = parent.ownerDocument
+if (doc == None):
+doc = parent
+e = doc.createElement(name)
+for i in range(len(attNames)):
+if (not (attValues[i] is None or (attValues[i] == ))):
+e.setAttribute(attNames[i], attValues[i])
+parent.appendChild(e)
+return e
+
+@classmethod
+def addElement1(self, parent, name, attName, attValue):
+return self.addElement(parent, name, [attName], [attValue])

-- 
To view, visit https://gerrit.libreoffice.org/2989
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I145965230232150e91233ed1cd9ba623c19955f0
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file XMLProvider.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2990

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/90/2990/1

Init: Added new file XMLProvider.py

Change-Id: Idfc71c05f80150d67bc3f27f01b4a95efe9a8b5a
---
A wizards/com/sun/star/wizards/common/XMLProvider.py
1 file changed, 24 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/common/XMLProvider.py 
b/wizards/com/sun/star/wizards/common/XMLProvider.py
new file mode 100644
index 000..4627238
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/XMLProvider.py
@@ -0,0 +1,24 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+from abc import abstractmethod
+
+class XMLProvider:
+
+@abstractmethod
+def createDOM(parent):
+pass

-- 
To view, visit https://gerrit.libreoffice.org/2990
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idfc71c05f80150d67bc3f27f01b4a95efe9a8b5a
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file Task.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2991

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/91/2991/1

Init: Added new file Task.py

Change-Id: I968fdf4b906cf6aab0a274fe4d1292cbaf1be51e
---
A wizards/com/sun/star/wizards/ui/event/Task.py
1 file changed, 114 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/ui/event/Task.py 
b/wizards/com/sun/star/wizards/ui/event/Task.py
new file mode 100644
index 000..133f93b
--- /dev/null
+++ b/wizards/com/sun/star/wizards/ui/event/Task.py
@@ -0,0 +1,114 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+import traceback
+
+from .TaskEvent import TaskEvent
+
+class Task:
+successfull = 0
+failed = 0
+maximum = 0
+taskName = 
+listeners = []
+subtaskName = 
+
+def __init__(self, taskName_, subtaskName_, max_):
+self.taskName = taskName_
+self.subtaskName = subtaskName_
+self.maximum = max_
+
+def start(self):
+self.fireTaskStarted()
+
+def fail(self):
+self.fireTaskFailed()
+
+def getMax(self):
+return self.maximum
+
+def setMax(self, max_):
+self.maximum = max_
+self.fireTaskStatusChanged()
+
+def advance(self, success_):
+if success_:
+self.successfull += 1
+print (Success :, self.successfull)
+else:
+self.failed += 1
+print (Failed :, self.failed)
+self.fireTaskStatusChanged()
+if (self.failed + self.successfull == self.maximum):
+self.fireTaskFinished()
+
+def advance1(self, success_, nextSubtaskName):
+self.advance(success_)
+self.setSubtaskName(nextSubtaskName)
+
+def getStatus(self):
+return self.successfull + self.failed
+
+def addTaskListener(self, tl):
+self.listeners.append(tl)
+
+def removeTaskListener(self, tl):
+try:
+index = self.listeners.index(tl)
+self.listeners.pop(index)
+except Exception:
+traceback.print_exc()
+
+def fireTaskStatusChanged(self):
+te = TaskEvent(self, TaskEvent.TASK_STATUS_CHANGED)
+for i in range(len(self.listeners)):
+self.listeners[i].taskStatusChanged(te)
+
+def fireTaskStarted(self):
+te = TaskEvent(self, TaskEvent.TASK_STARTED)
+for i in range(len(self.listeners)):
+self.listeners[i].taskStarted(te)
+
+def fireTaskFailed(self):
+te = TaskEvent(self, TaskEvent.TASK_FAILED)
+for i in range(len(self.listeners)):
+self.listeners[i].taskFinished(te)
+
+def fireTaskFinished(self):
+te = TaskEvent(self, TaskEvent.TASK_FINISHED)
+for i in range(len(self.listeners)):
+self.listeners[i].taskFinished(te)
+
+def fireSubtaskNameChanged(self):
+te = TaskEvent(self, TaskEvent.SUBTASK_NAME_CHANGED)
+for i in range(len(self.listeners)):
+self.listeners[i].subtaskNameChanged(te)
+
+def getSubtaskName(self):
+return self.subtaskName
+
+def getTaskName(self):
+return self.taskName
+
+def setSubtaskName(self, s):
+self.subtaskName = s
+self.fireSubtaskNameChanged()
+
+def getFailed(self):
+return self.failed
+
+def getSuccessfull(self):
+return self.successfull

-- 
To view, visit https://gerrit.libreoffice.org/2991
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I968fdf4b906cf6aab0a274fe4d1292cbaf1be51e
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file TaskEvent.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2992

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/92/2992/1

Init: Added new file TaskEvent.py

Change-Id: Iadaa2e003186fc041e67270da39454cd28014a46
---
A wizards/com/sun/star/wizards/ui/event/TaskEvent.py
1 file changed, 42 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/ui/event/TaskEvent.py 
b/wizards/com/sun/star/wizards/ui/event/TaskEvent.py
new file mode 100644
index 000..291a1896
--- /dev/null
+++ b/wizards/com/sun/star/wizards/ui/event/TaskEvent.py
@@ -0,0 +1,42 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+from com.sun.star.document import EventObject
+
+#class TaskEvent(EventObject):
+class TaskEvent:
+
+TASK_STARTED = 1
+TASK_FINISHED = 2
+TASK_STATUS_CHANGED = 3
+SUBTASK_NAME_CHANGED = 4
+TASK_FAILED = 5
+taskType = 0
+source = None
+
+#general constructor-
+# @param source
+# @param type_
+def __init__(self, source_, type_):
+#super(TaskEvent, self).__init__(source)
+self.taskType = type_
+self.source = source_
+
+def getTask(self):
+return self.getSource()
+
+def getSource(self):
+return self.source

-- 
To view, visit https://gerrit.libreoffice.org/2992
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iadaa2e003186fc041e67270da39454cd28014a46
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file TaskListener.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2993

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/93/2993/1

Init: Added new file TaskListener.py

Change-Id: I3b90d34dbe160410f63cd5cb6b40a1736a01c7cb
---
A wizards/com/sun/star/wizards/ui/event/TaskListener.py
1 file changed, 39 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/ui/event/TaskListener.py 
b/wizards/com/sun/star/wizards/ui/event/TaskListener.py
new file mode 100644
index 000..9cd86e9
--- /dev/null
+++ b/wizards/com/sun/star/wizards/ui/event/TaskListener.py
@@ -0,0 +1,39 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+from abc import abstractmethod
+from com.sun.star.script import EventListener
+
+class TaskListener(EventListener):
+
+@abstractmethod
+def taskStarted(self, te):
+pass
+
+@abstractmethod
+def taskFinished(self, te):
+pass
+
+# is called when the status of the task has advanced.
+# @param te
+@abstractmethod
+def taskStatusChanged(self, te):
+pass
+
+@abstractmethod
+def subtaskNameChanged(self, te):
+pass

-- 
To view, visit https://gerrit.libreoffice.org/2993
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b90d34dbe160410f63cd5cb6b40a1736a01c7cb
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file AbstractErrorHandler.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2994

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/94/2994/1

Init: Added new file AbstractErrorHandler.py

Change-Id: I8d5a304a51af734379c5597e9cdddf6ecfa6ba8a
---
A wizards/com/sun/star/wizards/web/AbstractErrorHandler.py
1 file changed, 181 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/AbstractErrorHandler.py 
b/wizards/com/sun/star/wizards/web/AbstractErrorHandler.py
new file mode 100644
index 000..5f79384
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/AbstractErrorHandler.py
@@ -0,0 +1,181 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+from abc import abstractmethod
+
+from .ErrorHandler import ErrorHandler
+from ..common.SystemDialog import SystemDialog
+
+from com.sun.star.awt.VclWindowPeerAttribute import OK, DEF_OK, OK_CANCEL, 
DEF_CANCEL
+from com.sun.star.awt.VclWindowPeerAttribute import YES_NO, DEF_NO, DEF_YES
+
+#import com.sun.star.awt.VclWindowPeerAttribute
+
+
+# An abstract implementation of ErrorHandler, which
+# uses a renderer method geMessageFor(Exception, Object, int, int)
+# (in this class still abstract...)
+# to render the errors, and displays
+# error messeges.
+class AbstractErrorHandler(ErrorHandler):
+
+xmsf = None
+peer = None
+
+def __init__(self, xmsf, peer_):
+self.xmsf = xmsf
+self.peer = peer_
+
+# Implementation of ErrorHandler:
+# shows a message box with the rendered error.
+# @param arg identifies the error. This object is passed to the render 
method
+# which returns the right error message.
+# @return true/false for continue/abort.
+def error(self, ex, arg, ix, errorType):
+if (errorType == ErrorHandler.ERROR_FATAL):
+return not self.showMessage(self.getMessageFor(ex, arg, ix, 
errorType), errorType)
+elif (errorType == ErrorHandler.ERROR_PROCESS_FATAL):
+return not self.showMessage(self.getMessageFor(ex, arg, ix, 
errorType), errorType)
+elif (errorType == ErrorHandler.ERROR_NORMAL_ABORT):
+return self.showMessage(self.getMessageFor(ex, arg, ix, 
errorType), errorType)
+elif (errorType == ErrorHandler.ERROR_NORMAL_IGNORE):
+return self.showMessage(self.getMessageFor(ex, arg, ix, 
errorType), errorType)
+elif (errorType == ErrorHandler.ERROR_QUESTION_CANCEL):
+return self.showMessage(self.getMessageFor(ex, arg, ix, 
errorType), errorType)
+elif (errorType == ErrorHandler.ERROR_QUESTION_OK):
+return self.showMessage(self.getMessageFor(ex, arg, ix, 
errorType), errorType)
+elif (errorType == ErrorHandler.ERROR_QUESTION_NO):
+return self.showMessage(self.getMessageFor(ex, arg, ix, 
errorType), errorType)
+elif (errorType == ErrorHandler.ERROR_QUESTION_YES):
+return self.showMessage(self.getMessageFor(ex, arg, ix, 
errorType), errorType)
+elif (errorType == ErrorHandler.ERROR_WARNING):
+return self.showMessage(self.getMessageFor(ex, arg, ix, 
errorType), errorType)
+elif (errorType == ErrorHandler.ERROR_MESSAGE):
+return self.showMessage(self.getMessageFor(ex, arg, ix, 
errorType), errorType)
+raise IllegalArgumentException(unknown error type)
+
+# @deprecated
+# @param message
+# @param errorType
+# @return true if the ok/yes button is clicked, false otherwise.
+def showMessage(self, message, errorType):
+return self.showMessage1(self.xmsf, self.peer, message, errorType)
+
+# display a message
+# @deprecated
+# @param xmsf
+# @param message the message to display
+# @param errorType an int constant from the ErrorHandler interface.
+# @return
+@classmethod
+def showMessage1(self, xmsf, peer, message, errorType):
+serviceName = self.getServiceNameFor(errorType)
+attribute = self.getAttributeFor(errorType)
+b = SystemDialog.showMessageBox(xmsf, serviceName, attribute, message, 
peer)
+return b == self.getTrueFor(errorType)
+
+@classmethod
+def 

[PATCH] Init: Added new file CallWizard.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2995

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/95/2995/1

Init: Added new file CallWizard.py

Change-Id: Iba5ce15586bffd997c925522ee50fe71cdf59ea2
---
A wizards/com/sun/star/wizards/web/CallWizard.py
1 file changed, 51 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/CallWizard.py 
b/wizards/com/sun/star/wizards/web/CallWizard.py
new file mode 100644
index 000..1a98a31
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/CallWizard.py
@@ -0,0 +1,51 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+import unohelper
+import traceback
+
+from .WebWizard import WebWizard
+
+from com.sun.star.task import XJobExecutor
+
+# implement a UNO component by deriving from the standard unohelper.Base class
+# and from the interface(s) you want to implement.
+class CallWizard(unohelper.Base, XJobExecutor):
+def __init__(self, ctx):
+# store the component context for later use
+self.ctx = ctx
+
+def trigger(self, args):
+try:
+ww = WebWizard(self.ctx.ServiceManager)
+ww.show()
+ww.cleanup()
+except Exception as e:
+print (Wizard failure exception  + str(type(e)) +
+message  + str(e) +  args  + str(e.args) +
+   traceback.format_exc())
+
+# pythonloader looks for a static g_ImplementationHelper variable
+g_ImplementationHelper = unohelper.ImplementationHelper()
+
+g_ImplementationHelper.addImplementation( \
+CallWizard,   # UNO object class
+com.sun.star.wizards.web.CallWizard,# implemenation name
+(com.sun.star.task.Job,),)  # list of implemented services
+  # (the only service)
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:

-- 
To view, visit https://gerrit.libreoffice.org/2995
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba5ce15586bffd997c925522ee50fe71cdf59ea2
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file ExtensionVerifier.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2997

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/97/2997/1

Init: Added new file ExtensionVerifier.py

Change-Id: Ie6f413317d192643c0a30da760965fdb02125abd
---
A wizards/com/sun/star/wizards/web/ExtensionVerifier.py
1 file changed, 38 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/ExtensionVerifier.py 
b/wizards/com/sun/star/wizards/web/ExtensionVerifier.py
new file mode 100644
index 000..6f5fee0
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/ExtensionVerifier.py
@@ -0,0 +1,38 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+
+from ..common.UCB import UCB
+
+# Verifies all String that do not end with
+# the given extension.
+# This is used to exclude from a copy all the
+# xsl files, so I copy from a layout directory
+# all the files that do *not* end with xsl.
+class ExtensionVerifier(UCB.Verifier):
+
+extension = 
+
+def __init__(self, extension_):
+self.extension = . + extension_
+
+# @return true if the given object is
+# a String which does not end with the
+# given extension.
+def verify(self, obj):
+if (isinstance(obj, str())):
+return not obj.endsWith(extension)
+return False

-- 
To view, visit https://gerrit.libreoffice.org/2997
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie6f413317d192643c0a30da760965fdb02125abd
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file ErrorHandler.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2996

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/96/2996/1

Init: Added new file ErrorHandler.py

Change-Id: Id4118c5f2e13e38d5c6803e8e07ef250cdcb2d7f
---
A wizards/com/sun/star/wizards/web/ErrorHandler.py
1 file changed, 79 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/ErrorHandler.py 
b/wizards/com/sun/star/wizards/web/ErrorHandler.py
new file mode 100644
index 000..093e498
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/ErrorHandler.py
@@ -0,0 +1,79 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+
+from com.sun.star.awt.VclWindowPeerAttribute import OK, DEF_OK, OK_CANCEL, 
DEF_CANCEL
+from com.sun.star.awt.VclWindowPeerAttribute import YES_NO, DEF_NO, DEF_YES
+
+class ErrorHandler:
+
+MESSAGE_INFO = infobox
+MESSAGE_QUESTION = querybox
+MESSAGE_ERROR = errorbox
+MESSAGE_WARNING = warningbox
+BUTTONS_OK = OK
+BUTTONS_OK_CANCEL = OK_CANCEL
+BUTTONS_YES_NO = YES_NO
+RESULT_CANCEL = 0
+RESULT_OK = 1
+RESULT_YES = 2
+DEF_OK = DEF_OK
+DEF_NO = DEF_NO
+DEF_CANCEL = DEF_CANCEL
+
+#Error type for fatal errors which should abort application
+# execution. Should actually never be used :-)
+ERROR_FATAL = 0
+# An Error type for errors which should stop the current process.
+ERROR_PROCESS_FATAL = 1
+# An Error type for errors to which the user can choose, whether
+# to continue or to abort the current process.
+# default is abort.
+ERROR_NORMAL_ABORT = 2
+# An Error type for errors to which the user can choose, whether
+# to continue or to abort the current process.
+# default is continue.
+ERROR_NORMAL_IGNORE = 3
+# An error type for warnings which requires user interaction.
+# (a question :-) )
+# Default is abort (cancel).
+ERROR_QUESTION_CANCEL = 4
+# An error type for warnings which requires user interaction
+# (a question :-) )
+# Default is to continue (ok).
+ERROR_QUESTION_OK = 5
+# An error type for warnings which requires user interaction.
+# (a question :-) )
+# Default is abort (No).
+ERROR_QUESTION_NO = 6
+# An error type for warnings which requires user interaction
+# (a question :-) )
+# Default is to continue (Yes).
+ERROR_QUESTION_YES = 7
+# An error type which is just a warning...
+ERROR_WARNING = 8
+# An error type which just tells the user something
+# ( like you look tired! you should take a bath! and so on)
+ERROR_MESSAGE = 9
+
+# @param ex the exception that accured
+# @param arg an object as help for recognizing the exception
+# @param ix an integer which helps for detailed recognizing of the 
exception
+# @param errorType one of the int constants defined by this Interface
+# @return true if the execution should continue, false if it should stop.
+def error(self, ex, arg, ix, errorType):
+pass
+

-- 
To view, visit https://gerrit.libreoffice.org/2996
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4118c5f2e13e38d5c6803e8e07ef250cdcb2d7f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file FTPDialog.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2998

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/98/2998/1

Init: Added new file FTPDialog.py

Change-Id: Ia5ac3202e602fa5154510c7249847713cc76692e
---
A wizards/com/sun/star/wizards/web/FTPDialog.py
1 file changed, 472 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/FTPDialog.py 
b/wizards/com/sun/star/wizards/web/FTPDialog.py
new file mode 100644
index 000..6cd34ae
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/FTPDialog.py
@@ -0,0 +1,472 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+import traceback
+import uno
+
+from .WWHID import *
+from .FTPDialogResources import FTPDialogResources
+from ..ui.UnoDialog2 import UnoDialog2
+from ..ui.UIConsts import UIConsts
+from ..ui.event.DataAware import DataAware
+from ..ui.event.UnoDataAware import UnoDataAware
+from ..common.PropertyNames import PropertyNames
+from ..common.SystemDialog import SystemDialog
+from ..common.FileAccess import FileAccess
+from ..common.HelpIds import HelpIds
+from ..common.UCB import UCB
+from .data.CGPublish import CGPublish
+from .data.CGSettings import CGSettings
+
+#from com.sun.star.ucb import AuthenticationRequest
+#from com.sun.star.ucb import InteractiveAugmentedIOException
+#from com.sun.star.ucb import InteractiveNetworkConnectException
+#from com.sun.star.ucb import InteractiveNetworkResolveNameException
+#from com.sun.star.ucb import OpenCommandArgument2
+#from com.sun.star.ucb import OpenMode
+
+PushButtonType_OK_value = uno.getConstantByName( 
com.sun.star.awt.PushButtonType.OK )
+PushButtonType_CANCEL_value = uno.getConstantByName( 
com.sun.star.awt.PushButtonType.CANCEL )
+PushButtonType_HELP_value = uno.getConstantByName( 
com.sun.star.awt.PushButtonType.HELP )
+
+
+# This is the FTP Dialog. br/
+# The Dialog enables the user:
+# (*) entering FTP server and user information.
+# (*) testing the connection.
+# (*) choosing a directory on the server.
+# If a connection was established successfully, the user may
+# press OK, which will change
+# the CGPublish object propertiers according the user's input.
+# If no connection was established. the OK and Choose-Dir button are disabled.
+# See the method disconnect() which disables them.
+#
+# I use here the DataAware concept to automatically update
+# the members ip, username, and password (via the methods setXXX(...))
+# for details see the ui.events.DataAware classes. br/
+class FTPDialog(UnoDialog2, UIConsts):
+
+# A Constant used for the setLabel(int) method to change the
+# status-display. unknown is the status when the user first
+# opens the dialog, or changes the servername/username/password.
+STATUS_UNKONWN = 0
+# A Constant used for the setLabel(int) method to change the
+# status-display. (connection established)
+STATUS_OK = 1
+# A Constant used for the setLabel(int) method to change the
+# status-display.
+STATUS_USER_PWD_WRONG = 2
+# A Constant used for the setLabel(int) method to change the
+# status-display.
+STATUS_SERVER_NOT_FOUND = 3
+# A Constant used for the setLabel(int) method to change the
+# status-display.
+STATUS_NO_RIGHTS = 4
+# A Constant used for the setLabel(int) method to change the
+# status-display.
+STATUS_HOST_UNREACHABLE = 5
+# A Constant used for the setLabel(int) method to change the
+# status-display.
+STATUS_CONNECTING = 6
+# The icon url for error
+ICON_ERROR = ftperror.gif
+# The icon url for ok (connection ok)
+ICON_OK = ftpconnected.gif
+# The icon url for unknown - this is the status when
+# the user first opens the dialog
+ICON_UNKNOWN = ftpunknown.gif
+# The icon url for an icon representing the connecting state.
+ICON_CONNECTING = ftpconnecting.gif# GUI Components as Class members.
+# Fixed Line
+ln1 = None
+lblFTPAddress = None
+txtHost = None
+lblUsername = None
+txtUsername = None
+lblPassword = None
+txtPassword = None
+# Fixed Line
+ln2 = None
+btnTestConnection = None
+imgStatus = None
+lblStatus = None
+# Fixed Line
+ 

[PATCH] Init: Added new file FTPDialogResources.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2999

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/99/2999/1

Init: Added new file FTPDialogResources.py

Change-Id: Ibacf3645ecfd892b924fb2d2b202a1f5f2db3215
---
A wizards/com/sun/star/wizards/web/FTPDialogResources.py
1 file changed, 79 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/FTPDialogResources.py 
b/wizards/com/sun/star/wizards/web/FTPDialogResources.py
new file mode 100644
index 000..1190fe0
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/FTPDialogResources.py
@@ -0,0 +1,79 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+
+from ..common.Resource import Resource
+
+class FTPDialogResources(Resource):
+
+UNIT_NAME = dbwizres
+MODULE_NAME = dbw
+RID_FTPDIALOG_START = 4200
+RID_COMMON_START = 500
+resFTPDialog_title = 
+reslblUsername_value = 
+reslblPassword_value = 
+resbtnConnect_value = 
+resbtnOK_value = 
+resbtnHelp_value = 
+resbtnCancel_value = 
+resln1_value = 
+reslblFTPAddress_value = 
+resln2_value = 
+resln3_value = 
+esln3_value = 
+restxtDir_value = 
+resbtnDir_value = 
+resFTPDisconnected = 
+resFTPConnected = 
+resFTPUserPwdWrong = 
+resFTPServerNotFound = 
+resFTPRights = 
+resFTPHostUnreachable = 
+resFTPUnknownError = 
+resFTPDirectory = 
+resIllegalFolder = 
+resConnecting = 
+
+def __init__(self, xmsf):
+super(FTPDialogResources, self).__init__(xmsf, self.MODULE_NAME)
+
+# Delete the String, uncomment the getResText method
+resFTPDialog_title = self.getResText(self.RID_FTPDIALOG_START + 0)
+reslblUsername_value = self.getResText(self.RID_FTPDIALOG_START + 1)
+reslblPassword_value = self.getResText(self.RID_FTPDIALOG_START + 2)
+resbtnConnect_value = self.getResText(self.RID_FTPDIALOG_START + 3)
+resln1_value = self.getResText(self.RID_FTPDIALOG_START + 4)
+reslblFTPAddress_value = self.getResText(self.RID_FTPDIALOG_START + 5)
+resln2_value = self.getResText(self.RID_FTPDIALOG_START + 6)
+resln3_value = self.getResText(self.RID_FTPDIALOG_START + 7)
+resbtnDir_value = self.getResText(self.RID_FTPDIALOG_START + 8)
+resFTPDisconnected = self.getResText(self.RID_FTPDIALOG_START + 9)
+resFTPConnected = self.getResText(self.RID_FTPDIALOG_START + 10)
+resFTPUserPwdWrong = self.getResText(self.RID_FTPDIALOG_START + 11)
+resFTPServerNotFound = self.getResText(self.RID_FTPDIALOG_START + 12)
+resFTPRights = self.getResText(self.RID_FTPDIALOG_START + 13)
+resFTPHostUnreachable = self.getResText(self.RID_FTPDIALOG_START + 14)
+resFTPUnknownError = self.getResText(self.RID_FTPDIALOG_START + 15)
+resFTPDirectory = self.getResText(self.RID_FTPDIALOG_START + 16)
+resIllegalFolder = self.getResText(self.RID_FTPDIALOG_START + 17)
+resConnecting = self.getResText(self.RID_FTPDIALOG_START + 18)
+
+resbtnCancel_value = self.getResText(self.RID_COMMON_START + 11)
+resbtnOK_value = self.getResText(self.RID_COMMON_START + 18)
+resbtnHelp_value = self.getResText(self.RID_COMMON_START + 15)
+
+restxtDir_value = /

-- 
To view, visit https://gerrit.libreoffice.org/2999
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibacf3645ecfd892b924fb2d2b202a1f5f2db3215
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file LogTaskListener.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3000

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/00/3000/1

Init: Added new file LogTaskListener.py

Change-Id: I3bed03d791c8ad5361b25e8374578a927aed9bf1
---
A wizards/com/sun/star/wizards/web/LogTaskListener.py
1 file changed, 49 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/LogTaskListener.py 
b/wizards/com/sun/star/wizards/web/LogTaskListener.py
new file mode 100644
index 000..13b7e59
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/LogTaskListener.py
@@ -0,0 +1,49 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+
+# used for debugging.
+class LogTaskListener(TaskListener, ErrorHandler):
+
+out
+
+def __init__(os):
+out = os
+
+def __init__():
+self.__init__(System.out)
+
+# @see 
com.sun.star.wizards.web.status.TaskListener#taskStarted(com.sun.star.wizards.web.status.TaskEvent)
+def taskStarted(te):
+out.println(TASK  + te.getTask().getTaskName() +  STARTED.)
+
+#@see 
com.sun.star.wizards.web.status.TaskListener#taskFinished(com.sun.star.wizards.web.status.TaskEvent)
+def taskFinished(te):
+out.println(TASK  + te.getTask().getTaskName() +  FINISHED:  + 
te.getTask().getSuccessfull() + / + te.getTask().getMax() + Succeeded.)
+
+#@see 
com.sun.star.wizards.web.status.TaskListener#taskStatusChanged(com.sun.star.wizards.web.status.TaskEvent)
+def taskStatusChanged(te)
+out.println(TASK  + te.getTask().getTaskName() +  status :  + 
te.getTask().getSuccessfull() + (+ + te.getTask().getFailed() + )/ + 
te.getTask().getMax())
+
+#@see 
com.sun.star.wizards.web.status.TaskListener#subtaskNameChanged(com.sun.star.wizards.web.status.TaskEvent)
+def subtaskNameChanged(te):
+out.println(SUBTASK Name: + te.getTask().getSubtaskName())
+
+# @see 
com.sun.star.wizards.web.status.ErrorReporter#error(java.lang.Exception, 
java.lang.Object, java.lang.String)
+def error(ex, arg, ix, i):
+print (PropertyNames.EMPTY_STRING + arg + // + ix + //Exception:  
+ ex.getLocalizedMessage())
+ex.printStackTrace()
+return True;

-- 
To view, visit https://gerrit.libreoffice.org/3000
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3bed03d791c8ad5361b25e8374578a927aed9bf1
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file Process.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3001

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/01/3001/1

Init: Added new file Process.py

Change-Id: I09a49ec08b89f6fbae27a60d5f9208bea7ba8cf8
---
A wizards/com/sun/star/wizards/web/Process.py
1 file changed, 594 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/Process.py 
b/wizards/com/sun/star/wizards/web/Process.py
new file mode 100644
index 000..1516cad
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/Process.py
@@ -0,0 +1,594 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+import traceback
+import importlib
+
+from .WebWizardConst import *
+from ..common.UCB import UCB
+from ..common.FileAccess import FileAccess
+from ..ui.event.Task import Task
+from .ProcessErrors import ProcessErrors
+from .ExtensionVerifier import ExtensionVerifier
+from .ErrorHandler import ErrorHandler
+from .data.CGContent import CGContent
+from .data.CGDocument import CGDocument
+from .data.CGExporter import CGExporter
+from .data.CGLayout import CGLayout
+from .data.CGPublish import CGPublish
+from .data.CGSettings import CGSettings
+#from .export.Exporter import Exporter
+#from .export.AbstractExporter import AbstractExporter
+#from .export.CopyExporter import CopyExporter
+
+from com.sun.star.io import IOException
+from com.sun.star.uno import SecurityException
+
+# This class is used to process a CGSession object
+# and generate a site. /br
+# it does the following: br/
+# 1. create a temporary directory.br/
+# 2. export documents to the temporary directory.br/
+# 3. generate the TOC page, includes copying images from the
+# web wizard work directory and other layout files.br/
+# 4. publish, or copy, from the temporary directory to
+# different destinations.br/
+# 5. delete the temporary directory.br/
+# br/
+# to follow up the status/errors it uses a TaskListener object,
+# and an ErrorHandler. br/
+# in practice, the TaskListener is the status dialog,
+# and the Errorhandler does the interaction with the user,
+# if something goes wrong.br/
+# Note that this class takes it in count that
+# the given session object is prepared for it -
+# all preparations are done in WWD_Events.finishWizard methods.
+# br/
+# br/
+#
+# note on error handling: br/
+# on catch clauses I tries to decide whether the
+# exception is fatal or not. For fatal exception an error message
+# is displayed (or rather: the errorHandler is being called...)
+# and a false is returned.
+# In less-fatal errors, the errorHandler should decide which means,
+# the user is given the option to OK or to Cancel and depending
+# on that interaction I cary on.
+class Process(ProcessErrors):
+
+TASKS_PER_DOC = 5
+TASKS_PER_XSL = 2
+TASKS_PER_PUBLISH = 2
+TASKS_IN_PREPARE = 1
+TASKS_IN_EXPORT = 2
+TASKS_IN_GENERATE = 2
+TASKS_IN_PUBLISH = 2
+TASKS_IN_FINISHUP = 1
+settings = None
+xmsf = None
+errorHandler = None
+tempDir = None
+fileAccess = None
+ucb = None
+myTask = None
+#This is a cache for exporters, so I do not need to
+#instanciate the same exporter more than once.
+exporters = {}
+result = None
+
+def __init__(self, settings, xmsf, er):
+self.xmsf = xmsf
+self.settings = settings
+self.fileAccess = FileAccess(xmsf)
+self.errorHandler = er
+
+self.ucb = UCB(xmsf)
+
+self.taskSteps = self.getTaskSteps()
+self.myTask = Task(TASK, TASK_PREPARE, self.taskSteps)
+
+# @return to how many destinations should the
+# generated site be published.
+def countPublish(self):
+count = 0
+publishers = self.settings.cp_DefaultSession.cp_Publishing
+for e in publishers.childrenList:
+if e.cp_Publish:
+count += 1
+return count
+
+# @return the number of task steps that this
+# session should have
+def getTaskSteps(self):
+docs = 
self.settings.cp_DefaultSession.cp_Content.cp_Documents.getSize()
+xsl = 0
+try:
+layout = self.settings.cp_DefaultSession.getLayout()
+xsl = 

[PATCH] Init: Added new file ProcessErrorHandler.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3002

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/02/3002/1

Init: Added new file ProcessErrorHandler.py

Change-Id: I0444f27eddc4367c963a4c5e81a7f4b8011d5626
---
A wizards/com/sun/star/wizards/web/ProcessErrorHandler.py
1 file changed, 61 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/ProcessErrorHandler.py 
b/wizards/com/sun/star/wizards/web/ProcessErrorHandler.py
new file mode 100644
index 000..6b6c8bb
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/ProcessErrorHandler.py
@@ -0,0 +1,61 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+
+from .ProcessErrors import ProcessErrors
+from .AbstractErrorHandler import AbstractErrorHandler
+from .WebWizardConst import *
+
+# used to interact error accuring when generating the
+# web-site to the user.
+# This class renders the different errors,
+# replaceing some strings from the resources with
+# content of the given arguments, depending on the error
+# that accured.
+class ProcessErrorHandler(AbstractErrorHandler, ProcessErrors):
+
+FILENAME = %FILENAME
+URL = %URL
+ERROR = %ERROR
+resources = None
+
+def __init__(self, xmsf, peer, res):
+super(ProcessErrorHandler, self).__init__(xmsf, peer)
+self.resources = res
+
+def getMessageFor(self, ex, obj, ix, errType):
+if ix == ProcessErrors.ERROR_MKDIR:
+return self.resources.resErrDocExport.replace(obj.localFilename, 
self.FILENAME)
+elif ix == ProcessErrors.ERROR_EXPORT_MKDIR:
+return self.resources.resErrMkDir.replace(obj.localFilename, 
self.FILENAME)
+elif ix == ProcessErrors.ERROR_DOC_VALIDATE:
+return self.resources.resErrDocInfo.replace(obj.localFilename, 
self.FILENAME)
+elif ix == ProcessErrors.ERROR_EXPORT_IO:
+return self.resources.resErrExportIO.replace(obj.localFilename, 
self.FILENAME)
+elif ix == ProcessErrors.ERROR_EXPORT_SECURITY:
+return self.resources.resErrSecurity.replace(obj.localFilename, 
self.FILENAME)
+elif ix == ProcessErrors.ERROR_GENERATE_XSLT:
+return self.resources.resErrTOC
+elif ix == ProcessErrors.ERROR_GENERATE_COPY:
+return self.resources.resErrTOCMedia
+elif ix == ProcessErrors.ERROR_PUBLISH:
+return self.resources.resErrPublish.replace(self.URL, obj.URL)
+elif (ix == ProcessErrors.ERROR_EXPORT or ix == 
ProcessErrors.ERROR_PUBLISH_MEDIA):
+return self.resources.resErrPublishMedia
+elif ix == ProcessErrors.ERROR_CLEANUP:
+return self.resources.resErrUnexpected
+else:
+return self.resources.resErrUnknown.replace(%ERROR, 
{0}/{1}/{2!s}.format(ex.__class__.__name__, obj.__class__.__name__, ix))

-- 
To view, visit https://gerrit.libreoffice.org/3002
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0444f27eddc4367c963a4c5e81a7f4b8011d5626
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file ProcessErrors.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3003

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/03/3003/1

Init: Added new file ProcessErrors.py

Change-Id: I02484002b23db77313247fb3c6de12dc82c08da7
---
A wizards/com/sun/star/wizards/web/ProcessErrors.py
1 file changed, 32 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/ProcessErrors.py 
b/wizards/com/sun/star/wizards/web/ProcessErrors.py
new file mode 100644
index 000..40fda77
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/ProcessErrors.py
@@ -0,0 +1,32 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+
+# Error IDs for errors that can accure
+# in the interaction with the Process class.
+class ProcessErrors:
+
+ERROR_MKDIR = 0
+ERROR_EXPORT = 1
+ERROR_EXPORT_MKDIR = 2
+ERROR_DOC_VALIDATE = 3
+ERROR_EXPORT_IO = 4
+ERROR_EXPORT_SECURITY = 5
+ERROR_GENERATE_XSLT = 6
+ERROR_GENERATE_COPY = 7
+ERROR_PUBLISH = 8
+ERROR_PUBLISH_MEDIA = 9
+ERROR_CLEANUP = 10

-- 
To view, visit https://gerrit.libreoffice.org/3003
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I02484002b23db77313247fb3c6de12dc82c08da7
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file ProcessStatusRenderer.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3004

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/04/3004/1

Init: Added new file ProcessStatusRenderer.py

Change-Id: Ifacbff7c1423580f14ff3c92a8202015f1afad6b
---
A wizards/com/sun/star/wizards/web/ProcessStatusRenderer.py
1 file changed, 48 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/ProcessStatusRenderer.py 
b/wizards/com/sun/star/wizards/web/ProcessStatusRenderer.py
new file mode 100644
index 000..f123785
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/ProcessStatusRenderer.py
@@ -0,0 +1,48 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+
+
+from .WebWizardConst import *
+from ..common.IRenderer import IRenderer
+
+
+# recieves status calls from the status dialog which
+# apears when the user clicks create.
+# allocates strings from the resources to
+# display the current task status.
+# (renders the state to resource strings)
+class ProcessStatusRenderer(IRenderer):
+
+strings = {}
+
+def __init__(self, res):
+self.strings[TASK_EXPORT_DOCUMENTS] = res.resTaskExportDocs
+self.strings[TASK_EXPORT_PREPARE] = res.resTaskExportPrepare
+self.strings[TASK_GENERATE_COPY] = res.resTaskGenerateCopy
+self.strings[TASK_GENERATE_PREPARE] = res.resTaskGeneratePrepare
+self.strings[TASK_GENERATE_XSL] = res.resTaskGenerateXsl
+self.strings[TASK_PREPARE] = res.resTaskPrepare
+self.strings[LOCAL_PUBLISHER] = res.resTaskPublishLocal
+self.strings[ZIP_PUBLISHER] = res.resTaskPublishZip
+self.strings[FTP_PUBLISHER] = res.resTaskPublishFTP
+
+self.strings[TASK_PUBLISH_PREPARE] = res.resTaskPublishPrepare
+self.strings[TASK_FINISH] = res.resTaskFinish
+
+def render(self, object):
+return self.strings[object]
+

-- 
To view, visit https://gerrit.libreoffice.org/3004
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifacbff7c1423580f14ff3c92a8202015f1afad6b
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file StatusDialog.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3005

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/05/3005/1

Init: Added new file StatusDialog.py

Change-Id: I679e60042d2d46fdeaf5b56063108bb0332393a0
---
A wizards/com/sun/star/wizards/web/StatusDialog.py
1 file changed, 174 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/StatusDialog.py 
b/wizards/com/sun/star/wizards/web/StatusDialog.py
new file mode 100644
index 000..5b353cc
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/StatusDialog.py
@@ -0,0 +1,174 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+import uno
+import traceback
+
+from ..ui.UnoDialog2 import UnoDialog2
+from ..ui.UnoDialog import UnoDialog
+from ..ui.event.TaskListener import TaskListener
+from ..common.PropertyNames import PropertyNames
+
+# Note on the argument resource:
+# This should be a String array containing the followin strings, in the
+# following order:
+# dialog title, cancel, close, counter prefix, counter midfix, counter postfix
+class StatusDialog(UnoDialog2):
+
+STANDARD_WIDTH = 240
+lblTaskName = None
+lblCounter = None
+progressBar = None
+btnCancel = None
+finished = False
+enableBreak = False
+closeOnFinish = True
+renderer = None
+finishedMethod = None
+
+def __init__(self, xmsf, width, taskName, displayCount, resources, hid):
+super(StatusDialog, self).__init__(xmsf)
+
+self.res = resources
+if not (len(self.res) == 6):
+# display a close button?
+raise IllegalArgumentException(The resources argument should 
contain 6 Strings, see doc on constructor.)
+
+b = not (self.enableBreak or self.closeOnFinish)
+
+uno.invoke(self.xDialogModel, setPropertyValues, (
+(Closeable,
+ PropertyNames.PROPERTY_HEIGHT,
+ PropertyNames.PROPERTY_HELPURL, Moveable,
+ PropertyNames.PROPERTY_NAME,
+ PropertyNames.PROPERTY_POSITION_X,
+ PropertyNames.PROPERTY_POSITION_Y,
+ PropertyNames.PROPERTY_STEP, Title,
+ PropertyNames.PROPERTY_WIDTH),
+(False, 6 + 25 + (27 if b else 7), hid, True, StatusDialog, 
102, 52, 0,
+ self.res[0], width)))
+
+tabstop = 1
+
+self.lblTaskName = self.insertLabel(lblTask,
+(PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, 
PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, 
PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH),
+(8, taskName, 6, 6, tabstop, int(width * 2 / 3)))
+tabstop += 1
+self.lblCounter = self.insertLabel(lblCounter,
+(PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, 
PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, 
PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH),
+(8, , int(width * 2 / 3), 6, tabstop, int(width / 3) - 4))
+tabstop += 1
+self.progressBar = self.insertProgressBar(progress,
+(PropertyNames.PROPERTY_HEIGHT, 
PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, 
PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH),
+(10, 6, 16, tabstop, width - 12))
+tabstop += 1
+
+if b:
+self.btnCancel = self.insertButton(btnCancel, performCancel, 
self,
+(PropertyNames.PROPERTY_HEIGHT, 
PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, 
PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_TABINDEX, 
PropertyNames.PROPERTY_WIDTH),
+(14, self.res[1], width / 2 - 20, 6 + 25 + 7, tabstop, 40))
+tabstop += 1
+
+def initProgressBar(self, t):
+self.progressBar.setRange(0, t.getMax())
+self.progressBar.setValue(0)
+
+def setStatus(self, status):
+if self.finished:
+return
+self.progressBar.setValue(status)
+#self.xReschedule.reschedule()
+
+def setLabel(self, s):
+self.lblTaskName.Text = s
+

[PATCH] Init: Added new file TOCPreview.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3006

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/06/3006/1

Init: Added new file TOCPreview.py

Change-Id: I77749fd794308da81096b95acc57613562d76f8b
---
A wizards/com/sun/star/wizards/web/TOCPreview.py
1 file changed, 65 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/TOCPreview.py 
b/wizards/com/sun/star/wizards/web/TOCPreview.py
new file mode 100644
index 000..ad27afd
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/TOCPreview.py
@@ -0,0 +1,65 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+import traceback
+
+from .Process import Process
+from ..ui.event.Task import Task
+from ..common.FileAccess import FileAccess
+from ..common.Properties import Properties
+from ..common.Desktop import Desktop
+from ..common.UCB import UCB
+
+# This class both copies necessary files to
+# a temporary directory, generates a temporary TOC page,
+# and opens the generated html document in a web browser,
+# by default index.html (unchangeable).
+# br/
+# Since the files are both static and dynamic (some are always the same,
+# while other change according to user choices)
+# I divide this tasks to two: all necessary
+# static files, which should not regularily update are copied upon
+# instanciation.
+# The TOC is generated in refresh(...);
+
+class TOCPreview:
+
+def __init__(self, xmsf_, settings, res, tempDir_, _xFrame):
+self.xFrame = _xFrame
+self.xmsf = xmsf_
+self.resources = res
+self.fileAccess = FileAccess(self.xmsf)
+self.tempDir = tempDir_
+self.loadArgs = self.loadArgs(FileAccess.connectURLs(self.tempDir, 
/index.html))
+self.openHyperlink = Desktop.getDispatchURL(self.xmsf, 
.uno:OpenHyperlink)
+self.xDispatch = Desktop.getDispatcher(self.xmsf, self.xFrame, _top, 
self.openHyperlink)
+self.ucb = UCB(self.xmsf)
+
+Process.copyStaticImages(self.ucb, settings, self.tempDir)
+
+def refresh(self, settings):
+doc = settings.cp_DefaultSession.createDOM1()
+layout = settings.cp_DefaultSession.getLayout()
+task = Task(, , 1);
+Process.generate1(self.xmsf, layout, doc, self.fileAccess, 
self.tempDir, task)
+Process.copyLayoutFiles(self.ucb, self.fileAccess, settings, layout, 
self.tempDir)
+self.xDispatch.dispatch(self.openHyperlink, tuple(self.loadArgs))
+
+def loadArgs(self, url):
+props = Properties()
+props[URL] = url
+return props.getProperties1()

-- 
To view, visit https://gerrit.libreoffice.org/3006
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I77749fd794308da81096b95acc57613562d76f8b
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file TypeDetection.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3007

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/07/3007/1

Init: Added new file TypeDetection.py

Change-Id: I1bd9f27fb0ebcde9af72bf7dc734c869a91da9ed
---
A wizards/com/sun/star/wizards/web/TypeDetection.py
1 file changed, 54 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/TypeDetection.py 
b/wizards/com/sun/star/wizards/web/TypeDetection.py
new file mode 100644
index 000..48957b6
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/TypeDetection.py
@@ -0,0 +1,54 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+'''
+a document which will open in writer.
+'''
+WRITER_DOC = writer
+'''
+a document which will open in calc.
+'''
+CALC_DOC = calc
+'''
+a document which will open in impress.
+'''
+IMPRESS_DOC = impress
+'''
+a document which will open in draw.
+'''
+DRAW_DOC = draw
+'''
+an HTML document
+'''
+HTML_DOC = html
+'''
+a GIF or an JPG file.
+'''
+WEB_GRAPHICS = graphics
+'''
+a PDF document.
+'''
+PDF_DOC = pdf
+'''
+a Sound file (mp3/wav ect.)
+'''
+SOUND_FILE = sound
+'''
+a File which can not be handled by neither SO or a Web browser
+(exe, jar, zip ect.)
+'''
+NO_TYPE = other

-- 
To view, visit https://gerrit.libreoffice.org/3007
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bd9f27fb0ebcde9af72bf7dc734c869a91da9ed
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new file WebWizard.py

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3008

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/08/3008/1

Init: Added new file WebWizard.py

Change-Id: I25dffb036644b9e8466256b866ce89abbabc5b2f
---
A wizards/com/sun/star/wizards/web/WebWizard.py
1 file changed, 42 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/WebWizard.py 
b/wizards/com/sun/star/wizards/web/WebWizard.py
new file mode 100644
index 000..241e776
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/WebWizard.py
@@ -0,0 +1,42 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+import traceback
+
+from .WWD_Events import WWD_Events
+
+# The last class in the WebWizard Dialog class hirarchy.
+# Has no functionality, is just nice to have it instanciated.
+class WebWizard(WWD_Events):
+
+def __init__(self, xmsf):
+super(WebWizard, self).__init__(xmsf)
+
+@classmethod
+def main(self):
+#Call the wizard remotely(see README)
+try:
+ConnectStr = \
+
uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext
+xLocMSF = Desktop.connect(ConnectStr)
+ww = WebWizard(xLocMSF)
+ww.show()
+ww.cleanup()
+except Exception as e:
+print (Wizard failure exception  + str(type(e)) +
+message  + str(e) +  args  + str(e.args) +
+   traceback.format_exc())

-- 
To view, visit https://gerrit.libreoffice.org/3008
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I25dffb036644b9e8466256b866ce89abbabc5b2f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Added new Exporter classes.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3009

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/09/3009/1

Init: Added new Exporter classes.

Change-Id: I45a0c3a4665581dcd0709d1ae72fbbbf404d7182
---
A wizards/com/sun/star/wizards/web/export/AbstractExporter.py
A wizards/com/sun/star/wizards/web/export/CopyExporter.py
A wizards/com/sun/star/wizards/web/export/Exporter.py
A wizards/com/sun/star/wizards/web/export/__init__.py
4 files changed, 199 insertions(+), 0 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/export/AbstractExporter.py 
b/wizards/com/sun/star/wizards/web/export/AbstractExporter.py
new file mode 100644
index 000..2dd45c2
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/export/AbstractExporter.py
@@ -0,0 +1,106 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+import traceback
+import uno
+
+from .Exporter import Exporter
+from ..TypeDetection import *
+from ...common.Desktop import Desktop
+from ...common.Properties import Properties
+from ...common.FileAccess import FileAccess
+from ...document.OfficeDocument import OfficeDocument
+from ...text.TextDocument import TextDocument
+
+from com.sun.star.lang import IllegalArgumentException
+from com.sun.star.document.MacroExecMode import NEVER_EXECUTE
+from com.sun.star.document.UpdateDocMode import NO_UPDATE
+
+class AbstractExporter(Exporter):
+
+exporter = None
+fileAccess = None
+
+def __init__(self, exporter_):
+print (DEBUG !!! AbstractExporter.init - exporter: , exporter_)
+self.exporter = exporter_
+
+def storeToURL(self, officeDocument, props, targetUrl, filterName, 
filterData):
+props = Properties()
+props[FilterName] = filterName
+if (len(filterData)  0):
+props[FilterData] = filterData
+o = props.getProperties1()
+officeDocument.storeToURL(targetUrl, tuple(o))
+
+def storeToURL1(self, officeDocument, targetUrl, filterName, filterData):
+self.storeToURL(officeDocument, Properties(), targetUrl, filterName, 
filterData)
+
+def storeToURL2(self, officeDocument, targetUrl, filterName):
+self.storeToURL(officeDocument, Properties(), targetUrl, filterName, 
[])
+
+def getArgument(self, name, p):
+return p.cp_Arguments.getElement(name).cp_Value
+
+def openDocument(self, doc, xmsf):
+document = None
+# open the document.
+try:
+desktop = Desktop.getDesktop(xmsf)
+props = list(range(3))
+props[0] = Properties.createProperty(Hidden, True)
+props[1] = Properties.createProperty(MacroExecutionMode, 
NEVER_EXECUTE)
+props[2] = Properties.createProperty(UpdateDocMode, NO_UPDATE)
+print (DEBUG !!! openDocument -- URL: , doc.cp_URL)
+document = desktop.loadComponentFromURL(doc.cp_URL, _blank, 0, 
tuple(props))
+except IllegalArgumentException:
+traceback.print_exc()
+# try to get the number of pages in the document
+try:
+self.pageCount(doc, document)
+except Exception:
+traceback.print_exc()
+# Here i do nothing since pages is not *so* important.
+return document
+
+def closeDocument(self, doc, xmsf):
+try:
+doc.close(False)
+except Exception:
+traceback.print_exc()
+
+def pageCount(self, doc, document):
+if (doc.appType == WRITER_DOC):
+doc.pages = TextDocument.getPageCount(document)
+elif (doc.appType == IMPRESS_DOC):
+doc.pages = OfficeDocument.getSlideCount(document)
+elif (doc.appType == DRAW_DOC):
+doc.pages = OfficeDocument.getSlideCount(document)
+
+def getFileAccess(self, xmsf):
+if (self.fileAccess == None):
+try:
+self.fileAccess = FileAccess(xmsf)
+except Exception:
+traceback.print_exc()
+return self.fileAccess
+
+def calcFileSize(self, doc, url, xmsf):
+# if the exporter exports to a
+# binary format, get the size of the destination.
+if 

[PATCH] Init: Relative paths and missing imports

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3010

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/10/3010/1

Init: Relative paths and missing imports

Change-Id: I2196567e0c9b90a9a56aa1db769f6efc9e56e74f
---
M wizards/com/sun/star/wizards/web/StylePreview.py
M wizards/com/sun/star/wizards/web/data/CGArgument.py
M wizards/com/sun/star/wizards/web/data/CGContent.py
M wizards/com/sun/star/wizards/web/data/CGDesign.py
M wizards/com/sun/star/wizards/web/data/CGFilter.py
M wizards/com/sun/star/wizards/web/data/CGGeneralInfo.py
M wizards/com/sun/star/wizards/web/data/CGIconSet.py
M wizards/com/sun/star/wizards/web/data/CGImage.py
M wizards/com/sun/star/wizards/web/data/CGLayout.py
M wizards/com/sun/star/wizards/web/data/CGSessionName.py
M wizards/com/sun/star/wizards/web/data/CGStyle.py
11 files changed, 22 insertions(+), 15 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/StylePreview.py 
b/wizards/com/sun/star/wizards/web/StylePreview.py
index eb9510f..d131037 100644
--- a/wizards/com/sun/star/wizards/web/StylePreview.py
+++ b/wizards/com/sun/star/wizards/web/StylePreview.py
@@ -15,8 +15,9 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from common.FileAccess import FileAccess
 import traceback
+
+from ..common.FileAccess import FileAccess
 
 '''
 @author rpiterman
@@ -46,7 +47,9 @@
 self.cssFilename = FileAccess.connectURLs(self.tempDir, style.css)
 self.backgroundFilename = FileAccess.connectURLs(
 self.tempDir, images/background.gif)
+
 self.wwRoot = wwRoot_
+print (WARNING !!! StylePreview init (review) - source, target: , 
self.wwRoot, self.htmlFilename)
 self.fileAccess.copy(FileAccess.connectURLs(
 self.wwRoot, preview.html), self.htmlFilename)
 
@@ -68,9 +71,11 @@
 # a solaris bug workaround
 # TODO
 #copy the background image to the temp directory.
+print (WARNING !!! refresh (background) - source, target: , 
background, self.backgroundFilename)
 self.fileAccess.copy(background, self.backgroundFilename)
 
 #copy the actual css to the temp directory
+print (WARNING !!! refresh (css) - source, target: , css, 
self.tempDir)
 self.fileAccess.copy(css, self.cssFilename)
 
 def cleanup(self):
diff --git a/wizards/com/sun/star/wizards/web/data/CGArgument.py 
b/wizards/com/sun/star/wizards/web/data/CGArgument.py
index 220f424..ee532de 100644
--- a/wizards/com/sun/star/wizards/web/data/CGArgument.py
+++ b/wizards/com/sun/star/wizards/web/data/CGArgument.py
@@ -15,7 +15,7 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from common.ConfigGroup import ConfigGroup
+from ...common.ConfigGroup import ConfigGroup
 
 class CGArgument(ConfigGroup):
 cp_Value = str()
diff --git a/wizards/com/sun/star/wizards/web/data/CGContent.py 
b/wizards/com/sun/star/wizards/web/data/CGContent.py
index d2969d8..c85d7df 100644
--- a/wizards/com/sun/star/wizards/web/data/CGContent.py
+++ b/wizards/com/sun/star/wizards/web/data/CGContent.py
@@ -15,9 +15,10 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from common.ConfigGroup import ConfigGroup
-from common.ConfigSet import ConfigSet
-from CGDocument import CGDocument
+from ...common.ConfigGroup import ConfigGroup
+from ...common.ConfigSet import ConfigSet
+from ...common.XMLHelper import XMLHelper
+from .CGDocument import CGDocument
 
 class CGContent(ConfigGroup):
 
diff --git a/wizards/com/sun/star/wizards/web/data/CGDesign.py 
b/wizards/com/sun/star/wizards/web/data/CGDesign.py
index 2d071d3..a53e40a 100644
--- a/wizards/com/sun/star/wizards/web/data/CGDesign.py
+++ b/wizards/com/sun/star/wizards/web/data/CGDesign.py
@@ -15,7 +15,7 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from common.ConfigGroup import ConfigGroup
+from ...common.ConfigGroup import ConfigGroup
 
 class CGDesign(ConfigGroup):
 
diff --git a/wizards/com/sun/star/wizards/web/data/CGFilter.py 
b/wizards/com/sun/star/wizards/web/data/CGFilter.py
index 75a4adc..8862cae 100644
--- a/wizards/com/sun/star/wizards/web/data/CGFilter.py
+++ b/wizards/com/sun/star/wizards/web/data/CGFilter.py
@@ -15,7 +15,7 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from common.ConfigGroup import ConfigGroup
+from ...common.ConfigGroup import ConfigGroup
 
 class CGFilter(ConfigGroup):
 cp_Index = -1
diff --git a/wizards/com/sun/star/wizards/web/data/CGGeneralInfo.py 
b/wizards/com/sun/star/wizards/web/data/CGGeneralInfo.py
index 

[PATCH] Init: fixed typo in the SystemDialog class.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3011

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/11/3011/1

Init: fixed typo in the SystemDialog class.

Change-Id: I8ab25ca01eb68ad10e60b9209e8a2ee6b0eb3252
---
M wizards/com/sun/star/wizards/common/SystemDialog.py
1 file changed, 2 insertions(+), 2 deletions(-)



diff --git a/wizards/com/sun/star/wizards/common/SystemDialog.py 
b/wizards/com/sun/star/wizards/common/SystemDialog.py
index ab9b463..cf640ff 100644
--- a/wizards/com/sun/star/wizards/common/SystemDialog.py
+++ b/wizards/com/sun/star/wizards/common/SystemDialog.py
@@ -91,8 +91,8 @@
 
 def callFolderDialog(self, title, description, displayDir):
 try:
-self.systemDialog.setDisplayDirectoryxPropertyValue(
-subst(displayDir))
+self.systemDialog.setDisplayDirectory(
+self.subst(displayDir))
 except IllegalArgumentException as iae:
 traceback.print_exc()
 raise AttributeError(iae.getMessage());

-- 
To view, visit https://gerrit.libreoffice.org/3011
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8ab25ca01eb68ad10e60b9209e8a2ee6b0eb3252
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Pythonize the BackgroundsDialog class.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3013

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/13/3013/1

Init: Pythonize the BackgroundsDialog class.

Change-Id: I50e153a07372aee447ce8a32186cc3fbf9fc9d9a
---
M wizards/com/sun/star/wizards/web/BackgroundsDialog.py
1 file changed, 28 insertions(+), 22 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/BackgroundsDialog.py 
b/wizards/com/sun/star/wizards/web/BackgroundsDialog.py
index 640daee..936aa16 100644
--- a/wizards/com/sun/star/wizards/web/BackgroundsDialog.py
+++ b/wizards/com/sun/star/wizards/web/BackgroundsDialog.py
@@ -15,11 +15,17 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from ImageListDialog import *
-from ImageListDialog import *
-from WWHID import HID_BG
-from common.SystemDialog import SystemDialog
-from common.FileAccess import FileAccess
+import uno
+import traceback
+
+from .ImageListDialog import ImageListDialog
+from .WWHID import HID_BG
+from .WebWizardConst import *
+from ..common.SystemDialog import SystemDialog
+from ..common.FileAccess import FileAccess
+from ..common.Configuration import Configuration
+
+from com.sun.star.awt import Size
 
 class BackgroundsDialog(ImageListDialog):
 
@@ -59,7 +65,7 @@
 if filename is not None and filename.length  0 and filename[0] is not 
None:
 self.settings.cp_DefaultSession.cp_InDirectory = \
 FileAccess.getParentDir(filename[0])
-i = add(filename[0])
+i = self.add(filename[0])
 il.setSelected(i)
 il.display(i)
 
@@ -74,7 +80,7 @@
 #first i check the item does not already exists in the list...
 i = 0
 while i  il.getListModel().getSize():
-if il.getListModel().getElementAt(i).equals(s):
+if il.getListModel().getElementAt(i) == s:
 return i
 
 i += 1
@@ -82,13 +88,13 @@
 try:
 configView = Configuration.getConfigurationRoot(
 self.xMSF, FileAccess.connectURLs(
-WebWizardConst.CONFIG_PATH, BackgroundImages), True)
+CONFIG_PATH, BackgroundImages), True)
 i = Configuration.getChildrenNames(configView).length + 1
 o = Configuration.addConfigNode(configView,  + i)
 Configuration.set(s, Href, o)
 Configuration.commit(configView)
-except Exception, ex:
-ex.printStackTrace()
+except Exception:
+traceback.print_exc()
 
 return il.getListModel().getSize() - 1
 
@@ -107,9 +113,9 @@
 self.cut = cut_
 
 def getImageUrls(self, listItem):
-if listItem is not None:
-sRetUrls = range(1)
-sRetUrls[0] = listItem
+sRetUrls = []
+if (listItem is not None):
+sRetUrls.append(listItem)
 return sRetUrls
 
 return None
@@ -153,8 +159,8 @@
 remove(model.getKey(image))
 
 i += 1
-except Exception, ex:
-ex.printStackTrace()
+except Exception:
+traceback.print_exc()
 
 '''
 when instanciating the model, it checks if each image
@@ -170,8 +176,8 @@
 self.xMSF, WebWizardConst.CONFIG_PATH + 
/BackgroundImages,
 True)
 Configuration.removeNode(conf, imageName)
-except Exception, ex:
-ex.printStackTrace()
+except Exception:
+traceback.print_exc()
 
 '''
 if the given url is a directory
@@ -182,9 +188,9 @@
 
 def addDir(self, url):
 if self.fileAccess.isDirectory(url):
-add(self.fileAccess.listFiles(url, False))
+self.add(self.fileAccess.listFiles(url, False))
 else:
-add(url)
+self.add(url)
 
 '''
 adds the given filenames (urls) to
@@ -194,8 +200,8 @@
 
 def add(self, filenames):
 i = 0
-while i  filenames.length:
-add(filenames[i])
+while i  len(filenames):
+self.add1(filenames[i])
 i += 1
 
 '''
@@ -205,7 +211,7 @@
 @param filename image url.
 '''
 
-def add(self, filename):
+def add1(self, filename):
 lcase = filename.toLowerCase()
 if lcase.endsWith(jpg) or lcase.endsWith(jpeg) or \
 lcase.endsWith(gif):

-- 
To view, visit https://gerrit.libreoffice.org/3013
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I50e153a07372aee447ce8a32186cc3fbf9fc9d9a
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: 

[PATCH] Init: Pythonize the ImageList class and avoid using the Help...

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3012

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/12/3012/1

Init: Pythonize the ImageList class and avoid using the Helper.

Change-Id: Ic48fa9d02eb9285937bc6b03e59dde67cf3c625c
---
M wizards/com/sun/star/wizards/ui/ImageList.py
1 file changed, 36 insertions(+), 42 deletions(-)



diff --git a/wizards/com/sun/star/wizards/ui/ImageList.py 
b/wizards/com/sun/star/wizards/ui/ImageList.py
index 10e3ff4..f21bcb7 100644
--- a/wizards/com/sun/star/wizards/ui/ImageList.py
+++ b/wizards/com/sun/star/wizards/ui/ImageList.py
@@ -15,11 +15,12 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
+import uno
+
 from threading import RLock
 from .PeerConfig import PeerConfig
 from ..common.PropertyNames import PropertyNames
 from ..common.HelpIds import HelpIds
-from ..common.Helper import Helper
 
 from com.sun.star.awt import Size
 
@@ -74,9 +75,10 @@
 self.pageStart = 0
 self.helpURL = 0
 self.counterRenderer = self.SimpleCounterRenderer()
-self.MOVE_SELECTION_VALS = range(3)
+self.MOVE_SELECTION_VALS = list(range(3))
 
 def create(self, dialog):
+print (DEBUG  ImageList create 1)
 self.oUnoDialog = dialog
 self.dialogModel = dialog.xDialogModel
 imageTextHeight = self.imageTextLines * ImageList.LINE_HEIGHT
@@ -93,7 +95,7 @@
 (ImageList.BACKGROUND_COLOR, 1,
 (self.imageSize.Height + self.gap.Height) \
 * self.rows + self.gap.Height + imageTextHeight + 1,
-self.pos.Width,self.pos.Height, self.step,
+self.pos.Width, self.pos.Height, self.step,
 (self.imageSize.Width + self.gap.Width) \
 * self.cols + self.gap.Width))
 opeerConfig.setPeerProperties(imgContainer,MouseTransparent, True)
@@ -114,10 +116,10 @@
 PropertyNames.PROPERTY_WIDTH),
 (ImageList.TRANSPARENT, 1,
 self.imageSize.Height + (self.selectionGap.Height * 2),
-0, #height
 0, #posx
 0, #posy
 self.step, True, selectionWidth))
+print (DEBUG  ImageList create 2)
 xWindow = self.grbxSelectedImage
 xWindow.addMouseListener(None)
 pNames1 = (PropertyNames.PROPERTY_HEIGHT,
@@ -134,6 +136,7 @@
 * self.rows + self.gap.Height, self.step, 0, False,
 self.cols * (self.imageSize.Width + self.gap.Width) \
 + self.gap.Width - 2))
+print (DEBUG  ImageList create 3)
 if self.showButtons:
 ImageList.btnBack = dialog.insertButton(
 self.name + _btnBack, prevPage, pNames1,
@@ -142,6 +145,7 @@
 (self.imageSize.Height + self.gap.Height) * \
 self.rows + self.gap.Height + imageTextHeight + 1,
 self.step, self.tabIndex + 1, True, 14), self)
+print (DEBUG  ImageList create 3.1)
 ImageList.btnNext = dialog.insertButton(
 self.name + _btnNext, nextPage, pNames1,
 (14, HelpIds.getHelpIdString((self.helpURL + 1)),
@@ -150,6 +154,7 @@
 self.pos.Height + (self.imageSize.Height + self.gap.Height) \
 * self.rows + self.gap.Height + imageTextHeight + 1,
 self.step, self.tabIndex + 2, True, 14), self)
+print (DEBUG  ImageList create 3.2)
 self.lblCounter = dialog.insertLabel(
 self.name + _lblCounter, pNames1,
 (ImageList.LINE_HEIGHT, , self.pos.Width + 14 + 1,
@@ -159,16 +164,15 @@
 self.step, 0, False, self.cols * \
 (self.imageSize.Width + self.gap.Width) + \
 self.gap.Width - 2 * 14 - 1))
-Helper.setUnoPropertyValue(self.lblCounter.Model, Align, 1)
-Helper.setUnoPropertyValue(ImageList.btnBack.Model,
-PropertyNames.PROPERTY_LABEL, )
-Helper.setUnoPropertyValue(ImageList.btnNext.Model,
-PropertyNames.PROPERTY_LABEL, )
+print (DEBUG  ImageList create 3.3)
+self.lblCounter.Model.Align = 1
+ImageList.btnBack.Model.Label = 
+ImageList.btnNext.Model.Label = 
 
 self.m_aImages = [None] * (self.rows * self.cols)
 
-for r in xrange(self.rows):
-for c in xrange(self.cols):
+for r in range(self.rows):
+for c in range(self.cols):
 self.m_aImages[r * self.cols + c] = self.createImage(dialog, 
r, c)
 
 self.refreshImages()
@@ -216,14 +220,12 @@
 oResources = None 
#self.renderer.getImageUrls(self.getObjectFor(index))
 if oResources is not None:

[PATCH] Init: Pythonize the IconsDialog class.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3014

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/14/3014/1

Init: Pythonize the IconsDialog class.

Change-Id: I0a214b28a62d2a86834f1ca2c83220324d9e80ae
---
M wizards/com/sun/star/wizards/web/IconsDialog.py
1 file changed, 15 insertions(+), 14 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/IconsDialog.py 
b/wizards/com/sun/star/wizards/web/IconsDialog.py
index ee83a77..09191e3 100644
--- a/wizards/com/sun/star/wizards/web/IconsDialog.py
+++ b/wizards/com/sun/star/wizards/web/IconsDialog.py
@@ -15,10 +15,12 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from ImageListDialog import *
-from ImageListDialog import *
-from WWHID import HID_IS
-from common.FileAccess import FileAccess
+
+from .ImageListDialog import ImageListDialog
+from .WWHID import HID_IS
+from ..common.FileAccess import FileAccess
+
+from com.sun.star.awt import Size
 
 '''
 @author rpiterman
@@ -61,10 +63,10 @@
 self.build()
 
 def getIconset(self):
-if getSelected() is None:
+if self.getSelected() is None:
 return None
 else:
-return self.set.getKey((getSelected()) / len(self.icons))
+return self.set.getKey((self.getSelected()) / len(self.icons))
 
 def setIconset(self, iconset):
 #COMMENTED
@@ -86,29 +88,28 @@
 icon = getIconNum(i)
 sRetUrls = range(2)
 sRetUrls[0] = self.htmlexpDirectory + /htmlexpo/ \
-+ getIconsetPref(iset) + self.icons[icon] + getIconsetPostfix(iset)
++ self.getIconsetPref(iset) + self.icons[icon] + 
self.getIconsetPostfix(iset)
 sRetUrls[1] = sRetUrls[0]
 return sRetUrls
 
 def render(self, object):
 if object is None:
 return 
-
 i = (object).intValue()
-iset = getIconsetNum(i)
-return getIconset(iset).cp_Name
+iset = self.getIconsetNum(i)
+return self.getIconset1(iset).cp_Name
 
 def getIconsetNum(self, i):
 return i / self.icons.length
 
 def getIconNum(self, i):
-return i % self.icons.length
+return i % len(self.icons)
 
 def getIconsetPref(self, iconset):
-return getIconset(iconset).cp_FNPrefix
+return self.getIconset1(iconset).cp_FNPrefix
 
 def getIconsetPostfix(self, iconset):
-return getIconset(iconset).cp_FNPostfix
+return self.getIconset1(iconset).cp_FNPostfix
 
-def getIconset(self, i):
+def getIconset1(self, i):
 return self.set.getElementAt(i)

-- 
To view, visit https://gerrit.libreoffice.org/3014
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a214b28a62d2a86834f1ca2c83220324d9e80ae
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Don't use the Helper in ImageListDialog.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3015

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/15/3015/1

Init: Don't use the Helper in ImageListDialog.

Change-Id: Ic58b14b73191039840b09e04b37109476e9a0a48
---
M wizards/com/sun/star/wizards/web/ImageListDialog.py
1 file changed, 10 insertions(+), 7 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/ImageListDialog.py 
b/wizards/com/sun/star/wizards/web/ImageListDialog.py
index d9dcf61..b9e176e 100644
--- a/wizards/com/sun/star/wizards/web/ImageListDialog.py
+++ b/wizards/com/sun/star/wizards/web/ImageListDialog.py
@@ -15,10 +15,12 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from ui.UnoDialog2 import *
-from ui.UnoDialog2 import *
-from ui.ImageList import ImageList
-from common.HelpIds import HelpIds
+import uno
+
+from ..ui.UnoDialog2 import UnoDialog2
+from ..ui.ImageList import ImageList
+from ..common.HelpIds import HelpIds
+from ..common.PropertyNames import PropertyNames
 
 from com.sun.star.awt import FontDescriptor
 from com.sun.star.awt.PushButtonType import OK, CANCEL, HELP, STANDARD
@@ -91,6 +93,7 @@
 '''
 
 def build(self):
+print (DEBUG  ImageListDialog build 1)
 #set dialog properties...
 ilWidth = (self.il.imageSize.Width + self.il.gap.Width) \
 * self.il.cols + self.il.gap.Width
@@ -98,8 +101,7 @@
 * self.il.rows + self.il.gap.Height
 dialogWidth = 6 + ilWidth + 6 + 50 + 6
 dialogHeight = 3 + 16 + 3 + (ilHeight + 8 + 14) + 6
-Helper.setUnoPropertyValues(
-self.xDialogModel,
+uno.invoke(self.xDialogModel, setPropertyValues,(
 (Closeable,
 PropertyNames.PROPERTY_HEIGHT,
 PropertyNames.PROPERTY_HELPURL,
@@ -112,7 +114,7 @@
 PropertyNames.PROPERTY_WIDTH),
 (True, dialogHeight, HelpIds.getHelpIdString(self.hid), True,
 imgDialog, 59, 24, 1,
-self.resources[ImageListDialog.RES_TITLE],dialogWidth))
+self.resources[ImageListDialog.RES_TITLE],dialogWidth)))
 #Set member- FontDescriptors...
 self.fontDescriptor1.Weight = 150
 PROPNAMES = (DefaultButton,
@@ -167,6 +169,7 @@
 self.il.helpURL = self.hid + 5
 self.il.tabIndex = 1
 self.il.create(self)
+print (DEBUG  ImageListDialog build 2)
 self.lblTitle = self.insertLabel(lblTitle,
 (FontDescriptor,
 PropertyNames.PROPERTY_HEIGHT,

-- 
To view, visit https://gerrit.libreoffice.org/3015
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic58b14b73191039840b09e04b37109476e9a0a48
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Pythonize the WWD_Events class.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3016

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/16/3016/1

Init: Pythonize the WWD_Events class.

Change-Id: I2000ac9f14b5ef8d2f1cc3bcb9c3d206c0ee5740
---
M wizards/com/sun/star/wizards/web/WWD_Events.py
1 file changed, 258 insertions(+), 218 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/WWD_Events.py 
b/wizards/com/sun/star/wizards/web/WWD_Events.py
index 427b428..6b86594 100644
--- a/wizards/com/sun/star/wizards/web/WWD_Events.py
+++ b/wizards/com/sun/star/wizards/web/WWD_Events.py
@@ -16,10 +16,28 @@
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
 import traceback
-from common.Desktop import Desktop
-from WWD_Startup import *
-from BackgroundsDialog import BackgroundsDialog
-from IconsDialog import IconsDialog
+import uno
+#from common.Desktop import Desktop
+from .WWD_Startup import WWD_Startup
+from .WWD_General import WWD_General
+from .WebWizardConst import *
+from ..common.FileAccess import FileAccess
+from ..common.Configuration import Configuration
+from ..ui.event.ListModelBinder import ListModelBinder
+from ..ui.event.Task import Task
+from .data.CGDocument import CGDocument
+from .data.CGSession import CGSession
+from .ProcessStatusRenderer import ProcessStatusRenderer
+from .FTPDialog import FTPDialog
+from .ErrorHandler import ErrorHandler
+from .AbstractErrorHandler import AbstractErrorHandler
+from .ProcessErrorHandler import ProcessErrorHandler
+from .Process import Process
+from .BackgroundsDialog import BackgroundsDialog
+from .IconsDialog import IconsDialog
+from .TOCPreview import TOCPreview
+
+from com.sun.star.container import NoSuchElementException
 
 '''
 This class implements the ui-events of the
@@ -35,6 +53,7 @@
 
 iconsDialog = None
 bgDialog = None
+docPreview = None
 
 '''
 He - my constructor !
@@ -70,15 +89,15 @@
 def enterStep(self, old, newStep):
 if old == 1:
 sessionToLoad = 
-s = Helper.getUnoPropertyValue(lstLoadWWD_Startup.settings.Model, 
SelectedItems)
-if s.length == 0 or s[0] == 0:
+s = self.lstLoadSettings.Model.SelectedItems
+if len(s) == 0 or s[0] == 0:
 sessionToLoad = 
 else:
 sessionToLoad = \
 
WWD_Startup.settings.cp_SavedSessions.getElementAt(s[0]).cp_Name
 
-if not sessionToLoad.equals(self.currentSession):
-loadSession(sessionToLoad)
+if sessionToLoad is not self.currentSession:
+self.loadSession(sessionToLoad)
 
 '''
 **
@@ -91,71 +110,71 @@
 user selects a saved session.
 '''
 def sessionSelected(self):
-s = Helper.getUnoPropertyValue(getModel(lstLoadSettings), 
SelectedItems)
-setEnabled(btnDelSession, s.length  0 and s[0]  0)
+s = self.getModel(self.lstLoadSettings).SelectedItems
+self.setEnabled(self.btnDelSession, len(s)  0 and s[0]  0)
 
 '''
 Ha ! the session should be loaded :-)
 '''
 
 def loadSession(self, sessionToLoad):
+print (DEBUG !!! loadSession -- sessionToLoad: , sessionToLoad)
 try:
 sd = self.getStatusDialog()
-#task = Task(LoadDocs, , 10)
-sd.execute(this, task, resources.resLoadingSession)
-#task.start()
-self.setSelectedDoc(WWD_Events.EMPTY_SHORT_ARRAY)
-Helper.setUnoPropertyValue(
-lstDocuments.Model, SelectedItems, 
WWD_Events.EMPTY_SHORT_ARRAY)
-Helper.setUnoPropertyValue(
-lstDocuments.Model, StringItemList, 
WWD_Events.EMPTY_STRING_ARRAY)
-if not sessionToLoad:
+task = Task(LoadDocs, , 10)
+sd.execute(self, task, self.resources.resLoadingSession)
+task.start()
+self.setSelectedDoc([])
+self.lstDocuments.Model.SelectedItems = tuple([])
+self.lstDocuments.Model.StringItemList = tuple([])
+if sessionToLoad == :
 view = Configuration.getConfigurationRoot(
-xMSF, CONFIG_PATH + /DefaultSession, False)
+self.xMSF, CONFIG_PATH + /DefaultSession, False)
 else:
 view = Configuration.getConfigurationRoot(
-xMSF, CONFIG_PATH + /SavedSessions, False)
+self.xMSF, CONFIG_PATH + /SavedSessions, False)
 view = Configuration.getNode(sessionToLoad, view)
 
 session = CGSession()
-session.root = settings
+session.root = WWD_Startup.settings
+print (DEBUG !!! loadSession -- reading configuration ...)
 session.readConfiguration(view, CONFIG_READ_PARAM)
-#task.setMax(session.cp_Content.cp_Documents.getSize() * 5 + 7)
-#task.advance(True)
+

[PATCH] Init: Pythonize the WWD_General class.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3017

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/17/3017/1

Init: Pythonize the WWD_General class.

Change-Id: Idc799956ffc688009e771fe9f8eea735cd22652d
---
M wizards/com/sun/star/wizards/web/WWD_General.py
1 file changed, 58 insertions(+), 33 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/WWD_General.py 
b/wizards/com/sun/star/wizards/web/WWD_General.py
index 72a18b9..58a4c4c 100644
--- a/wizards/com/sun/star/wizards/web/WWD_General.py
+++ b/wizards/com/sun/star/wizards/web/WWD_General.py
@@ -15,10 +15,22 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from WebWizardDialog import *
-from WebWizardDialog import *
-from common.SystemDialog import SystemDialog
-from ui.event.ListModelBinder import ListModelBinder
+import traceback
+
+from .WebWizardDialog import WebWizardDialog
+from .StatusDialog import StatusDialog
+from .AbstractErrorHandler import AbstractErrorHandler
+from .ErrorHandler import ErrorHandler
+from .WebWizardConst import *
+from .WWHID import *
+from .FTPDialog import FTPDialog
+from ..common.SystemDialog import SystemDialog
+from ..common.FileAccess import FileAccess
+from ..common.HelpIds import HelpIds
+from ..common.PropertyNames import PropertyNames
+from ..ui.event.ListModelBinder import ListModelBinder
+
+from com.sun.star.lang import IllegalArgumentException
 
 '''
 @author rpiterman
@@ -29,6 +41,11 @@
 class WWD_General(WebWizardDialog):
 
 settings = None
+folderDialog = None
+ftpDialog = None
+zipDialog = None
+docAddDialog = None
+fileAccess = None
 
 def __init__(self, xmsf):
 super(WWD_General, self).__init__(xmsf)
@@ -41,7 +58,7 @@
 [self.resources.prodName, , , , , ],
 HelpIds.getHelpIdString(HID0_STATUS_DIALOG))
 try:
-statusDialog.createWindowPeer(xControl.Peer)
+statusDialog.createWindowPeer(self.xUnoDialog.Peer)
 except Exception:
 traceback.print_exc()
 
@@ -53,7 +70,7 @@
 
 def getDocAddDialog(self):
 self.docAddDialog = SystemDialog.createOpenDialog(self.xMSF)
-for i in xrange(WWD_General.settings.cp_Filters.getSize()):
+for i in range(WWD_General.settings.cp_Filters.getSize()):
 f = WWD_General.settings.cp_Filters.getElementAt(i)
 if f is not None:
 self.docAddDialog.addFilter(
@@ -63,7 +80,7 @@
 
 def getZipDialog(self):
 if self.zipDialog is None:
-self.zipDialog = SystemDialog.createStoreDialog(xMSF)
+self.zipDialog = SystemDialog.createStoreDialog(self.xMSF)
 self.zipDialog.addFilter(self.resources.resZipFiles, *.zip, True)
 
 return self.zipDialog
@@ -71,18 +88,24 @@
 def getFTPDialog(self, pub):
 if self.ftpDialog is None:
 try:
-self.ftpDialog = FTPDialog.FTPDialog_unknown(xMSF, pub)
-self.ftpDialog.createWindowPeer(xControl.getPeer())
+self.ftpDialog = FTPDialog(self.xMSF, pub)
+self.ftpDialog.createWindowPeer(self.xUnoDialog.getPeer())
 except Exception:
 traceback.print_exc()
-
 return self.ftpDialog
 
-def showFolderDialog(self, title, description, dir):
+def showFolderDialog(self, title, description, folder):
 if self.folderDialog is None:
-self.folderDialog = SystemDialog.createFolderDialog(xMSF)
+self.folderDialog = SystemDialog.createFolderDialog(self.xMSF)
+return self.folderDialog.callFolderDialog(title, description, folder)
 
-return self.folderDialog.callFolderDialog(title, description, dir)
+def getFileAccess(self):
+if (self.fileAccess is None):
+try:
+self.fileAccess = FileAccess(self.xMSF)
+except Exception:
+traceback.print_exc()
+return self.fileAccess
 
 '''
 returns the document specified
@@ -91,22 +114,20 @@
 @return
 '''
 
-@classmethod
 def getDoc(self, s):
-if len(s) == 0:
+print (DEBUG !!! getDoc -- , s)
+if (len(s) == 0):
 return None
-elif 
WWD_General.settings.cp_DefaultSession.cp_Content.cp_Documents.getSize() = 
s[0]:
+elif 
(WWD_General.settings.cp_DefaultSession.cp_Content.cp_Documents.getSize() = 
s[0]):
 return None
 else:
-return \
-
WWD_General.settings.cp_DefaultSession.cp_Content.cp_Documents.childrenList[s[0]]
+return 
WWD_General.settings.cp_DefaultSession.cp_Content.cp_Documents.getElementAt(s[0])
 
 '''
 how many documents are in the list?
 @return the number of documents in the docs list.
 '''
 
-@classmethod
 def getDocsCount(self):
 

[PATCH] Init: Pythonize the WWD_Startup class.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3018

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/18/3018/1

Init: Pythonize the WWD_Startup class.

Change-Id: Ic23a6c834f470baa47b10ef6cb6aa4ca34d40af7
---
M wizards/com/sun/star/wizards/web/WWD_Startup.py
1 file changed, 72 insertions(+), 58 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/WWD_Startup.py 
b/wizards/com/sun/star/wizards/web/WWD_Startup.py
index 8b00112..a31806e 100644
--- a/wizards/com/sun/star/wizards/web/WWD_Startup.py
+++ b/wizards/com/sun/star/wizards/web/WWD_Startup.py
@@ -15,19 +15,25 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from WWD_General import *
-from WWD_General import *
-from common.Configuration import Configuration
-from common.FileAccess import FileAccess
-from data.CGSettings import CGSettings
-from data.CGSessionName import CGSessionName
-from ui.event.ListModelBinder import ListModelBinder
-from ui.event.UnoDataAware import UnoDataAware
-from ui.event.RadioDataAware import RadioDataAware
-from data.CGDocument import CGDocument
-from ui.DocumentPreview import DocumentPreview
-from StylePreview import StylePreview
-from ui.event.DataAware import DataAware
+import traceback
+import uno
+
+from .WWD_General import WWD_General
+from .WebWizardConst import *
+from .StylePreview import StylePreview
+from ..common.Configuration import Configuration
+from ..common.FileAccess import FileAccess
+from ..common.Desktop import Desktop
+from ..document.OfficeDocument import OfficeDocument
+from .data.CGSettings import CGSettings
+from .data.CGDocument import CGDocument
+from .data.CGSessionName import CGSessionName
+from ..ui.event.ListModelBinder import ListModelBinder
+from ..ui.event.UnoDataAware import UnoDataAware
+from ..ui.event.RadioDataAware import RadioDataAware
+from ..ui.DocumentPreview import DocumentPreview
+from ..ui.event.DataAware import DataAware
+from ..ui.event.Task import Task
 
 from com.sun.star.lang import IllegalArgumentException
 
@@ -74,7 +80,8 @@
 
 class WWD_Startup(WWD_General):
 
-selectedDoc = ()
+selectedDoc = []
+ftp = False
 
 '''
 He - my constructor !
@@ -128,7 +135,7 @@
 self.ilLayouts.listModel = WWD_General.settings.cp_Layouts
 self.ilLayouts.create(self)
 #COMMENTED
-self.checkContent(WWD_General.settings.cp_DefaultSession.cp_Content, 
None, self.xUnoDialog)
+self.checkContent(WWD_General.settings.cp_DefaultSession.cp_Content, 
Task(, , 9), self.xUnoDialog)
 #saved sessions, styles, combobox save session.
 # also set the chosen saved session...
 self.fillLists()
@@ -140,8 +147,8 @@
 self.fillDocumentList(self.settings.cp_DefaultSession.cp_Content)
 
 if self.proxies:
-self.setEnabled(btnFTP, False)
-self.setEnabled(chkFTP, False)
+self.btnFTP.Model.Enabled = False
+self.chkFTP.Model.Enabled = False
 
 '''
 return true if http proxies or other proxies
@@ -175,7 +182,7 @@
 length = self.resources.resSessionName
 # traverse between the sessions and find the one that
 # has the biggest number.
-for i in xrange(WWD_General.settings.cp_SavedSessions.getSize()):
+for i in range(WWD_General.settings.cp_SavedSessions.getSize()):
 sessionName = \
 WWD_General.settings.cp_SavedSessions.getElementAt(i).cp_Name
 if sessionName.startswith(self.resources.resSessionName):
@@ -229,6 +236,7 @@
 self.addRoadMapItems()
 self.addStylePreview()
 self.checkSteps()
+print (WARNING !!! show() : executeDialogFromComponent)
 self.executeDialogFromComponent(self.myFrame)
 self.removeTerminateListener()
 except Exception:
@@ -243,9 +251,9 @@
 self.dpStylePreview = DocumentPreview(self.xMSF, self.imgPreview)
 self.stylePreview = StylePreview(
 self.xMSF, WWD_General.settings.workPath)
-self.stylePreview.refresh(
-WWD_General.settings.cp_DefaultSession.getStyle(),
-
WWD_General.settings.cp_DefaultSession.cp_Design.cp_BackgroundImage)
+style = WWD_General.settings.cp_DefaultSession.getStyle()
+bg = 
WWD_General.settings.cp_DefaultSession.cp_Design.cp_BackgroundImage
+self.stylePreview.refresh(style, bg)
 self.dpStylePreview.setDocument(
 self.stylePreview.htmlFilename, DocumentPreview.PREVIEW_MODE)
 except Exception:
@@ -268,22 +276,25 @@
 self.xMSF, WWD_General.settingsResources, document)
 # get configuration view
 confRoot = Configuration.getConfigurationRoot(
-self.xMSF, CONFIG_PATH, False)
+

[PATCH] Init: Pythonize the WebWizardDialogResources class.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3020

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/20/3020/1

Init: Pythonize the WebWizardDialogResources class.

Change-Id: I416e4b02c7f8128c0a9f81cb7e7dbf366c7941e5
---
M wizards/com/sun/star/wizards/web/WebWizardDialogResources.py
1 file changed, 5 insertions(+), 5 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/WebWizardDialogResources.py 
b/wizards/com/sun/star/wizards/web/WebWizardDialogResources.py
index ca295de..a8b5e54 100644
--- a/wizards/com/sun/star/wizards/web/WebWizardDialogResources.py
+++ b/wizards/com/sun/star/wizards/web/WebWizardDialogResources.py
@@ -16,10 +16,10 @@
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
 import traceback
-from common.Resource import Resource
-from common.Configuration import Configuration
-from common.Properties import Properties
-from document.OfficeDocument import OfficeDocument
+from ..common.Resource import Resource
+from ..common.Configuration import Configuration
+from ..common.Properties import Properties
+from ..document.OfficeDocument import OfficeDocument
 
 class WebWizardDialogResources(Resource):
 UNIT_NAME = dbwizres
@@ -311,5 +311,5 @@
 self.resGifFiles = Properties.getPropertyValue(
 OfficeDocument.getTypeMediaDescriptor(
 xmsf, gif_Graphics_Interchange), UIName)
-except Exception, ex:
+except Exception as ex:
 traceback.print_exc()

-- 
To view, visit https://gerrit.libreoffice.org/3020
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I416e4b02c7f8128c0a9f81cb7e7dbf366c7941e5
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Pythonize the CGDocument class.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3021

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/21/3021/1

Init: Pythonize the CGDocument class.

Change-Id: I09c40828c5a6dbceaf531a7146014dc36f67a1f5
---
M wizards/com/sun/star/wizards/web/data/CGDocument.py
1 file changed, 68 insertions(+), 36 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/data/CGDocument.py 
b/wizards/com/sun/star/wizards/web/data/CGDocument.py
index a5a4e10..47f9caf 100644
--- a/wizards/com/sun/star/wizards/web/data/CGDocument.py
+++ b/wizards/com/sun/star/wizards/web/data/CGDocument.py
@@ -15,14 +15,16 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
+import uno
+
 from os import sep as separator
-from common.ConfigGroup import ConfigGroup
-from document.OfficeDocument import OfficeDocument
-from common.Properties import Properties
-from common.PropertyNames import PropertyNames
-from common.FileAccess import FileAccess
-from TypeDetection import *
-from common.Desktop import Desktop
+from ...common.ConfigGroup import ConfigGroup
+from ...document.OfficeDocument import OfficeDocument
+from ...common.Properties import Properties
+from ...common.PropertyNames import PropertyNames
+from ...common.FileAccess import FileAccess
+from ..TypeDetection import *
+from ...common.Desktop import Desktop
 
 from com.sun.star.document.MacroExecMode import NEVER_EXECUTE
 from com.sun.star.document.UpdateDocMode import NO_UPDATE
@@ -49,6 +51,7 @@
 PAGE_TYPE_SLIDE = 2
 cp_Title = 
 cp_Description = 
+cp_URL = 
 cp_Author = 
 localFilename = 
 urlFilename = 
@@ -60,6 +63,17 @@
 valid = False
 appType = None
 
+def __init__(self, url = , xmsf = None, Task = None):
+if (xmsf is None):
+return
+cp_URL = self.getSettings().getFileAccess(xmsf).getURL(url);
+if (task is None):
+task = Task(, , 5)
+self.validate(xmsf, task);
+
+def getSettings(self):
+return ConfigGroup.root
+
 '''
 the task will advance 5 times during validate.
 @param xmsf
@@ -68,6 +82,7 @@
 '''
 
 def validate(self, xmsf, task):
+print (WARNING !!! VALIDATING DOCUMENT )
 if not self.root.getFileAccess(xmsf).exists(self.cp_URL, False):
 raise FileNotFoundException (
 The given URL does not point to a file);
@@ -79,35 +94,36 @@
 
 self.mediaDescriptor = OfficeDocument.getFileMediaDecriptor(
 xmsf, self.cp_URL)
-#task.advance(True)
+task.advance(True)
 #1
 self.analyzeFileType(self.mediaDescriptor)
-#task.advance(True)
+task.advance(True)
 #2
 path = self.root.getFileAccess(xmsf).getPath(self.cp_URL, )
-localFilename = FileAccess.getFilename(path, separator)
+self.localFilename = FileAccess.getFilename(path, separator)
 '''
 if the type is a star office convertable document
 We try to open the document to get some properties
 '''
 xProps = None
-#task.advance(True)
+task.advance(True)
 #3
 if self.isSOOpenable:
 # for documents which are openable through SO,
 # use DocumentProperties service.
 desktop = Desktop.getDesktop(xmsf)
-props = range(3)
-props[0] = Properties.createProperty(Hidden, True)
-props[1] = Properties.createProperty(
-MacroExecutionMode, NEVER_EXECUTE)
-props[2] = Properties.createProperty(
-UpdateDocMode, NO_UPDATE)
+props = []
+props.append(Properties.createProperty(Hidden, True))
+props.append(Properties.createProperty(
+MacroExecutionMode, NEVER_EXECUTE))
+props.append(Properties.createProperty(
+UpdateDocMode, NO_UPDATE))
+print (DEBUG !!! validate -- URL: , self.cp_URL)
 component = desktop.loadComponentFromURL(
 self.cp_URL, _default, 0, tuple(props))
 xProps = component.DocumentProperties
 
-#task.advance(True)
+task.advance(True)
 #4
 #now use the object to read some document properties.
 if xProps is not None:
@@ -121,9 +137,9 @@
 #get some information from OS.
 title = self.localFilename
 updateDate = \
-getSettings().getFileAccess(xmsf).getLastModified(self.cp_URL)
+
self.getSettings().getFileAccess(xmsf).getLastModified(self.cp_URL)
 
-#task.advance(True)
+task.advance(True)
 #5
 valid = True
 if self.cp_Title == :
@@ -139,8 +155,13 @@
 cp_Author = self.author
 
 if self.cp_Exporter is None or self.cp_Exporter == :
-

[PATCH] Init: Pythonize the CGExporter class.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3022

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/22/3022/1

Init: Pythonize the CGExporter class.

Change-Id: I985d0cc3cdb75b6f1443f316181ce83d423e2b91
---
M wizards/com/sun/star/wizards/web/data/CGExporter.py
1 file changed, 4 insertions(+), 4 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/data/CGExporter.py 
b/wizards/com/sun/star/wizards/web/data/CGExporter.py
index ef4a944..74288c7 100644
--- a/wizards/com/sun/star/wizards/web/data/CGExporter.py
+++ b/wizards/com/sun/star/wizards/web/data/CGExporter.py
@@ -15,9 +15,9 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from common.ConfigSet import ConfigSet
-from CGArgument import CGArgument
-from common.ConfigGroup import ConfigGroup
+from ...common.ConfigSet import ConfigSet
+from ...common.ConfigGroup import ConfigGroup
+from .CGArgument import CGArgument
 
 class CGExporter(ConfigGroup):
 cp_Index = -1
@@ -37,4 +37,4 @@
 
 def supports(self, mime):
 return CGExporter.cp_SupportedMimeTypes ==  or \
-CGExporter.cp_SupportedMimeTypes.index(mime)  -1
+CGExporter.cp_SupportedMimeTypes.find(mime)  -1

-- 
To view, visit https://gerrit.libreoffice.org/3022
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I985d0cc3cdb75b6f1443f316181ce83d423e2b91
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Pythonize the WebWizardDialog class.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3019

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/19/3019/1

Init: Pythonize the WebWizardDialog class.

Change-Id: Ief62c2feea79ceb0e90c940bd1d442cf996df839
---
M wizards/com/sun/star/wizards/web/WebWizardDialog.py
1 file changed, 13 insertions(+), 12 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/WebWizardDialog.py 
b/wizards/com/sun/star/wizards/web/WebWizardDialog.py
index f6fbc39..bec0f70 100644
--- a/wizards/com/sun/star/wizards/web/WebWizardDialog.py
+++ b/wizards/com/sun/star/wizards/web/WebWizardDialog.py
@@ -15,12 +15,14 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from ui.WizardDialog import *
-from ui.WizardDialog import *
-from WebWizardDialogResources import WebWizardDialogResources
-from WebWizardConst import *
-from WWHID import *
-from ui.ImageList import ImageList
+import unohelper
+
+from ..ui.WizardDialog import WizardDialog, uno, PropertyNames
+from .WebWizardDialogResources import WebWizardDialogResources
+from .WebWizardConst import *
+from .WWHID import *
+from ..ui.ControlScroller import HelpIds
+from ..ui.ImageList import ImageList
 from com.sun.star.awt import Size
 from com.sun.star.awt.FontUnderline import SINGLE
 from com.sun.star.awt.FontFamily import ROMAN
@@ -87,8 +89,8 @@
 #Load Resources
 self.resources = WebWizardDialogResources(xmsf)
 #set dialog properties...
-Helper.setUnoPropertyValues(self.xDialogModel,(
-Closeable,
+uno.invoke(self.xDialogModel, setPropertyValues,(
+(Closeable,
 PropertyNames.PROPERTY_HEIGHT,
 PropertyNames.PROPERTY_HELPURL, Moveable,
 PropertyNames.PROPERTY_NAME,
@@ -99,7 +101,7 @@
 PropertyNames.PROPERTY_WIDTH),
 (True, 210, HelpIds.getHelpIdString(HID0_WEBWIZARD), True,
 WebWizardDialog, 102, 52, 1, 6,
-self.resources.resWebWizardDialog_title, 330))
+self.resources.resWebWizardDialog_title, 330)))
 self.fontDescriptor0 = \
 uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
 self.fontDescriptor1 = \
@@ -446,7 +448,7 @@
 274, 43, 5, 53, 50), self)
 self.insertLabel(lblIconset, WebWizardDialog.PROPNAMES_LBL,
 (8, self.resources.reslblIconset, lblIconset, 97, 64, 5, 51, 70))
-self.insertLabel(txtIconset,
+self.txtIconset = self.insertLabel(txtIconset,
 (Border,
 PropertyNames.PROPERTY_HEIGHT,
 PropertyNames.PROPERTY_LABEL,
@@ -727,5 +729,4 @@
 return oResIds
 
 def render(self, listItem):
-print implementar
-#return listItem == None ?  : (listItem).cp_Name
+return  if (listItem is None) else listItem.cp_Name

-- 
To view, visit https://gerrit.libreoffice.org/3019
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief62c2feea79ceb0e90c940bd1d442cf996df839
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Pythonize the class CGPublish.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3023

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/23/3023/1

Init: Pythonize the class CGPublish.

Change-Id: I3930dd1702bf12f35d0456b56e629d3d865df056
---
M wizards/com/sun/star/wizards/web/data/CGPublish.py
1 file changed, 5 insertions(+), 3 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/data/CGPublish.py 
b/wizards/com/sun/star/wizards/web/data/CGPublish.py
index 2a0619c..6a5c92f 100644
--- a/wizards/com/sun/star/wizards/web/data/CGPublish.py
+++ b/wizards/com/sun/star/wizards/web/data/CGPublish.py
@@ -15,7 +15,7 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from common.ConfigGroup import ConfigGroup
+from ...common.ConfigGroup import ConfigGroup
 
 '''
 A Class which describes the publishing arguments
@@ -30,18 +30,20 @@
 cp_URL = str()
 cp_Username = str()
 password = str()
+overwriteApproved = bool()
+url = str()
 
 def setURL(self, path):
 try:
 self.cp_URL = (self.root).getFileAccess().getURL(path)
 self.overwriteApproved = False
-except Exception, ex:
+except Exception as ex:
 ex.printStackTrace()
 
 def getURL(self):
 try:
 return (self.root).getFileAccess().getPath(self.cp_URL, None)
-except Exception, e:
+except Exception as e:
 e.printStackTrace()
 return 
 

-- 
To view, visit https://gerrit.libreoffice.org/3023
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3930dd1702bf12f35d0456b56e629d3d865df056
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Pythonize the class CGSession.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3024

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/24/3024/1

Init: Pythonize the class CGSession.

Change-Id: Iff1b076654be0b8b95e9802650e2803a274aaf98
---
M wizards/com/sun/star/wizards/web/data/CGSession.py
1 file changed, 17 insertions(+), 13 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/data/CGSession.py 
b/wizards/com/sun/star/wizards/web/data/CGSession.py
index dfa94db..211cea9 100644
--- a/wizards/com/sun/star/wizards/web/data/CGSession.py
+++ b/wizards/com/sun/star/wizards/web/data/CGSession.py
@@ -15,12 +15,17 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from common.ConfigGroup import ConfigGroup
-from common.ConfigSet import ConfigSet
-from CGContent import CGContent
-from CGDesign import CGDesign
-from CGGeneralInfo import CGGeneralInfo
-from CGPublish import CGPublish
+import uno
+
+from ...common.ConfigGroup import ConfigGroup
+from ...common.ConfigSet import ConfigSet
+from ...common.XMLHelper import XMLHelper
+from .CGContent import CGContent
+from .CGDesign import CGDesign
+from .CGGeneralInfo import CGGeneralInfo
+from .CGPublish import CGPublish
+
+from xml.dom.minidom import Document
 
 class CGSession(ConfigGroup):
 
@@ -37,7 +42,7 @@
 def createDOM(self, parent):
 root = XMLHelper.addElement(
 parent, session, [name, screen-size],
-[self.cp_Name, getScreenSize()])
+[self.cp_Name, self.getScreenSize()])
 self.cp_GeneralInfo.createDOM(root)
 self.cp_Content.createDOM(root)
 return root
@@ -54,13 +59,12 @@
 return 800
 
 def getLayout(self):
-return self. root.cp_Layouts.getElement(self.cp_Design.cp_Layout)
+return self.root.cp_Layouts.getElement(self.cp_Design.cp_Layout)
 
 def getStyle(self):
-return self.root.cp_Styles.getElement(self.cp_Design.cp_Style)
+return self.root.cp_Styles.getElementAt(self.cp_Design.cp_Style)
 
-def createDOM(self):
-factory = DocumentBuilderFactory.newInstance()
-doc = factory.newDocumentBuilder().newDocument()
-createDOM(doc)
+def createDOM1(self):
+doc = Document()
+self.createDOM(doc)
 return doc

-- 
To view, visit https://gerrit.libreoffice.org/3024
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff1b076654be0b8b95e9802650e2803a274aaf98
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Init: Pythonize the CGSettings class; added a new internal c...

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3025

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/25/3025/1

Init: Pythonize the CGSettings class; added a new internal class DateUtils.

Change-Id: I604544ae224c3a822514e479db223a6e0268fb12
---
M wizards/com/sun/star/wizards/web/data/CGSettings.py
1 file changed, 56 insertions(+), 24 deletions(-)



diff --git a/wizards/com/sun/star/wizards/web/data/CGSettings.py 
b/wizards/com/sun/star/wizards/web/data/CGSettings.py
index ff5bf55..ecada3f 100644
--- a/wizards/com/sun/star/wizards/web/data/CGSettings.py
+++ b/wizards/com/sun/star/wizards/web/data/CGSettings.py
@@ -16,19 +16,22 @@
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
 import traceback
-from common.FileAccess import FileAccess
-from common.ConfigGroup import ConfigGroup
-from common.ConfigSet import ConfigSet
-from CGExporter import CGExporter
-from CGLayout import CGLayout
-from CGStyle import CGStyle
-from CGIconSet import CGIconSet
-from CGImage import CGImage
-from CGFilter import CGFilter
-from common.Helper import Helper
-from CGSessionName import CGSessionName
-from CGSession import CGSession
-from common.Properties import Properties
+import uno
+from datetime import date as dateTimeObject
+
+from ...common.FileAccess import FileAccess
+from ...common.ConfigGroup import ConfigGroup
+from ...common.ConfigSet import ConfigSet
+from ...common.NumberFormatter import NumberFormatter
+from ...common.Properties import Properties
+from .CGExporter import CGExporter
+from .CGLayout import CGLayout
+from .CGStyle import CGStyle
+from .CGIconSet import CGIconSet
+from .CGImage import CGImage
+from .CGFilter import CGFilter
+from .CGSessionName import CGSessionName
+from .CGSession import CGSession
 
 from com.sun.star.i18n.NumberFormatIndex import DATE_SYS_DMMM
 from com.sun.star.i18n.NumberFormatIndex import NUMBER_1000DEC2
@@ -57,10 +60,8 @@
 def __init__(self, xmsf_, resources_, document):
 self.xmsf = xmsf_
 try:
-self.soTemplateDir = FileAccess.getOfficePath2(
-self.xmsf, Config, , )
-self.soGalleryDir = FileAccess.getOfficePath2(
-self.xmsf, Gallery, share, )
+self.soTemplateDir = FileAccess.getOfficePath2(self.xmsf, 
Config, , );
+self.soGalleryDir = FileAccess.getOfficePath2(self.xmsf, 
Gallery, share, );
 ConfigGroup.root = self
 self.formatter = self.Formatter(self.xmsf, document)
 self.resources = resources_
@@ -85,9 +86,10 @@
 if i.supports(mime):
 try:
 v.append(i)
-except Exception, ex:
+except Exception:
 traceback.print_exc()
-
+else:
+print (DEBUG !!! Exporter is None)
 return v
 
 '''
@@ -100,19 +102,25 @@
 self.workPath = FileAccess.connectURLs(
 self.soTemplateDir, self.cp_WorkDir)
 #COMMENTED
-#self.calcExportersTargetTypeNames(xmsf)
+self.calcExportersTargetTypeNames(xmsf)
 
 def calcExportersTargetTypeNames(self, xmsf):
 typeDetect = xmsf.createInstance(
 com.sun.star.document.TypeDetection)
-for i in xrange(self.cp_Exporters.getSize()):
+for i in range(self.cp_Exporters.getSize()):
 self.calcExporterTargetTypeName(
 typeDetect, self.cp_Exporters.getElementAt(i))
 
 def calcExporterTargetTypeName(self, typeDetect, exporter):
-if not exporter.cp_TargetType == :
-exporter.targetTypeName = Properties.getPropertyValue(
+if (exporter is None):
+print (WARNING  calcExporterTargetTypeName - received None as 
exporter argument.)
+return
+print (WARNING  calcExporterTargetTypeName - targetType: , 
exporter.cp_TargetType)
+if not (exporter.cp_TargetType ==  or exporter.cp_TargetType is 
None):
+targetTypeName = Properties.getPropertyValue(
 typeDetect.getByName(exporter.cp_TargetType), UIName)
+print (WARNING  calcExporterTargetTypeName - targetTypeName: 
, targetTypeName)
+exporter.cp_targetTypeName = targetTypeName
 
 @classmethod
 def getFileAccess(self, xmsf = None):
@@ -124,8 +132,32 @@
 return CGSettings.fileAccess
 
 class Formatter(object):
+class DateUtils(object):
+
+def __init__(self, xmsf, document):
+self.formatSupplier = document
+formatSettings = self.formatSupplier.getNumberFormatSettings()
+date = formatSettings.NullDate
+self.calendar = dateTimeObject(date.Year, date.Month, date.Day)
+self.formatter = NumberFormatter.createNumberFormatter(xmsf, 
self.formatSupplier)
+
+'''
+@param format a 

[PATCH] Init: Pythonize the class ListModelBinder and avoid using th...

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3026

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/26/3026/1

Init: Pythonize the class ListModelBinder and avoid using the Helper class.

Change-Id: Ic080237bc075d979cbc6c70e43c6781a7ce36106
---
M wizards/com/sun/star/wizards/ui/event/ListModelBinder.py
1 file changed, 13 insertions(+), 14 deletions(-)



diff --git a/wizards/com/sun/star/wizards/ui/event/ListModelBinder.py 
b/wizards/com/sun/star/wizards/ui/event/ListModelBinder.py
index cd255ff..5cbe5ae 100644
--- a/wizards/com/sun/star/wizards/ui/event/ListModelBinder.py
+++ b/wizards/com/sun/star/wizards/ui/event/ListModelBinder.py
@@ -15,7 +15,6 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
-from ...common.Helper import Helper
 
 class ListModelBinder(object):
 
@@ -33,45 +32,45 @@
 self.listModel.addListDataListener(this)
 
 def contentsChanged(self, lde):
-selected = getSelectedItems()
+selected = self.getSelectedItems()
 i = lde.getIndex0()
 while i = lde.getIndex1():
-update(i)
+self.update(i)
 i += 1
-setSelectedItems(selected)
+self.setSelectedItems(selected)
 
 def update(self, i):
-remove(i, i)
-insert(i)
+self.remove(i, i)
+self.insert(i)
 
 def remove(self, i1, i2):
 self.unoList.removeItems(i1, i2 - i1 + 1)
 
 def insert(self, i):
-self.unoList.addItem(getItemString(i), i)
+self.unoList.addItem(self.getItemString(i), i)
 
 def getItemString(self, i):
-return getItemString(self.listModel.getElementAt(i))
+return self.getItemString(self.listModel.getElementAt(i))
 
 def getItemString(self, item):
 return self.renderer.render(item)
 
 def getSelectedItems(self):
-return Helper.getUnoPropertyValue(self.unoListModel, SelectedItems)
+return self.unoListModel.SelectedItems
 
 def setSelectedItems(self, selected):
-Helper.setUnoPropertyValue(self.unoListModel, SelectedItems, 
selected)
+self.unoListModel.SelectedItems = selected;
 
 def intervalAdded(self, lde):
 for i in xrange(lde.Index0, lde.Index1):
-insert(i)
+self.insert(i)
 
 def intervalRemoved(self, lde):
-remove(lde.Index0, lde.Index1)
+self.remove(lde.Index0, lde.Index1)
 
 @classmethod
 def fillList(self, xlist, items, renderer):
-Helper.setUnoPropertyValue(xlist.Model, StringItemList, ())
+xlist.Model.StringItemList = ()
 for index,item in enumerate(items):
 if item is not None:
 if renderer is not None:
@@ -82,7 +81,7 @@
 
 @classmethod
 def fillComboBox(self, xComboBox, items, renderer):
-Helper.setUnoPropertyValue(xComboBox.Model, StringItemList, ())
+xComboBox.Model.StringItemList = ()
 for index,item in enumerate(items):
 if item is not None:
 if renderer is not None:

-- 
To view, visit https://gerrit.libreoffice.org/3026
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic080237bc075d979cbc6c70e43c6781a7ce36106
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Javier Fernandez javier@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Pack and register the Web wizard.

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3027

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/27/3027/1

Pack and register the Web wizard.

Change-Id: I8e43d228e842f24b054afc6bf59040667a6703d5
---
M postprocess/Rdb_services.mk
M scp2/source/ooo/directory_ooo.scp
M scp2/source/ooo/file_ooo.scp
M wizards/Module_wizards.mk
M wizards/Pyuno_commonwizards.mk
A wizards/Pyuno_web.mk
M wizards/com/sun/star/wizards/web/web.component
7 files changed, 103 insertions(+), 4 deletions(-)



diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index 4b0b8b7..1216d09 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -169,6 +169,7 @@
wizards/com/sun/star/wizards/fax/fax \
wizards/com/sun/star/wizards/letter/letter \
wizards/com/sun/star/wizards/agenda/agenda \
+   wizards/com/sun/star/wizards/web/web \
scripting/source/stringresource/stringresource \
scripting/source/vbaevents/vbaevents \
scripting/util/scriptframe \
diff --git a/scp2/source/ooo/directory_ooo.scp 
b/scp2/source/ooo/directory_ooo.scp
index 65acecc..6a16cb8 100644
--- a/scp2/source/ooo/directory_ooo.scp
+++ b/scp2/source/ooo/directory_ooo.scp
@@ -121,6 +121,12 @@
 DosName = agenda;
 End
 
+Directory gid_Dir_Wizards_Web
+Styles = (CREATE);
+ParentID = gid_Dir_Wizards;
+DosName = web;
+End
+
 Directory gid_Dir_Resource
 ParentID = gid_Brand_Dir_Program;
 DosName = resource;
diff --git a/scp2/source/ooo/file_ooo.scp b/scp2/source/ooo/file_ooo.scp
index dab412c..828671a 100644
--- a/scp2/source/ooo/file_ooo.scp
+++ b/scp2/source/ooo/file_ooo.scp
@@ -506,6 +506,12 @@
 Name = agenda.zip;
 End
 
+File gid_File_Wizards_Web
+Dir = gid_Dir_Wizards_Web;
+ARCHIVE_TXT_FILE_BODY;
+Name = web.zip;
+End
+
 File gid_File_Pymailmerge
 Dir = gid_Brand_Dir_Program;
 ARCHIVE_TXT_FILE_BODY;
diff --git a/wizards/Module_wizards.mk b/wizards/Module_wizards.mk
index 14d6c05..8aaf41c 100644
--- a/wizards/Module_wizards.mk
+++ b/wizards/Module_wizards.mk
@@ -37,6 +37,7 @@
Pyuno_fax \
Pyuno_letter \
Pyuno_agenda \
+   Pyuno_web \
Pyuno_commonwizards \
Zip_depot \
Zip_euro \
diff --git a/wizards/Pyuno_commonwizards.mk b/wizards/Pyuno_commonwizards.mk
index f213bb1..2fc4d4e 100644
--- a/wizards/Pyuno_commonwizards.mk
+++ b/wizards/Pyuno_commonwizards.mk
@@ -42,6 +42,10 @@
 common/Desktop.py \
 common/HelpIds.py \
 common/NumberFormatter.py \
+common/IRenderer.py \
+common/UCB.py \
+common/XMLHelper.py \
+common/XMLProvider.py \
 text/TextElement.py \
 document/__init__.py \
 document/OfficeDocument.py \
@@ -66,6 +70,9 @@
 ui/event/ListModelBinder.py \
 ui/event/RadioDataAware.py \
 ui/event/UnoDataAware.py \
+ui/event/Task.py \
+ui/event/TaskEvent.py \
+ui/event/TaskListener.py \
 ))
 
 # vim:set noet sw=4 ts=4:
diff --git a/wizards/Pyuno_web.mk b/wizards/Pyuno_web.mk
new file mode 100644
index 000..5a6ae77
--- /dev/null
+++ b/wizards/Pyuno_web.mk
@@ -0,0 +1,79 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the License); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an AS IS basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# Major Contributor(s):
+# Copyright (C) 2011 Red Hat, Inc., David Tardon dtar...@redhat.com
+#  (initial developer)
+#
+# All Rights Reserved.
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the GPLv3+), or
+# the GNU Lesser General Public License Version 3 or later (the LGPLv3+),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+
+$(eval $(call gb_Pyuno_Pyuno,web,$(SRCDIR)/wizards/com/sun/star/wizards/web))
+
+$(eval $(call gb_Pyuno_add_files,web,\
+   CallWizard.py \
+   BackgroundsDialog.py \
+   ErrorHandler.py \
+   AbstractErrorHandler.py \
+   FTPDialog.py \
+   FTPDialogResources.py \
+   IconsDialog.py \
+   ImageListDialog.py \
+   LogTaskListener.py \
+   Process.py \
+   ProcessErrorHandler.py \
+   ProcessErrors.py \
+   ProcessStatusRenderer.py \
+   StatusDialog.py \
+   StylePreview.py \
+   TOCPreview.py \
+   WWD_Events.py \
+   

[PATCH] Ugly Hack: using our own WebConfigSet while the Topic stuff ...

2013-03-25 Thread Javier Fernandez (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3028

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/28/3028/1

Ugly Hack: using our own WebConfigSet while the Topic stuff is not integrated.

Change-Id: I0df92af6b01e5eab99212bb1587f7165c70fd59b
---
M wizards/Pyuno_web.mk
A wizards/com/sun/star/wizards/web/WebConfigSet.py
M wizards/com/sun/star/wizards/web/data/CGContent.py
M wizards/com/sun/star/wizards/web/data/CGExporter.py
M wizards/com/sun/star/wizards/web/data/CGSession.py
M wizards/com/sun/star/wizards/web/data/CGSettings.py
6 files changed, 227 insertions(+), 17 deletions(-)



diff --git a/wizards/Pyuno_web.mk b/wizards/Pyuno_web.mk
index 5a6ae77..93b312f 100644
--- a/wizards/Pyuno_web.mk
+++ b/wizards/Pyuno_web.mk
@@ -54,6 +54,7 @@
WebWizardDialogResources.py \
TypeDetection.py \
ExtensionVerifier.py\
+   WebConfigSet.py\
__init__.py \
data/CGArgument.py \
data/CGContent.py \
diff --git a/wizards/com/sun/star/wizards/web/WebConfigSet.py 
b/wizards/com/sun/star/wizards/web/WebConfigSet.py
new file mode 100644
index 000..88b49f2
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/WebConfigSet.py
@@ -0,0 +1,209 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the License); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+import traceback
+from ..common.ConfigGroup import ConfigGroup
+from ..common.Configuration import Configuration
+from ..common.XMLProvider import XMLProvider
+
+class WebConfigSet(ConfigGroup):
+'''
+After reading the configuration set items,
+the ConfigSet checks this field.
+If it is true, it will remove any nulls from
+the vector.
+subclasses can change this field in the constructor
+to avoid this deletion of nulls.
+'''
+
+def __init__(self, childType):
+print (DEBUG !!! childType: , childType)
+self.childClass = childType
+self.childrenMap = {}
+self.childrenList = []
+self.noNulls = False
+
+def add(self, name, o):
+print (DEBUG !!! WebConfigSet.add -- name: , name)
+if (o is None):
+print (DEBUG !!! WebConfigSet.add -- Received None object as 
argument.)
+oldO = None
+if (name in self.childrenMap):
+oldO = self.childrenMap[name]
+self.childrenMap[name] = o
+try:
+i = int(name)
+print (DEBUG !!! WebConfigSet.add -- name IS an integer.)
+self.childrenList.insert(i, o)
+except Exception:
+print (DEBUG !!! WebConfigSet.add -- name IS NOT an integer.)
+try:
+i = o.cp_Index
+print (DEBUG !!! WebConfigSet.add -- index: , i)
+oldSize = self.getSize()
+print (DEBUG !!! WebConfigSet.add -- oldSize: , oldSize)
+if oldSize  i:
+newSize = i - oldSize
+self.childrenList += [None] * newSize
+self.noNulls |= True
+else:
+self.noNulls |= False
+print (DEBUG !!! WebConfigSet.add -- inserting object o: , o)
+self.childrenList.insert(i, o)
+if oldSize  i:
+oldSize = i
+except Exception:
+if (oldO is not None):
+print (DEBUG !!! WebConfigSet.add -- No cp_Index 
attribute, but element already present, so replace it.)
+i = self.childrenList.index(oldO)
+self.childrenList[i] = o
+else:
+print (DEBUG !!! WebConfigSet.add -- No cp_Index 
attribute, so just append it.)
+self.childrenList.append(o)
+
+
+def writeConfiguration(self, configView, param):
+print (DEBUG !!! writeConfiguration --)
+names = self.childrenMap.keys()
+#first I remove all the children from the configuration.
+children = configView.ElementNames
+print (DEBUG !!! writeConfiguration -- children length: , 
len(children))
+if children:
+print (DEBUG !!! writeConfiguration -- removing childrens.)
+for i in children:
+try:
+