1*2e2212a7SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*2e2212a7SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*2e2212a7SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*2e2212a7SAndrew Rist * distributed with this work for additional information 6*2e2212a7SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*2e2212a7SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*2e2212a7SAndrew Rist * "License"); you may not use this file except in compliance 9*2e2212a7SAndrew Rist * with the License. You may obtain a copy of the License at 10*2e2212a7SAndrew Rist * 11*2e2212a7SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*2e2212a7SAndrew Rist * 13*2e2212a7SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*2e2212a7SAndrew Rist * software distributed under the License is distributed on an 15*2e2212a7SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*2e2212a7SAndrew Rist * KIND, either express or implied. See the License for the 17*2e2212a7SAndrew Rist * specific language governing permissions and limitations 18*2e2212a7SAndrew Rist * under the License. 19*2e2212a7SAndrew Rist * 20*2e2212a7SAndrew Rist *************************************************************/ 21*2e2212a7SAndrew Rist 22*2e2212a7SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef DBACCESS_MIGRATIONERROR_HXX 25cdf0e10cSrcweir #define DBACCESS_MIGRATIONERROR_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir /** === begin UNO includes === **/ 28cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx> 29cdf0e10cSrcweir /** === end UNO includes === **/ 30cdf0e10cSrcweir 31cdf0e10cSrcweir #include <vector> 32cdf0e10cSrcweir 33cdf0e10cSrcweir //........................................................................ 34cdf0e10cSrcweir namespace dbmm 35cdf0e10cSrcweir { 36cdf0e10cSrcweir //........................................................................ 37cdf0e10cSrcweir 38cdf0e10cSrcweir enum MigrationErrorType 39cdf0e10cSrcweir { 40cdf0e10cSrcweir ERR_OPENING_SUB_DOCUMENT_FAILED = 1, 41cdf0e10cSrcweir ERR_CLOSING_SUB_DOCUMENT_FAILED, 42cdf0e10cSrcweir ERR_STORAGE_COMMIT_FAILED, 43cdf0e10cSrcweir ERR_STORING_DATABASEDOC_FAILED, 44cdf0e10cSrcweir ERR_COLLECTING_DOCUMENTS_FAILED, 45cdf0e10cSrcweir ERR_UNEXPECTED_LIBSTORAGE_ELEMENT, 46cdf0e10cSrcweir ERR_CREATING_DBDOC_SCRIPT_STORAGE_FAILED, 47cdf0e10cSrcweir ERR_COMMITTING_SCRIPT_STORAGES_FAILED, 48cdf0e10cSrcweir ERR_GENERAL_SCRIPT_MIGRATION_FAILURE, 49cdf0e10cSrcweir ERR_GENERAL_MACRO_MIGRATION_FAILURE, 50cdf0e10cSrcweir ERR_UNKNOWN_SCRIPT_TYPE, 51cdf0e10cSrcweir ERR_UNKNOWN_SCRIPT_LANGUAGE, 52cdf0e10cSrcweir ERR_UNKNOWN_SCRIPT_NAME_FORMAT, 53cdf0e10cSrcweir ERR_SCRIPT_TRANSLATION_FAILURE, 54cdf0e10cSrcweir ERR_INVALID_SCRIPT_DESCRIPTOR_FORMAT, 55cdf0e10cSrcweir ERR_ADJUSTING_DOCUMENT_EVENTS_FAILED, 56cdf0e10cSrcweir ERR_ADJUSTING_DIALOG_EVENTS_FAILED, 57cdf0e10cSrcweir ERR_ADJUSTING_FORMCOMP_EVENTS_FAILED, 58cdf0e10cSrcweir ERR_BIND_SCRIPT_STORAGE_FAILED, 59cdf0e10cSrcweir ERR_REMOVE_SCRIPTS_STORAGE_FAILED, 60cdf0e10cSrcweir ERR_DOCUMENT_BACKUP_FAILED, 61cdf0e10cSrcweir ERR_UNKNOWN_SCRIPT_FOLDER, 62cdf0e10cSrcweir ERR_EXAMINING_SCRIPTS_FOLDER_FAILED, 63cdf0e10cSrcweir ERR_PASSWORD_VERIFICATION_FAILED, 64cdf0e10cSrcweir ERR_NEW_STYLE_REPORT 65cdf0e10cSrcweir }; 66cdf0e10cSrcweir 67cdf0e10cSrcweir //==================================================================== 68cdf0e10cSrcweir //= MigrationError 69cdf0e10cSrcweir //==================================================================== 70cdf0e10cSrcweir /** encapsulates information about an error which happened during the migration 71cdf0e10cSrcweir */ 72cdf0e10cSrcweir struct MigrationError 73cdf0e10cSrcweir { 74cdf0e10cSrcweir const MigrationErrorType eType; 75cdf0e10cSrcweir ::std::vector< ::rtl::OUString > aErrorDetails; 76cdf0e10cSrcweir const ::com::sun::star::uno::Any aCaughtException; 77cdf0e10cSrcweir MigrationErrordbmm::MigrationError78cdf0e10cSrcweir MigrationError( 79cdf0e10cSrcweir const MigrationErrorType _eType ) 80cdf0e10cSrcweir :eType( _eType ) 81cdf0e10cSrcweir { 82cdf0e10cSrcweir } 83cdf0e10cSrcweir MigrationErrordbmm::MigrationError84cdf0e10cSrcweir MigrationError( 85cdf0e10cSrcweir const MigrationErrorType _eType, 86cdf0e10cSrcweir const ::com::sun::star::uno::Any& _rCaughtException ) 87cdf0e10cSrcweir :eType( _eType ) 88cdf0e10cSrcweir ,aCaughtException( _rCaughtException ) 89cdf0e10cSrcweir { 90cdf0e10cSrcweir } 91cdf0e10cSrcweir MigrationErrordbmm::MigrationError92cdf0e10cSrcweir MigrationError( 93cdf0e10cSrcweir const MigrationErrorType _eType, 94cdf0e10cSrcweir const ::rtl::OUString& _rDetail ) 95cdf0e10cSrcweir :eType( _eType ) 96cdf0e10cSrcweir { 97cdf0e10cSrcweir impl_constructDetails( _rDetail ); 98cdf0e10cSrcweir } 99cdf0e10cSrcweir MigrationErrordbmm::MigrationError100cdf0e10cSrcweir MigrationError( 101cdf0e10cSrcweir const MigrationErrorType _eType, 102cdf0e10cSrcweir const ::rtl::OUString& _rDetail, 103cdf0e10cSrcweir const ::com::sun::star::uno::Any& _rCaughtException ) 104cdf0e10cSrcweir :eType( _eType ) 105cdf0e10cSrcweir ,aCaughtException( _rCaughtException ) 106cdf0e10cSrcweir { 107cdf0e10cSrcweir impl_constructDetails( _rDetail ); 108cdf0e10cSrcweir } 109cdf0e10cSrcweir MigrationErrordbmm::MigrationError110cdf0e10cSrcweir MigrationError( 111cdf0e10cSrcweir const MigrationErrorType _eType, 112cdf0e10cSrcweir const ::rtl::OUString& _rDetail1, 113cdf0e10cSrcweir const ::rtl::OUString& _rDetail2 ) 114cdf0e10cSrcweir :eType( _eType ) 115cdf0e10cSrcweir { 116cdf0e10cSrcweir impl_constructDetails( _rDetail1, _rDetail2 ); 117cdf0e10cSrcweir } 118cdf0e10cSrcweir MigrationErrordbmm::MigrationError119cdf0e10cSrcweir MigrationError( 120cdf0e10cSrcweir const MigrationErrorType _eType, 121cdf0e10cSrcweir const ::rtl::OUString& _rDetail1, 122cdf0e10cSrcweir const ::rtl::OUString& _rDetail2, 123cdf0e10cSrcweir const ::com::sun::star::uno::Any& _rCaughtException ) 124cdf0e10cSrcweir :eType( _eType ) 125cdf0e10cSrcweir ,aCaughtException( _rCaughtException ) 126cdf0e10cSrcweir { 127cdf0e10cSrcweir impl_constructDetails( _rDetail1, _rDetail2 ); 128cdf0e10cSrcweir } 129cdf0e10cSrcweir MigrationErrordbmm::MigrationError130cdf0e10cSrcweir MigrationError( 131cdf0e10cSrcweir const MigrationErrorType _eType, 132cdf0e10cSrcweir const ::rtl::OUString& _rDetail1, 133cdf0e10cSrcweir const ::rtl::OUString& _rDetail2, 134cdf0e10cSrcweir const ::rtl::OUString& _rDetail3, 135cdf0e10cSrcweir const ::com::sun::star::uno::Any& _rCaughtException ) 136cdf0e10cSrcweir :eType( _eType ) 137cdf0e10cSrcweir ,aCaughtException( _rCaughtException ) 138cdf0e10cSrcweir { 139cdf0e10cSrcweir impl_constructDetails( _rDetail1, _rDetail2, _rDetail3 ); 140cdf0e10cSrcweir } 141cdf0e10cSrcweir MigrationErrordbmm::MigrationError142cdf0e10cSrcweir MigrationError( 143cdf0e10cSrcweir const MigrationErrorType _eType, 144cdf0e10cSrcweir const ::rtl::OUString& _rDetail1, 145cdf0e10cSrcweir const ::rtl::OUString& _rDetail2, 146cdf0e10cSrcweir const ::rtl::OUString& _rDetail3 ) 147cdf0e10cSrcweir :eType( _eType ) 148cdf0e10cSrcweir { 149cdf0e10cSrcweir impl_constructDetails( _rDetail1, _rDetail2, _rDetail3 ); 150cdf0e10cSrcweir } 151cdf0e10cSrcweir 152cdf0e10cSrcweir private: impl_constructDetailsdbmm::MigrationError153cdf0e10cSrcweir void impl_constructDetails( 154cdf0e10cSrcweir const ::rtl::OUString& _rDetail1, 155cdf0e10cSrcweir const ::rtl::OUString& _rDetail2 = ::rtl::OUString(), 156cdf0e10cSrcweir const ::rtl::OUString& _rDetail3 = ::rtl::OUString() 157cdf0e10cSrcweir ) 158cdf0e10cSrcweir { 159cdf0e10cSrcweir if ( _rDetail1.getLength() ) aErrorDetails.push_back( _rDetail1 ); 160cdf0e10cSrcweir if ( _rDetail2.getLength() ) aErrorDetails.push_back( _rDetail2 ); 161cdf0e10cSrcweir if ( _rDetail3.getLength() ) aErrorDetails.push_back( _rDetail3 ); 162cdf0e10cSrcweir } 163cdf0e10cSrcweir }; 164cdf0e10cSrcweir 165cdf0e10cSrcweir //........................................................................ 166cdf0e10cSrcweir } // namespace dbmm 167cdf0e10cSrcweir //........................................................................ 168cdf0e10cSrcweir 169cdf0e10cSrcweir #endif // DBACCESS_MIGRATIONERROR_HXX 170cdf0e10cSrcweir 171