1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <osl/mutex.hxx>
21 #include <tools/diagnose_ex.h>
22 #include <cppuhelper/weak.hxx>
23 #include <cppuhelper/supportsservice.hxx>
24 #include <svl/itemprop.hxx>
25 #include <uno/environment.h>
26 #include <svl/urihelper.hxx>
27 #include <toolkit/helper/vclunohelper.hxx>
28 #include <comphelper/processfactory.hxx>
29 #include <cppuhelper/factory.hxx>
30 #include <com/sun/star/sdbc/ResultSetType.hpp>
31 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
32 #include <com/sun/star/sdb/XColumn.hpp>
33 #include <com/sun/star/util/XURLTransformer.hpp>
34 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
35 #include <com/sun/star/sdbc/XRowSet.hpp>
36 #include <com/sun/star/sdb/CommandType.hpp>
37 #include <com/sun/star/frame/XFrameLoader.hpp>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
40 #include <com/sun/star/beans/PropertyAttribute.hpp>
41 #include <com/sun/star/beans/XPropertySet.hpp>
42 #include <com/sun/star/container/XNameAccess.hpp>
43 #include <com/sun/star/text/BibliographyDataField.hpp>
44 #include <com/sun/star/form/XLoadListener.hpp>
45 #include <com/sun/star/frame/XLayoutManager.hpp>
46 #include <com/sun/star/uno/XAggregation.hpp>
47 #include <toolkit/awt/vclxwindow.hxx>
48 #include <vcl/window.hxx>
49 #include <vcl/edit.hxx>
50 #include <vcl/svapp.hxx>
51 #include <vcl/group.hxx>
52 #include <svtools/svmedit.hxx>
54 #include "bibresid.hxx"
56 #include "bibcont.hxx"
57 #include "bibbeam.hxx"
59 #include "bibview.hxx"
60 #include "framectr.hxx"
62 #include <bibconfig.hxx>
63 #include <cppuhelper/implbase4.hxx>
65 using namespace ::com::sun::star
;
66 using namespace ::com::sun::star::uno
;
67 using namespace ::com::sun::star::beans
;
68 using namespace ::com::sun::star::lang
;
69 using namespace ::com::sun::star::sdb
;
70 using namespace ::com::sun::star::sdbc
;
71 using namespace ::com::sun::star::form
;
72 using namespace ::com::sun::star::container
;
73 using namespace ::com::sun::star::frame
;
75 class BibliographyLoader
: public cppu::WeakImplHelper4
76 < XServiceInfo
, XNameAccess
, XPropertySet
, XFrameLoader
>
78 HdlBibModul m_pBibMod
;
79 Reference
< XLoadable
> m_xDatMan
;
80 BibDataManager
* m_pDatMan
;
81 Reference
< XNameAccess
> m_xColumns
;
82 Reference
< XResultSet
> m_xCursor
;
86 void loadView(const Reference
< XFrame
> & aFrame
, const OUString
& aURL
,
87 const Sequence
< PropertyValue
>& aArgs
,
88 const Reference
< XLoadEventListener
> & aListener
);
90 BibDataManager
* GetDataManager()const;
91 Reference
< XNameAccess
> GetDataColumns() const;
92 Reference
< XResultSet
> GetDataCursor() const;
93 Reference
< sdb::XColumn
> GetIdentifierColumn() const;
97 virtual ~BibliographyLoader();
100 OUString SAL_CALL
getImplementationName() throw(std::exception
) SAL_OVERRIDE
;
101 sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) throw(std::exception
) SAL_OVERRIDE
;
102 Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() throw(std::exception
) SAL_OVERRIDE
;
103 static OUString
getImplementationName_Static() throw( )
107 return OUString("com.sun.star.extensions.Bibliography");
112 virtual Any SAL_CALL
getByName(const OUString
& aName
) throw ( NoSuchElementException
, WrappedTargetException
, RuntimeException
, std::exception
) SAL_OVERRIDE
;
113 virtual Sequence
< OUString
> SAL_CALL
getElementNames() throw ( RuntimeException
, std::exception
) SAL_OVERRIDE
;
114 virtual sal_Bool SAL_CALL
hasByName(const OUString
& aName
) throw ( RuntimeException
, std::exception
) SAL_OVERRIDE
;
117 virtual Type SAL_CALL
getElementType() throw ( RuntimeException
, std::exception
) SAL_OVERRIDE
;
118 virtual sal_Bool SAL_CALL
hasElements() throw ( RuntimeException
, std::exception
) SAL_OVERRIDE
;
121 virtual Reference
< XPropertySetInfo
> SAL_CALL
getPropertySetInfo() throw ( RuntimeException
, std::exception
) SAL_OVERRIDE
;
122 virtual void SAL_CALL
setPropertyValue(const OUString
& PropertyName
, const Any
& aValue
) throw( UnknownPropertyException
, PropertyVetoException
, IllegalArgumentException
, WrappedTargetException
, RuntimeException
, std::exception
) SAL_OVERRIDE
;
123 virtual Any SAL_CALL
getPropertyValue(const OUString
& PropertyName
) throw ( UnknownPropertyException
, WrappedTargetException
, RuntimeException
, std::exception
) SAL_OVERRIDE
;
124 virtual void SAL_CALL
addPropertyChangeListener(const OUString
& PropertyName
, const Reference
< XPropertyChangeListener
> & aListener
) throw( UnknownPropertyException
, WrappedTargetException
, RuntimeException
, std::exception
) SAL_OVERRIDE
;
125 virtual void SAL_CALL
removePropertyChangeListener(const OUString
& PropertyName
, const Reference
< XPropertyChangeListener
> & aListener
) throw( UnknownPropertyException
, WrappedTargetException
, RuntimeException
, std::exception
) SAL_OVERRIDE
;
126 virtual void SAL_CALL
addVetoableChangeListener(const OUString
& PropertyName
, const Reference
< XVetoableChangeListener
> & aListener
) throw( UnknownPropertyException
, WrappedTargetException
, RuntimeException
, std::exception
) SAL_OVERRIDE
;
127 virtual void SAL_CALL
removeVetoableChangeListener(const OUString
& PropertyName
, const Reference
< XVetoableChangeListener
> & aListener
) throw( UnknownPropertyException
, WrappedTargetException
, RuntimeException
, std::exception
) SAL_OVERRIDE
;
129 static Sequence
<OUString
> SAL_CALL
getSupportedServiceNames_Static() throw( );
131 friend Reference
< XInterface
> SAL_CALL
BibliographyLoader_CreateInstance( const Reference
< XMultiServiceFactory
> & rSMgr
) throw( Exception
);
134 virtual void SAL_CALL
load(const Reference
< XFrame
> & aFrame
, const OUString
& aURL
,
135 const Sequence
< PropertyValue
>& aArgs
,
136 const Reference
< XLoadEventListener
> & aListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
137 virtual void SAL_CALL
cancel() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
140 BibliographyLoader::BibliographyLoader() :
146 BibliographyLoader::~BibliographyLoader()
148 Reference
< lang::XComponent
> xComp(m_xCursor
, UNO_QUERY
);
152 CloseBibModul(m_pBibMod
);
156 Reference
< XInterface
> SAL_CALL
BibliographyLoader_CreateInstance( const Reference
< XMultiServiceFactory
> & /*rSMgr*/ ) throw( Exception
)
158 return *(new BibliographyLoader
);
163 OUString
BibliographyLoader::getImplementationName() throw(std::exception
)
166 return getImplementationName_Static();
170 sal_Bool
BibliographyLoader::supportsService(const OUString
& ServiceName
) throw(std::exception
)
172 return cppu::supportsService(this, ServiceName
);
176 Sequence
< OUString
> BibliographyLoader::getSupportedServiceNames() throw(std::exception
)
178 return getSupportedServiceNames_Static();
181 // ORegistryServiceManager_Static
182 Sequence
< OUString
> BibliographyLoader::getSupportedServiceNames_Static() throw( )
184 Sequence
< OUString
> aSNS( 2 );
185 aSNS
.getArray()[0] = "com.sun.star.frame.FrameLoader";
187 aSNS
.getArray()[1] = "com.sun.star.frame.Bibliography";
194 SAL_DLLPUBLIC_EXPORT
void * SAL_CALL
bib_component_getFactory(
195 const sal_Char
* pImplName
, void * pServiceManager
, void * /*pRegistryKey*/ )
198 if (BibliographyLoader::getImplementationName_Static().equalsAscii( pImplName
) )
200 // create the factory
201 Reference
< XSingleServiceFactory
> xFactory
=
202 cppu::createSingleFactory(
203 static_cast<css::lang::XMultiServiceFactory
*>(pServiceManager
),
204 BibliographyLoader::getImplementationName_Static(),
205 BibliographyLoader_CreateInstance
,
206 BibliographyLoader::getSupportedServiceNames_Static() );
207 // acquire, because we return an interface pointer instead of a reference
209 pRet
= xFactory
.get();
216 void BibliographyLoader::cancel() throw (::com::sun::star::uno::RuntimeException
, std::exception
)
222 void BibliographyLoader::load(const Reference
< XFrame
> & rFrame
, const OUString
& rURL
,
223 const Sequence
< PropertyValue
>& rArgs
,
224 const Reference
< XLoadEventListener
> & rListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
)
227 SolarMutexGuard aGuard
;
229 m_pBibMod
= OpenBibModul();
231 OUString
aURLStr( rURL
);
232 OUString aPartName
= aURLStr
.getToken( 1, '/' );
233 Reference
<XPropertySet
> xPrSet(rFrame
, UNO_QUERY
);
237 aTitle
<<= BibResId(RID_BIB_STR_FRAME_TITLE
).toString();
238 xPrSet
->setPropertyValue("Title", aTitle
);
240 if(aPartName
== "View" || aPartName
== "View1")
242 loadView(rFrame
, rURL
, rArgs
, rListener
);
247 void BibliographyLoader::loadView(const Reference
< XFrame
> & rFrame
, const OUString
& /*rURL*/,
248 const Sequence
< PropertyValue
>& /*rArgs*/,
249 const Reference
< XLoadEventListener
> & rListener
)
251 SolarMutexGuard aGuard
;
254 m_pBibMod
= OpenBibModul();
256 m_pDatMan
= BibModul::createDataManager();
257 m_xDatMan
= m_pDatMan
;
258 BibDBDescriptor aBibDesc
= BibModul::GetConfig()->GetBibliographyURL();
260 if(aBibDesc
.sDataSource
.isEmpty())
262 DBChangeDialogConfig_Impl aConfig
;
263 const Sequence
<OUString
> aSources
= aConfig
.GetDataSourceNames();
264 if(aSources
.getLength())
265 aBibDesc
.sDataSource
= aSources
.getConstArray()[0];
268 Reference
< XForm
> xForm
= m_pDatMan
->createDatabaseForm( aBibDesc
);
270 Reference
< awt::XWindow
> aWindow
= rFrame
->getContainerWindow();
271 VCLXWindow
* pParentComponent
= VCLXWindow::GetImplementation(aWindow
);
272 assert(pParentComponent
);
274 vcl::Window
* pParent
= VCLUnoHelper::GetWindow( aWindow
);
276 VclPtrInstance
<BibBookContainer
> pMyWindow( pParent
);
279 VclPtrInstance
< ::bib::BibView
> pView( pMyWindow
, m_pDatMan
, WB_VSCROLL
| WB_HSCROLL
| WB_3DLOOK
);
281 m_pDatMan
->SetView( pView
);
283 VclPtrInstance
< ::bib::BibBeamer
> pBeamer( pMyWindow
, m_pDatMan
);
285 pMyWindow
->createTopFrame(pBeamer
);
287 pMyWindow
->createBottomFrame(pView
);
289 Reference
< awt::XWindow
> xWin ( pMyWindow
->GetComponentInterface(), UNO_QUERY
);
291 Reference
< XController
> xCtrRef( new BibFrameController_Impl( xWin
, m_pDatMan
) );
293 xCtrRef
->attachFrame(rFrame
);
294 rFrame
->setComponent( xWin
, xCtrRef
);
295 pBeamer
->SetXController(xCtrRef
);
297 if (pParentComponent
)
299 // not earlier because SetFocus() is triggered in setVisible()
300 pParentComponent
->setVisible(sal_True
);
304 // #100312# ----------
305 m_pDatMan
->RegisterInterceptor(pBeamer
);
307 if ( rListener
.is() )
308 rListener
->loadFinished( this );
311 Reference
< XPropertySet
> xPropSet( rFrame
, UNO_QUERY
);
312 Reference
< ::com::sun::star::frame::XLayoutManager
> xLayoutManager
;
317 Any a
= xPropSet
->getPropertyValue("LayoutManager");
318 a
>>= xLayoutManager
;
320 catch ( const uno::Exception
& )
325 if ( xLayoutManager
.is() )
326 xLayoutManager
->createElement( OUString( "private:resource/menubar/menubar" ));
329 BibDataManager
* BibliographyLoader::GetDataManager()const
334 const_cast< BibliographyLoader
* >( this )->m_pBibMod
= OpenBibModul();
335 const_cast< BibliographyLoader
* >( this )->m_pDatMan
= BibModul::createDataManager();
336 const_cast< BibliographyLoader
* >( this )->m_xDatMan
= m_pDatMan
;
341 Reference
< XNameAccess
> BibliographyLoader::GetDataColumns() const
343 if (!m_xColumns
.is())
345 Reference
< XMultiServiceFactory
> xMgr
= comphelper::getProcessServiceFactory();
346 Reference
< XRowSet
> xRowSet(xMgr
->createInstance("com.sun.star.sdb.RowSet"), UNO_QUERY
);
347 Reference
< XPropertySet
> xResultSetProps(xRowSet
, UNO_QUERY
);
348 DBG_ASSERT(xResultSetProps
.is() , "BibliographyLoader::GetDataCursor : invalid row set (no XResultSet or no XPropertySet) !");
350 BibDBDescriptor aBibDesc
= BibModul::GetConfig()->GetBibliographyURL();
352 Any aBibUrlAny
; aBibUrlAny
<<= aBibDesc
.sDataSource
;
353 xResultSetProps
->setPropertyValue("DataSourceName", aBibUrlAny
);
354 Any aCommandType
; aCommandType
<<= aBibDesc
.nCommandType
;
355 xResultSetProps
->setPropertyValue("CommandType", aCommandType
);
356 Any aTableName
; aTableName
<<= aBibDesc
.sTableOrQuery
;
357 xResultSetProps
->setPropertyValue("Command", aTableName
);
358 Any aResultSetType
; aResultSetType
<<= (sal_Int32
)(ResultSetType::SCROLL_INSENSITIVE
);
359 xResultSetProps
->setPropertyValue("ResultSetType", aResultSetType
);
360 Any aResultSetCurrency
; aResultSetCurrency
<<= (sal_Int32
)(ResultSetConcurrency::UPDATABLE
);
361 xResultSetProps
->setPropertyValue("ResultSetConcurrency", aResultSetCurrency
);
363 bool bSuccess
= false;
369 catch(const SQLException
&)
371 DBG_UNHANDLED_EXCEPTION();
373 catch(const Exception
& )
375 DBG_UNHANDLED_EXCEPTION();
381 Reference
< XComponent
> xSetComp(xRowSet
, UNO_QUERY
);
387 const_cast<BibliographyLoader
*>(this)->m_xCursor
= xRowSet
.get();
389 Reference
< sdbcx::XColumnsSupplier
> xSupplyCols(m_xCursor
, UNO_QUERY
);
390 if (xSupplyCols
.is())
391 const_cast<BibliographyLoader
*>(this)->m_xColumns
= xSupplyCols
->getColumns();
397 Reference
< sdb::XColumn
> BibliographyLoader::GetIdentifierColumn() const
399 BibDataManager
* pDatMan
= GetDataManager();
400 Reference
< XNameAccess
> xColumns
= GetDataColumns();
401 OUString sIdentifierColumnName
= pDatMan
->GetIdentifierMapping();
403 Reference
< sdb::XColumn
> xReturn
;
404 if (xColumns
.is() && xColumns
->hasByName(sIdentifierColumnName
))
406 xReturn
= Reference
< XColumn
> (*static_cast<Reference
< XInterface
> const *>(
407 xColumns
->getByName(sIdentifierColumnName
).getValue()), UNO_QUERY
);
412 Reference
< XResultSet
> BibliographyLoader::GetDataCursor() const
421 static OUString
lcl_AddProperty(Reference
< XNameAccess
> xColumns
,
422 const Mapping
* pMapping
, const OUString
& rColumnName
)
424 OUString
sColumnName(rColumnName
);
427 for(sal_uInt16 nEntry
= 0; nEntry
< COLUMN_COUNT
; nEntry
++)
429 if(pMapping
->aColumnPairs
[nEntry
].sLogicalColumnName
== rColumnName
)
431 sColumnName
= pMapping
->aColumnPairs
[nEntry
].sRealColumnName
;
436 OUString
uColumnName(sColumnName
);
438 Reference
< sdb::XColumn
> xCol
;
439 if (xColumns
->hasByName(uColumnName
))
440 xCol
= Reference
< sdb::XColumn
> (*static_cast<Reference
< XInterface
> const *>(xColumns
->getByName(uColumnName
).getValue()), UNO_QUERY
);
442 uRet
= xCol
->getString();
446 Any
BibliographyLoader::getByName(const OUString
& rName
) throw
447 ( NoSuchElementException
, WrappedTargetException
, RuntimeException
, std::exception
)
452 BibDataManager
* pDatMan
= GetDataManager();
453 Reference
< XResultSet
> xCursor
= GetDataCursor();
454 Reference
< sdbcx::XColumnsSupplier
> xSupplyCols(xCursor
, UNO_QUERY
);
455 Reference
< XNameAccess
> xColumns
;
456 if (!xSupplyCols
.is())
458 xColumns
= xSupplyCols
->getColumns();
459 DBG_ASSERT(xSupplyCols
.is(), "BibliographyLoader::getByName : invalid columns returned by the data cursor (may be the result set is not alive ?) !");
463 OUString sIdentifierMapping
= pDatMan
->GetIdentifierMapping();
464 OUString sId
= sIdentifierMapping
;
465 Reference
< sdb::XColumn
> xColumn
;
466 if (xColumns
->hasByName(sId
))
467 xColumn
= Reference
< sdb::XColumn
> (*static_cast<Reference
< XInterface
> const *>(xColumns
->getByName(sId
).getValue()), UNO_QUERY
);
472 if ((rName
== xColumn
->getString()) && !xColumn
->wasNull())
474 Sequence
<PropertyValue
> aPropSequ(COLUMN_COUNT
);
475 PropertyValue
* pValues
= aPropSequ
.getArray();
476 BibConfig
* pConfig
= BibModul::GetConfig();
477 BibDBDescriptor aBibDesc
= BibModul::GetConfig()->GetBibliographyURL();
478 const Mapping
* pMapping
= pConfig
->GetMapping(aBibDesc
);
479 for(sal_uInt16 nEntry
= 0; nEntry
< COLUMN_COUNT
; nEntry
++)
481 const OUString sColName
= pConfig
->GetDefColumnName(
483 pValues
[nEntry
].Name
= sColName
;
484 pValues
[nEntry
].Value
<<= lcl_AddProperty(xColumns
, pMapping
, sColName
);
486 aRet
.setValue(&aPropSequ
, cppu::UnoType
<Sequence
<PropertyValue
>>::get());
491 while(xCursor
->next());
494 catch(const Exception
&)
496 DBG_UNHANDLED_EXCEPTION();
501 Sequence
< OUString
> BibliographyLoader::getElementNames() throw ( RuntimeException
, std::exception
)
503 Sequence
< OUString
> aRet(10);
504 int nRealNameCount
= 0;
507 Reference
< XResultSet
> xCursor(GetDataCursor());
508 Reference
< sdb::XColumn
> xIdColumn(GetIdentifierColumn());
509 if (xIdColumn
.is()) // implies xCursor.is()
513 OUString sTemp
= xIdColumn
->getString();
514 if (!sTemp
.isEmpty() && !xIdColumn
->wasNull())
516 int nLen
= aRet
.getLength();
517 if(nLen
== nRealNameCount
)
518 aRet
.realloc(nLen
+ 10);
519 OUString
* pArray
= aRet
.getArray();
520 pArray
[nRealNameCount
] = sTemp
;
524 while (xCursor
->next());
527 catch(const Exception
&)
529 DBG_UNHANDLED_EXCEPTION();
532 aRet
.realloc(nRealNameCount
);
536 sal_Bool
BibliographyLoader::hasByName(const OUString
& rName
) throw ( RuntimeException
, std::exception
)
541 Reference
< XResultSet
> xCursor
= GetDataCursor();
542 Reference
< sdb::XColumn
> xIdColumn
= GetIdentifierColumn();
544 if (xIdColumn
.is()) // implies xCursor.is()
548 OUString sCurrentId
= xIdColumn
->getString();
549 if (!xIdColumn
->wasNull() && rName
.startsWith(sCurrentId
))
555 while(xCursor
->next());
558 catch(const Exception
&)
560 DBG_UNHANDLED_EXCEPTION();
565 Type
BibliographyLoader::getElementType() throw ( RuntimeException
, std::exception
)
567 return cppu::UnoType
<Sequence
<PropertyValue
>>::get();
570 sal_Bool
BibliographyLoader::hasElements() throw ( RuntimeException
, std::exception
)
572 Reference
< XResultSet
> xCursor
= GetDataCursor();
573 Reference
< XNameAccess
> xColumns
= GetDataColumns();
574 return xColumns
.is() && (xColumns
->getElementNames().getLength() != 0);
577 Reference
< XPropertySetInfo
> BibliographyLoader::getPropertySetInfo() throw
578 ( RuntimeException
, std::exception
)
580 static const SfxItemPropertyMapEntry aBibProps_Impl
[] =
582 { OUString("BibliographyDataFieldNames"), 0, cppu::UnoType
<Sequence
<PropertyValue
>>::get(), PropertyAttribute::READONLY
, 0},
583 { OUString(), 0, css::uno::Type(), 0, 0 }
585 static Reference
< XPropertySetInfo
> xRet
=
586 SfxItemPropertySet(aBibProps_Impl
).getPropertySetInfo();
590 void BibliographyLoader::setPropertyValue(const OUString
& /*PropertyName*/,
591 const Any
& /*aValue*/)
592 throw( UnknownPropertyException
, PropertyVetoException
,
593 IllegalArgumentException
, WrappedTargetException
, RuntimeException
, std::exception
)
595 throw UnknownPropertyException();
596 //no changeable properties
599 Any
BibliographyLoader::getPropertyValue(const OUString
& rPropertyName
)
600 throw( UnknownPropertyException
, WrappedTargetException
, RuntimeException
, std::exception
)
603 static const sal_uInt16 aInternalMapping
[] =
605 IDENTIFIER_POS
, // BibliographyDataField_IDENTIFIER
606 AUTHORITYTYPE_POS
, // BibliographyDataField_BIBILIOGRAPHIC_TYPE
607 ADDRESS_POS
, // BibliographyDataField_ADDRESS
608 ANNOTE_POS
, // BibliographyDataField_ANNOTE
609 AUTHOR_POS
, // BibliographyDataField_AUTHOR
610 BOOKTITLE_POS
, // BibliographyDataField_BOOKTITLE
611 CHAPTER_POS
, // BibliographyDataField_CHAPTER
612 EDITION_POS
, // BibliographyDataField_EDITION
613 EDITOR_POS
, // BibliographyDataField_EDITOR
614 HOWPUBLISHED_POS
, // BibliographyDataField_HOWPUBLISHED
615 INSTITUTION_POS
, // BibliographyDataField_INSTITUTION
616 JOURNAL_POS
, // BibliographyDataField_JOURNAL
617 MONTH_POS
, // BibliographyDataField_MONTH
618 NOTE_POS
, // BibliographyDataField_NOTE
619 NUMBER_POS
, // BibliographyDataField_NUMBER
620 ORGANIZATIONS_POS
, // BibliographyDataField_ORGANIZATIONS
621 PAGES_POS
, // BibliographyDataField_PAGES
622 PUBLISHER_POS
, // BibliographyDataField_PUBLISHER
623 SCHOOL_POS
, // BibliographyDataField_SCHOOL
624 SERIES_POS
, // BibliographyDataField_SERIES
625 TITLE_POS
, // BibliographyDataField_TITLE
626 REPORTTYPE_POS
, // BibliographyDataField_REPORT_TYPE
627 VOLUME_POS
, // BibliographyDataField_VOLUME
628 YEAR_POS
, // BibliographyDataField_YEAR
629 URL_POS
, // BibliographyDataField_URL
630 CUSTOM1_POS
, // BibliographyDataField_CUSTOM1
631 CUSTOM2_POS
, // BibliographyDataField_CUSTOM2
632 CUSTOM3_POS
, // BibliographyDataField_CUSTOM3
633 CUSTOM4_POS
, // BibliographyDataField_CUSTOM4
634 CUSTOM5_POS
, // BibliographyDataField_CUSTOM5
635 ISBN_POS
//BibliographyDataField_ISBN
637 if(rPropertyName
== "BibliographyDataFieldNames")
639 Sequence
<PropertyValue
> aSeq(COLUMN_COUNT
);
640 PropertyValue
* pArray
= aSeq
.getArray();
641 BibConfig
* pConfig
= BibModul::GetConfig();
642 for(sal_uInt16 i
= 0; i
<= text::BibliographyDataField::ISBN
; i
++)
644 pArray
[i
].Name
= pConfig
->GetDefColumnName(aInternalMapping
[i
]);
645 pArray
[i
].Value
<<= (sal_Int16
) i
;
647 aRet
.setValue(&aSeq
, cppu::UnoType
<Sequence
<PropertyValue
>>::get());
650 throw UnknownPropertyException();
654 void BibliographyLoader::addPropertyChangeListener(
655 const OUString
& /*PropertyName*/, const Reference
< XPropertyChangeListener
> & /*aListener*/)
656 throw( UnknownPropertyException
, WrappedTargetException
, RuntimeException
, std::exception
)
658 //no bound properties
661 void BibliographyLoader::removePropertyChangeListener(
662 const OUString
& /*PropertyName*/, const Reference
< XPropertyChangeListener
> & /*aListener*/)
663 throw( UnknownPropertyException
, WrappedTargetException
, RuntimeException
, std::exception
)
665 //no bound properties
668 void BibliographyLoader::addVetoableChangeListener(
669 const OUString
& /*PropertyName*/, const Reference
< XVetoableChangeListener
> & /*aListener*/)
670 throw( UnknownPropertyException
, WrappedTargetException
, RuntimeException
, std::exception
)
672 //no vetoable properties
675 void BibliographyLoader::removeVetoableChangeListener(
676 const OUString
& /*PropertyName*/, const Reference
< XVetoableChangeListener
> & /*aListener*/)
677 throw( UnknownPropertyException
, WrappedTargetException
, RuntimeException
, std::exception
)
679 //no vetoable properties
684 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */