1 /*************************************************************************
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * Copyright 2008 by Sun Microsystems, Inc.
6 * OpenOffice.org - a multi-platform office productivity suite
8 * $RCSfile: migrationerror.hxx,v $
10 * $Revision: 1.1.2.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
28 ************************************************************************/
30 #ifndef DBACCESS_MIGRATIONERROR_HXX
31 #define DBACCESS_MIGRATIONERROR_HXX
33 /** === begin UNO includes === **/
34 #include <com/sun/star/uno/Any.hxx>
35 /** === end UNO includes === **/
39 //........................................................................
42 //........................................................................
44 enum MigrationErrorType
46 ERR_OPENING_SUB_DOCUMENT_FAILED
= 1,
47 ERR_CLOSING_SUB_DOCUMENT_FAILED
,
48 ERR_STORAGE_COMMIT_FAILED
,
49 ERR_STORING_DATABASEDOC_FAILED
,
50 ERR_COLLECTING_DOCUMENTS_FAILED
,
51 ERR_UNEXPECTED_LIBSTORAGE_ELEMENT
,
52 ERR_CREATING_DBDOC_SCRIPT_STORAGE_FAILED
,
53 ERR_COMMITTING_SCRIPT_STORAGES_FAILED
,
54 ERR_GENERAL_SCRIPT_MIGRATION_FAILURE
,
55 ERR_GENERAL_MACRO_MIGRATION_FAILURE
,
56 ERR_UNKNOWN_SCRIPT_TYPE
,
57 ERR_UNKNOWN_SCRIPT_LANGUAGE
,
58 ERR_UNKNOWN_SCRIPT_NAME_FORMAT
,
59 ERR_SCRIPT_TRANSLATION_FAILURE
,
60 ERR_INVALID_SCRIPT_DESCRIPTOR_FORMAT
,
61 ERR_ADJUSTING_DOCUMENT_EVENTS_FAILED
,
62 ERR_ADJUSTING_DIALOG_EVENTS_FAILED
,
63 ERR_ADJUSTING_FORMCOMP_EVENTS_FAILED
,
64 ERR_BIND_SCRIPT_STORAGE_FAILED
,
65 ERR_REMOVE_SCRIPTS_STORAGE_FAILED
,
66 ERR_DOCUMENT_BACKUP_FAILED
,
67 ERR_UNKNOWN_SCRIPT_FOLDER
,
68 ERR_EXAMINING_SCRIPTS_FOLDER_FAILED
,
69 ERR_PASSWORD_VERIFICATION_FAILED
,
73 //====================================================================
75 //====================================================================
76 /** encapsulates information about an error which happened during the migration
80 const MigrationErrorType eType
;
81 ::std::vector
< ::rtl::OUString
> aErrorDetails
;
82 const ::com::sun::star::uno::Any aCaughtException
;
85 const MigrationErrorType _eType
)
91 const MigrationErrorType _eType
,
92 const ::com::sun::star::uno::Any
& _rCaughtException
)
94 ,aCaughtException( _rCaughtException
)
99 const MigrationErrorType _eType
,
100 const ::rtl::OUString
& _rDetail
)
103 impl_constructDetails( _rDetail
);
107 const MigrationErrorType _eType
,
108 const ::rtl::OUString
& _rDetail
,
109 const ::com::sun::star::uno::Any
& _rCaughtException
)
111 ,aCaughtException( _rCaughtException
)
113 impl_constructDetails( _rDetail
);
117 const MigrationErrorType _eType
,
118 const ::rtl::OUString
& _rDetail1
,
119 const ::rtl::OUString
& _rDetail2
)
122 impl_constructDetails( _rDetail1
, _rDetail2
);
126 const MigrationErrorType _eType
,
127 const ::rtl::OUString
& _rDetail1
,
128 const ::rtl::OUString
& _rDetail2
,
129 const ::com::sun::star::uno::Any
& _rCaughtException
)
131 ,aCaughtException( _rCaughtException
)
133 impl_constructDetails( _rDetail1
, _rDetail2
);
137 const MigrationErrorType _eType
,
138 const ::rtl::OUString
& _rDetail1
,
139 const ::rtl::OUString
& _rDetail2
,
140 const ::rtl::OUString
& _rDetail3
,
141 const ::com::sun::star::uno::Any
& _rCaughtException
)
143 ,aCaughtException( _rCaughtException
)
145 impl_constructDetails( _rDetail1
, _rDetail2
, _rDetail3
);
149 const MigrationErrorType _eType
,
150 const ::rtl::OUString
& _rDetail1
,
151 const ::rtl::OUString
& _rDetail2
,
152 const ::rtl::OUString
& _rDetail3
)
155 impl_constructDetails( _rDetail1
, _rDetail2
, _rDetail3
);
159 void impl_constructDetails(
160 const ::rtl::OUString
& _rDetail1
,
161 const ::rtl::OUString
& _rDetail2
= ::rtl::OUString(),
162 const ::rtl::OUString
& _rDetail3
= ::rtl::OUString()
165 if ( _rDetail1
.getLength() ) aErrorDetails
.push_back( _rDetail1
);
166 if ( _rDetail2
.getLength() ) aErrorDetails
.push_back( _rDetail2
);
167 if ( _rDetail3
.getLength() ) aErrorDetails
.push_back( _rDetail3
);
171 //........................................................................
173 //........................................................................
175 #endif // DBACCESS_MIGRATIONERROR_HXX