summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2004-05-19 12:13:10 +0000
committerKurt Zenker <kz@openoffice.org>2004-05-19 12:13:10 +0000
commit32a377414620efa3a86677f1c8fd480c70fdce02 (patch)
tree7573a742246ee6d95d4c67de600fbb7cb13d1089 /wizards/com/sun/star
parent5ee716fd275c63d9c45dac21d3703b7b9917055a (diff)
INTEGRATION: CWS qwizards1 (1.1.2); FILE ADDED
2004/05/05 19:16:07 rpiterman 1.1.2.4: Changed HIDs Added own Frame as house-pet Issue number: Submitted by: Reviewed by: 2004/03/12 16:16:56 rpiterman 1.1.2.3: documentation and small implementation-fixes 2004/02/20 18:11:12 rpiterman 1.1.2.2: changes were made to use the Field Support of the DataAware model (beta) 2004/02/10 18:47:54 rpiterman 1.1.2.1: An error handler for the Process class, which renders errors (exceptions) to localized messages.
Diffstat (limited to 'wizards/com/sun/star')
-rw-r--r--wizards/com/sun/star/wizards/web/ProcessErrorHandler.java130
1 files changed, 130 insertions, 0 deletions
diff --git a/wizards/com/sun/star/wizards/web/ProcessErrorHandler.java b/wizards/com/sun/star/wizards/web/ProcessErrorHandler.java
new file mode 100644
index 000000000000..395eb2634301
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/ProcessErrorHandler.java
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * $RCSfile: ProcessErrorHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: kz $ $Date: 2004-05-19 13:13:10 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (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.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ */
+
+package com.sun.star.wizards.web;
+
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.wizards.common.JavaTools;
+import com.sun.star.wizards.web.data.CGDocument;
+import com.sun.star.wizards.web.data.CGPublish;
+
+/**
+ * @author rpiterman
+ * 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.
+ */
+public class ProcessErrorHandler extends AbstractErrorHandler
+ implements WebWizardConst,
+ ProcessErrors
+{
+
+ private static final String FILENAME= "%FILENAME";
+ private static final String URL = "%URL";
+ private static final String ERROR = "%ERROR";
+
+
+ WebWizardDialogResources resources;
+
+ public ProcessErrorHandler(XMultiServiceFactory xmsf, XWindowPeer peer, WebWizardDialogResources res) {
+ super(xmsf, peer);
+ resources = res;
+ }
+
+ protected String getMessageFor(Exception ex, Object obj, int ix, int errType) {
+
+ switch (ix) {
+
+ case ERROR_MKDIR :
+ return JavaTools.replaceSubString(resources.resErrDocExport, ((CGDocument) obj).localFilename, FILENAME);
+
+ case ERROR_EXPORT :
+ return "";
+ case ERROR_EXPORT_MKDIR :
+ return JavaTools.replaceSubString(resources.resErrMkDir, ((CGDocument) obj).localFilename, FILENAME);
+ case ERROR_DOC_VALIDATE :
+ return JavaTools.replaceSubString(resources.resErrDocInfo, ((CGDocument) obj).localFilename, FILENAME);
+ case ERROR_EXPORT_IO :
+ return JavaTools.replaceSubString(resources.resErrExportIO, ((CGDocument) obj).localFilename, FILENAME);
+ case ERROR_EXPORT_SECURITY :
+ return JavaTools.replaceSubString(resources.resErrSecurity, ((CGDocument) obj).localFilename, FILENAME);
+
+ case ERROR_GENERATE_XSLT :
+ return resources.resErrTOC;
+ case ERROR_GENERATE_COPY :
+ return resources.resErrTOCMedia;
+
+ case ERROR_PUBLISH :
+ return JavaTools.replaceSubString(resources.resErrPublish, ((CGPublish) obj).cp_URL, URL);
+ case ERROR_PUBLISH_MEDIA :
+ return resources.resErrPublishMedia;
+
+ case ERROR_CLEANUP :
+ return resources.resErrUnexpected;
+
+ default :
+ return JavaTools.replaceSubString(resources.resErrUnknown, ex.getClass().getName() + "/" + obj.getClass().getName() + "/" + ix, ERROR);
+ }
+ }
+}