Bring module to HEAD.

This commit is contained in:
Rüdiger Timm
2007-07-09 10:56:41 +00:00
parent 43729c2b57
commit 94ccba3eeb
441 changed files with 82921 additions and 0 deletions

View File

@@ -0,0 +1,110 @@
#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
#define _RPTUI_MODULE_HELPER_RPT_HXX_
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ModuleHelper.hxx,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#endif
#ifndef _TOOLS_RESMGR_HXX
#include <tools/resmgr.hxx>
#endif
#include "dllapi.h"
//.........................................................................
namespace rptui
{
//.........................................................................
//=========================================================================
//= OModule
//=========================================================================
class OModuleImpl;
class REPORTDESIGN_DLLPUBLIC OModule
{
friend class OModuleClient;
private:
OModule();
// not implemented. OModule is a static class
protected:
static ::osl::Mutex s_aMutex; /// access safety
static sal_Int32 s_nClients; /// number of registered clients
static OModuleImpl* s_pImpl; /// impl class. lives as long as at least one client for the module is registered
public:
/// get the vcl res manager of the module
static ResMgr* getResManager();
protected:
/// register a client for the module
static void registerClient();
/// revoke a client for the module
static void revokeClient();
private:
/** ensure that the impl class exists
@precond m_aMutex is guarded when this method gets called
*/
static void ensureImpl();
};
//=========================================================================
//= OModuleClient
//=========================================================================
/** base class for objects which uses any global module-specific ressources
*/
class REPORTDESIGN_DLLPUBLIC OModuleClient
{
public:
OModuleClient() { OModule::registerClient(); }
~OModuleClient() { OModule::revokeClient(); }
};
//=========================================================================
//= ModuleRes
//=========================================================================
/** specialized ResId, using the ressource manager provided by the global module
*/
class REPORTDESIGN_DLLPUBLIC ModuleRes : public ::ResId
{
public:
ModuleRes(USHORT _nId) : ResId(_nId, *OModule::getResManager()) { }
};
//.........................................................................
} // namespace rptui
//.........................................................................
#endif // _RPTUI_MODULE_HELPER_RPT_HXX_

View File

@@ -0,0 +1,111 @@
#ifndef RPTUI_PROPERTYSETFORWARD_HXX
#define RPTUI_PROPERTYSETFORWARD_HXX
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: PropertyForward.hxx,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_
#include <com/sun/star/beans/XPropertyChangeListener.hpp>
#endif
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include <com/sun/star/beans/XPropertySet.hpp>
#endif
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#endif
#ifndef _CPPUHELPER_COMPBASE1_HXX_
#include <cppuhelper/compbase1.hxx>
#endif
#ifndef _CPPUHELPER_BASEMUTEX_HXX_
#include "cppuhelper/basemutex.hxx"
#endif
#ifndef _REPORT_RPTUIDEF_HXX
#include "RptDef.hxx"
#endif
#include "dllapi.h"
//........................................................................
namespace rptui
{
//........................................................................
typedef ::cppu::WeakComponentImplHelper1< ::com::sun::star::beans::XPropertyChangeListener
> OPropertyForward_Base;
/** \class OPropertyMediator
* \brief This class ensures the communication between two XPropertySet instances.
* Identical properties will be set at the other propertyset.
* \ingroup reportdesign_source_ui_misc
*/
class REPORTDESIGN_DLLPUBLIC OPropertyMediator : public ::cppu::BaseMutex
,public OPropertyForward_Base
{
TPropertyNamePair m_aNameMap;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xSource;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> m_xSourceInfo;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xDest;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> m_xDestInfo;
sal_Bool m_bInChange;
OPropertyMediator(OPropertyMediator&);
void operator =(OPropertyMediator&);
protected:
virtual ~OPropertyMediator();
/** this function is called upon disposing the component
*/
virtual void SAL_CALL disposing();
public:
OPropertyMediator(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xSource
,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xDest
,const TPropertyNamePair& _aNameMap
,sal_Bool _bReverse = sal_False);
// ::com::sun::star::beans::XPropertyChangeListener
virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XEventListener
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& _rSource ) throw (::com::sun::star::uno::RuntimeException);
/** stop the listening mode.
*/
void stopListening();
/** starts the listening mode again.
*/
void startListening();
};
//........................................................................
} // namespace rptui
//........................................................................
#endif // RPTUI_PROPERTYSETFORWARD_HXX

View File

@@ -0,0 +1,353 @@
#ifndef REPORTDESIGN_API_REPORTDEFINITION_HXX
#define REPORTDESIGN_API_REPORTDEFINITION_HXX
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ReportDefinition.hxx,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
#include <com/sun/star/report/XReportDefinition.hpp>
#endif
#ifndef _CPPUHELPER_COMPBASE6_HXX_
#include <cppuhelper/compbase6.hxx>
#endif
#ifndef _CPPUHELPER_BASEMUTEX_HXX_
#include <cppuhelper/basemutex.hxx>
#endif
#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
#include <com/sun/star/lang/XServiceInfo.hpp>
#endif
#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
#include <com/sun/star/lang/XUnoTunnel.hpp>
#endif
#ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_
#include <com/sun/star/lang/XTypeProvider.hpp>
#endif
#ifndef INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
#include <cppuhelper/propertysetmixin.hxx>
#endif
#ifndef _COMPHELPER_UNO3_HXX_
#include <comphelper/uno3.hxx>
#endif
#ifndef SVX_UNOMOD_HXX
#include <svx/unomod.hxx>
#endif
#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATSSUPPLIER_HPP_
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#endif
#include <com/sun/star/frame/XModule.hpp>
#include "ReportHelperDefines.hxx"
#include <boost/shared_ptr.hpp>
#include "dllapi.h"
namespace rptui
{
class OReportModel;
}
namespace comphelper
{
class MediaDescriptor;
}
namespace reportdesign
{
class OReportComponentProperties;
typedef ::cppu::WeakComponentImplHelper6< com::sun::star::report::XReportDefinition
,com::sun::star::document::XEventBroadcaster
,com::sun::star::lang::XServiceInfo
,com::sun::star::frame::XModule
,com::sun::star::lang::XUnoTunnel
,SvxUnoDrawMSFactory> ReportDefinitionBase;
typedef ::cppu::PropertySetMixin<com::sun::star::report::XReportDefinition> ReportDefinitionPropertySet;
struct OReportDefinitionImpl;
/** \class OReportDefinition Defines the implementation of a \interface com:::sun::star::report::XReportDefinition
* \ingroup reportdesign_api
*
*/
class REPORTDESIGN_DLLPUBLIC OReportDefinition : public ::cppu::BaseMutex,
public ReportDefinitionBase,
public ReportDefinitionPropertySet
{
::boost::shared_ptr<OReportComponentProperties> m_aProps;
::boost::shared_ptr<OReportDefinitionImpl> m_pImpl;
private:
OReportDefinition(const OReportDefinition&);
OReportDefinition& operator=(const OReportDefinition&);
void setSection( const ::rtl::OUString& _sProperty
,const sal_Bool& _bOn
,const ::rtl::OUString& _sName
,::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _member);
template <typename T> void set( const ::rtl::OUString& _sProperty
,const T& _Value
,T& _member)
{
BoundListeners l;
{
::osl::MutexGuard aGuard(m_aMutex);
prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
_member = _Value;
}
l.notify();
}
/// write a single XML stream into the package
sal_Bool WriteThroughComponent(
/// the component we export
const ::com::sun::star::uno::Reference<
::com::sun::star::lang::XComponent> & xComponent,
const sal_Char* pStreamName, /// the stream name
const sal_Char* pServiceName, /// service name of the component
/// the argument (XInitialization)
const ::com::sun::star::uno::Sequence<
::com::sun::star::uno::Any> & rArguments,
/// output descriptor
const ::com::sun::star::uno::Sequence<
::com::sun::star::beans::PropertyValue> & rMediaDesc,
sal_Bool bPlainStream
, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _xStorageToSaveTo); /// neither compress nor encrypt
/// write a single output stream
/// (to be called either directly or by WriteThroughComponent(...))
sal_Bool WriteThroughComponent(
const ::com::sun::star::uno::Reference<
::com::sun::star::io::XOutputStream> & xOutputStream,
const ::com::sun::star::uno::Reference<
::com::sun::star::lang::XComponent> & xComponent,
const sal_Char* pServiceName,
const ::com::sun::star::uno::Sequence<
::com::sun::star::uno::Any> & rArguments,
const ::com::sun::star::uno::Sequence<
::com::sun::star::beans::PropertyValue> & rMediaDesc);
void notifyEvent(const ::rtl::OUString& _sEventName);
void init();
void fillArgs(::comphelper::MediaDescriptor& _aDescriptor);
protected:
virtual ~OReportDefinition();
/** this function is called upon disposing the component
*/
virtual void SAL_CALL disposing();
public:
explicit OReportDefinition(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext);
explicit OReportDefinition(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext
,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & _xFactory
,::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _xShape);
DECLARE_XINTERFACE( )
DECLARE_XTYPEPROVIDER( )
// ::com::sun::star::lang::XServiceInfo
virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
// com::sun::star::beans::XPropertySet
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
// XReportDefinition
virtual ::rtl::OUString SAL_CALL getMimeType() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setMimeType( const ::rtl::OUString& _mimetype ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getCaption() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int16 SAL_CALL getGroupKeepTogether() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setGroupKeepTogether( ::sal_Int16 _groupkeeptogether ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int16 SAL_CALL getPageHeaderOption() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setPageHeaderOption( ::sal_Int16 _pageheaderoption ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int16 SAL_CALL getPageFooterOption() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setPageFooterOption( ::sal_Int16 _pagefooteroption ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getMasterFields() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setMasterFields( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _masterfields ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getDetailFields() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setDetailFields( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _detailfields ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getCommand() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setCommand( const ::rtl::OUString& _command ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getCommandType() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setCommandType( ::sal_Int32 _commandtype ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getFilter() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setFilter( const ::rtl::OUString& _filter ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getEscapeProcessing() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setEscapeProcessing( ::sal_Bool _escapeprocessing ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getReportHeaderOn() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setReportHeaderOn( ::sal_Bool _reportheaderon ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getReportFooterOn() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setReportFooterOn( ::sal_Bool _reportfooteron ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getPageHeaderOn() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setPageHeaderOn( ::sal_Bool _pageheaderon ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getPageFooterOn() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setPageFooterOn( ::sal_Bool _pagefooteron ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups > SAL_CALL getGroups() throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getReportHeader() throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getPageHeader() throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getDetail() throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getPageFooter() throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getReportFooter() throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventBroadcaster > SAL_CALL getEventBroadcaster( ) throw (::com::sun::star::lang::DisposedException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableMimeTypes( ) throw (::com::sun::star::lang::DisposedException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
// XReportComponent
REPORTCOMPONENT_HEADER()
// XShape
SHAPE_HEADER()
// XShapeDescriptor
virtual ::rtl::OUString SAL_CALL getShapeType( ) throw (::com::sun::star::uno::RuntimeException);
//XFunctionsSupplier
virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctions > SAL_CALL getFunctions() throw (::com::sun::star::uno::RuntimeException);
// XCloneable
virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
// XComponent
virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
{
cppu::WeakComponentImplHelperBase::addEventListener(aListener);
}
virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
{
cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
}
// XChild
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
// XCloseBroadcaster
virtual void SAL_CALL addCloseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeCloseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
// XCloseable
virtual void SAL_CALL close( ::sal_Bool DeliverOwnership ) throw (::com::sun::star::util::CloseVetoException, ::com::sun::star::uno::RuntimeException);
// XModel
virtual ::sal_Bool SAL_CALL attachResource( const ::rtl::OUString& URL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getURL( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getArgs( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL connectController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& Controller ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL disconnectController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& Controller ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL lockControllers( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL unlockControllers( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL hasControllersLocked( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > SAL_CALL getCurrentController( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setCurrentController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& Controller ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getCurrentSelection( ) throw (::com::sun::star::uno::RuntimeException);
// XStorageBasedDocument
virtual void SAL_CALL loadFromStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescriptor ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::frame::DoubleInitializationException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL storeToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescriptor ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL switchToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > SAL_CALL getDocumentStorage( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addStorageChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XStorageChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeStorageChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XStorageChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
// XViewDataSupplier
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getViewData( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setViewData( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& Data ) throw (::com::sun::star::uno::RuntimeException);
// XLoadable
virtual void SAL_CALL initNew( ) throw (::com::sun::star::frame::DoubleInitializationException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL load( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments ) throw (::com::sun::star::frame::DoubleInitializationException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
// XVisualObject
virtual void SAL_CALL setVisualAreaSize( ::sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::embed::WrongStateException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::awt::Size SAL_CALL getVisualAreaSize( ::sal_Int64 nAspect ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::embed::WrongStateException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::embed::WrongStateException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getMapUnit( ::sal_Int64 nAspect ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
// XModifiable
virtual ::sal_Bool SAL_CALL isModified( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setModified( ::sal_Bool bModified ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException);
// XModifyBroadcaster
virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
// document::XEventBroadcaster
virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
// document::XEventListener
virtual void SAL_CALL notifyEvent( const ::com::sun::star::document::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
// XUIConfigurationManagerSupplier
virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager( ) throw (::com::sun::star::uno::RuntimeException);
// XDocumentSubStorageSupplier
virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > SAL_CALL getDocumentSubStorage( const ::rtl::OUString& aStorageName, sal_Int32 nMode ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getDocumentSubStoragesNames( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
// com::sun::star::lang::XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
// SvxUnoDrawMSFactory
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
// XStyleFamiliesSupplier
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getStyleFamilies( ) throw (::com::sun::star::uno::RuntimeException);
// XModule
virtual void SAL_CALL setIdentifier( const ::rtl::OUString& Identifier ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getIdentifier( ) throw (::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getContext();
/** return the SdrModel of the real model
*
* \return
*/
::boost::shared_ptr<rptui::OReportModel> getSdrModel() const;
static ::boost::shared_ptr<rptui::OReportModel> getSdrModel(::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReportDefinition);
};
// =============================================================================
} // namespace reportdesign
// =============================================================================
#endif // REPORTDESIGN_API_REPORTDEFINITION_HXX

View File

@@ -0,0 +1,158 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ReportHelperDefines.hxx,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef INCLUDED_REPORTHELPERDEFINES_HXX
#define INCLUDED_REPORTHELPERDEFINES_HXX
#define REPORTCONTROLMODEL_HEADER() \
virtual ::rtl::OUString SAL_CALL getDataField() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setDataField(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Bool SAL_CALL getPrintWhenGroupChange() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setPrintWhenGroupChange(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::rtl::OUString SAL_CALL getConditionalPrintExpression() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setConditionalPrintExpression(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XFormatCondition > SAL_CALL createFormatCondition() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception);
#define SHAPE_HEADER() \
virtual ::com::sun::star::awt::Point SAL_CALL getPosition() throw (::com::sun::star::uno::RuntimeException); \
virtual void SAL_CALL setPosition(const ::com::sun::star::awt::Point & aPosition) throw (::com::sun::star::uno::RuntimeException); \
virtual ::com::sun::star::awt::Size SAL_CALL getSize() throw (::com::sun::star::uno::RuntimeException); \
virtual void SAL_CALL setSize(const ::com::sun::star::awt::Size & aSize) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::PropertyVetoException);
#define REPORTCOMPONENT_HEADER() \
virtual ::rtl::OUString SAL_CALL getName() throw (::com::sun::star::uno::RuntimeException); \
virtual void SAL_CALL setName(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::PropertyVetoException); \
virtual ::sal_Int32 SAL_CALL getHeight() throw (::com::sun::star::uno::RuntimeException); \
virtual void SAL_CALL setHeight(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException); \
virtual ::sal_Int32 SAL_CALL getPositionX() throw (::com::sun::star::uno::RuntimeException); \
virtual void SAL_CALL setPositionX(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException); \
virtual ::sal_Int32 SAL_CALL getPositionY() throw (::com::sun::star::uno::RuntimeException); \
virtual void SAL_CALL setPositionY(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException); \
virtual ::sal_Int32 SAL_CALL getWidth() throw (::com::sun::star::uno::RuntimeException); \
virtual void SAL_CALL setWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException); \
virtual ::sal_Int16 SAL_CALL getControlBorder() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setControlBorder(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int32 SAL_CALL getControlBorderColor() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setControlBorderColor(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Bool SAL_CALL getPrintRepeatedValues() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setPrintRepeatedValues(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getSection() throw (::com::sun::star::uno::RuntimeException);
#define REPORTCONTROLFORMAT_HEADER() \
virtual ::sal_Int32 SAL_CALL getControlBackground() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setControlBackground(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Bool SAL_CALL getControlBackgroundTransparent() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setControlBackgroundTransparent(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int16 SAL_CALL getParaAdjust() throw (::com::sun::star::uno::RuntimeException); \
virtual void SAL_CALL setParaAdjust(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException); \
virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getFontDescriptor() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setFontDescriptor(const ::com::sun::star::awt::FontDescriptor & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int16 SAL_CALL getControlTextEmphasis() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setControlTextEmphasis(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int16 SAL_CALL getCharEmphasis() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharEmphasis(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Bool SAL_CALL getCharCombineIsOn() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharCombineIsOn(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::rtl::OUString SAL_CALL getCharCombinePrefix() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharCombinePrefix(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::rtl::OUString SAL_CALL getCharCombineSuffix() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharCombineSuffix(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Bool SAL_CALL getCharHidden() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharHidden(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Bool SAL_CALL getCharShadowed() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharShadowed(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Bool SAL_CALL getCharContoured() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharContoured(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int16 SAL_CALL getCharCaseMap() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharCaseMap(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::com::sun::star::lang::Locale SAL_CALL getCharLocale() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharLocale(const ::com::sun::star::lang::Locale & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int16 SAL_CALL getCharEscapement() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharEscapement(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int8 SAL_CALL getCharEscapementHeight() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharEscapementHeight(::sal_Int8 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Bool SAL_CALL getCharAutoKerning() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharAutoKerning(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Bool SAL_CALL getCharFlash() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharFlash(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int16 SAL_CALL getCharRelief() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharRelief(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::rtl::OUString SAL_CALL getCharFontName() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharFontName(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::rtl::OUString SAL_CALL getCharFontStyleName() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharFontStyleName(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int16 SAL_CALL getCharFontFamily() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharFontFamily(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int16 SAL_CALL getCharFontCharSet() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharFontCharSet(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int16 SAL_CALL getCharFontPitch() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharFontPitch(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int32 SAL_CALL getCharColor() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharColor(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int32 SAL_CALL getCharUnderlineColor() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharUnderlineColor(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual float SAL_CALL getCharHeight() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharHeight(float the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int16 SAL_CALL getCharUnderline() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharUnderline(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual float SAL_CALL getCharWeight() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharWeight(float the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::com::sun::star::awt::FontSlant SAL_CALL getCharPosture() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharPosture(::com::sun::star::awt::FontSlant the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int16 SAL_CALL getCharStrikeout() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharStrikeout(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Bool SAL_CALL getCharWordMode() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharWordMode(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int16 SAL_CALL getCharRotation() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharRotation(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int16 SAL_CALL getCharScaleWidth() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setCharScaleWidth(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::sal_Int16 SAL_CALL getParaVertAlignment() throw (::com::sun::star::uno::RuntimeException); \
virtual void SAL_CALL setParaVertAlignment(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException);\
virtual ::rtl::OUString SAL_CALL getHyperLinkURL() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setHyperLinkURL(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::rtl::OUString SAL_CALL getHyperLinkTarget() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setHyperLinkTarget(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::rtl::OUString SAL_CALL getHyperLinkName() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setHyperLinkName(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::rtl::OUString SAL_CALL getVisitedCharStyleName() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setVisitedCharStyleName(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual ::rtl::OUString SAL_CALL getUnvisitedCharStyleName() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
virtual void SAL_CALL setUnvisitedCharStyleName(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);\
virtual ::sal_Int16 SAL_CALL getCharKerning() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);\
virtual void SAL_CALL setCharKerning(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
#endif // INCLUDED_REPORTHELPERDEFINES_HXX

View File

@@ -0,0 +1,76 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ReportVisitor.hxx,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef INCLUDED_REPORT_VISTITOR_HXX
#define INCLUDED_REPORT_VISTITOR_HXX
#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
#include <com/sun/star/report/XReportDefinition.hpp>
#endif
#include "dllapi.h"
namespace reportdesign
{
class SAL_NO_VTABLE ITraverseReport
{
public:
virtual void traverseReport(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport) = 0;
virtual void traverseReportFunctions(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctions>& _xFunctions) = 0;
virtual void traverseReportHeader(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) = 0;
virtual void traverseReportFooter(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) = 0;
virtual void traversePageHeader(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) = 0;
virtual void traversePageFooter(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) = 0;
virtual void traverseGroups(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups>& _xGroups) = 0;
virtual void traverseGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup) = 0;
virtual void traverseGroupFunctions(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctions>& _xFunctions) = 0;
virtual void traverseGroupHeader(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) = 0;
virtual void traverseGroupFooter(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) = 0;
virtual void traverseDetail(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) = 0;
};
class REPORTDESIGN_DLLPUBLIC OReportVisitor
{
ITraverseReport* m_pTraverseReport;
public:
OReportVisitor(ITraverseReport* _pTraverseReport);
void start(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReportDefinition);
void start(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup);
};
// =============================================================================
} // namespace reportdesign
// =============================================================================
#endif // INCLUDED_REPORT_VISTITOR_HXX

119
reportdesign/inc/RptDef.hxx Normal file
View File

@@ -0,0 +1,119 @@
#ifndef _REPORT_RPTUIDEF_HXX
#define _REPORT_RPTUIDEF_HXX
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: RptDef.hxx,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef _SOLAR_H
#include <tools/solar.h>
#endif
#ifndef _SVDOBJ_HXX
#include <svx/svdobj.hxx>
#endif
#ifndef _COMPHELPER_STLTYPES_HXX_
#include <comphelper/stl_types.hxx>
#endif
#ifndef _COMPHELPER_UNO3_HXX_
#include <comphelper/uno3.hxx>
#endif
#include <svx/fmglob.hxx>
#include "dllapi.h"
FORWARD_DECLARE_INTERFACE(report,XReportComponent)
FORWARD_DECLARE_INTERFACE(report,XReportDefinition)
FORWARD_DECLARE_INTERFACE(style,XStyle)
FORWARD_DECLARE_INTERFACE(beans,XPropertySet)
namespace rptui
{
const UINT32 ReportInventor = UINT32('R')*0x00000001+
UINT32('P')*0x00000100+
UINT32('T')*0x00010000+
UINT32('1')*0x01000000;
#define OBJ_DLG_FIXEDTEXT ((UINT16) OBJ_MAXI + 1)
#define OBJ_DLG_IMAGECONTROL OBJ_FM_IMAGECONTROL
#define OBJ_DLG_FORMATTEDFIELD ((UINT16) OBJ_MAXI + 3)
#define OBJ_DLG_HFIXEDLINE ((UINT16) OBJ_MAXI + 4)
#define OBJ_DLG_VFIXEDLINE ((UINT16) OBJ_MAXI + 5)
// allows the alignment and resizing of controls
namespace ControlModification
{
static const ::sal_Int32 NONE = (sal_Int32)0;
static const ::sal_Int32 LEFT = (sal_Int32)1;
static const ::sal_Int32 RIGHT = (sal_Int32)2;
static const ::sal_Int32 TOP = (sal_Int32)3;
static const ::sal_Int32 BOTTOM = (sal_Int32)4;
static const ::sal_Int32 CENTER_HORIZONTAL = (sal_Int32)5;
static const ::sal_Int32 CENTER_VERTICAL = (sal_Int32)6;
static const ::sal_Int32 WIDTH_SMALLEST = (sal_Int32)7;
static const ::sal_Int32 HEIGHT_SMALLEST = (sal_Int32)8;
static const ::sal_Int32 WIDTH_GREATEST = (sal_Int32)9;
static const ::sal_Int32 HEIGHT_GREATEST = (sal_Int32)10;
}
/** returns teh object type depending on the service name
@param _xComponent the report component
*/
REPORTDESIGN_DLLPUBLIC sal_uInt16 getObjectType(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
DECLARE_STL_USTRINGACCESS_MAP(::rtl::OUString , TPropertyNamePair);
/** returns teh property name map for the givern property id
@param _nObjectId the object id
*/
REPORTDESIGN_DLLPUBLIC const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId);
REPORTDESIGN_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle> getUsedStyle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport);
// -----------------------------------------------------------------------------
template < typename T> T getStyleProperty(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport,const ::rtl::OUString& _sPropertyName)
{
T nReturn;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xProp(getUsedStyle(_xReport),::com::sun::star::uno::UNO_QUERY_THROW);
xProp->getPropertyValue(_sPropertyName) >>= nReturn;
return nReturn;
}
// -----------------------------------------------------------------------------
template<typename T> void setStyleProperty(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport,const ::rtl::OUString& _sPropertyName,const T& _aValue)
{
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xProp(getUsedStyle(_xReport),::com::sun::star::uno::UNO_QUERY);
if ( xProp.is() )
xProp->setPropertyValue(_sPropertyName,::com::sun::star::uno::makeAny(_aValue));
}
}
#endif // _REPORT_RPTUIDEF_HXX

View File

@@ -0,0 +1,104 @@
#ifndef REPORT_RPTMODEL_HXX
#define REPORT_RPTMODEL_HXX
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: RptModel.hxx,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef _SVDMODEL_HXX
#include <svx/svdmodel.hxx>
#endif
#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
#include <com/sun/star/report/XReportDefinition.hpp>
#endif
#include "dllapi.h"
class Window;
namespace dbaui
{
class OSingleDocumentController;
}
namespace rptui
{
//============================================================================
// OReportModel
//============================================================================
class OReportPage;
class OXUndoEnvironment;
class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel
{
friend class OReportPage;
private:
OXUndoEnvironment* m_pUndoEnv;
::dbaui::OSingleDocumentController* m_pController;
OReportModel( const OReportModel& );
void operator=(const OReportModel& rSrcModel);
public:
TYPEINFO();
OReportModel();
virtual ~OReportModel();
virtual void SetChanged(sal_Bool bFlg = sal_True);
virtual SdrPage* AllocPage(FASTBOOL bMasterPage);
virtual Window* GetCurDocViewWin();
virtual SdrPage* RemovePage(USHORT nPgNum);
/** returns the numbering type that is used to format page fields in drawing shapes */
virtual SvxNumType GetPageNumType() const;
OXUndoEnvironment& GetUndoEnv();
void SetModified(sal_Bool _bModified);
inline dbaui::OSingleDocumentController* getController() const { return m_pController; }
inline void attachController( dbaui::OSingleDocumentController& _rController ) { m_pController = &_rController; }
void detachController();
OReportPage* createNewPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
/** returns the page which belongs to a section
*
* \param _xSection
* \return The page or <NULL/> when t<>no page could be found.
*/
OReportPage* getPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
/// returns the XReportDefinition which the OReportModel belongs to
::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >
getReportDefinition() const;
};
}
#endif

View File

@@ -0,0 +1,267 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: RptObject.hxx,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef _REPORT_RPTUIOBJ_HXX
#define _REPORT_RPTUIOBJ_HXX
#ifndef _SVDOUNO_HXX
#include <svx/svdouno.hxx>
#endif
#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
#include <comphelper/processfactory.hxx>
#endif
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_
#include <com/sun/star/beans/XPropertyChangeListener.hpp>
#endif
#ifndef _COM_SUN_STAR_CONTAINER_XCONTAINERLISTENER_HPP_
#include <com/sun/star/container/XContainerListener.hpp>
#endif
#ifndef _COM_SUN_STAR_REPORT_XREPORTCOMPONENT_HPP_
#include <com/sun/star/report/XReportComponent.hpp>
#endif
#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
#include <com/sun/star/report/XSection.hpp>
#endif
#ifndef _SVDOCIRC_HXX
#include <svx/svdocirc.hxx>
#endif
#ifndef _SVDOGRP_HXX
#include <svx/svdogrp.hxx>
#endif
#ifndef _SVDOASHP_HXX
#include <svx/svdoashp.hxx>
#endif
#ifndef _COMPHELPER_STLTYPES_HXX_
#include <comphelper/stl_types.hxx>
#endif
#ifndef _COMPHELPER_IMPLEMENTATIONREFERENCE_HXX
#include <comphelper/implementationreference.hxx>
#endif
#include "dllapi.h"
namespace rptui
{
typedef ::std::multimap< sal_Int16, ::rtl::OUString, ::std::less< sal_Int16 > > IndexToNameMap;
enum DlgEdHintKind
{
RPTUI_HINT_UNKNOWN,
RPTUI_HINT_WINDOWSCROLLED,
RPTUI_HINT_LAYERCHANGED,
RPTUI_HINT_OBJORDERCHANGED,
RPTUI_HINT_SELECTIONCHANGED
};
class OUnoObject;
class REPORTDESIGN_DLLPUBLIC DlgEdHint: public SfxHint
{
private:
DlgEdHintKind eHintKind;
OUnoObject* pDlgEdObj;
DlgEdHint(DlgEdHint&);
void operator =(DlgEdHint&);
public:
TYPEINFO();
DlgEdHint( DlgEdHintKind eHint );
DlgEdHint( DlgEdHintKind eHint, OUnoObject* pObj );
virtual ~DlgEdHint();
inline DlgEdHintKind GetKind() const { return eHintKind; }
inline OUnoObject* GetObject() const { return pDlgEdObj; }
};
class OReportPage;
class OPropertyMediator;
class REPORTDESIGN_DLLPUBLIC OObjectBase
{
public:
typedef ::comphelper::ImplementationReference<OPropertyMediator,::com::sun::star::beans::XPropertyChangeListener> TMediator;
protected:
mutable TMediator m_xMediator;
mutable ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener> m_xPropertyChangeListener;
//mutable ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener>
mutable ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> m_xReportComponent;
::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener> m_xContainerListener;
::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> m_xSection;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xKeepShapeAlive;
::rtl::OUString m_sComponentName;
sal_Bool m_bIsListening;
OObjectBase(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
OObjectBase(const ::rtl::OUString& _sComponentName);
virtual ~OObjectBase();
inline sal_Bool isListening() const { return m_bIsListening; }
void SetPropsFromRect(const Rectangle& _rRect);
void PositionAndSizeChange( const ::com::sun::star::beans::PropertyChangeEvent& evt );
virtual void SetSnapRectImpl(const Rectangle& _rRect) = 0;
virtual SdrPage* GetImplPage() const = 0;
virtual void SetObjectItemHelper(const SfxPoolItem& rItem);
sal_Bool IsInside(const Rectangle& _rRect,const Point& rPnt,USHORT nTol) const;
/** called by instances of derived classes to implement their overloading of getUnoShape
*/
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
getUnoShapeOf( SdrObject& _rSdrObject );
public:
void StartListening();
void EndListening(sal_Bool bRemoveListener = sal_True);
// PropertyChangeListener
virtual void _propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException);
// ContainerListener
void _elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
void _elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
void _elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
sal_Bool supportsService( const sal_Char* _pServiceName ) const;
::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> getReportComponent() const;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getAwtComponent();
inline void setOldParent(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) { m_xSection = _xSection; }
inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> getOldParent() const { return m_xSection;}
::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> getSection() const;
/** releases the reference to our UNO shape (m_xKeepShapeAlive)
*/
void releaseUnoShape() { m_xKeepShapeAlive.clear(); }
static SdrObject* createObject(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
static sal_uInt16 getObjectType(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
};
//============================================================================
// OCustomShape
//============================================================================
class REPORTDESIGN_DLLPUBLIC OCustomShape: public SdrObjCustomShape , public OObjectBase
{
friend class OReportPage;
friend class OObjectBase;
friend class DlgEdFactory;
protected:
OCustomShape(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
OCustomShape(const ::rtl::OUString& _sComponentName);
virtual void NbcMove( const Size& rSize );
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
virtual void NbcSetLogicRect(const Rectangle& rRect);
virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
virtual void SetSnapRectImpl(const Rectangle& _rRect);
virtual SdrPage* GetImplPage() const;
void SetObjectItemHelper(const SfxPoolItem& rItem);
public:
TYPEINFO();
virtual ~OCustomShape();
virtual sal_Int32 GetStep() const;
virtual SdrObject* CheckHit(const Point& rPnt,USHORT nTol,const SetOfByte*) const;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getAwtComponent();
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape();
};
//============================================================================
// OUnoObject
//============================================================================
class REPORTDESIGN_DLLPUBLIC OUnoObject: public SdrUnoObj , public OObjectBase
{
friend class OReportPage;
friend class OObjectBase;
friend class DlgEdFactory;
sal_uInt16 m_nObjectType;
::rtl::OUString GetDefaultName() const;
protected:
OUnoObject( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent
,const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _xControlModel
,sal_uInt16 _nObjectType);
OUnoObject(const ::rtl::OUString& _sComponentName
,const ::rtl::OUString& rModelName
,sal_uInt16 _nObjectType);
OUnoObject( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent
,const ::rtl::OUString& rModelName
,sal_uInt16 _nObjectType);
virtual ~OUnoObject();
virtual void NbcMove( const Size& rSize );
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
virtual void NbcSetLogicRect(const Rectangle& rRect);
virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
virtual void SetSnapRectImpl(const Rectangle& _rRect);
virtual SdrPage* GetImplPage() const;
public:
TYPEINFO();
virtual sal_Int32 GetStep() const;
virtual SdrObject* CheckHit(const Point& rPnt,USHORT nTol,const SetOfByte*) const;
virtual void _propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException);
/** creates the m_xMediator when it doesn't already exist.
@param _bReverse when set to <TRUE/> then the properties from the uno control will be copied into report control
*/
void CreateMediator(sal_Bool _bReverse = sal_False);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getAwtComponent();
inline sal_uInt16 getObjectId() const { return m_nObjectType; }
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape();
};
//============================================================================
} // rptui
//============================================================================
#endif // _REPORT_RPTUIOBJ_HXX

View File

@@ -0,0 +1,106 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: RptPage.hxx,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef _REPORT_RPTUIPAGE_HXX
#define _REPORT_RPTUIPAGE_HXX
#ifndef _SVDPAGE_HXX
#include "svx/svdpage.hxx"
#endif
#ifndef _COM_SUN_STAR_REPORT_XREPORTCOMPONENT_HPP_
#include <com/sun/star/report/XReportComponent.hpp>
#endif
#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
#include <com/sun/star/report/XSection.hpp>
#endif
#include "dllapi.h"
namespace rptui
{
//============================================================================
// OReportPage
//============================================================================
class OReportModel;
//class OReportSection;
class REPORTDESIGN_DLLPUBLIC OReportPage : public SdrPage
{
OReportModel& rModel;
::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
m_xSection;
OReportPage(const OReportPage&);
protected:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage();
public:
TYPEINFO();
OReportPage( OReportModel& rModel
,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
,FASTBOOL bMasterPage=FALSE );
virtual ~OReportPage();
virtual SdrPage* Clone() const;
using SdrPage::Clone;
virtual void NbcInsertObject(SdrObject* pObj, ULONG nPos, const SdrInsertReason* pReason);
virtual SdrObject* RemoveObject(ULONG nObjNum);
/** returns teh index inside the object list which belongs to the report component.
@param _xObject the report component
*/
ULONG getIndexOf(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xObject);
/** removes the SdrObject which belongs to the report component.
@param _xObject the report component
*/
void removeSdrObject(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xObject);
/** insert a new SdrObject which belongs to the report component.
@param _xObject the report component
*/
void insertObject(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xObject);
//inline OReportSection* getReportSection() { return m_pView; }
/** sets the view to <NULL/>
*/
//inline void clearSection() { m_pView = NULL; }
::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getSection() const;
};
}
#endif //_REPORT_RPTUIPAGE_HXX

View File

@@ -0,0 +1,255 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: RptResId.hrc,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef _RPTUI_DLGRESID_HRC
#define _RPTUI_DLGRESID_HRC
// include -----------------------------------------------------------
#ifndef _SOLAR_HRC
#include <svtools/solar.hrc>
#endif
#define RID_DIALOG_START RID_RPT_START
#define RID_PAGE_START RID_RPT_START
#define RID_ERRORBOX_START RID_RPT_START
#define RID_QUERYBOX_START RID_RPT_START
#define RID_TOOLBOX_START RID_RPT_START
#define RID_BITMAP_START RID_RPT_START
#define RID_IMAGE_START RID_RPT_START
#define RID_IMAGELIST_START RID_RPT_START
#define RID_MENU_START RID_RPT_START
#define RID_STRING_START RID_RPT_START
#define RID_UNTYPED_START RID_RPT_START
#define RID_WARN_START RID_RPT_START
#define RID_CONTROL_START RID_RPT_START
#define RID_MISC_START RID_RPT_START
// Dialog Control Id's -----------------------------------------------------------
#define RID_GROUPS_SORTING ( RID_DIALOG_START + 0 )
#define RID_PAGENUMBERS ( RID_DIALOG_START + 1 )
#define RID_DATETIME_DLG ( RID_DIALOG_START + 2 )
#define RID_CONDFORMAT ( RID_DIALOG_START + 3 )
#define WIN_CONDITION ( RID_DIALOG_START + 4 )
#define RID_NAVIGATOR ( RID_DIALOG_START + 5 )
// strings
#define RID_STR_CLASS_FORMATTEDFIELD ( RID_STRING_START + 1 )
#define RID_STR_CLASS_FIXEDTEXT ( RID_STRING_START + 2 )
#define RID_STR_CLASS_IMAGECONTROL ( RID_STRING_START + 3 )
#define RID_STR_PROPTITLE_FIXEDTEXT ( RID_STRING_START + 4 )
#define RID_STR_PROPTITLE_FORMATTED ( RID_STRING_START + 5 )
#define RID_STR_PROPTITLE_SHAPE ( RID_STRING_START + 6 )
#define RID_STR_PROPTITLE_IMAGECONTROL ( RID_STRING_START + 7 )
#define RID_STR_PROPTITLE_REPORT ( RID_STRING_START + 8 )
#define RID_STR_PROPTITLE_SECTION ( RID_STRING_START + 9 )
#define RID_STR_PROPTITLE_FUNCTION ( RID_STRING_START + 10 )
// undo strings
#define RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER ( RID_STRING_START + 11 )
#define RID_STR_UNDO_ADD_REPORTHEADERFOOTER ( RID_STRING_START + 12 )
#define RID_STR_UNDO_REMOVE_PAGEHEADERFOOTER ( RID_STRING_START + 13 )
#define RID_STR_UNDO_ADD_PAGEHEADERFOOTER ( RID_STRING_START + 14 )
#define RID_STR_UNDO_PROPERTY ( RID_STRING_START + 15 )
#define RID_STR_UNDO_REMOVE_GROUP ( RID_STRING_START + 16 )
#define RID_STR_UNDO_APPEND_GROUP ( RID_STRING_START + 17 )
#define RID_STR_UNDO_MOVE_GROUP ( RID_STRING_START + 18 )
#define RID_STR_UNDO_CONDITIONAL_FORMATTING ( RID_STRING_START + 19 )
#define RID_STR_UNDO_REMOVE_SELECTION ( RID_STRING_START + 20 )
#define RID_STR_UNDO_PASTE ( RID_STRING_START + 21 )
#define RID_STR_UNDO_CHANGE_SIZE ( RID_STRING_START + 22 )
#define RID_STR_UNDO_INSERT_CONTROL ( RID_STRING_START + 23 )
#define RID_STR_UNDO_DELETE_CONTROL ( RID_STRING_START + 24 )
#define RID_STR_UNDO_GROUP ( RID_STRING_START + 25 )
#define RID_STR_UNDO_UNGROUP ( RID_STRING_START + 26 )
#define RID_STR_UNDO_CHANGEPOSITION ( RID_STRING_START + 27 )
#define RID_STR_UNDO_ADDFUNCTION ( RID_STRING_START + 28 )
#define RID_STR_UNDO_DELETEFUNCTION ( RID_STRING_START + 29 )
// title of tab pages
#define RID_STR_DESIGN_VIEW ( RID_STRING_START + 30 )
#define RID_STR_PREVIEW_VIEW ( RID_STRING_START + 31 )
// other
#define STR_RPT_TITLE ( RID_STRING_START + 32 )
#define STR_RPT_LABEL ( RID_STRING_START + 33 )
#define STR_RPT_EXPRESSION ( RID_STRING_START + 34 )
#define STR_RPT_SORTING ( RID_STRING_START + 35 )
#define STR_RPT_PN_PAGE ( RID_STRING_START + 36 )
#define STR_RPT_PN_PAGE_OF ( RID_STRING_START + 37 )
#define STR_RPT_PREFIXCHARS ( RID_STRING_START + 38 )
#define STR_RPT_YEAR ( RID_STRING_START + 39 )
#define STR_RPT_QUARTER ( RID_STRING_START + 40 )
#define STR_RPT_MONTH ( RID_STRING_START + 41 )
#define STR_RPT_WEEK ( RID_STRING_START + 42 )
#define STR_RPT_DAY ( RID_STRING_START + 43 )
#define STR_RPT_HOUR ( RID_STRING_START + 44 )
#define STR_RPT_MINUTE ( RID_STRING_START + 45 )
#define STR_RPT_INTERVAL ( RID_STRING_START + 46 )
#define STR_RPT_HELP_FIELD ( RID_STRING_START + 47 )
#define STR_RPT_HELP_HEADER ( RID_STRING_START + 48 )
#define STR_RPT_HELP_FOOTER ( RID_STRING_START + 49 )
#define STR_RPT_HELP_GROUPON ( RID_STRING_START + 50 )
#define STR_RPT_HELP_INTERVAL ( RID_STRING_START + 51 )
#define STR_RPT_HELP_KEEP ( RID_STRING_START + 52 )
#define STR_RPT_HELP_SORT ( RID_STRING_START + 53 )
#define RID_STR_GROUPHEADER ( RID_STRING_START + 54 )
#define RID_STR_GROUPFOOTER ( RID_STRING_START + 55 )
#define RID_STR_UNDO_REMOVE_FUNCTION ( RID_STRING_START + 56 )
#define STR_NUMBERED_CONDITION ( RID_STRING_START + 57 )
// Property Browser Headline Id's -----------------------------------------------------------
#define RID_STR_BRWTITLE_PROPERTIES ( RID_STRING_START + 60 )
#define RID_STR_BRWTITLE_NO_PROPERTIES ( RID_STRING_START + 61 )
#define RID_STR_BRWTITLE_MULTISELECT ( RID_STRING_START + 62 )
#define STR_SHOW_RULER ( RID_STRING_START + 63 )
#define STR_SHOW_GRID ( RID_STRING_START + 64 )
#define STR_COLOR_WHITE ( RID_STRING_START + 65 )
#define STR_CHARCOLOR ( RID_STRING_START + 66 )
#define STR_CHARBACKGROUND ( RID_STRING_START + 67 )
#define STR_TRANSPARENT ( RID_STRING_START + 68 )
#define RID_STR_FIELDSELECTION ( RID_STRING_START + 69 )
#define RID_STR_UNDO_ADD_GROUP_HEADER ( RID_STRING_START + 70 )
#define RID_STR_UNDO_REMOVE_GROUP_HEADER ( RID_STRING_START + 71 )
#define RID_STR_UNDO_ADD_GROUP_FOOTER ( RID_STRING_START + 72 )
#define RID_STR_UNDO_REMOVE_GROUP_FOOTER ( RID_STRING_START + 73 )
#define RID_STR_PROPPAGE_DEFAULT ( RID_STRING_START + 74 )
#define RID_STR_PROPPAGE_DATA ( RID_STRING_START + 75 )
#define RID_STR_FILTER ( RID_STRING_START + 76 )
#define RID_STR_BOOL ( RID_STRING_START + 77 )
#define RID_STR_FORCENEWPAGE (RID_STRING_START + 78)
#define RID_STR_NEWROWORCOL (RID_STRING_START + 79)
#define RID_STR_KEEPTOGETHER (RID_STRING_START + 80)
#define RID_STR_CANGROW (RID_STRING_START + 81)
#define RID_STR_CANSHRINK (RID_STRING_START + 82)
#define RID_STR_REPEATSECTION (RID_STRING_START + 83)
#define RID_STR_PROPTITLE_GROUP (RID_STRING_START + 84)
#define RID_STR_PROPTITLE_FIXEDLINE (RID_STRING_START + 85)
#define RID_STR_CLASS_FIXEDLINE (RID_STRING_START + 86)
#define RID_STR_BACKTRANSPARENT (RID_STRING_START + 87)
#define RID_STR_CONTROLBACKGROUNDTRANSPARENT (RID_STRING_START + 88)
#define RID_STR_OVERLAP_OTHER_CONTROL (RID_STRING_START + 89)
#define RID_STR_ILLEGAL_POSITION (RID_STRING_START + 90)
#define RID_STR_PAGEHEADERFOOTER_INSERT (RID_STRING_START + 91)
#define RID_STR_PAGEHEADERFOOTER_DELETE (RID_STRING_START + 92)
#define RID_STR_BACKCOLOR (RID_STRING_START + 93)
#define RID_STR_PRINTREPEATEDVALUES (RID_STRING_START + 94)
#define RID_STR_CONDITIONALPRINTEXPRESSION (RID_STRING_START + 95)
#define RID_STR_COLUMNHEADERFOOTER_INSERT (RID_STRING_START + 96)
#define RID_STR_STARTNEWCOLUMN (RID_STRING_START + 97)
#define RID_STR_STARTNEWPAGE (RID_STRING_START + 98)
#define RID_STR_RESETPAGENUMBER (RID_STRING_START + 99)
#define RID_STR_COLUMNHEADERFOOTER_DELETE (RID_STRING_START + 100)
#define RID_STR_MINHEIGHTNEWPAGE (RID_STRING_START + 101)
#define RID_STR_PRINTWHENGROUPCHANGE (RID_STRING_START + 102)
#define RID_STR_REPORTHEADERFOOTER_INSERT (RID_STRING_START + 103)
#define RID_STR_REPORTHEADERFOOTER_DELETE (RID_STRING_START + 104)
#define RID_STR_VISIBLE (RID_STRING_START + 105)
#define RID_STR_FORCENEWPAGE_CONST (RID_STRING_START + 106)
#define RID_STR_KEEPTOGETHER_CONST (RID_STRING_START + 107)
#define RID_STR_GROUPKEEPTOGETHER (RID_STRING_START + 108)
#define RID_STR_GROUPKEEPTOGETHER_CONST (RID_STRING_START + 109)
#define RID_STR_PAGEHEADEROPTION (RID_STRING_START + 110)
#define RID_STR_PAGEFOOTEROPTION (RID_STRING_START + 111)
#define RID_STR_REPORTPRINTOPTION_CONST (RID_STRING_START + 112)
#define RID_STR_SECTIONPAGEBREAK_CONST (RID_STRING_START + 113)
// free
#define RID_APP_TITLE (RID_STRING_START + 115)
#define RID_APP_NEW_DOC (RID_STRING_START + 116)
#define RID_STR_UNDO_ALIGNMENT (RID_STRING_START + 117)
#define RID_STR_HEADER (RID_STRING_START + 118)
#define RID_STR_FOOTER (RID_STRING_START + 119)
#define RID_STR_DATAFIELD (RID_STRING_START + 120)
#define RID_STR_FONT (RID_STRING_START + 121)
#define RID_STR_COULD_NOT_CREATE_REPORT (RID_STRING_START + 122)
#define RID_STR_PRESERVEIRI (RID_STRING_START + 123)
#define RID_STR_IMPORT_GRAPHIC (RID_STRING_START + 124)
#define RID_STR_POSITIONX (RID_STRING_START + 125)
#define RID_STR_POSITIONY (RID_STRING_START + 126)
#define RID_STR_WIDTH (RID_STRING_START + 127)
#define RID_STR_HEIGHT (RID_STRING_START + 128)
#define RID_STR_DELETE (RID_STRING_START + 129)
#define RID_STR_DEEPTRAVERSING (RID_STRING_START + 130)
#define RID_STR_PREEVALUATED (RID_STRING_START + 131)
#define RID_STR_FUNCTIONS (RID_STRING_START + 132)
#define RID_STR_GROUPS (RID_STRING_START + 133)
#define RID_STR_FUNCTION (RID_STRING_START + 134)
#define RID_STR_FORMULA (RID_STRING_START + 135)
#define RID_STR_INITIALFORMULA (RID_STRING_START + 136)
#define RID_STR_UNDO_CHANGEFONT (RID_STRING_START + 137)
#define RID_STR_UNDO_CHANGEPAGE (RID_STRING_START + 138)
#define RID_STR_CAUGHT_FOREIGN_EXCEPTION (RID_STRING_START + 139)
// #define RID_STR_ (RID_STRING_START + 130)
// -----------------------------------------------------------------------
#define RID_PAGEDIALOG_PAGE ( RID_PAGE_START + 1 )
#define RID_PAGEDIALOG_BACKGROUND ( RID_PAGE_START + 2 )
#define RID_PAGEDIALOG_CHAR ( RID_PAGE_START + 3 )
#define RID_PAGE_CHAR ( RID_PAGE_START + 4 )
#define RID_PAGE_EFFECTS ( RID_PAGE_START + 5 )
#define RID_PAGE_POSITION ( RID_PAGE_START + 6 )
#define RID_PAGE_BACKGROUND ( RID_PAGE_START + 7 )
#define RID_PAGE_TWOLN ( RID_PAGE_START + 8 )
#define RID_PAGEDIALOG_LINE ( RID_PAGE_START + 9 )
#define RID_PAGE_LINE ( RID_PAGE_START + 10 )
#define RID_PAGE_ALIGNMENT ( RID_PAGE_START + 11 )
// -----------------------------------------------------------------------
#define RID_IMG_TREENODE_COLLAPSED ( RID_IMAGE_START + 1 )
#define RID_IMG_TREENODE_EXPANDED ( RID_IMAGE_START + 2 )
#define RID_IMG_TREENODE_COLLAPSED_HC ( RID_IMAGE_START + 3 )
#define RID_IMG_TREENODE_EXPANDED_HC ( RID_IMAGE_START + 4 )
#define REPORT_TREE_ICON ( RID_IMAGE_START + 5 )
// menu -----------------------------------------------------------------------
#define RID_MENU_REPORT ( RID_MENU_START + 0 )
#define RID_GROUPSROWPOPUPMENU ( RID_MENU_START + 1 )
#define RID_MENU_NAVIGATOR ( RID_MENU_START + 2 )
// image lists -----------------------------------------------------------------------
#define IMG_CONDFORMAT_DLG_SC (RID_IMAGELIST_START + 0)
#define IMG_CONDFORMAT_DLG_SCH (RID_IMAGELIST_START + 1)
#define IMG_CONDFORMAT_DLG_LC (RID_IMAGELIST_START + 2)
#define IMG_CONDFORMAT_DLG_LCH (RID_IMAGELIST_START + 3)
#define RID_SVXIMGLIST_RPTEXPL (RID_IMAGELIST_START + 4)
#define RID_SVXIMGLIST_RPTEXPL_HC (RID_IMAGELIST_START + 5)
#endif // _RPTUI_DLGRESID_HRC

View File

@@ -0,0 +1,323 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: UndoActions.hxx,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef RPTUI_UNDOACTIONS_HXX
#define RPTUI_UNDOACTIONS_HXX
#ifndef _SVDUNDO_HXX
#include <svx/svdundo.hxx>
#endif
#ifndef _STRING_HXX
#include <tools/string.hxx>
#endif
/** === begin UNO includes === **/
#ifndef _COM_SUN_STAR_UTIL_XMODIFYLISTENER_HPP_
#include <com/sun/star/util/XModifyListener.hpp>
#endif
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include <com/sun/star/beans/XPropertySet.hpp>
#endif
#ifndef _COM_SUN_STAR_BEANS_PROPERTYCHANGEEVENT_HPP_
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
#endif
#ifndef _COM_SUN_STAR_SCRIPT_SCRIPTEVENT_HPP_
#include <com/sun/star/script/ScriptEvent.hpp>
#endif
#ifndef _COM_SUN_STAR_SCRIPT_XSCRIPTLISTENER_HPP_
#include <com/sun/star/script/XScriptListener.hpp>
#endif
#ifndef _COM_SUN_STAR_SCRIPT_SCRIPTEVENTDESCRIPTOR_HPP_
#include <com/sun/star/script/ScriptEventDescriptor.hpp>
#endif
#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
#include <com/sun/star/container/XNameContainer.hpp>
#endif
#ifndef _COM_SUN_STAR_CONTAINER_CONTAINEREVENT_HPP_
#include <com/sun/star/container/ContainerEvent.hpp>
#endif
#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
#include <com/sun/star/container/XNameContainer.hpp>
#endif
#ifndef _COM_SUN_STAR_REPORT_XREPORTCOMPONENT_HPP_
#include <com/sun/star/report/XReportComponent.hpp>
#endif
#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
#include <com/sun/star/report/XReportDefinition.hpp>
#endif
#ifndef _COM_SUN_STAR_REPORT_XGROUP_HPP_
#include <com/sun/star/report/XGroup.hpp>
#endif
/** === end UNO includes === **/
#ifndef _CPPUHELPER_IMPLBASE3_HXX_
#include <cppuhelper/implbase3.hxx>
#endif
#ifndef _COMPHELPER_UNO3_HXX_
#include <comphelper/uno3.hxx>
#endif
#include <comphelper/sequence.hxx>
#ifndef _SFXLSTNER_HXX //autogen
#include <svtools/lstner.hxx>
#endif
#ifndef _SVDOUNO_HXX
#include <svx/svdouno.hxx>
#endif
#ifndef REPORT_RPTMODEL_HXX
#include "RptModel.hxx"
#endif
#include "dllapi.h"
#include <functional>
#include <memory>
#include <boost/shared_ptr.hpp>
FORWARD_DECLARE_INTERFACE(awt,XControl)
FORWARD_DECLARE_INTERFACE(awt,XControlContainer)
namespace dbaui
{
class IController;
}
namespace rptui
{
class OObjectBase;
enum Action
{
Inserted = 1,
Removed = 2
};
/** Helper class to allow std::mem_fun for SAL_CALL
*/
class REPORTDESIGN_DLLPUBLIC OGroupHelper
{
::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup > m_xGroup;
OGroupHelper(const OGroupHelper&);
OGroupHelper& operator=(const OGroupHelper&);
public:
OGroupHelper(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup)
:m_xGroup(_xGroup)
{
}
inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getHeader() { return m_xGroup->getHeader(); }
inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getFooter() { return m_xGroup->getFooter(); }
inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup > getGroup() { return m_xGroup; }
inline ::sal_Bool getHeaderOn() { return m_xGroup->getHeaderOn(); }
inline ::sal_Bool getFooterOn() { return m_xGroup->getFooterOn(); }
static ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OGroupHelper> getMemberFunction(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
};
typedef com::sun::star::uno::Reference< ::com::sun::star::report::XSection > TSection;
/** Helper class to allow std::mem_fun for SAL_CALL
*/
class REPORTDESIGN_DLLPUBLIC OReportHelper
{
::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xReport;
public:
OReportHelper(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReport)
:m_xReport(_xReport)
{
}
inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getReportHeader() { return m_xReport->getReportHeader(); }
inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getReportFooter() { return m_xReport->getReportFooter(); }
inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getPageHeader() { return m_xReport->getPageHeader(); }
inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getPageFooter() { return m_xReport->getPageFooter(); }
inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getDetail() { return m_xReport->getDetail(); }
static ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OReportHelper> getMemberFunction(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
};
class REPORTDESIGN_DLLPUBLIC OCommentUndoAction : public SdrUndoAction
{
protected:
String m_strComment; // undo, redo comment
::dbaui::IController* m_pController;
public:
TYPEINFO();
OCommentUndoAction( SdrModel& rMod
,USHORT nCommentID);
virtual UniString GetComment() const { return m_strComment; }
virtual void Undo();
virtual void Redo();
};
//==================================================================
// OUndoContainerAction
//==================================================================
class REPORTDESIGN_DLLPUBLIC OUndoContainerAction: public OCommentUndoAction
{
OUndoContainerAction(OUndoContainerAction&);
void operator =(OUndoContainerAction&);
protected:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
m_xElement; // object not owned by the action
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
m_xOwnElement; // object owned by the action
::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >
m_xContainer;
::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
m_xSection;
Action m_eAction;
public:
OUndoContainerAction(SdrModel& rMod
,Action _eAction
,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > _xContainer
,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xElem
,USHORT _nCommentId);
virtual ~OUndoContainerAction();
virtual void Undo();
virtual void Redo();
protected:
virtual void implReInsert( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
virtual void implReRemove( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
};
//==================================================================
// OUndoReportSectionAction
//==================================================================
class REPORTDESIGN_DLLPUBLIC OUndoReportSectionAction : public OUndoContainerAction
{
OReportHelper m_aReportHelper;
::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
,OReportHelper> m_pMemberFunction;
public:
OUndoReportSectionAction(SdrModel& rMod
,Action _eAction
,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
,OReportHelper> _pMemberFunction
,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReport
,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xElem
,USHORT _nCommentId);
protected:
virtual void implReInsert( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
virtual void implReRemove( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
};
//==================================================================
// OUndoGroupSectionAction
//==================================================================
class REPORTDESIGN_DLLPUBLIC OUndoGroupSectionAction : public OUndoContainerAction
{
OGroupHelper m_aGroupHelper;
::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
,OGroupHelper> m_pMemberFunction;
public:
OUndoGroupSectionAction(SdrModel& rMod
,Action _eAction
,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
,OGroupHelper> _pMemberFunction
,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup
,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xElem
,USHORT _nCommentId);
protected:
virtual void implReInsert( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
virtual void implReRemove( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
};
///==================================================================
/// ORptUndoPropertyAction
///==================================================================
class REPORTDESIGN_DLLPUBLIC ORptUndoPropertyAction: public OCommentUndoAction
{
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xObj;
::rtl::OUString m_aPropertyName;
::com::sun::star::uno::Any m_aNewValue;
::com::sun::star::uno::Any m_aOldValue;
/** sets either the old value or the new value again at the property set.
*
* \param _bOld If set to <TRUE/> than the old value will be set otherwise the new value will be set.
*/
void setProperty(sal_Bool _bOld);
protected:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getObject();
public:
ORptUndoPropertyAction(SdrModel& rMod, const ::com::sun::star::beans::PropertyChangeEvent& evt);
virtual void Undo();
virtual void Redo();
virtual String GetComment() const;
};
//==================================================================
// OUndoPropertyReportSectionAction
//==================================================================
class REPORTDESIGN_DLLPUBLIC OUndoPropertyReportSectionAction : public ORptUndoPropertyAction
{
OReportHelper m_aReportHelper;
::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
,OReportHelper> m_pMemberFunction;
protected:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getObject();
public:
OUndoPropertyReportSectionAction(SdrModel& rMod
,const ::com::sun::star::beans::PropertyChangeEvent& evt
,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
,OReportHelper> _pMemberFunction
,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReport
);
};
//==================================================================
// OUndoPropertyGroupSectionAction
//==================================================================
class REPORTDESIGN_DLLPUBLIC OUndoPropertyGroupSectionAction : public ORptUndoPropertyAction
{
OGroupHelper m_aGroupHelper;
::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
,OGroupHelper> m_pMemberFunction;
protected:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getObject();
public:
OUndoPropertyGroupSectionAction(SdrModel& rMod
,const ::com::sun::star::beans::PropertyChangeEvent& evt
,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
,OGroupHelper> _pMemberFunction
,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup
);
};
}
#endif //RPTUI_UNDOACTIONS_HXX

View File

@@ -0,0 +1,130 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: UndoEnv.hxx,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef INCLUDED_UNDOENV_HXX
#define INCLUDED_UNDOENV_HXX
#include <com/sun/star/beans/XPropertyChangeListener.hpp>
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
#include <com/sun/star/container/XContainerListener.hpp>
#include <com/sun/star/report/XReportDefinition.hpp>
#include <memory>
namespace rptui
{
class OXUndoEnvironmentImpl;
//========================================================================
class REPORTDESIGN_DLLPUBLIC OXUndoEnvironment
: public ::cppu::WeakImplHelper3< ::com::sun::star::beans::XPropertyChangeListener
, ::com::sun::star::container::XContainerListener
, ::com::sun::star::util::XModifyListener
>
, public SfxListener
{
const ::std::auto_ptr<OXUndoEnvironmentImpl> m_pImpl;
OXUndoEnvironment(const OXUndoEnvironment&);
OXUndoEnvironment& operator=(const OXUndoEnvironment&);
protected:
virtual ~OXUndoEnvironment();
public:
OXUndoEnvironment(OReportModel& _rModel);
class OUndoEnvLock
{
OXUndoEnvironment& m_rUndoEnv;
public:
OUndoEnvLock(OXUndoEnvironment& _rUndoEnv): m_rUndoEnv(_rUndoEnv){m_rUndoEnv.Lock();}
~OUndoEnvLock(){ m_rUndoEnv.UnLock(); }
};
void Lock();
void UnLock();
sal_Bool IsLocked() const;
// access control
struct Accessor { friend class OReportModel; private: Accessor() { } };
void Clear(const Accessor& _r);
void AddElement(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& Element);
void RemoveElement(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& Element);
void AddSection( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection);
void RemoveSection( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection );
/** removes the section from the page out of the undo env
*
* \param _pPage
*/
void RemoveSection(OReportPage* _pPage);
// readonly-ness
void SetReadOnly( sal_Bool bRead, const Accessor& );
sal_Bool IsReadOnly() const;
protected:
// XEventListener
virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException );
// XPropertyChangeListener
virtual void SAL_CALL propertyChange(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
// XContainerListener
virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
// XModifyListener
virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
void ModeChanged();
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
private:
void TogglePropertyListening(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& Element);
void implSetModified();
void switchListening( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& _rxContainer, bool _bStartListening ) SAL_THROW(());
void switchListening( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxObject, bool _bStartListening ) SAL_THROW(());
::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::container::XChild> >::const_iterator
getSection(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XChild>& _xContainer) const;
};
}
#endif //

51
reportdesign/inc/dllapi.h Normal file
View File

@@ -0,0 +1,51 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: dllapi.h,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef INCLUDED_DLLAPI_H
#define INCLUDED_DLLAPI_H
#ifndef _SAL_TYPES_H_
#include "sal/types.h"
#endif
#if defined(REPORTDESIGN_DLLIMPLEMENTATION)
#define REPORTDESIGN_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
#else
#define REPORTDESIGN_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
#endif
#define REPORTDESIGN_DLLPRIVATE SAL_DLLPRIVATE
#endif /* INCLUDED_DLLAPI_H */

View File

@@ -0,0 +1,131 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: helpids.hrc,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
#define RTPUI_REPORTDESIGN_HELPID_HRC
#ifndef _SOLAR_HRC
#include <svtools/solar.hrc> // HID_DBACCESS_START
#endif
#define UID_RPT_APP_VIEW (HID_RPT_START + 0)
#define UID_SCROLLWINDOW (HID_RPT_START + 1)
#define UID_REPORTWINDOW (HID_RPT_START + 2)
#define HID_HORZ_RULER (HID_RPT_START + 3)
#define UID_SECTIONSWINDOW (HID_RPT_START + 4)
#define UID_VIEWSWINDOW (HID_RPT_START + 5)
#define HID_ENDMARKER (HID_RPT_START + 6)
#define HID_SPLITTER (HID_RPT_START + 7)
#define HID_REPORTSECTION (HID_RPT_START + 8)
#define HID_HORZ_SCROLLBAR (HID_RPT_START + 9)
#define HID_VERT_SCROLLBAR (HID_RPT_START + 10)
#define HID_STARTMARKER (HID_RPT_START + 11)
#define HID_FIELDEXPRESSION (HID_RPT_START + 12)
#define HID_SORTORDER (HID_RPT_START + 13)
#define HID_GROUPSBRW (HID_RPT_START + 14)
#define HID_GROUPSSORTING_DLG (HID_RPT_START + 15)
#define HID_PAGENUMBERS_DLG (HID_RPT_START + 16)
#define HID_DATETIME_DLG (HID_RPT_START + 17)
#define HID_CONDFORMAT_DLG (HID_RPT_START + 18)
#define HID_CONDFORMAT_TB (HID_RPT_START + 19)
#define HID_CRTL_FORMAT_PREVIEW (HID_RPT_START + 20)
#define HID_COND_DLG (HID_RPT_START + 21)
#define HID_RPT_POPUP_COLOR_CTRL (HID_RPT_START + 22)
#define HID_RPT_POPUP_COLOR (HID_RPT_START + 23)
#define HID_FIELD_SEL (HID_RPT_START + 24)
#define HID_FIELD_SEL_WIN (HID_RPT_START + 25)
#define HID_PROPDLG_TAB_GENERAL (HID_RPT_START + 26)
#define HID_PROPDLG_TAB_DATA (HID_RPT_START + 27)
#define HID_PROP_FORCENEWPAGE (HID_RPT_START + 28)
#define HID_PROP_NEWROWORCOL (HID_RPT_START + 29)
#define HID_PROP_KEEPTOGETHER (HID_RPT_START + 30)
#define HID_PROP_CANGROW (HID_RPT_START + 31)
#define HID_PROP_CANSHRINK (HID_RPT_START + 32)
#define HID_PROP_REPEATSECTION (HID_RPT_START + 33)
// free
// free
// free
// free
// free
// free
// free
// free
// free
// free
#define HID_PROP_PRINTREPEATEDVALUES (HID_RPT_START + 44)
#define HID_PROP_CONDITIONALPRINTEXPRESSION (HID_RPT_START + 45)
// free
#define HID_PROP_STARTNEWCOLUMN (HID_RPT_START + 47)
#define HID_PROP_STARTNEWPAGE (HID_RPT_START + 48)
#define HID_PROP_RESETPAGENUMBER (HID_RPT_START + 49)
// free
#define HID_PROP_MINHEIGHTNEWPAGE (HID_RPT_START + 51)
#define HID_PROP_PRINTWHENGROUPCHANGE (HID_RPT_START + 52)
// free
// free
#define HID_PROP_VISIBLE (HID_RPT_START + 55)
#define HID_PROP_GROUPKEEPTOGETHER (HID_RPT_START + 56)
#define HID_PROP_PAGEHEADEROPTION (HID_RPT_START + 57)
#define HID_PROP_PAGEFOOTEROPTION (HID_RPT_START + 58)
#define UID_PROP_DLG_LINE_STYLE (HID_RPT_START + 59)
// free
#define HID_PROP_DATAFIELD (HID_RPT_START + 61)
#define HID_PROP_BACKCOLOR (HID_RPT_START + 62)
#define HID_PROP_RPT_POSITIONX (HID_RPT_START + 63)
#define HID_PROP_RPT_POSITIONY (HID_RPT_START + 64)
#define HID_PROP_RPT_WIDTH (HID_RPT_START + 65)
#define HID_PROP_RPT_HEIGHT (HID_RPT_START + 66)
#define HID_START_TITLE (HID_RPT_START + 67)
#define HID_START_IMAGE (HID_RPT_START + 68)
#define HID_PROP_DEEPTRAVERSING (HID_RPT_START + 69)
#define HID_PROP_PREEVALUATED (HID_RPT_START + 70)
#define HID_NAVIGATOR_DLG (HID_RPT_START + 71)
#define HID_REPORT_NAVIGATOR_TREE (HID_RPT_START + 72)
#define HID_PROP_FORMULA (HID_RPT_START + 73)
#define HID_PROP_INITIALFORMULA (HID_RPT_START + 74)
#define HID_PROP_RPT_FONT (HID_RPT_START + 75)
#define UID_RPT_PROP_DLG_FONT_TYPE (HID_RPT_START + 76)
#define HID_PROP_PRESERVEIRI (HID_RPT_START + 77)
#define HID_PROP_BACKTRANSPARENT (HID_RPT_START + 78)
#define HID_PROP_CONTROLBACKGROUNDTRANSPARENT (HID_RPT_START + 79)
#if HID_PROP_CONTROLBACKGROUNDTRANSPARENT > HID_RPT_END
#error Help-Id Ueberlauf in #file, #line
#endif
// don't forget to update the file util/hidother.src
#endif //RTPUI_REPORTDESIGN_HELPID_HRC

View File

@@ -0,0 +1,55 @@
#*************************************************************************
#
# OpenOffice.org - a multi-platform office productivity suite
#
# $RCSfile: makefile.mk,v $
#
# $Revision: 1.2 $
#
# last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
#
# The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1.
#
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2005 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
#
#*************************************************************************
PRJ=..
PRJNAME=reportdesign
TARGET=inc
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
# --- Files --------------------------------------------------------
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
.IF "$(ENABLE_PCH)"!=""
ALLTAR : \
$(SLO)$/precompiled.pch \
$(SLO)$/precompiled_ex.pch
.ENDIF # "$(ENABLE_PCH)"!=""

View File

@@ -0,0 +1,37 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: precompiled_reportdesign.cxx,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#include "precompiled_reportdesign.hxx"

View File

@@ -0,0 +1,40 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: precompiled_reportdesign.hxx,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
// MARKER(update_precomp.py): Generated on 2006-09-01 17:49:38.561560
#ifdef PRECOMPILED_HEADERS
#endif

View File

@@ -0,0 +1,210 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: rptui_slotid.hrc,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
#ifndef _RPTUI_SLOTID_HRC_
#define _RPTUI_SLOTID_HRC_
#include <svx/svxids.hrc>
#define SID_PAGEHEADERFOOTER ( SID_RPTUI_START + 0 )
#define SID_REPORTHEADERFOOTER ( SID_RPTUI_START + 1 )
#define SID_SORTINGANDGROUPING ( SID_RPTUI_START + 2 )
#define SID_INSERT_FLD_PGNUMBER ( SID_RPTUI_START + 3 )
#define SID_CONDITIONALFORMATTING ( SID_RPTUI_START + 4 )
#define SID_PAGEDIALOG ( SID_RPTUI_START + 5 )
#define SID_SETCONTROLDEFAULTS ( SID_RPTUI_START + 6 )
#define SID_INSERTBREAK ( SID_RPTUI_START + 7 )
#define SID_PAGEHEADER_WITHOUT_UNDO ( SID_RPTUI_START + 8 )
#define SID_PAGEFOOTER_WITHOUT_UNDO ( SID_RPTUI_START + 9 )
#define SID_REPORTHEADER_WITHOUT_UNDO ( SID_RPTUI_START + 10 )
#define SID_REPORTFOOTER_WITHOUT_UNDO ( SID_RPTUI_START + 11 )
#define SID_SELECT_REPORT ( SID_RPTUI_START + 12 )
#define SID_GROUPHEADER_WITHOUT_UNDO ( SID_RPTUI_START + 13 )
#define SID_GROUPHEADER ( SID_RPTUI_START + 14 )
#define SID_GROUPFOOTER_WITHOUT_UNDO ( SID_RPTUI_START + 15 )
#define SID_GROUPFOOTER ( SID_RPTUI_START + 16 )
#define SID_GROUP_REMOVE ( SID_RPTUI_START + 17 )
#define SID_GROUP_APPEND ( SID_RPTUI_START + 18 )
#define SID_EXECUTE_REPORT ( SID_RPTUI_START + 19 )
#define SID_DATETIME ( SID_RPTUI_START + 20 )
#define SID_ESCAPE ( SID_RPTUI_START + 21 )
#define SID_ADD_CONTROL_PAIR ( SID_RPTUI_START + 22 )
#define SID_SPLIT_POSITION ( SID_RPTUI_START + 23 )
#define SID_PROPERTYBROWSER_LAST_PAGE ( SID_RPTUI_START + 24 )
// free
#define SID_DRAWTBX_CS_BASIC1 ( SID_RPTUI_START + 26 )
#define SID_DRAWTBX_CS_BASIC2 ( SID_RPTUI_START + 27 )
#define SID_DRAWTBX_CS_BASIC3 ( SID_RPTUI_START + 28 )
#define SID_DRAWTBX_CS_BASIC4 ( SID_RPTUI_START + 29 )
#define SID_DRAWTBX_CS_BASIC5 ( SID_RPTUI_START + 30 )
#define SID_DRAWTBX_CS_BASIC6 ( SID_RPTUI_START + 31 )
#define SID_DRAWTBX_CS_BASIC7 ( SID_RPTUI_START + 32 )
#define SID_DRAWTBX_CS_BASIC8 ( SID_RPTUI_START + 33 )
#define SID_DRAWTBX_CS_BASIC9 ( SID_RPTUI_START + 34 )
#define SID_DRAWTBX_CS_BASIC10 ( SID_RPTUI_START + 35 )
#define SID_DRAWTBX_CS_BASIC11 ( SID_RPTUI_START + 36 )
#define SID_DRAWTBX_CS_BASIC12 ( SID_RPTUI_START + 37 )
#define SID_DRAWTBX_CS_BASIC13 ( SID_RPTUI_START + 38 )
#define SID_DRAWTBX_CS_BASIC14 ( SID_RPTUI_START + 39 )
#define SID_DRAWTBX_CS_BASIC15 ( SID_RPTUI_START + 40 )
#define SID_DRAWTBX_CS_BASIC16 ( SID_RPTUI_START + 41 )
#define SID_DRAWTBX_CS_BASIC17 ( SID_RPTUI_START + 42 )
#define SID_DRAWTBX_CS_BASIC18 ( SID_RPTUI_START + 43 )
#define SID_DRAWTBX_CS_BASIC19 ( SID_RPTUI_START + 44 )
#define SID_DRAWTBX_CS_BASIC20 ( SID_RPTUI_START + 45 )
#define SID_DRAWTBX_CS_BASIC21 ( SID_RPTUI_START + 46 )
#define SID_DRAWTBX_CS_BASIC22 ( SID_RPTUI_START + 47 )
#define SID_DRAWTBX_CS_SYMBOL1 ( SID_RPTUI_START + 48 )
#define SID_DRAWTBX_CS_SYMBOL2 ( SID_RPTUI_START + 49 )
#define SID_DRAWTBX_CS_SYMBOL3 ( SID_RPTUI_START + 50 )
#define SID_DRAWTBX_CS_SYMBOL4 ( SID_RPTUI_START + 51 )
#define SID_DRAWTBX_CS_SYMBOL5 ( SID_RPTUI_START + 52 )
#define SID_DRAWTBX_CS_SYMBOL6 ( SID_RPTUI_START + 53 )
#define SID_DRAWTBX_CS_SYMBOL7 ( SID_RPTUI_START + 54 )
#define SID_DRAWTBX_CS_SYMBOL8 ( SID_RPTUI_START + 55 )
#define SID_DRAWTBX_CS_SYMBOL9 ( SID_RPTUI_START + 56 )
#define SID_DRAWTBX_CS_SYMBOL10 ( SID_RPTUI_START + 57 )
#define SID_DRAWTBX_CS_SYMBOL11 ( SID_RPTUI_START + 58 )
#define SID_DRAWTBX_CS_SYMBOL12 ( SID_RPTUI_START + 59 )
#define SID_DRAWTBX_CS_SYMBOL13 ( SID_RPTUI_START + 60 )
#define SID_DRAWTBX_CS_SYMBOL14 ( SID_RPTUI_START + 61 )
#define SID_DRAWTBX_CS_SYMBOL15 ( SID_RPTUI_START + 62 )
#define SID_DRAWTBX_CS_SYMBOL16 ( SID_RPTUI_START + 63 )
#define SID_DRAWTBX_CS_SYMBOL17 ( SID_RPTUI_START + 64 )
#define SID_DRAWTBX_CS_SYMBOL18 ( SID_RPTUI_START + 65 )
#define SID_DRAWTBX_CS_ARROW1 ( SID_RPTUI_START + 66 )
#define SID_DRAWTBX_CS_ARROW2 ( SID_RPTUI_START + 67 )
#define SID_DRAWTBX_CS_ARROW3 ( SID_RPTUI_START + 68 )
#define SID_DRAWTBX_CS_ARROW4 ( SID_RPTUI_START + 69 )
#define SID_DRAWTBX_CS_ARROW5 ( SID_RPTUI_START + 70 )
#define SID_DRAWTBX_CS_ARROW6 ( SID_RPTUI_START + 71 )
#define SID_DRAWTBX_CS_ARROW7 ( SID_RPTUI_START + 72 )
#define SID_DRAWTBX_CS_ARROW8 ( SID_RPTUI_START + 73 )
#define SID_DRAWTBX_CS_ARROW9 ( SID_RPTUI_START + 74 )
#define SID_DRAWTBX_CS_ARROW10 ( SID_RPTUI_START + 75 )
#define SID_DRAWTBX_CS_ARROW11 ( SID_RPTUI_START + 76 )
#define SID_DRAWTBX_CS_ARROW12 ( SID_RPTUI_START + 77 )
#define SID_DRAWTBX_CS_ARROW13 ( SID_RPTUI_START + 78 )
#define SID_DRAWTBX_CS_ARROW14 ( SID_RPTUI_START + 79 )
#define SID_DRAWTBX_CS_ARROW15 ( SID_RPTUI_START + 80 )
#define SID_DRAWTBX_CS_ARROW16 ( SID_RPTUI_START + 81 )
#define SID_DRAWTBX_CS_ARROW17 ( SID_RPTUI_START + 82 )
#define SID_DRAWTBX_CS_ARROW18 ( SID_RPTUI_START + 83 )
#define SID_DRAWTBX_CS_ARROW19 ( SID_RPTUI_START + 84 )
#define SID_DRAWTBX_CS_ARROW20 ( SID_RPTUI_START + 85 )
#define SID_DRAWTBX_CS_ARROW21 ( SID_RPTUI_START + 86 )
#define SID_DRAWTBX_CS_ARROW22 ( SID_RPTUI_START + 87 )
#define SID_DRAWTBX_CS_ARROW23 ( SID_RPTUI_START + 88 )
#define SID_DRAWTBX_CS_ARROW24 ( SID_RPTUI_START + 89 )
#define SID_DRAWTBX_CS_ARROW25 ( SID_RPTUI_START + 90 )
#define SID_DRAWTBX_CS_ARROW26 ( SID_RPTUI_START + 91 )
#define SID_DRAWTBX_CS_STAR1 ( SID_RPTUI_START + 92 )
#define SID_DRAWTBX_CS_STAR2 ( SID_RPTUI_START + 93 )
#define SID_DRAWTBX_CS_STAR3 ( SID_RPTUI_START + 94 )
#define SID_DRAWTBX_CS_STAR4 ( SID_RPTUI_START + 95 )
#define SID_DRAWTBX_CS_STAR5 ( SID_RPTUI_START + 96 )
#define SID_DRAWTBX_CS_STAR6 ( SID_RPTUI_START + 97 )
#define SID_DRAWTBX_CS_STAR7 ( SID_RPTUI_START + 98 )
#define SID_DRAWTBX_CS_STAR8 ( SID_RPTUI_START + 99 )
#define SID_DRAWTBX_CS_STAR9 ( SID_RPTUI_START + 100 )
#define SID_DRAWTBX_CS_STAR10 ( SID_RPTUI_START + 101 )
#define SID_DRAWTBX_CS_STAR11 ( SID_RPTUI_START + 102 )
#define SID_DRAWTBX_CS_STAR12 ( SID_RPTUI_START + 103 )
#define SID_DRAWTBX_CS_FLOWCHART1 ( SID_RPTUI_START + 104 )
#define SID_DRAWTBX_CS_FLOWCHART2 ( SID_RPTUI_START + 105 )
#define SID_DRAWTBX_CS_FLOWCHART3 ( SID_RPTUI_START + 106 )
#define SID_DRAWTBX_CS_FLOWCHART4 ( SID_RPTUI_START + 107 )
#define SID_DRAWTBX_CS_FLOWCHART5 ( SID_RPTUI_START + 108 )
#define SID_DRAWTBX_CS_FLOWCHART6 ( SID_RPTUI_START + 109 )
#define SID_DRAWTBX_CS_FLOWCHART7 ( SID_RPTUI_START + 110 )
#define SID_DRAWTBX_CS_FLOWCHART8 ( SID_RPTUI_START + 111 )
#define SID_DRAWTBX_CS_FLOWCHART9 ( SID_RPTUI_START + 112 )
#define SID_DRAWTBX_CS_FLOWCHART10 ( SID_RPTUI_START + 113 )
#define SID_DRAWTBX_CS_FLOWCHART11 ( SID_RPTUI_START + 114 )
#define SID_DRAWTBX_CS_FLOWCHART12 ( SID_RPTUI_START + 115 )
#define SID_DRAWTBX_CS_FLOWCHART13 ( SID_RPTUI_START + 116 )
#define SID_DRAWTBX_CS_FLOWCHART14 ( SID_RPTUI_START + 117 )
#define SID_DRAWTBX_CS_FLOWCHART15 ( SID_RPTUI_START + 118 )
#define SID_DRAWTBX_CS_FLOWCHART16 ( SID_RPTUI_START + 119 )
#define SID_DRAWTBX_CS_FLOWCHART17 ( SID_RPTUI_START + 120 )
#define SID_DRAWTBX_CS_FLOWCHART18 ( SID_RPTUI_START + 121 )
#define SID_DRAWTBX_CS_FLOWCHART19 ( SID_RPTUI_START + 122 )
#define SID_DRAWTBX_CS_FLOWCHART20 ( SID_RPTUI_START + 123 )
#define SID_DRAWTBX_CS_FLOWCHART21 ( SID_RPTUI_START + 124 )
#define SID_DRAWTBX_CS_FLOWCHART22 ( SID_RPTUI_START + 125 )
#define SID_DRAWTBX_CS_FLOWCHART23 ( SID_RPTUI_START + 126 )
#define SID_DRAWTBX_CS_FLOWCHART24 ( SID_RPTUI_START + 127 )
#define SID_DRAWTBX_CS_FLOWCHART25 ( SID_RPTUI_START + 128 )
#define SID_DRAWTBX_CS_FLOWCHART26 ( SID_RPTUI_START + 129 )
#define SID_DRAWTBX_CS_FLOWCHART27 ( SID_RPTUI_START + 130 )
#define SID_DRAWTBX_CS_FLOWCHART28 ( SID_RPTUI_START + 131 )
#define SID_DRAWTBX_CS_CALLOUT1 ( SID_RPTUI_START + 132 )
#define SID_DRAWTBX_CS_CALLOUT2 ( SID_RPTUI_START + 133 )
#define SID_DRAWTBX_CS_CALLOUT3 ( SID_RPTUI_START + 134 )
#define SID_DRAWTBX_CS_CALLOUT4 ( SID_RPTUI_START + 135 )
#define SID_DRAWTBX_CS_CALLOUT5 ( SID_RPTUI_START + 136 )
#define SID_DRAWTBX_CS_CALLOUT6 ( SID_RPTUI_START + 137 )
#define SID_DRAWTBX_CS_CALLOUT7 ( SID_RPTUI_START + 138 )
#define SID_RPT_TEXTDOCUMENT ( SID_RPTUI_START + 139 )
#define SID_RPT_SPREADSHEET ( SID_RPTUI_START + 140 )
#define SID_RPT_SHOWREPORTEXPLORER ( SID_RPTUI_START + 141 )
#define SID_RPT_NEW_FUNCTION ( SID_RPTUI_START + 142 )
#define SID_OBJECT_SMALLESTWIDTH ( SID_RPTUI_START + 143 )
#define SID_OBJECT_SMALLESTHEIGHT ( SID_RPTUI_START + 144 )
#define SID_OBJECT_GREATESTWIDTH ( SID_RPTUI_START + 145 )
#define SID_OBJECT_GREATESTHEIGHT ( SID_RPTUI_START + 146 )
#define SID_OBJECT_RESIZING ( SID_RPTUI_START + 147 )
#define SID_ARRANGEMENU ( SID_RPTUI_START + 148 )
#define SID_SELECTALL_IN_SECTION ( SID_RPTUI_START + 149 )
#define SID_ICON_GROUP ( SID_RPTUI_START + 150 )
#define SID_ICON_DETAIL ( SID_RPTUI_START + 151 )
#define SID_SECTION_ALIGN ( SID_RPTUI_START + 152 )
#define SID_SECTION_ALIGN_LEFT ( SID_RPTUI_START + 153 )
#define SID_SECTION_ALIGN_CENTER ( SID_RPTUI_START + 154 )
#define SID_SECTION_ALIGN_RIGHT ( SID_RPTUI_START + 155 )
#define SID_SECTION_ALIGN_UP ( SID_RPTUI_START + 156 )
#define SID_SECTION_ALIGN_MIDDLE ( SID_RPTUI_START + 157 )
#define SID_SECTION_ALIGN_DOWN ( SID_RPTUI_START + 158 )
#define SID_NEXT_MARK ( SID_RPTUI_START + 159 )
#define SID_PREV_MARK ( SID_RPTUI_START + 160 )
#endif // _RPTUI_SLOTID_HRC_

View File

@@ -0,0 +1,54 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: DataRow.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
/**
* This feeds data into the reporting engine, in case the data has been provided
* by the caller. The methods are a mix of TableModel methods and methods borrowed
* from the java.sql.ResultSet interface.
*
* The column and row index starts at 1 (as it is done in JDBC).
*
* @author Thomas Morgner
*/
public interface DataRow
{
public int getColumnCount() throws DataSourceException;
public String getColumnName(int column) throws DataSourceException;
public Object getObject (int column) throws DataSourceException;
}

View File

@@ -0,0 +1,54 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: DataSource.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
/**
* This feeds data into the reporting engine, in case the data has been provided
* by the caller. The methods are a mix of TableModel methods and methods borrowed
* from the java.sql.ResultSet interface.
*
* The column and row index starts at 1 (as it is done in JDBC).
*
* @author Thomas Morgner
*/
public interface DataSource extends DataRow
{
public int getRowCount() throws DataSourceException;
public boolean absolute (int row) throws DataSourceException;
public boolean next() throws DataSourceException;
public void close() throws DataSourceException;
}

View File

@@ -0,0 +1,105 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: DataSourceException.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
import java.security.PrivilegedActionException;
/**
* A general exception to indicate that there was an error while accessing the
* datasource.
*
* @author Thomas Morgner
*/
public class DataSourceException extends Exception
{
/**
* Constructs a new exception with <code>null</code> as its detail message.
* The cause is not initialized, and may subsequently be initialized by a call
* to {@link #initCause}.
*/
public DataSourceException()
{
super();
}
/**
* Constructs a new exception with the specified detail message. The cause is
* not initialized, and may subsequently be initialized by a call to {@link
* #initCause}.
*
* @param message the detail message. The detail message is saved for later
* retrieval by the {@link #getMessage()} method.
*/
public DataSourceException(String message)
{
super(message);
}
/**
* Constructs a new exception with the specified detail message and cause.
* <p>Note that the detail message associated with <code>cause</code> is
* <i>not</i> automatically incorporated in this exception's detail message.
*
* @param message the detail message (which is saved for later retrieval by
* the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the {@link
* #getCause()} method). (A <tt>null</tt> value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.4
*/
public DataSourceException(String message, Throwable cause)
{
super(message, cause);
}
/**
* Constructs a new exception with the specified cause and a detail message of
* <tt>(cause==null ? null : cause.toString())</tt> (which typically contains
* the class and detail message of <tt>cause</tt>). This constructor is useful
* for exceptions that are little more than wrappers for other throwables (for
* example, {@link PrivilegedActionException}).
*
* @param cause the cause (which is saved for later retrieval by the {@link
* #getCause()} method). (A <tt>null</tt> value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.4
*/
public DataSourceException(Throwable cause)
{
super(cause);
}
}

View File

@@ -0,0 +1,52 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: DataSourceFactory.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
import java.util.Map;
/**
* Allows to query the data repository and returns a datasource for the
* specified name and parameters. The parameters-map can be null, if there
* are no parameters required.
*
* @author Thomas Morgner
*/
public interface DataSourceFactory
{
public DataSource queryData(String name, Map parameter)
throws DataSourceException;
}

View File

@@ -0,0 +1,67 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ImageService.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
package com.sun.star.report;
import java.io.InputStream;
import java.awt.Dimension;
/**
*
* @author oj93728
*/
public interface ImageService {
/**
* @return the mime-type of the image as string.
*/
public String getMimeType(final InputStream image) throws ReportExecutionException;
/**
* @return the mime-type of the image as string.
*/
public String getMimeType(final byte[] image) throws ReportExecutionException;
/**
* @returns the dimension in 100th mm.
**/
public Dimension getImageSize(final InputStream image) throws ReportExecutionException;
/**
* @returns the dimension in 100th mm.
**/
public Dimension getImageSize(final byte[] image) throws ReportExecutionException;
}

View File

@@ -0,0 +1,81 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: InputRepository.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
import java.io.InputStream;
import java.io.IOException;
/**
* This allows the job processor to load data from a repository. It is assumed,
* that all resource names are given as strings and furthermore, that the names
* identify a resource uniquely within the input repository.
*
* An input repository connects the report processing to the xml definitions.
* Unless defined otherwise, it is assumed, that the input-name is 'content.xml';
* possible other files are 'settings.xml' and 'styles.xml' (see the Oasis standard
* for details on these files and their contents).
*
* @author Thomas Morgner
*/
public interface InputRepository
{
/**
* Returns a unique identifier for this repository. Two repositories accessing
* the same location should return the same id. The identifier must never
* be null.
*
* @return the repository id
*/
public Object getId();
public InputStream createInputStream(String name) throws IOException;
/**
* This returns an version number for the given resource. Return zero, if
* the resource is not versionable, else return a unique number for each version.
* As rule of thumb: Increase the version number by at least one for each change
* made to the resource.
*
* @param name the name of the resource
* @return the version number
*/
public long getVersion (String name);
public boolean exists (String name);
public boolean isReadable (String name);
}

View File

@@ -0,0 +1,73 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: JobDefinitionException.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
/**
* Creation-Date: 05.02.2006, 17:36:33
*
* @author Thomas Morgner
*/
public class JobDefinitionException extends RuntimeException
{
/**
* Creates a StackableRuntimeException with no message and no parent.
*/
public JobDefinitionException ()
{
}
/**
* Creates an exception.
*
* @param message the exception message.
*/
public JobDefinitionException (final String message)
{
super(message);
}
/**
* Creates an exception.
*
* @param message the exception message.
* @param ex the parent exception.
*/
public JobDefinitionException (final String message, final Exception ex)
{
super(message, ex);
}
}

View File

@@ -0,0 +1,87 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: JobProgressIndicator.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
/**
* Based on
* http://api.openoffice.org/docs/common/ref/com/sun/star/task/XStatusIndicator.html
*
* @author Thomas Morgner
*/
public interface JobProgressIndicator
{
/**
* Updates the progress description.
*
* @param string the new description
*/
public void setText(String string);
/**
* Initializes the progress indicator and sets the progress description to
* the text given in the parameter <code>text</code>. The progress values
* passed to this indicator will not exceed the given <code>maxValue</code>.
* The value range of this indicator is set to 0 to <code>maxValue</code>
* Stopped indicators must ignore that call.
*
* @param string the progress description
* @param maxValue the maximum value
* @see JobProgressIndicator#setText(String)
*/
public void start(String text, int maxValue);
/**
* Updates the value to the specified value. Invalid values must be ignored.
* Stopped indicators must ignore that call.
*
* @param value the new value that should be shown now. This must fit the
* range [0..maxValue] as defined in {@link JobProgressIndicator#start(String, int)}.
*/
public void setValue(int value);
/**
* Stop the progress. A progress indicator cannot be destructed before end()
* has been called.
*/
public void end();
/**
* Clear progress value and description. Calling of setValue(0) and
* setText("") should do the same. Stopped indicators must ignore this call.
*/
public void reset();
}

View File

@@ -0,0 +1,54 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: JobProperties.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
public interface JobProperties
{
public void setProperty (String key, Object value)
throws JobDefinitionException;
public Object getProperty (String key);
/**
* A type safe clone operation. We derive a copy of all properties,
* so that changes to the original job properties collection does not
* affect the copy.
*
* @return a copy.
*/
public JobProperties copy();
}

View File

@@ -0,0 +1,67 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OutputRepository.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
import java.io.OutputStream;
import java.io.IOException;
/**
* A repository for writing. Providing a repository always assumes,
* that more than one stream can be written.
*
* @author Thomas Morgner
*/
public interface OutputRepository
{
/**
* Creates an output stream for writing the data. If there is an entry with
* that name already contained in the repository, try to overwrite it.
*
* @param name
* the name of the output stream
* @param mimeType
* the mime type of the to-be-created output stream. Repository implementations which do not support
* associating a mime time with a stream might ignore this parameter.
* @return the outputstream
* @throws IOException if opening the stream fails
*/
public OutputStream createOutputStream (String name, String mimeType) throws IOException;
public boolean exists (String name);
public boolean isWritable (String name);
}

View File

@@ -0,0 +1,79 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ParameterMap.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
public interface ParameterMap
{
/**
* Adds a property to this properties collection. If a property with the given name
* exist, the property will be replaced with the new value. If the value is null, the
* property will be removed.
*
* @param key the property key.
* @param value the property value.
*/
public void put (final String key, final Object value);
/**
* Retrieves the value stored for a key in this properties collection.
*
* @param key the property key.
* @return The stored value, or <code>null</code> if the key does not exist in this
* collection.
*/
public Object get (final String key);
/**
* Retrieves the value stored for a key in this properties collection, and returning the
* default value if the key was not stored in this properties collection.
*
* @param key the property key.
* @param defaultValue the default value to be returned when the key is not stored in
* this properties collection.
* @return The stored value, or the default value if the key does not exist in this
* collection.
*/
public Object get (final String key, final Object defaultValue);
public String[] keys ();
public void clear ();
public int size();
}

View File

@@ -0,0 +1,53 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ReportAddIn.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
/**
* A report add-in defines a set of expressions, which can
* be used in the reporting.
*
* Each expression must provide meta-data to support GUI implementors.
* Expressions are assumed to be statefull, if they are not, they are
* free to be implemented as stateless expression.
*/
public interface ReportAddIn
{
public int getExpressionCount();
public ReportExpression createExpression(int expression);
public ReportExpressionMetaData getMetaData (int expression);
}

View File

@@ -0,0 +1,64 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ReportEngine.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
/**
* The job factory collects all required properties to build a reportJob
* object. Implementors should define a suitable set of properties to allow
* the configuration of the created report jobs.
*
* How these properties are collected is beyond the scope of this interface.
* For each type of Job, there should be separate job-factory (remote jobs
* vs. local jobs etc).
*
* @author Thomas Morgner
*/
public interface ReportEngine
{
public ReportJobDefinition createJobDefinition();
public ReportEngineMetaData getMetaData();
/**
* Open points: How to define scheduling?
*
* @return the report job definition for the job description.
* @throws JobDefinitionException
*/
public ReportJob createJob(ReportJobDefinition definition)
throws JobDefinitionException;
}

View File

@@ -0,0 +1,68 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ReportEngineMetaData.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
public interface ReportEngineMetaData
{
/**
* Checks, whether a certain output type is available.
* Feed the mime-type of the output type in and you'll get
* a true or false back.
*
* @param mimeType
* @return true, if the output type is supported; false otherwise.
*/
public boolean isOutputSupported(String mimeType);
/**
* Lists all supported output parameters for the given mime-type.
* This listing can be used to build a generic user interface for
* configuring a certain output.
*
* @param mimeType
* @return
*/
public String[] getOutputParameters (String mimeType);
public Class getParameterType (String parameter);
public boolean isMandatory(String parameter);
public boolean isEnumeration(String parameter);
public Object[] getEnumerationValues (String parameter);
}

View File

@@ -0,0 +1,58 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ReportEngineParameterNames.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
/**
* Making this enumeration typesafe and fully defined here would
* be nice, wouldn't it?
*/
public class ReportEngineParameterNames
{
public static final String CONTENT_TYPE = "content-type";
public static final String INPUT_NAME= "input.name";
public static final String INPUT_REPOSITORY = "input.repository";
public static final String OUTPUT_NAME= "output.name";
public static final String OUTPUT_REPOSITORY = "output.repository";
public static final String INPUT_DATASOURCE_FACTORY = "input.datasource-factory";
public static final String IMAGE_SERVICE = "ImageService";
public static final String MIMETYPE = "output.mimetype";
private ReportEngineParameterNames ()
{
}
}

View File

@@ -0,0 +1,96 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ReportExecutionException.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
public class ReportExecutionException extends Exception
{
/**
* Constructs a new exception with <code>null</code> as its detail message. The cause is
* not initialized, and may subsequently be initialized by a call to {@link
* #initCause}.
*/
public ReportExecutionException ()
{
}
/**
* Constructs a new exception with the specified cause and a detail message of
* <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class
* and detail message of <tt>cause</tt>). This constructor is useful for exceptions that
* are little more than wrappers for other throwables (for example, {@link
* java.security.PrivilegedActionException}).
*
* @param cause the cause (which is saved for later retrieval by the {@link #getCause()}
* method). (A <tt>null</tt> value is permitted, and indicates that the
* cause is nonexistent or unknown.)
* @since 1.4
*/
public ReportExecutionException (Throwable cause)
{
super(cause);
}
/**
* Constructs a new exception with the specified detail message. The cause is not
* initialized, and may subsequently be initialized by a call to {@link #initCause}.
*
* @param message the detail message. The detail message is saved for later retrieval by
* the {@link #getMessage()} method.
*/
public ReportExecutionException (String message)
{
super(message);
}
/**
* Constructs a new exception with the specified detail message and cause. <p>Note that
* the detail message associated with <code>cause</code> is <i>not</i> automatically
* incorporated in this exception's detail message.
*
* @param message the detail message (which is saved for later retrieval by the {@link
* #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the {@link
* #getCause()} method). (A <tt>null</tt> value is permitted, and
* indicates that the cause is nonexistent or unknown.)
* @since 1.4
*/
public ReportExecutionException (String message, Throwable cause)
{
super(message, cause);
}
}

View File

@@ -0,0 +1,60 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ReportExpression.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
/**
* Expressions are simple computation components.
*
* Expressions are always assumed to be immutable. They are not allowed to
* change their state and it is not guaranteed, in which order they get called.
* If the expression has been called before, the last computed value will be
* available from the datarow.
*
* This construct allows us to write expressions in the form
* "Sum := Sum + Column".
*
* Multiple calls to getValue on the same expression instance must return the
* same value (assuming that the datarow passed in is the same).
*/
public interface ReportExpression
{
public void setParameters (Object[] parameters);
public Object getParameters ();
public Object getValue(DataRow row);
}

View File

@@ -0,0 +1,53 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ReportExpressionMetaData.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
import java.util.Locale;
public interface ReportExpressionMetaData
{
public int getParameterCount();
public String getParameterName(int param);
public String getParameterDisplayName(int param, Locale locale);
public String getParameterDescription(int param, Locale locale);
public String getName();
public String getDisplayName(Locale l);
public String getDescription(Locale l);
}

View File

@@ -0,0 +1,56 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ReportFunction.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
import java.util.Map;
/**
* Functions are statefull computation components.
*
* Functions are allowed to have a state, but are considered
* immutable (the same is true for expressions). Functions are
* allowed to update their state on every call to 'advance', which
* signals, that the cursor has been moved.
*
* Functions have no way to 'reset' their state, if a reset is needed,
* the report engine is urged to query a new instance from the ReportAddin.
*/
public interface ReportFunction extends ReportExpression
{
public ReportFunction advance(DataRow row);
}

View File

@@ -0,0 +1,97 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ReportJob.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
import java.io.IOException;
/**
* This allows some simple job control. A job can be interrupted (or if it has
* not yet been started, canceled), and the job status can be queried (scheduled,
* running, finished).
*
* <table border="1">
* <tr>
* <th>JobStatus</th><th>running</th><th>finished</th>
* </tr>
* <tr>
* <td>Scheduled</td><td>false</td><td>false</td>
* </tr>
* <tr>
* <td>Running</td><td>true</td><td>false</td>
* </tr>
* <tr>
* <td>Finished</td><td>false</td><td>true</td>
* </tr>
* </table>
*
* @author Thomas Morgner
*/
public interface ReportJob
{
/**
* Although we might want to run the job as soon as it has been
* created, sometimes it is wiser to let the user add some listeners
* first. If we execute at once, the user either has to deal with
* threading code or wont receive any progress information in single
* threaded environments.
*/
public void execute()
throws ReportExecutionException, IOException;
/**
* Interrupt the job.
*/
public void interrupt();
/**
* Queries the jobs execution status.
*
* @return true, if the job is currently running, false otherwise.
*/
public boolean isRunning();
/**
* Queries the jobs result status.
*
* @return true, if the job is finished (or has been interrupted), false
* if the job waits for activation.
*/
public boolean isFinished();
public void addProgressIndicator(JobProgressIndicator indicator);
public void removeProgressIndicator(JobProgressIndicator indicator);
}

View File

@@ -0,0 +1,66 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ReportJobDefinition.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report;
/**
* The report job is created by the report job factory and holds all properties
* required to complete the reporting task.
*
* @author Thomas Morgner
*/
public interface ReportJobDefinition
{
/**
* The parameters of the root report definition. The report parameters are using
* by the query factory to parametrize the query statement.
*
* The query parameters for the subreports are defined using mappings, it would not
* make sense to define them here.
*
* @return a map containing the report parameters
*/
public ParameterMap getQueryParameters ();
/**
* The report processing parameters control the behaviour of the report. There are
* several mandatory parameters, some optional and possibly some not-yet-understood
* parameters. Use the engine meta data to find out, which parameters are supported.
*
* @return the processing parameters
*/
public JobProperties getProcessingParameters ();
}

View File

@@ -0,0 +1,327 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: SDBCReportData.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
package com.sun.star.report;
import com.sun.star.beans.XPropertySet;
import com.sun.star.container.XIndexAccess;
import com.sun.star.sdb.XParametersSupplier;
import java.sql.Timestamp;
import com.sun.star.sdbc.DataType;
import com.sun.star.sdbc.SQLException;
import com.sun.star.sdbc.XResultSetMetaData;
import com.sun.star.sdbc.XResultSetMetaDataSupplier;
import com.sun.star.sdbc.XRow;
import com.sun.star.sdbc.XRowSet;
import com.sun.star.uno.Any;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.util.DateTime;
import com.sun.star.util.Time;
public class SDBCReportData implements DataSource
{
private XRowSet rowSet;
private XRow row;
private int rowCount;
private XIndexAccess parameters;
private int firstParameterIndex = -1;
private int columnCount;
private final String[] columnNames;
private final int[] columnTypes;
public SDBCReportData(final XRowSet rowSet) throws SQLException
{
row = (XRow) UnoRuntime.queryInterface(XRow.class, rowSet);
this.rowSet = rowSet;
XParametersSupplier xSuppParams = (XParametersSupplier)UnoRuntime.queryInterface(
XParametersSupplier.class, rowSet );
if ( xSuppParams != null )
parameters = xSuppParams.getParameters();
final XResultSetMetaDataSupplier sup = (XResultSetMetaDataSupplier) UnoRuntime.queryInterface(XResultSetMetaDataSupplier.class, rowSet);
final XResultSetMetaData resultSetMetaData = sup.getMetaData();
columnCount = resultSetMetaData.getColumnCount();
if ( parameters != null )
{
firstParameterIndex = columnCount + 1;
columnCount += parameters.getCount();
}
columnTypes = new int[columnCount];
columnNames = new String[columnCount];
for (int i = 1;i <= columnCount;++i)
{
if ( i < firstParameterIndex )
{
columnNames[i-1] = resultSetMetaData.getColumnName(i);
columnTypes[i-1] = resultSetMetaData.getColumnType(i);
}
else
{
try
{
XPropertySet paramColumn = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, parameters.getByIndex(i-firstParameterIndex) );
columnNames[i-1] = (String)paramColumn.getPropertyValue( "Name" );
columnTypes[i-1] = ((Integer)paramColumn.getPropertyValue( "Type" )).intValue();
}
catch( Exception e )
{
columnNames[i-1] = "Error";
columnTypes[i-1] = DataType.CHAR;
}
}
}
if (rowSet.last())
{
rowCount = rowSet.getRow();
rowSet.beforeFirst();
}
else
{
rowCount = 0;
}
}
public int getColumnCount() throws DataSourceException
{
return columnCount;
}
public int getRowCount()
{
return rowCount;
}
public String getColumnName(final int column) throws DataSourceException
{
return columnNames[column - 1];
}
public boolean absolute(final int row) throws DataSourceException
{
try
{
if (row == 0)
{
rowSet.beforeFirst();
return true;
}
return rowSet.absolute(row);
}
catch (SQLException e)
{
throw new DataSourceException(e.getMessage(), e);
}
}
public boolean next() throws DataSourceException
{
try
{
return rowSet.next();
}
catch (SQLException e)
{
throw new DataSourceException(e.getMessage(), e);
}
}
public void close() throws DataSourceException
{
}
// public int getCurrentRow() throws DataSourceException
// {
// try
// {
// return rowSet.getRow();
// }
// catch (SQLException e)
// {
// throw new DataSourceException(e.getMessage(), e);
// }
// }
static private java.sql.Date getDate(final Object obj)
{
java.sql.Date date = null;
if (obj != null && obj instanceof com.sun.star.util.Date)
{
final com.sun.star.util.Date unodate = (com.sun.star.util.Date) obj;
date = java.sql.Date.valueOf(getDateString(unodate.Year, unodate.Month, unodate.Day).toString());
}
return date;
}
private static StringBuffer getTimeString(final int hours, final int minutes, final int seconds)
{
final StringBuffer timeString = new StringBuffer();
if (hours < 10)
{
timeString.append("0");
}
timeString.append(hours);
timeString.append(":");
if (minutes < 10)
{
timeString.append("0");
}
timeString.append(minutes);
timeString.append(":");
if (seconds < 10)
{
timeString.append("0");
}
timeString.append(seconds);
return timeString;
}
static private StringBuffer getDateString(final int years, final int months, final int days)
{
final StringBuffer str = new StringBuffer();
str.append(years);
StringBuffer str2 = new StringBuffer("0000");
str2 = str2.delete(0, str.length());
str.insert(0, str2);
str.append("-");
if (months < 10)
{
str.append("0");
}
str.append(months);
str.append("-");
if (days < 10)
{
str.append("0");
}
str.append(days);
return str;
}
static private java.sql.Time getTime(final Object obj)
{
java.sql.Time time = null;
if (obj != null && obj instanceof Time)
{
final Time unoTime = (Time) obj;
time = java.sql.Time.valueOf
(getTimeString(unoTime.Hours, unoTime.Minutes, unoTime.Seconds).toString());
}
return time;
}
static private Timestamp getTimestamp(final Object obj)
{
Timestamp ts = null;
if (obj != null && obj instanceof DateTime)
{
final DateTime unoTs = (DateTime) obj;
final StringBuffer str = getDateString(unoTs.Year, unoTs.Month, unoTs.Day);
str.append(" ");
str.append(getTimeString(unoTs.Hours, unoTs.Minutes, unoTs.Seconds));
str.append(".");
str.append(unoTs.HundredthSeconds);
ts = java.sql.Timestamp.valueOf(str.toString());
}
return ts;
}
public Object getObject(final int column) throws DataSourceException
{
try
{
boolean isParameterValue = ( parameters != null ) && ( column >= firstParameterIndex );
Object obj = null;
boolean wasNull = true;
if ( isParameterValue )
{
try
{
XPropertySet paramCol = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, parameters.getByIndex( column - firstParameterIndex ) );
obj = paramCol.getPropertyValue( "Value" );
wasNull = false;
}
catch( Exception e )
{
wasNull = true;
}
}
else
{
obj = row.getObject( column, null );
wasNull = row.wasNull();
}
if ( wasNull )
{
return null;
}
switch (columnTypes[column - 1])
{
case DataType.DATE:
obj = getDate(obj);
break;
case DataType.TIME:
obj = getTime(obj);
break;
case DataType.TIMESTAMP:
obj = getTimestamp(obj);
break;
case DataType.DECIMAL:
case DataType.NUMERIC:
if (obj != null && !(obj instanceof Any))
{
obj = new java.math.BigDecimal((String) obj);
}
break;
default:
break;
}
return obj;
}
catch (SQLException e)
{
throw new DataSourceException(e.getMessage(), e);
}
}
}

View File

@@ -0,0 +1,66 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: SDBCReportDataFactory.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
package com.sun.star.report;
import java.util.Map;
import com.sun.star.sdbc.SQLException;
import com.sun.star.sdbc.XRowSet;
/**
* Very primitive implementation, just to show how this could be used ...
*
*/
public class SDBCReportDataFactory implements DataSourceFactory
{
private XRowSet rowSet;
public SDBCReportDataFactory(final XRowSet rowSet)
{
this.rowSet = rowSet;
}
public DataSource queryData(final String query, final Map parameters) throws DataSourceException {
try
{
return new SDBCReportData(rowSet);
}
catch (SQLException e)
{
throw new DataSourceException(e.getMessage(),e);
}
}
}

View File

@@ -0,0 +1,200 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: SOImageService.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
package com.sun.star.report;
import java.awt.Dimension;
import java.io.InputStream;
import com.sun.star.awt.Size;
import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.UnknownPropertyException;
import com.sun.star.beans.XPropertySet;
import com.sun.star.beans.XPropertySetInfo;
import com.sun.star.graphic.XGraphicProvider;
import com.sun.star.io.IOException;
import com.sun.star.io.XInputStream;
import com.sun.star.lang.WrappedTargetException;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lib.uno.adapter.ByteArrayToXInputStreamAdapter;
import com.sun.star.lib.uno.adapter.InputStreamToXInputStreamAdapter;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
/**
* @author oj93728
*/
public class SOImageService implements ImageService
{
private XGraphicProvider m_xGraphicProvider;
/**
* Creates a new instance of SOImageService
*/
public SOImageService(final XComponentContext xCompContext)
throws ReportExecutionException, com.sun.star.uno.Exception
{
if (xCompContext == null)
{
throw new ReportExecutionException();
}
final XMultiComponentFactory m_xMCF = xCompContext.getServiceManager();
m_xGraphicProvider = (XGraphicProvider) UnoRuntime.queryInterface(XGraphicProvider.class,
m_xMCF.createInstanceWithContext("com.sun.star.graphic.GraphicProvider", xCompContext));
if (m_xGraphicProvider == null)
{
throw new ReportExecutionException("There is no graphic-provider available.");
}
}
public Dimension getImageSize(final InputStream image) throws ReportExecutionException
{
return getImageSize(new InputStreamToXInputStreamAdapter(image));
}
private Dimension getImageSize(final XInputStream image) throws ReportExecutionException
{
final Dimension dim = new Dimension();
try
{
final PropertyValue[] value = new PropertyValue[1];
value[0] = new PropertyValue();
value[0].Name = "InputStream";
value[0].Value = image;
final XPropertySet xImage = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
m_xGraphicProvider.queryGraphic( value ) );
if (xImage != null)
{
final XPropertySetInfo xInfo = xImage.getPropertySetInfo();
if (xInfo.hasPropertyByName("Size100thMM"))
{
Size imageSize = (Size) xImage.getPropertyValue("Size100thMM");
dim.setSize(imageSize.Width, imageSize.Height);
if (dim.height == 0 && dim.width == 0)
{
imageSize = (Size) xImage.getPropertyValue("SizePixel");
final int dpi = java.awt.Toolkit.getDefaultToolkit().getScreenResolution();
final double fac = 25400 / dpi;
dim.setSize(imageSize.Width * fac, imageSize.Height * fac);
}
}
else if (xInfo.hasPropertyByName("SizePixel"))
{
final Size imageSize = (Size) xImage.getPropertyValue("SizePixel");
final int dpi = java.awt.Toolkit.getDefaultToolkit().getScreenResolution();
final double fac = 25400 / dpi;
dim.setSize(imageSize.Width * fac, imageSize.Height * fac);
}
}
}
catch (UnknownPropertyException ex)
{
throw new ReportExecutionException("Failed to query Image-Size", ex);
}
catch (WrappedTargetException ex)
{
throw new ReportExecutionException("Failed to query Image-Size", ex);
}
catch (com.sun.star.lang.IllegalArgumentException ex)
{
throw new ReportExecutionException("Failed to query Image-Size", ex);
}
catch (IOException ex)
{
throw new ReportExecutionException("Failed to query Image-Size", ex);
}
return dim;
}
public Dimension getImageSize(final byte[] image) throws ReportExecutionException
{
return getImageSize(new ByteArrayToXInputStreamAdapter(image));
}
private String getMimeType(final XInputStream image) throws ReportExecutionException
{
String mimeType = null;
try
{
final PropertyValue[] value = new PropertyValue[] { new PropertyValue() };
value[0].Name = "InputStream";
value[0].Value = image;
final XPropertySet xImage = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,
m_xGraphicProvider.queryGraphic(value));
if (xImage != null)
{
final XPropertySetInfo xInfo = xImage.getPropertySetInfo();
if (xInfo.hasPropertyByName("MimeType"))
{
mimeType = (String) xImage.getPropertyValue("MimeType");
}
}
}
catch (UnknownPropertyException ex)
{
throw new ReportExecutionException();
}
catch (WrappedTargetException ex)
{
throw new ReportExecutionException();
}
catch (com.sun.star.lang.IllegalArgumentException ex)
{
throw new ReportExecutionException();
}
catch (IOException ex)
{
throw new ReportExecutionException();
}
return mimeType;
}
public String getMimeType(final InputStream image) throws ReportExecutionException
{
return getMimeType(new InputStreamToXInputStreamAdapter(image));
}
public String getMimeType(final byte[] image) throws ReportExecutionException
{
return getMimeType(new ByteArrayToXInputStreamAdapter(image));
}
}

View File

@@ -0,0 +1,147 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: StorageRepository.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
package com.sun.star.report;
import com.sun.star.beans.XPropertySet;
import com.sun.star.container.NoSuchElementException;
import com.sun.star.embed.ElementModes;
import com.sun.star.embed.InvalidStorageException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.*;
import com.sun.star.embed.XStorage;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.io.XStream;
import com.sun.star.lib.uno.adapter.XInputStreamToInputStreamAdapter;
import com.sun.star.lib.uno.adapter.XOutputStreamToOutputStreamAdapter;
/**
* A directory holds all the contents here.
*
*
* @author Ocke Janssen
*/
public class StorageRepository implements InputRepository, OutputRepository {
private XStorage input;
private XStorage output;
/**
*
* @param input
* @param output
* @throws java.io.IOException
*/
public StorageRepository(final XStorage input,final XStorage output) throws IOException {
this.input = input;
this.output = output;
if ( output == null || input == null )
throw new IOException("Need a valid storage not NULL.");
}
public InputStream createInputStream(String name) throws IOException {
try{
final XStream xStream = (XStream) UnoRuntime.queryInterface(XStream.class,input.openStreamElement(name,ElementModes.READ));
return new BufferedInputStream(new XInputStreamToInputStreamAdapter(xStream.getInputStream()),102400);
}catch(com.sun.star.uno.Exception e){
throw new IOException("createInputStream");
}
}
/**
* Creates an output stream for writing the data. If there is an entry with
* that name already contained in the repository, try to overwrite it.
*
* @param name
* @param mimeType
* @return the outputstream
* @throws IOException if opening the stream fails
*/
public OutputStream createOutputStream(String name, String mimeType) throws IOException {
try{
final XStream stream = (XStream) UnoRuntime.queryInterface(XStream.class,output.openStreamElement(name,ElementModes.WRITE|ElementModes.TRUNCATE));
stream.getInputStream().closeInput();
if (mimeType != null)
{
final XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,stream);
prop.setPropertyValue("MediaType",mimeType);
}
return new BufferedOutputStream(new XOutputStreamToOutputStreamAdapter(stream.getOutputStream()),204800);
}catch(com.sun.star.uno.Exception e){
throw new IOException("createOutputStream");
}
}
public boolean exists(String name) {
try {
return output.isStreamElement(name);
} catch (InvalidStorageException ex) {
ex.printStackTrace();
} catch (com.sun.star.lang.IllegalArgumentException ex) {
ex.printStackTrace();
} catch (NoSuchElementException ex) {
ex.printStackTrace();
}
return false;
}
public boolean isWritable(String name) {
return true;
}
public Object getId() {
return "1";
}
public long getVersion(String name) {
return 1;
}
public boolean isReadable(String name)
{
try {
if ( input != null )
return input.isStreamElement(name);
} catch (InvalidStorageException ex) {
ex.printStackTrace();
} catch (com.sun.star.lang.IllegalArgumentException ex) {
ex.printStackTrace();
} catch (NoSuchElementException ex) {
ex.printStackTrace();
}
return false;
}
}

View File

@@ -0,0 +1,74 @@
#*************************************************************************
#
# OpenOffice.org - a multi-platform office productivity suite
#
# $RCSfile: makefile.mk,v $
#
# $Revision: 1.2 $
#
# last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
#
# The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1.
#
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2005 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
#
#*************************************************************************
PRJ = ..$/..$/..$/..$/..
PRJNAME = reportdesign
TARGET = $(PRJNAME)
PACKAGE = com$/sun$/star$/report
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
#----- compile .java files -----------------------------------------
JARFILES = ridl.jar unoil.jar jurt.jar juh.jar jut.jar java_uno.jar jcommon-1.0.8.jar
JAVAFILES := DataRow.java\
DataSource.java\
DataSourceException.java\
DataSourceFactory.java\
InputRepository.java\
JobDefinitionException.java\
JobProgressIndicator.java\
JobProperties.java\
OutputRepository.java\
ParameterMap.java\
ReportAddIn.java\
ReportEngine.java\
ReportEngineMetaData.java\
ReportEngineParameterNames.java\
ReportExecutionException.java\
ReportExpression.java\
ReportExpressionMetaData.java\
ReportFunction.java\
ReportJob.java\
ReportJobDefinition.java\
ImageService.java\
SOImageService.java\
StorageRepository.java\
SDBCReportData.java\
SDBCReportDataFactory.java
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk

View File

@@ -0,0 +1,118 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: DefaultNameGenerator.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho;
import java.io.IOException;
import com.sun.star.report.OutputRepository;
public class DefaultNameGenerator
{
private OutputRepository outputRepository;
public DefaultNameGenerator(final OutputRepository outputRepository)
{
if (outputRepository == null)
{
throw new NullPointerException();
}
this.outputRepository = outputRepository;
}
/**
* Generates a new, unique name for storing resources in the output repository. Assuming that proper synchronization
* has been applied, the generated name will be unique within that repository.
*
* @param namePrefix a user defined name for that resource.
* @param mimeType the mime type of the resource to be stored in the repository.
* @return the generated, fully qualified name.
*/
public String generateName(final String namePrefix, final String mimeType)
throws IOException
{
final String name;
if (namePrefix != null)
{
name = namePrefix;
}
else
{
name = "file";
}
final String suffix = getSuffixForType(mimeType);
final String firstFileName = name + "." + suffix;
if (outputRepository.exists(firstFileName) == false)
{
return firstFileName;
}
int counter = 0;
while (true)
{
if (counter < 0) // wraparound should not happen..
{
throw new IOException();
}
final String filename = name + counter + "." + suffix;
if (outputRepository.exists(filename) == false)
{
return filename;
}
counter += 1;
}
}
protected String getSuffixForType(final String mimeType)
{
if ("image/png".equals(mimeType))
{
return "png";
}
if ("image/jpeg".equals(mimeType))
{
return "jpg";
}
if ("image/gif".equals(mimeType))
{
return "gif";
}
// todo ... use a flexible mapping ...
return "dat";
}
}

View File

@@ -0,0 +1,7 @@
RegistrationClassName: com.sun.star.report.pentaho.SOReportJobFactory
Class-Path: jcommon-1.0.10.jar sac.jar
libxml-0.9.5.jar flute-1.3-jfree-20061107.jar jfreereport-0.9.0-05.jar
liblayout-0.2.6.jar libloader-0.3.4.jar libfonts-0.2.6.jar
jcommon-serializer-0.1.0.jar libformula-0.1.8.jar
librepository-0.1.1.jar
UNO-Type-Path:

View File

@@ -0,0 +1,85 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeNamespaces.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho;
import java.io.File;
/**
* Creation-Date: Feb 22, 2007, 1:53:29 PM
*
* @author Thomas Morgner
*/
public class OfficeNamespaces
{
public static final String OFFICE_NS = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
public static final String TABLE_NS = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
public static final String TEXT_NS = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
public static final String STYLE_NS = "urn:oasis:names:tc:opendocument:xmlns:style:1.0";
public static final String DRAWING_NS = "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0";
public static final String FO_NS = "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0";
public static final String XLINK_NS = "http://www.w3.org/1999/xlink";
public static final String PURL_NS = "http://purl.org/dc/elements/1.1/";
public static final String META_NS = "urn:oasis:names:tc:opendocument:xmlns:meta:1.0";
public static final String DATASTYLE_NS = "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0";
public static final String SVG_NS = "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0";
public static final String CHART_NS = "urn:oasis:names:tc:opendocument:xmlns:chart:1.0";
public static final String DR3D_NS = "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0";
public static final String MATHML_NS = "http://www.w3.org/1998/Math/MathML";
public static final String FORM_NS = "urn:oasis:names:tc:opendocument:xmlns:form:1.0";
public static final String SCRIPT_NS = "urn:oasis:names:tc:opendocument:xmlns:script:1.0";
public static final String OO2004_NS = "http://openoffice.org/2004/office";
public static final String OOW2004_NS = "http://openoffice.org/2004/writer";
public static final String OOC2004_NS = "http://openoffice.org/2004/calc";
public static final String XML_EVENT_NS = "http://www.w3.org/2001/xml-events";
public static final String XFORMS_NS = "http://www.w3.org/2002/xforms";
public static final String XSD_NS = "http://www.w3.org/2001/XMLSchema";
public static final String XSI_NS = "http://www.w3.org/2001/XMLSchema-instance";
public static final String OOREPORT_NS = "http://openoffice.org/2005/report";
public static final String CONFIG = "urn:oasis:names:tc:opendocument:xmlns:config:1.0";
public static final String INTERNAL_NS = "http://reporting.pentaho.org/namespaces/engine";
public static final String MANIFEST_NS = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0";
/**
* @deprecated
*/
public static final String NUMBER_NS = DATASTYLE_NS;
private OfficeNamespaces()
{
}
}

View File

@@ -0,0 +1,74 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: PentahoReportAddIn.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho;
import com.sun.star.report.ReportAddIn;
import com.sun.star.report.ReportExpression;
import com.sun.star.report.ReportExpressionMetaData;
import com.sun.star.report.pentaho.expressions.SumExpression;
/**
* This class is a dummy implementation. Ignore it for now, we may extend this
* one later.
*/
public class PentahoReportAddIn implements ReportAddIn
{
public PentahoReportAddIn()
{
}
public ReportExpression createExpression(int expression)
{
if (expression == 0)
{
return new SumExpression();
}
return null;
}
public int getExpressionCount()
{
return 1;
}
public ReportExpressionMetaData getMetaData(int expression)
{
// todo implement me
return null;
}
}

View File

@@ -0,0 +1,81 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: PentahoReportEngine.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho;
import com.sun.star.report.JobDefinitionException;
import com.sun.star.report.ReportEngine;
import com.sun.star.report.ReportEngineMetaData;
import com.sun.star.report.ReportJob;
import com.sun.star.report.ReportJobDefinition;
import com.sun.star.report.util.DefaultReportJobDefinition;
import org.jfree.report.JFreeReportBoot;
public class PentahoReportEngine implements ReportEngine
{
private ReportEngineMetaData metaData;
public PentahoReportEngine ()
{
JFreeReportBoot.getInstance().start();
this.metaData = new PentahoReportEngineMetaData();
}
public ReportEngineMetaData getMetaData ()
{
return metaData;
}
public ReportJobDefinition createJobDefinition ()
{
return new DefaultReportJobDefinition(metaData);
}
/**
* Open points: How to define scheduling?
*
* @return the report job definition for the job description.
*
* @throws com.sun.star.report.JobDefinitionException
*
*/
public ReportJob createJob (final ReportJobDefinition definition)
throws JobDefinitionException
{
return new PentahoReportJob(definition);
}
}

View File

@@ -0,0 +1,134 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: PentahoReportEngineMetaData.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho;
import java.util.HashMap;
import java.util.HashSet;
import com.sun.star.report.DataSourceFactory;
import com.sun.star.report.InputRepository;
import com.sun.star.report.OutputRepository;
import com.sun.star.report.ReportEngineMetaData;
import com.sun.star.report.ReportEngineParameterNames;
import com.sun.star.report.ImageService;
import org.jfree.util.HashNMap;
public class PentahoReportEngineMetaData
implements ReportEngineMetaData
{
public static final String OPENDOCUMENT_TEXT = "application/vnd.oasis.opendocument.text";
public static final String OPENDOCUMENT_SPREADSHEET = "application/vnd.oasis.opendocument.spreadsheet";
public static final String DEBUG = "raw/text+xml";
private HashSet mandatoryParameters;
private HashMap parameterTypes;
private HashNMap enumerationValues;
public PentahoReportEngineMetaData ()
{
mandatoryParameters = new HashSet();
mandatoryParameters.add(ReportEngineParameterNames.CONTENT_TYPE);
mandatoryParameters.add(ReportEngineParameterNames.INPUT_NAME);
mandatoryParameters.add(ReportEngineParameterNames.INPUT_REPOSITORY);
mandatoryParameters.add(ReportEngineParameterNames.OUTPUT_NAME);
mandatoryParameters.add(ReportEngineParameterNames.OUTPUT_REPOSITORY);
mandatoryParameters.add(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY);
mandatoryParameters.add(ReportEngineParameterNames.IMAGE_SERVICE);
parameterTypes = new HashMap();
parameterTypes.put (ReportEngineParameterNames.CONTENT_TYPE, String.class);
parameterTypes.put (ReportEngineParameterNames.INPUT_NAME, String.class);
parameterTypes.put (ReportEngineParameterNames.OUTPUT_NAME, String.class);
parameterTypes.put (ReportEngineParameterNames.INPUT_REPOSITORY, InputRepository.class);
parameterTypes.put (ReportEngineParameterNames.OUTPUT_REPOSITORY, OutputRepository.class);
parameterTypes.put (ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY, DataSourceFactory.class);
parameterTypes.put (ReportEngineParameterNames.IMAGE_SERVICE, ImageService.class);
enumerationValues = new HashNMap();
enumerationValues.add("content-type",
PentahoReportEngineMetaData.OPENDOCUMENT_TEXT);
enumerationValues.add("content-type",
PentahoReportEngineMetaData.OPENDOCUMENT_SPREADSHEET);
enumerationValues.add("content-type", PentahoReportEngineMetaData.DEBUG);
}
public Object[] getEnumerationValues (final String parameter)
{
return enumerationValues.toArray(parameter);
}
public Class getParameterType (final String parameter)
{
return (Class) parameterTypes.get(parameter);
}
public boolean isEnumeration (final String parameter)
{
return enumerationValues.containsKey(parameter);
}
/**
* Checks, whether a certain output type is available. Feed the mime-type of the output
* type in and you'll get a true or false back.
*
* @param mimeType
* @return true, if the output type is supported; false otherwise.
*/
public boolean isOutputSupported (final String mimeType)
{
return enumerationValues.containsValue
("content-type", mimeType.toLowerCase());
}
/**
* Lists all supported output parameters for the given mime-type. This listing can be
* used to build a generic user interface for configuring a certain output.
*
* @param mimeType
* @return
*/
public String[] getOutputParameters (final String mimeType)
{
return new String[0];
}
public boolean isMandatory (final String parameter)
{
return mandatoryParameters.contains(parameter);
}
}

View File

@@ -0,0 +1,261 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: PentahoReportJob.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho;
import java.io.IOException;
import java.util.ArrayList;
import com.sun.star.report.DataSourceFactory;
import com.sun.star.report.InputRepository;
import com.sun.star.report.JobDefinitionException;
import com.sun.star.report.JobProgressIndicator;
import com.sun.star.report.JobProperties;
import com.sun.star.report.OutputRepository;
import com.sun.star.report.ParameterMap;
import com.sun.star.report.ReportEngineParameterNames;
import com.sun.star.report.ReportExecutionException;
import com.sun.star.report.ReportJob;
import com.sun.star.report.ReportJobDefinition;
import com.sun.star.report.ImageService;
import com.sun.star.report.pentaho.loader.InputRepositoryLoader;
import com.sun.star.report.pentaho.model.OfficeDocument;
import com.sun.star.report.pentaho.output.text.TextRawReportProcessor;
import com.sun.star.report.pentaho.output.spreadsheet.SpreadsheetRawReportProcessor;
import org.jfree.report.flow.DefaultReportJob;
import org.jfree.report.flow.ReportProcessor;
import org.jfree.report.flow.raw.XmlPrintReportProcessor;
import org.jfree.report.util.ReportParameters;
import org.jfree.resourceloader.Resource;
import org.jfree.resourceloader.ResourceException;
import org.jfree.resourceloader.ResourceManager;
import org.jfree.util.Log;
/**
* ToDo: Allow interrupting of jobs and report the report progress
*/
public class PentahoReportJob implements ReportJob
{
private boolean finished;
private ArrayList listeners;
private DataSourceFactory dataSourceFactory;
private OutputRepository outputRepository;
private JobProperties jobProperties;
private OfficeDocument report;
private ResourceManager resourceManager;
private String outputName;
private ImageService imageService;
private InputRepository inputRepository;
public PentahoReportJob (final ReportJobDefinition definition)
throws JobDefinitionException
{
if (definition == null)
{
throw new NullPointerException();
}
this.listeners = new ArrayList();
this.jobProperties = definition.getProcessingParameters().copy();
this.dataSourceFactory = (DataSourceFactory) jobProperties.getProperty
(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY);
if (this.dataSourceFactory == null)
{
throw new JobDefinitionException("DataSourceFactory must not be null.");
}
this.outputRepository = (OutputRepository) jobProperties.getProperty
(ReportEngineParameterNames.OUTPUT_REPOSITORY);
if (this.outputRepository == null)
{
throw new JobDefinitionException("OutputRepository must not be null.");
}
this.inputRepository =
(InputRepository) jobProperties.getProperty
(ReportEngineParameterNames.INPUT_REPOSITORY);
if (inputRepository == null)
{
throw new JobDefinitionException("InputRepository must not be null.");
}
this.outputName = (String) jobProperties
.getProperty(ReportEngineParameterNames.OUTPUT_NAME);
if (outputName == null)
{
throw new JobDefinitionException("OutputName must not be null");
}
this.imageService = (ImageService) jobProperties.getProperty(ReportEngineParameterNames.IMAGE_SERVICE);
if (imageService == null)
{
throw new JobDefinitionException("A valid image-service implementation must be given.");
}
this.resourceManager = new ResourceManager();
this.resourceManager.registerDefaults();
this.resourceManager.registerLoader(new InputRepositoryLoader(inputRepository));
try
{
this.report = parseReport(definition);
}
catch (ResourceException e)
{
throw new JobDefinitionException("Failed to parse the report.", e);
}
}
private OfficeDocument parseReport (final ReportJobDefinition definition)
throws ResourceException, JobDefinitionException
{
final String reportResource = (String) this.jobProperties.getProperty
(ReportEngineParameterNames.INPUT_NAME);
if (reportResource == null)
{
throw new JobDefinitionException("Report definition name must be given");
}
final Resource res = resourceManager.createDirectly
("sun:oo://" + reportResource, OfficeDocument.class);
final OfficeDocument report = (OfficeDocument) res.getResource();
report.setDataFactory(new StarReportDataFactory(dataSourceFactory));
final ReportParameters inputParameters = report.getInputParameters();
final ParameterMap queryParameters = definition.getQueryParameters();
final String[] paramKeys = queryParameters.keys();
for (int i = 0; i < paramKeys.length; i++)
{
final String key = paramKeys[i];
inputParameters.put(key, queryParameters.get(key));
}
return report;
}
public void addProgressIndicator (final JobProgressIndicator indicator)
{
listeners.add(indicator);
}
/**
* Interrupt the job.
*/
public void interrupt ()
{
// hey, not yet ..
}
/**
* Queries the jobs result status.
*
* @return true, if the job is finished (or has been interrupted), false if the job
* waits for activation.
*/
public boolean isFinished ()
{
return finished;
}
public void finish ()
{
finished = true;
}
/**
* Queries the jobs execution status.
*
* @return true, if the job is currently running, false otherwise.
*/
public boolean isRunning ()
{
return finished == false;
}
public void removeProgressIndicator (final JobProgressIndicator indicator)
{
listeners.remove(indicator);
}
/**
* Although we might want to run the job as soon as it has been created, sometimes it is
* wiser to let the user add some listeners first. If we execute at once, the user
* either has to deal with threading code or wont receive any progress information in
* single threaded environments.
*/
public void execute ()
throws ReportExecutionException, IOException
{
final DefaultReportJob job = new DefaultReportJob(report);
final String contentType = (String)
jobProperties.getProperty(ReportEngineParameterNames.CONTENT_TYPE);
//noinspection OverlyBroadCatchBlock
try
{
final long startTime = System.currentTimeMillis();
final ReportProcessor rp = getProcessorForContentType(contentType);
rp.processReport(job);
job.close();
final long endTime = System.currentTimeMillis();
Log.debug ("Report processing time: " + (endTime - startTime));
}
catch (final Exception e)
{
throw new ReportExecutionException("Failed to process the report", e);
}
}
protected ReportProcessor getProcessorForContentType(final String mimeType)
throws ReportExecutionException
{
if (PentahoReportEngineMetaData.OPENDOCUMENT_SPREADSHEET.equals(mimeType))
{
return new SpreadsheetRawReportProcessor(inputRepository, outputRepository, outputName, imageService);
}
if (PentahoReportEngineMetaData.OPENDOCUMENT_TEXT.equals(mimeType))
{
return new TextRawReportProcessor(inputRepository, outputRepository, outputName, imageService);
}
if (PentahoReportEngineMetaData.DEBUG.equals(mimeType))
{
return new XmlPrintReportProcessor(System.out, "ISO-8859-1");
}
throw new ReportExecutionException("Invalid mime-type");
}
}

View File

@@ -0,0 +1,340 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: SOReportJobFactory.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 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
*
************************************************************************/
package com.sun.star.report.pentaho;
import java.net.URL;
import com.sun.star.beans.NamedValue;
import com.sun.star.beans.XPropertySet;
import com.sun.star.beans.UnknownPropertyException;
import com.sun.star.beans.PropertyVetoException;
import com.sun.star.beans.XPropertyChangeListener;
import com.sun.star.beans.XVetoableChangeListener;
import com.sun.star.embed.XStorage;
import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.XServiceInfo;
import com.sun.star.lang.XSingleComponentFactory;
import com.sun.star.lang.WrappedTargetException;
import com.sun.star.lib.uno.helper.Factory;
import com.sun.star.lib.uno.helper.PropertySetMixin;
import com.sun.star.lib.uno.helper.WeakBase;
import com.sun.star.registry.XRegistryKey;
import com.sun.star.report.DataSourceFactory;
import com.sun.star.report.JobProperties;
import com.sun.star.report.ReportEngineParameterNames;
import com.sun.star.report.ReportJob;
import com.sun.star.report.ReportJobDefinition;
import com.sun.star.report.SDBCReportDataFactory;
import com.sun.star.report.SOImageService;
import com.sun.star.report.StorageRepository;
import com.sun.star.sdbc.XRowSet;
import com.sun.star.task.XJob;
import com.sun.star.uno.Type;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import org.jfree.util.Log;
/**
* This class capsulates the class, that implements the minimal component, a factory for creating the service
* (<CODE>__getComponentFactory</CODE>) and a method, that writes the information into the given registry key
* (<CODE>__writeRegistryServiceInfo</CODE>).
*/
public class SOReportJobFactory
{
private SOReportJobFactory()
{
}
public static class _SOReportJobFactory extends WeakBase implements XInitialization, XServiceInfo, XJob, XPropertySet
{
/**
* The service name, that must be used to get an instance of this service.
*/
private static final String __serviceName =
"com.sun.star.report.pentaho.SOReportJobFactory";
private PropertySetMixin m_prophlp;
/**
* The initial component contextr, that gives access to the service manager, supported singletons, ... It's
* often later used
*/
private XComponentContext m_cmpCtx;
public _SOReportJobFactory(final XComponentContext xCompContext)
{
m_cmpCtx = xCompContext;
try
{
final XMultiComponentFactory m_xMCF = m_cmpCtx.getServiceManager();
m_prophlp = new PropertySetMixin(m_cmpCtx, this,
new Type(XJob.class),
null); // no optionals
}
catch (Exception e)
{
Log.error ("Failed to query the service manager: ", e);
throw new RuntimeException();
}
}
/**
* This method is a member of the interface for initializing an object directly after its creation.
*
* @param object This array of arbitrary objects will be passed to the component after its creation.
* @throws Exception Every exception will not be handled, but will be passed to the caller.
*/
public void initialize(final Object[] object)
throws com.sun.star.uno.Exception
{
/* The component describes what arguments its expected and in which
* order!At this point you can read the objects and can intialize
* your component using these objects.
*/
}
/**
* This method returns an array of all supported service names.
*
* @return Array of supported service names.
*/
public String[] getSupportedServiceNames()
{
return getServiceNames();
}
/**
* This method is a simple helper function to used in the static component initialisation functions as well as
* in getSupportedServiceNames.
*/
public static String[] getServiceNames()
{
return new String[]{__serviceName};
}
/**
* This method returns true, if the given service will be supported by the component.
*
* @param sServiceName Service name.
* @return True, if the given service name will be supported.
*/
public boolean supportsService(final String sServiceName)
{
return sServiceName.equals(__serviceName);
}
/**
* Return the class name of the component.
*
* @return Class name of the component.
*/
public String getImplementationName()
{
return SOReportJobFactory.class.getName();
}
public Object execute(final NamedValue[] namedValue)
throws com.sun.star.lang.IllegalArgumentException, com.sun.star.uno.Exception
{
final ClassLoader cl = java.lang.Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
try
{
XStorage input = null;
XStorage output = null;
XRowSet rowSet = null;
String mimetype = null;
for (int i = 0; i < namedValue.length; ++i)
{
final NamedValue aProps = namedValue[i];
if ("DataSource".equalsIgnoreCase(aProps.Name))
{
}
else if ("RowSet".equalsIgnoreCase(aProps.Name))
{
rowSet = (XRowSet) UnoRuntime.queryInterface(XRowSet.class, aProps.Value);
}
else if ("Parameters".equalsIgnoreCase(aProps.Name))
{
}
else if ("InputStorage".equalsIgnoreCase(aProps.Name))
{
input = (XStorage) UnoRuntime.queryInterface(XStorage.class, aProps.Value);
}
else if ("OutputStorage".equalsIgnoreCase(aProps.Name))
{
output = (XStorage) UnoRuntime.queryInterface(XStorage.class, aProps.Value);
}
else if ("mimetype".equalsIgnoreCase(aProps.Name))
{
mimetype = (String) aProps.Value;
}
}
if (rowSet == null || input == null || output == null)
{
throw new com.sun.star.lang.IllegalArgumentException();
}
if (mimetype == null)
{
mimetype = "application/vnd.oasis.opendocument.text";
}
final DataSourceFactory dataFactory = new SDBCReportDataFactory(rowSet);
final StorageRepository storageRepository = new StorageRepository(input, output);
final PentahoReportEngine engine = new PentahoReportEngine();
final ReportJobDefinition definition = engine.createJobDefinition();
final JobProperties procParms = definition.getProcessingParameters();
final String inputName = "content.xml";
final String outputName = "content.xml";
procParms.setProperty(ReportEngineParameterNames.INPUT_REPOSITORY, storageRepository);
procParms.setProperty(ReportEngineParameterNames.OUTPUT_REPOSITORY, storageRepository);
procParms.setProperty(ReportEngineParameterNames.INPUT_NAME, inputName);
procParms.setProperty(ReportEngineParameterNames.OUTPUT_NAME, outputName);
procParms.setProperty(ReportEngineParameterNames.CONTENT_TYPE, mimetype);
procParms.setProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY, dataFactory);
procParms.setProperty(ReportEngineParameterNames.IMAGE_SERVICE, new SOImageService(m_cmpCtx));
final ReportJob job = engine.createJob(definition);
job.execute();
}
catch (java.lang.Exception e)
{
Log.error("ReportProcessing failed", e);
throw new com.sun.star.lang.WrappedTargetException
("caught a " + e.getClass().getName(), this, new com.sun.star.uno.Exception(e.getLocalizedMessage()));
}
catch (java.lang.IncompatibleClassChangeError e2)
{
Log.error("Detected an IncompatibleClassChangeError");
e2.printStackTrace(System.err);
System.err.println(e2);
}
Thread.currentThread().setContextClassLoader(cl);
return null;
}
// com.sun.star.beans.XPropertySet:
public com.sun.star.beans.XPropertySetInfo getPropertySetInfo()
{
return m_prophlp.getPropertySetInfo();
}
public void setPropertyValue(final String aPropertyName, final Object aValue)
throws UnknownPropertyException, PropertyVetoException, com.sun.star.lang.IllegalArgumentException,
WrappedTargetException
{
m_prophlp.setPropertyValue(aPropertyName, aValue);
}
public Object getPropertyValue(final String aPropertyName)
throws UnknownPropertyException, WrappedTargetException
{
return m_prophlp.getPropertyValue(aPropertyName);
}
public void addPropertyChangeListener(final String aPropertyName, final XPropertyChangeListener xListener)
throws UnknownPropertyException, WrappedTargetException
{
m_prophlp.addPropertyChangeListener(aPropertyName, xListener);
}
public void removePropertyChangeListener(final String aPropertyName, final XPropertyChangeListener xListener)
throws UnknownPropertyException, WrappedTargetException
{
m_prophlp.removePropertyChangeListener(aPropertyName, xListener);
}
public void addVetoableChangeListener(final String aPropertyName, final XVetoableChangeListener xListener)
throws UnknownPropertyException, WrappedTargetException
{
m_prophlp.addVetoableChangeListener(aPropertyName, xListener);
}
public void removeVetoableChangeListener(final String aPropertyName, final XVetoableChangeListener xListener)
throws UnknownPropertyException, WrappedTargetException
{
m_prophlp.removeVetoableChangeListener(aPropertyName, xListener);
}
}
/**
* Gives a factory for creating the service. This method is called by the <code>JavaLoader</code>
* <p/>
*
* @param sImplName the name of the implementation for which a service is desired
* @return returns a <code>XSingleComponentFactory</code> for creating the component
* @see com.sun.star.comp.loader.JavaLoader
*/
public static XSingleComponentFactory __getComponentFactory(final String sImplName)
{
XSingleComponentFactory xFactory = null;
try
{
if (sImplName.equals(_SOReportJobFactory.class.getName()))
{
xFactory = Factory.createComponentFactory(_SOReportJobFactory.class,
_SOReportJobFactory.getServiceNames());
}
}
catch (java.lang.IncompatibleClassChangeError e2)
{
e2.printStackTrace(System.err);
System.err.println(e2);
}
return xFactory;
}
/**
* Writes the service information into the given registry key. This method is called by the <code>JavaLoader</code>
* <p/>
*
* @param regKey the registryKey
* @return returns true if the operation succeeded
* @see com.sun.star.comp.loader.JavaLoader
*/
public static boolean __writeRegistryServiceInfo(final XRegistryKey regKey)
{
return Factory.writeRegistryServiceInfo(_SOReportJobFactory.class.getName(),
_SOReportJobFactory.getServiceNames(),
regKey);
}
}

View File

@@ -0,0 +1,177 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: StarReportData.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho;
import com.sun.star.report.DataSource;
import org.jfree.report.DataSourceException;
import org.jfree.report.ReportData;
public class StarReportData implements ReportData
{
private DataSource dataSource;
private int currentRow;
private int rowCount;
public StarReportData (final DataSource dataSource)
throws com.sun.star.report.DataSourceException
{
if (dataSource == null)
{
throw new NullPointerException();
}
this.dataSource = dataSource;
this.currentRow = 0;
this.rowCount = dataSource.getRowCount();
}
public boolean setCursorPosition(final int row) throws DataSourceException
{
try
{
if (dataSource.absolute(row))
{
currentRow = row;
return true;
}
return false;
}
catch (com.sun.star.report.DataSourceException e)
{
throw new DataSourceException("Failed to move cursor", e);
}
}
public void close ()
throws DataSourceException
{
try
{
dataSource.close();
}
catch (com.sun.star.report.DataSourceException e)
{
throw new DataSourceException("Failed to close datasource", e);
}
}
public int getCursorPosition ()
throws DataSourceException
{
return currentRow;
}
/**
* This operation checks, whether a call to next will be likely to succeed. If
* there is a next data row, this should return true.
*
* @return
* @throws org.jfree.report.DataSourceException
*
*/
public boolean isAdvanceable() throws DataSourceException
{
return currentRow < rowCount;
}
public boolean next ()
throws DataSourceException
{
try
{
if (dataSource.next())
{
currentRow += 1;
return true;
}
return false;
}
catch (com.sun.star.report.DataSourceException e)
{
throw new DataSourceException("Failed to move cursor", e);
}
}
public Object get (final int column)
throws DataSourceException
{
if (isReadable() == false)
{
throw new DataSourceException("Failed to query column.");
}
try
{
return dataSource.getObject(column + 1);
}
catch (com.sun.star.report.DataSourceException e)
{
throw new DataSourceException("Failed to query column.", e);
}
}
public int getColumnCount ()
throws DataSourceException
{
try
{
return dataSource.getColumnCount();
}
catch (com.sun.star.report.DataSourceException e)
{
throw new DataSourceException("Failed to query column count.", e);
}
}
public String getColumnName (final int column)
throws DataSourceException
{
try
{
return dataSource.getColumnName(column + 1);
}
catch (com.sun.star.report.DataSourceException e)
{
throw new DataSourceException("Failed to query column name.", e);
}
}
public boolean isReadable() throws DataSourceException
{
return currentRow > 0 && rowCount > 0;
}
}

View File

@@ -0,0 +1,126 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: StarReportDataFactory.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho;
import java.util.HashMap;
import org.jfree.report.ReportDataFactory;
import org.jfree.report.ReportData;
import org.jfree.report.DataSet;
import org.jfree.report.ReportDataFactoryException;
import com.sun.star.report.DataSourceException;
import com.sun.star.report.DataSourceFactory;
public class StarReportDataFactory implements ReportDataFactory, Cloneable
{
private DataSourceFactory backend;
public StarReportDataFactory (DataSourceFactory backend)
{
this.backend = backend;
}
/**
* Queries a datasource. The string 'query' defines the name of the query. The
* Parameterset given here may contain more data than actually needed.
* <p/>
* The dataset may change between two calls, do not assume anything!
*
* @param query
* @param parameters
* @return
*/
public ReportData queryData (final String query, final DataSet parameters)
throws ReportDataFactoryException
{
try
{
final HashMap map = new HashMap();
final int count = parameters.getColumnCount();
for (int i = 0; i < count; i++)
{
final Object o = parameters.get(i);
map.put (parameters.getColumnName(i), o);
}
return new StarReportData(backend.queryData(query, map));
}
catch(DataSourceException dse)
{
throw new ReportDataFactoryException("Failed to create report data wrapper");
}
catch (org.jfree.report.DataSourceException e)
{
throw new ReportDataFactoryException("Failed to query data");
}
}
public void open()
{
}
public void close()
{
}
/**
* Derives a freshly initialized report data factory, which is independend of
* the original data factory. Opening or Closing one data factory must not
* affect the other factories.
*
* @return
*/
public ReportDataFactory derive()
{
try
{
return (ReportDataFactory) clone();
}
catch (CloneNotSupportedException e)
{
throw new IllegalStateException("Clone failed?");
}
}
public Object clone () throws CloneNotSupportedException
{
return super.clone();
}
}

View File

@@ -0,0 +1,68 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: StarReportModule.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho;
import org.jfree.base.modules.AbstractModule;
import org.jfree.base.modules.ModuleInitializeException;
import org.jfree.base.modules.SubSystem;
public class StarReportModule extends AbstractModule
{
public StarReportModule ()
throws ModuleInitializeException
{
loadModuleInfo();
}
/**
* Initializes the module. Use this method to perform all initial setup operations. This
* method is called only once in a modules lifetime. If the initializing cannot be
* completed, throw a ModuleInitializeException to indicate the error,. The module will
* not be available to the system.
*
* @param subSystem the subSystem.
* @throws org.jfree.base.modules.ModuleInitializeException
* if an error ocurred while initializing the module.
*/
public void initialize (SubSystem subSystem)
throws ModuleInitializeException
{
}
}

View File

@@ -0,0 +1,152 @@
#*************************************************************************
#
# OpenOffice.org - a multi-platform office productivity suite
#
# $RCSfile: configuration.properties,v $
#
# $Revision: 1.2 $
#
# last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
#
# The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1.
#
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2005 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
#
#*************************************************************************
##
# Do not modify the following lines. They connect this module to the central
# parser registry.
org.jfree.resourceloader.factory.modules.com.sun.star.report.pentaho.model.OfficeDocument.star=com.sun.star.report.pentaho.parser.StarXmlFactoryModule
org.jfree.resourceloader.factory.modules.com.sun.star.report.pentaho.model.OfficeStylesCollection.star=com.sun.star.report.pentaho.parser.StarStyleXmlFactoryModule
org.jfree.resourceloader.factory.modules.com.sun.star.report.pentaho.styles.StyleMapper.star=com.sun.star.report.pentaho.styles.StyleMapperXmlFactoryModule
##
# The known namespaces.
#
org.jfree.report.namespaces.star-rpt.Uri=http://openoffice.org/2005/report
org.jfree.report.namespaces.star-rpt.Default-Style=res://com/sun/star/report/pentaho/star-rpt.css
org.jfree.report.namespaces.star-rpt.Prefix=rpt
org.jfree.report.namespaces.star-rpt.ClassAttr=style-name
org.jfree.report.namespaces.star-office.Uri=http://openoffice.org/2004/office
org.jfree.report.namespaces.star-office.Default-Style=res://com/sun/star/report/pentaho/star-office.css
org.jfree.report.namespaces.star-office.Prefix=office
org.jfree.report.namespaces.star-office.ClassAttr=style-name
org.jfree.report.namespaces.oasis-style.Uri=urn:oasis:names:tc:opendocument:xmlns:style:1.0
org.jfree.report.namespaces.oasis-style.Default-Style=res://com/sun/star/report/pentaho/oasis-style.css
org.jfree.report.namespaces.oasis-style.Prefix=style
org.jfree.report.namespaces.oasis-table.Uri=urn:oasis:names:tc:opendocument:xmlns:table:1.0
org.jfree.report.namespaces.oasis-table.Default-Style=res://com/sun/star/report/pentaho/oasis-table.css
org.jfree.report.namespaces.oasis-table.Prefix=table
org.jfree.report.namespaces.oasis-table.ClassAttr=style-name
org.jfree.report.namespaces.oasis-draw.Uri=urn:oasis:names:tc:opendocument:xmlns:drawing:1.0
org.jfree.report.namespaces.oasis-draw.Default-Style=res://com/sun/star/report/pentaho/oasis-draw.css
org.jfree.report.namespaces.oasis-draw.Prefix=draw
org.jfree.report.namespaces.oasis-draw.ClassAttr=style-name
org.jfree.report.namespaces.oasis-text.Uri=urn:oasis:names:tc:opendocument:xmlns:text:1.0
org.jfree.report.namespaces.oasis-text.Default-Style=res://com/sun/star/report/pentaho/oasis-text.css
org.jfree.report.namespaces.oasis-text.Prefix=text
org.jfree.report.namespaces.oasis-text.ClassAttr=style-name
org.jfree.report.namespaces.oasis-number.Uri=urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0
org.jfree.report.namespaces.oasis-number.Default-Style=res://com/sun/star/report/pentaho/oasis-number.css
org.jfree.report.namespaces.oasis-number.Prefix=number
org.jfree.report.namespaces.oasis-number.ClassAttr=style-name
org.jfree.report.namespaces.oasis-form.Uri=urn:oasis:names:tc:opendocument:xmlns:form:1.0
org.jfree.report.namespaces.oasis-form.Default-Style=res://com/sun/star/report/pentaho/oasis-form.css
org.jfree.report.namespaces.oasis-form.Prefix=form
#
# This defines a subset of the real XSL-FO standard.
org.jfree.report.namespaces.oasis-compat-fo.Uri=urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0
org.jfree.report.namespaces.oasis-compat-fo.Default-Style=res://com/sun/star/report/pentaho/xsl-fo.css
org.jfree.report.namespaces.oasis-compat-fo.Prefix=fo
#
# This defines a subset of the real XSL-FO standard.
org.jfree.report.namespaces.oasis-compat-svg.Uri=urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0
org.jfree.report.namespaces.oasis-compat-svg.Default-Style=res://com/sun/star/report/pentaho/svg.css
org.jfree.report.namespaces.oasis-compat-svg.Prefix=svg
#
# This defines a subset of the real XSL-FO standard.
org.jfree.report.namespaces.oasis-compat-smil.Uri=urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0
org.jfree.report.namespaces.oasis-compat-smil.Default-Style=res://com/sun/star/report/pentaho/smil.css
org.jfree.report.namespaces.oasis-compat-smil.Prefix=svg
org.jfree.report.namespaces.xsl-fo.Uri=http://www.w3.org/1999/XSL/Format
org.jfree.report.namespaces.xsl-fo.Default-Style=res://com/sun/star/report/pentaho/xsl-fo.css
org.jfree.report.namespaces.xsl-fo.Prefix=fo
org.jfree.report.namespaces.svg.Uri=http://www.w3.org/2000/svg
org.jfree.report.namespaces.svg.Default-Style=res://com/sun/star/report/pentaho/svg.css
org.jfree.report.namespaces.svg.Prefix=svg
org.jfree.report.namespaces.svg.ClassAttr=class
org.jfree.report.namespaces.svg.StyleAttr=style
org.jfree.report.namespaces.xml-xlink.Uri=http://www.w3.org/1999/xlink
#org.jfree.report.namespaces.xml-xlink.Default-Style=res://com/sun/star/report/pentaho/xml-xlink.css
org.jfree.report.namespaces.xml-xlink.Prefix=xlink
#
# Tag-definition for the XML-writer.
# Prefix is 'com.sun.star.report.pentaho.output.'
#
# Declare the namespaces (this is independent of the ones defined above ..)
# <prefix>"namespace."<ns-prefix>=<ns-uri>
com.sun.star.report.pentaho.output.namespace.oasis-text=urn:oasis:names:tc:opendocument:xmlns:text:1.0
com.sun.star.report.pentaho.output.default.oasis-text=deny
com.sun.star.report.pentaho.output.namespace.oasis-config=urn:oasis:names:tc:opendocument:xmlns:config:1.0
com.sun.star.report.pentaho.output.default.oasis-config=allow
#
# Next define the tags for which we want to customize the indent-behaviour
com.sun.star.report.pentaho.output.tag.oasis-text.p=deny
com.sun.star.report.pentaho.output.tag.oasis-text.section=allow
com.sun.star.report.pentaho.output.tag.oasis-text.variable-decls=allow
com.sun.star.report.pentaho.output.tag.oasis-text.variable-decl=allow
com.sun.star.report.pentaho.output.tag.oasis-config.config-item=deny
com.sun.star.report.pentaho.output.namespace.oasis-data=urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0
com.sun.star.report.pentaho.output.default.oasis-data=allow
com.sun.star.report.pentaho.output.tag.oasis-data.text=deny
org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.FixedTextElement=com.sun.star.report.pentaho.layoutprocessor.FixedTextLayoutController
org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.FormattedTextElement=com.sun.star.report.pentaho.layoutprocessor.FormattedTextLayoutController
org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.ImageElement=com.sun.star.report.pentaho.layoutprocessor.ImageElementLayoutController
org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.TableCellElement=com.sun.star.report.pentaho.layoutprocessor.TableCellLayoutController
org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.OfficeReport=com.sun.star.report.pentaho.layoutprocessor.OfficeReportLayoutController
org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.OfficeGroup=com.sun.star.report.pentaho.layoutprocessor.OfficeGroupLayoutController
org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.OfficeGroupSection=com.sun.star.report.pentaho.layoutprocessor.OfficeGroupSectionLayoutController
org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.VariablesDeclarationSection=com.sun.star.report.pentaho.layoutprocessor.VariablesDeclarationLayoutController
org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.OfficeDetailSection=com.sun.star.report.pentaho.layoutprocessor.OfficeDetailLayoutController
org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.OfficeTableSection=com.sun.star.report.pentaho.layoutprocessor.OfficeTableLayoutController

View File

@@ -0,0 +1,66 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: SumExpression.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.expressions;
import com.sun.star.report.ReportExpression;
import com.sun.star.report.DataRow;
public class SumExpression implements ReportExpression
{
private Object[] parameters;
public SumExpression ()
{
}
public Object getParameters ()
{
return parameters;
}
public Object getValue (DataRow row)
{
return null;
}
public void setParameters (Object[] parameters)
{
this.parameters = parameters;
}
}

View File

@@ -0,0 +1,87 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: SumExpressionMetaData.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.expressions;
import java.util.Locale;
import com.sun.star.report.ReportExpressionMetaData;
public class SumExpressionMetaData implements ReportExpressionMetaData
{
public String getDescription (Locale l)
{
// todo implement me
return null;
}
public String getDisplayName (Locale l)
{
// todo implement me
return null;
}
public String getName ()
{
// todo implement me
return null;
}
public int getParameterCount ()
{
// todo implement me
return 0;
}
public String getParameterDescription (int param, Locale locale)
{
// todo implement me
return null;
}
public String getParameterDisplayName (int param, Locale locale)
{
// todo implement me
return null;
}
public String getParameterName (int param)
{
// todo implement me
return null;
}
}

View File

@@ -0,0 +1,296 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: AbstractReportElementLayoutController.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
import com.sun.star.report.pentaho.model.ReportElement;
import com.sun.star.report.pentaho.model.OfficeGroupSection;
import org.jfree.report.DataSourceException;
import org.jfree.report.ReportDataFactoryException;
import org.jfree.report.ReportProcessingException;
import org.jfree.report.DataRow;
import org.jfree.report.DataFlags;
import org.jfree.report.structure.Element;
import org.jfree.report.structure.Group;
import org.jfree.report.expressions.Expression;
import org.jfree.report.flow.FlowController;
import org.jfree.report.flow.ReportTarget;
import org.jfree.report.flow.layoutprocessor.AbstractLayoutController;
import org.jfree.report.flow.layoutprocessor.LayoutController;
import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil;
import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
import org.jfree.formula.lvalues.LValue;
import org.jfree.formula.lvalues.ContextLookup;
/**
* Todo: Document me!
*
* @author Thomas Morgner
* @since 05.03.2007
* @noinspection CloneableClassWithoutClone
*/
public abstract class AbstractReportElementLayoutController
extends AbstractLayoutController
{
public static final int NOT_STARTED = 0;
public static final int FINISHED = 2;
private int state;
protected AbstractReportElementLayoutController()
{
}
/**
* Advances the processing position.
*
* @param target the report target that receives generated events.
* @return the new layout controller instance representing the new state.
*
* @throws org.jfree.report.DataSourceException if there was a problem reading data from
* the datasource.
* @throws org.jfree.report.ReportProcessingException if there was a general problem during
* the report processing.
* @throws org.jfree.report.ReportDataFactoryException if a query failed.
*/
public LayoutController advance(final ReportTarget target)
throws DataSourceException, ReportDataFactoryException,
ReportProcessingException
{
if (state != AbstractReportElementLayoutController.NOT_STARTED)
{
throw new IllegalStateException();
}
boolean isPrintableContent = true;
final ReportElement text = (ReportElement) getNode();
// Tests we have to perform:
// 1. Print when group changes. We can know whether a group changed by
// looking at the newly introduced iteration counter.
//
// Whether we use the next one or the one after that depends on whether
// this element is a child of a group-header or group-footer.
if (text.isPrintWhenGroupChanges())
{
// if this is set to true, then we print the element only if this is the
// first occurrence in this group.
if (isGroupChanged() == false)
{
// Log.debug ("Group Change Condition");
isPrintableContent = false;
}
}
// 2. Print repeated values. This never applies to static text or static
// elements.
if (text.isPrintRepeatedValues() == false)
{
// If this is set to true, we evaluate the formula of the element and
// try to derive whether there was a change.
if (isValueChanged() == false)
{
// Log.debug ("Value Repeat Condition");
isPrintableContent = false;
}
}
// 3. Evaluate the Display Condition
final Expression dc = text.getDisplayCondition();
if (dc != null)
{
final Object o = LayoutControllerUtil.evaluateExpression
(getFlowController(), text, dc);
if (Boolean.FALSE.equals(o))
{
// Log.debug ("DISPLAY Condition forbids printing");
isPrintableContent = false;
}
}
if (isPrintableContent == false)
{
// There is no printable content at all. Set the state to FINISHED
return join (getFlowController());
}
else
{
// delegate to the handler ..
return delegateContentGeneration(target);
}
}
protected abstract boolean isValueChanged();
protected boolean isGroupChanged()
{
// search the group.
final SectionLayoutController slc = findGroup();
if (slc == null)
{
// Always print the content of the report header and footer and
// the page header and footer.
return true;
}
// we are in the first iteration, so yes, the group has changed recently.
return slc.getIterationCount() == 0;
}
private SectionLayoutController findGroup()
{
LayoutController parent = getParent();
boolean skipNext = false;
while (parent != null)
{
if (parent instanceof SectionLayoutController == false)
{
parent = parent.getParent();
continue;
}
final SectionLayoutController slc = (SectionLayoutController) parent;
final Element element = slc.getElement();
if (element instanceof OfficeGroupSection)
{
// This is a header or footer. So we take the next group instead.
skipNext = true;
parent = parent.getParent();
continue;
}
if (element instanceof Group == false)
{
parent = parent.getParent();
continue;
}
if (skipNext)
{
skipNext = false;
parent = parent.getParent();
continue;
}
return (SectionLayoutController) parent;
}
return null;
}
/**
* Joins with a delegated process flow. This is generally called from a child
* flow and should *not* (I mean it!) be called from outside. If you do,
* you'll suffer.
*
* @param flowController the flow controller of the parent.
* @return the joined layout controller that incorperates all changes from the
* delegate.
*/
public LayoutController join(final FlowController flowController)
throws DataSourceException, ReportDataFactoryException,
ReportProcessingException
{
final AbstractReportElementLayoutController alc =
(AbstractReportElementLayoutController) clone();
alc.state = AbstractReportElementLayoutController.FINISHED;
return alc;
}
protected abstract LayoutController delegateContentGeneration (final ReportTarget target)
throws ReportProcessingException, ReportDataFactoryException,
DataSourceException;
/**
* Checks, whether the layout controller would be advanceable. If this method
* returns true, it is generally safe to call the 'advance()' method.
*
* @return true, if the layout controller is advanceable, false otherwise.
*/
public boolean isAdvanceable()
{
return state != AbstractReportElementLayoutController.FINISHED;
}
protected boolean isReferenceChanged (final LValue lValue)
{
if (lValue instanceof ContextLookup)
{
final ContextLookup rval = (ContextLookup) lValue;
final String s = rval.getName();
final DataRow view = getFlowController().getMasterRow().getGlobalView();
try
{
final DataFlags flags = view.getFlags(s);
if (flags != null)
{
if (flags.isChanged())
{
// Log.debug ("Reference " + s + " is changed");
return true;
}
}
// Log.debug ("Reference " + s + " is unchanged");
}
catch (DataSourceException e)
{
// ignore .. assume that the reference has not changed.
}
}
final LValue[] childValues = lValue.getChildValues();
for (int i = 0; i < childValues.length; i++)
{
final LValue value = childValues[i];
if (isReferenceChanged(value))
{
return true;
}
}
// Log.debug ("Unchanged.");
return false;
}
public int getState()
{
return state;
}
protected void setState(final int state)
{
this.state = state;
}
}

View File

@@ -0,0 +1,101 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: FixedTextLayoutController.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
import org.jfree.report.flow.layoutprocessor.LayoutController;
import org.jfree.report.flow.layoutprocessor.LayoutControllerFactory;
import org.jfree.report.flow.ReportTarget;
import org.jfree.report.flow.FlowController;
import org.jfree.report.flow.ReportContext;
import org.jfree.report.data.GlobalMasterRow;
import org.jfree.report.data.ReportDataRow;
import org.jfree.report.structure.Section;
import org.jfree.report.ReportProcessingException;
import org.jfree.report.ReportDataFactoryException;
import org.jfree.report.DataSourceException;
import com.sun.star.report.pentaho.model.FixedTextElement;
/**
* Processes a fixed-text element of the OpenOffice reporting specifciation.
* The element itself contains a single paragraph which contains the content.
* After checking, whether this element should be printed, this layout
* controller simply delegates the dirty work to a suitable handler.
*
* @author Thomas Morgner
* @noinspection CloneableClassWithoutClone
* @since 05.03.2007
*/
public class FixedTextLayoutController
extends AbstractReportElementLayoutController
{
public FixedTextLayoutController()
{
}
protected boolean isValueChanged()
{
final FlowController controller = getFlowController();
final GlobalMasterRow masterRow = controller.getMasterRow();
final ReportDataRow reportDataRow = masterRow.getReportDataRow();
if (reportDataRow.getCursor() == 0)
{
return true;
}
return false;
}
protected LayoutController delegateContentGeneration
(final ReportTarget target)
throws ReportProcessingException, ReportDataFactoryException,
DataSourceException
{
final FixedTextElement fte = (FixedTextElement) getNode();
final Section content = fte.getContent();
final FlowController flowController = getFlowController();
final ReportContext reportContext = flowController.getReportContext();
final LayoutControllerFactory layoutControllerFactory =
reportContext.getLayoutControllerFactory();
final FixedTextLayoutController flc = (FixedTextLayoutController) clone();
flc.setState(AbstractReportElementLayoutController.FINISHED);
return layoutControllerFactory.create(flowController, content, flc);
}
}

View File

@@ -0,0 +1,136 @@
package com.sun.star.report.pentaho.layoutprocessor;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.sun.star.report.pentaho.OfficeNamespaces;
import com.sun.star.report.pentaho.model.FormattedTextElement;
import org.jfree.layouting.util.AttributeMap;
import org.jfree.report.DataFlags;
import org.jfree.report.DataSourceException;
import org.jfree.report.data.DefaultDataFlags;
import org.jfree.report.expressions.FormulaExpression;
import org.jfree.report.flow.FlowController;
import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil;
import org.jfree.util.Log;
/**
* Creation-Date: 06.06.2007, 17:03:30
*
* @author Thomas Morgner
*/
public class FormatValueUtility
{
private static SimpleDateFormat dateFormat;
private FormatValueUtility()
{
}
public static void applyValueForVariable(final Object value, final AttributeMap variableSection)
{
if (value instanceof Date)
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", "date");
variableSection.setAttribute
(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value));
}
else if (value instanceof Number)
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", "float");
variableSection.setAttribute
(OfficeNamespaces.OFFICE_NS, "value", String.valueOf(value));
}
else if (value instanceof Boolean)
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", "boolean");
if (Boolean.TRUE.equals(value))
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "boolean-value", "true");
}
else
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "boolean-value", "false");
}
}
else if (value != null)
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", "string");
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "string-value", String.valueOf(value));
}
else
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", "string");
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "string-value", "");
}
}
public static void applyValueForCell(final Object value, final AttributeMap variableSection)
{
if (value instanceof Date)
{
variableSection.setAttribute
(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value));
}
else if (value instanceof Number)
{
variableSection.setAttribute
(OfficeNamespaces.OFFICE_NS, "value", String.valueOf(value));
}
else if (value instanceof Boolean)
{
if (Boolean.TRUE.equals(value))
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "boolean-value", "true");
}
else
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "boolean-value", "false");
}
}
else if (value != null)
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "string-value", String.valueOf(value));
}
else
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "string-value", "");
}
}
private static synchronized String formatDate(final Date date)
{
if (dateFormat == null)
{
dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss'.'S'Z'");
}
return dateFormat.format(date);
}
public static DataFlags computeDataFlag(final FormattedTextElement element,
final FlowController flowController)
throws DataSourceException
{
// here it is relatively easy. We have to evaluate the expression, convert
// the result into a string, and print that string.
final FormulaExpression formulaExpression = element.getValueExpression();
final Object result = LayoutControllerUtil.evaluateExpression
(flowController, element, formulaExpression);
if (result == null)
{
// ignore it. Ignoring it is much better than printing 'null'.
Log.debug("Formula '" + formulaExpression.getFormula() + "' evaluated to null.");
return null;
}
else if (result instanceof DataFlags)
{
return (DataFlags) result;
}
else
{
return new DefaultDataFlags(null, result, true);
}
}
}

View File

@@ -0,0 +1,208 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: FormattedTextLayoutController.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
import com.sun.star.report.pentaho.OfficeNamespaces;
import com.sun.star.report.pentaho.model.FormattedTextElement;
import org.jfree.formula.Formula;
import org.jfree.formula.lvalues.LValue;
import org.jfree.formula.parser.ParseException;
import org.jfree.layouting.util.AttributeMap;
import org.jfree.report.DataFlags;
import org.jfree.report.DataSourceException;
import org.jfree.report.JFreeReportInfo;
import org.jfree.report.ReportDataFactoryException;
import org.jfree.report.ReportProcessingException;
import org.jfree.report.expressions.FormulaExpression;
import org.jfree.report.flow.ReportTarget;
import org.jfree.report.flow.layoutprocessor.ElementLayoutController;
import org.jfree.report.flow.layoutprocessor.LayoutController;
import org.jfree.report.structure.Element;
import org.jfree.util.Log;
/**
* Todo: Document me!
*
* @author Thomas Morgner
* @since 05.03.2007
*/
public class FormattedTextLayoutController
extends AbstractReportElementLayoutController
{
// private Boolean inRepeatingSection;
public FormattedTextLayoutController()
{
}
// private boolean isInRepeatingSection ()
// {
// if (inRepeatingSection == null)
// {
// LayoutController parent = getParent();
// while (parent != null && inRepeatingSection == null)
// {
// if (parent instanceof OfficeRepeatingStructureLayoutController)
// {
// final OfficeRepeatingStructureLayoutController orslc =
// (OfficeRepeatingStructureLayoutController) parent;
// if (orslc.isNormalFlowProcessing())
// {
// inRepeatingSection = Boolean.FALSE;
// }
// else
// {
// inRepeatingSection = Boolean.TRUE;
// }
// }
// parent = parent.getParent();
// }
//
// if (inRepeatingSection == null)
// {
// inRepeatingSection = Boolean.FALSE;
// }
// }
// return inRepeatingSection.booleanValue();
// }
private VariablesCollection getVariablesCollection()
{
LayoutController parent = getParent();
while (parent != null)
{
if (parent instanceof OfficeRepeatingStructureLayoutController)
{
final OfficeRepeatingStructureLayoutController orslc =
(OfficeRepeatingStructureLayoutController) parent;
if (orslc.isNormalFlowProcessing())
{
return null;
}
return orslc.getVariablesCollection();
}
parent = parent.getParent();
}
return null;
}
protected boolean isValueChanged()
{
try
{
final FormattedTextElement element = (FormattedTextElement) getNode();
final FormulaExpression formulaExpression = element.getValueExpression();
final Formula formula = formulaExpression.getCompiledFormula();
final LValue lValue = formula.getRootReference();
return isReferenceChanged(lValue);
}
catch (final ParseException e)
{
Log.debug ("Parse Exception" , e);
return false;
}
}
protected LayoutController delegateContentGeneration(final ReportTarget target)
throws ReportProcessingException, ReportDataFactoryException,
DataSourceException
{
final FormattedTextElement element = (FormattedTextElement) getNode();
final VariablesCollection vc = getVariablesCollection();
if (vc != null)
{
final String name = vc.addVariable(element);
final AttributeMap variablesGet = new AttributeMap();
variablesGet.setAttribute(JFreeReportInfo.REPORT_NAMESPACE,
Element.TYPE_ATTRIBUTE, "variable-get");
variablesGet.setAttribute(JFreeReportInfo.REPORT_NAMESPACE,
Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TEXT_NS);
variablesGet.setAttribute(OfficeNamespaces.TEXT_NS, "name", name);
//variablesGet.setAttribute(OfficeNamespaces.TEXT_NS, "display", "value");
final String valueType = computeValueType();
variablesGet.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", valueType);
target.startElement(variablesGet);
target.endElement(variablesGet);
}
else
{
final DataFlags df = FormatValueUtility.computeDataFlag(element, getFlowController());
if (df != null)
{
target.processContent(df);
}
}
return join(getFlowController());
}
private Element getParentTableCell()
{
LayoutController parent = getParent();
while (parent != null)
{
if (parent instanceof ElementLayoutController)
{
final ElementLayoutController cellController = (ElementLayoutController) parent;
return cellController.getElement();
}
parent = parent.getParent();
}
return null;
}
private String computeValueType ()
{
final Element tce = getParentTableCell();
if (tce == null)
{
// NO particular format means: Fallback to string and hope and pray ..
return "string";
}
final String type = (String) tce.getAttribute(OfficeNamespaces.OFFICE_NS, "value-type");
if (type == null)
{
return "string";
}
return type;
}
}

View File

@@ -0,0 +1,100 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ImageElementContext.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
/**
* Todo: Document me!
*
* @author Thomas Morgner
* @since 30.03.2007
*/
public class ImageElementContext
{
private int colSpan;
private int rowSpan;
private String[] rowStyles;
private String[] colStyles;
public ImageElementContext(final int colSpan, final int rowSpan)
{
this.colSpan = colSpan;
this.rowSpan = rowSpan;
this.colStyles = new String[colSpan];
this.rowStyles = new String[rowSpan];
}
public int getColSpan()
{
return colSpan;
}
public int getRowSpan()
{
return rowSpan;
}
public String[] getRowStyles()
{
return rowStyles;
}
public String[] getColStyles()
{
return colStyles;
}
public void setRowStyle (final int pos, final String styleName)
{
rowStyles[pos] = styleName;
}
public void setColStyle (final int pos, final String styleName)
{
colStyles[pos] = styleName;
}
public String getRowStyle (final int pos)
{
return rowStyles[pos];
}
public String getColStyle (final int pos)
{
return colStyles[pos];
}
}

View File

@@ -0,0 +1,329 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ImageElementLayoutController.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
import com.sun.star.report.pentaho.OfficeNamespaces;
import com.sun.star.report.pentaho.model.ImageElement;
import org.jfree.formula.Formula;
import org.jfree.formula.lvalues.LValue;
import org.jfree.formula.parser.ParseException;
import org.jfree.layouting.util.AttributeMap;
import org.jfree.report.DataSourceException;
import org.jfree.report.JFreeReportInfo;
import org.jfree.report.ReportDataFactoryException;
import org.jfree.report.ReportProcessingException;
import org.jfree.report.util.TextUtilities;
import org.jfree.report.data.DefaultDataFlags;
import org.jfree.report.data.GlobalMasterRow;
import org.jfree.report.data.ReportDataRow;
import org.jfree.report.expressions.FormulaExpression;
import org.jfree.report.flow.FlowController;
import org.jfree.report.flow.ReportTarget;
import org.jfree.report.flow.layoutprocessor.LayoutController;
import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil;
import org.jfree.report.structure.Element;
import org.jfree.report.structure.Section;
import org.jfree.report.structure.Node;
import org.jfree.util.Log;
import org.jfree.util.ObjectUtilities;
/**
* Produces an image. The image-structures itself (draw:frame and so on) are not generated here. This element produces a
* place-holder element and relies on the output target to compute a sensible position for the element. The report
* definition does not give any hints about the size of the image, so we have to derive this from the surrounding
* context.
*
* @author Thomas Morgner
* @since 05.03.2007
*/
public class ImageElementLayoutController
extends AbstractReportElementLayoutController
{
private ImageElementContext context;
public ImageElementLayoutController()
{
}
protected LayoutController delegateContentGeneration
(final ReportTarget target)
throws ReportProcessingException, ReportDataFactoryException,
DataSourceException
{
final ImageElement imageElement = (ImageElement) getNode();
final FormulaExpression formulaExpression = imageElement.getFormula();
if (formulaExpression == null)
{
// A static image is easy. At least at this level. Dont ask about the weird things we have to do in the
// output targets ...
final String linkTarget = imageElement.getImageData();
generateImage(target, linkTarget, imageElement.isScale(), imageElement.isPreserveIRI());
}
else
{
final Object value =
LayoutControllerUtil.evaluateExpression(getFlowController(), imageElement, formulaExpression);
generateImage(target, value, imageElement.isScale(), imageElement.isPreserveIRI());
}
return join(getFlowController());
}
private void generateImage(final ReportTarget target,
final Object linkTarget,
final boolean scale,
final boolean preserveIri)
throws ReportProcessingException, DataSourceException
{
if (linkTarget == null)
{
return;
}
final AttributeMap image = new AttributeMap();
image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.INTERNAL_NS);
image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, "image");
image.setAttribute(OfficeNamespaces.INTERNAL_NS, "scale", String.valueOf(scale));
image.setAttribute(OfficeNamespaces.INTERNAL_NS, "preserve-IRI", String.valueOf(preserveIri));
image.setAttribute(OfficeNamespaces.INTERNAL_NS, "image-context", createContext());
image.setAttribute(OfficeNamespaces.INTERNAL_NS, "image-data", linkTarget);
target.startElement(image);
target.endElement(image);
}
protected ImageElementContext createContext()
{
if (context == null)
{
// Step 1: Find the parent cell.
final LayoutController cellController = findParentCell();
if (cellController == null)
{
Log.warn("Image is not contained in a table. Unable to calculate the image-size.");
return null;
}
final Element tableCell = (Element) cellController.getNode();
final int rowSpan = TextUtilities.parseInt
((String) tableCell.getAttribute(OfficeNamespaces.TABLE_NS, "number-rows-spanned"), 1);
final int colSpan = TextUtilities.parseInt
((String) tableCell.getAttribute(OfficeNamespaces.TABLE_NS, "number-cols-spanned"), 1);
if (rowSpan < 1 || colSpan < 1)
{
Log.warn("Rowspan or colspan for image-size calculation was invalid.");
return null;
}
final LayoutController rowController = cellController.getParent();
if (rowController == null)
{
Log.warn("Table-Cell has no parent. Unable to calculate the image-size.");
return null;
}
final Section tableRow = (Section) rowController.getNode();
// we are now making the assumption, that the row is a section, that contains the table-cell.
// This breaks the ability to return nodes or to construct reports on the fly, but the OO-report format
// is weird anyway and wont support such advanced techniques for the next few centuries ..
final int columnPos = findNodeInSection(tableRow, tableCell);
if (columnPos == -1)
{
Log.warn("Table-Cell is not a direct child of the table-row. Unable to calculate the image-size.");
return null;
}
final LayoutController tableController = rowController.getParent();
if (tableController == null)
{
Log.warn("Table-Row has no Table. Unable to calculate the image-size.");
return null;
}
final Section table = (Section) tableController.getNode();
// ok, we got a table, so as next we have to search for the columns now.
final Section columns = (Section) table.findFirstChild(OfficeNamespaces.TABLE_NS, "table-columns");
if (columns.getNodeCount() <= columnPos + colSpan)
{
// the colspan is to large. The table definition is therefore invalid. We do not try to fix this.
Log.warn(
"The Table's defined columns do not match the col-span or col-position. Unable to calculate the image-size.");
return null;
}
final ImageElementContext context = new ImageElementContext(colSpan, rowSpan);
final Node[] columnDefs = columns.getNodeArray();
int columnCounter = 0;
for (int i = 0; i < columnDefs.length; i++)
{
final Element column = (Element) columnDefs[i];
if (ObjectUtilities.equal(column.getNamespace(), OfficeNamespaces.TABLE_NS) == false ||
ObjectUtilities.equal(column.getType(), "table-column") == false)
{
continue;
}
if (columnCounter >= columnPos)
{
final String colStyle = (String) column.getAttribute(OfficeNamespaces.TABLE_NS, "style-name");
context.setColStyle(columnCounter - columnPos, colStyle);
}
columnCounter += 1;
if (columnCounter >= (columnPos + colSpan))
{
break;
}
}
// finally search the styles for the row now.
final int rowPos = findNodeInSection(table, tableRow);
if (rowPos == -1)
{
Log.warn("Table-Cell is not a direct child of the table-row. Unable to calculate the image-size.");
return null;
}
final Node[] rows = table.getNodeArray();
int rowCounter = 0;
for (int i = 0; i < rows.length; i++)
{
final Element row = (Element) rows[i];
if (ObjectUtilities.equal(row.getNamespace(), OfficeNamespaces.TABLE_NS) == false ||
ObjectUtilities.equal(row.getType(), "table-row") == false)
{
continue;
}
if (rowCounter >= rowPos)
{
final String rowStyle = (String) row.getAttribute(OfficeNamespaces.TABLE_NS, "style-name");
context.setRowStyle(rowCounter - rowPos, rowStyle);
}
rowCounter += 1;
if (rowCounter >= (rowPos + rowSpan))
{
break;
}
}
this.context = context;
}
return this.context;
}
private int findNodeInSection(final Section tableRow,
final Element tableCell)
{
int retval = 0;
final Node[] nodes = tableRow.getNodeArray();
final String namespace = tableCell.getNamespace();
final String type = tableCell.getType();
for (int i = 0; i < nodes.length; i++)
{
final Node node = nodes[i];
if (node instanceof Element == false)
{
continue;
}
final Element child = (Element) node;
if (ObjectUtilities.equal(child.getNamespace(), namespace) == false ||
ObjectUtilities.equal(child.getType(), type) == false)
{
continue;
}
if (node == tableCell)
{
return retval;
}
retval += 1;
}
return -1;
}
private LayoutController findParentCell()
{
LayoutController parent = getParent();
while (parent != null)
{
final Object node = parent.getNode();
if (node instanceof Element)
{
final Element element = (Element) node;
if (OfficeNamespaces.TABLE_NS.equals(element.getNamespace()) && "table-cell".equals(element.getType()))
{
return parent;
}
}
parent = parent.getParent();
}
return null;
}
protected boolean isValueChanged()
{
final ImageElement imageElement = (ImageElement) getNode();
final FormulaExpression formulaExpression = imageElement.getFormula();
if (formulaExpression == null)
{
final FlowController controller = getFlowController();
final GlobalMasterRow masterRow = controller.getMasterRow();
final ReportDataRow reportDataRow = masterRow.getReportDataRow();
if (reportDataRow.getCursor() == 0)
{
return true;
}
return false;
}
try
{
final Formula formula = formulaExpression.getCompiledFormula();
final LValue lValue = formula.getRootReference();
return isReferenceChanged(lValue);
}
catch (ParseException e)
{
return false;
}
}
}

View File

@@ -0,0 +1,170 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeDetailLayoutController.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
import com.sun.star.report.pentaho.model.VariablesDeclarationSection;
import org.jfree.report.DataSourceException;
import org.jfree.report.ReportDataFactoryException;
import org.jfree.report.ReportProcessingException;
import org.jfree.report.ReportData;
import org.jfree.report.data.GlobalMasterRow;
import org.jfree.report.data.ReportDataRow;
import org.jfree.report.flow.FlowController;
import org.jfree.report.flow.ReportTarget;
import org.jfree.report.flow.layoutprocessor.ElementLayoutController;
import org.jfree.report.flow.layoutprocessor.LayoutController;
import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
/**
* Creation-Date: 11.04.2007, 11:04:02
*
* @author Thomas Morgner
*/
public class OfficeDetailLayoutController extends SectionLayoutController
{
public static final int STATE_PROCESS_VARIABLES = 2;
public static final int STATE_PROCESS_NORMAL_FLOW = 3;
private boolean waitForJoin;
private int state;
public OfficeDetailLayoutController()
{
}
/**
* Initializes the layout controller. This method is called exactly once. It
* is the creators responsibility to call this method.
* <p/>
* Calling initialize after the first advance must result in a
* IllegalStateException.
*
* @param node the currently processed object or layout node.
* @param flowController the current flow controller.
* @param parent the parent layout controller that was responsible for
* instantiating this controller.
* @throws org.jfree.report.DataSourceException
* if there was a problem reading data from the datasource.
* @throws org.jfree.report.ReportProcessingException
* if there was a general problem during the report processing.
* @throws org.jfree.report.ReportDataFactoryException
* if a query failed.
*/
public void initialize(final Object node,
final FlowController flowController,
final LayoutController parent)
throws DataSourceException, ReportDataFactoryException,
ReportProcessingException
{
super.initialize(node, flowController, parent);
state = OfficeDetailLayoutController.STATE_PROCESS_VARIABLES;
}
/**
* This method is called for each newly instantiated layout controller. The returned layout controller instance should
* have a processing state of either 'OPEN' or 'FINISHING' depending on whether there is any content or any child
* nodes to process.
*
* @param target the report target that receives generated events.
* @return the new layout controller instance representing the new state.
* @throws org.jfree.report.DataSourceException
* if there was a problem reading data from the datasource.
* @throws org.jfree.report.ReportProcessingException
* if there was a general problem during the report processing.
* @throws org.jfree.report.ReportDataFactoryException
* if a query failed.
*/
protected LayoutController startElement(final ReportTarget target)
throws DataSourceException, ReportProcessingException, ReportDataFactoryException
{
final FlowController fc = getFlowController();
final GlobalMasterRow masterRow = fc.getMasterRow();
final ReportDataRow reportDataRow = masterRow.getReportDataRow();
final ReportData reportData = reportDataRow.getReportData();
if (reportData.isReadable() == false)
{
reportData.isReadable();
// If this report has no data, then do not print the detail section. The detail section
// is the only section that behaves this way, and for now this is only done in the OO-implementation
final SectionLayoutController derived = (SectionLayoutController) clone();
derived.setProcessingState(ElementLayoutController.FINISHED);
derived.setFlowController(fc);
return derived;
}
if (state == OfficeDetailLayoutController.STATE_PROCESS_VARIABLES)
{
final VariablesDeclarationSection variables = new VariablesDeclarationSection();
final OfficeDetailLayoutController controller = (OfficeDetailLayoutController) clone();
controller.state = OfficeDetailLayoutController.STATE_PROCESS_NORMAL_FLOW;
controller.waitForJoin = true;
return processChild(controller, variables, fc);
}
return super.startElement(target);
}
protected void resetSectionForRepeat()
{
super.resetSectionForRepeat();
state = STATE_PROCESS_VARIABLES;
}
/**
* Joins with a delegated process flow. This is generally called from a child
* flow and should *not* (I mean it!) be called from outside. If you do,
* you'll suffer.
*
* @param flowController the flow controller of the parent.
* @return the joined layout controller that incorperates all changes from the
* delegate.
*/
public LayoutController join(final FlowController flowController)
{
if (waitForJoin)
{
final OfficeDetailLayoutController derived = (OfficeDetailLayoutController) clone();
derived.setProcessingState(ElementLayoutController.NOT_STARTED);
derived.setFlowController(flowController);
derived.waitForJoin = false;
return derived;
}
return super.join(flowController);
}
}

View File

@@ -0,0 +1,218 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeGroupLayoutController.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
import com.sun.star.report.pentaho.OfficeNamespaces;
import com.sun.star.report.pentaho.model.OfficeGroup;
import com.sun.star.report.pentaho.model.OfficeGroupSection;
import com.sun.star.report.pentaho.model.VariablesDeclarationSection;
import org.jfree.report.DataSourceException;
import org.jfree.report.ReportDataFactoryException;
import org.jfree.report.ReportProcessingException;
import org.jfree.report.flow.FlowController;
import org.jfree.report.flow.ReportTarget;
import org.jfree.report.flow.layoutprocessor.LayoutController;
import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
import org.jfree.report.flow.layoutprocessor.ElementLayoutController;
/**
* Todo: Document me!
*
* @author Thomas Morgner
* @since 15.03.2007
*/
public class OfficeGroupLayoutController extends SectionLayoutController
implements OfficeRepeatingStructureLayoutController
{
public static final int STATE_PROCESS_REPEATING_HEADER = 0;
public static final int STATE_PROCESS_REPEATING_FOOTER = 1;
public static final int STATE_PROCESS_VARIABLES = 2;
public static final int STATE_PROCESS_NORMAL_FLOW = 3;
private boolean waitForJoin;
private int state;
private VariablesCollection variablesCollection;
public OfficeGroupLayoutController()
{
}
/**
* Initializes the layout controller. This method is called exactly once. It
* is the creators responsibility to call this method.
* <p/>
* Calling initialize after the first advance must result in a
* IllegalStateException.
*
* @param node the currently processed object or layout node.
* @param flowController the current flow controller.
* @param parent the parent layout controller that was responsible for
* instantiating this controller.
* @throws org.jfree.report.DataSourceException
* if there was a problem reading data from the datasource.
* @throws org.jfree.report.ReportProcessingException
* if there was a general problem during the report processing.
* @throws org.jfree.report.ReportDataFactoryException
* if a query failed.
*/
public void initialize(final Object node,
final FlowController flowController,
final LayoutController parent)
throws DataSourceException, ReportDataFactoryException,
ReportProcessingException
{
super.initialize(node, flowController, parent);
state = OfficeGroupLayoutController.STATE_PROCESS_REPEATING_HEADER;
variablesCollection = new VariablesCollection(computeVariablesPrefix());
}
protected LayoutController processContent(final ReportTarget target)
throws DataSourceException, ReportProcessingException,
ReportDataFactoryException
{
if (state == OfficeGroupLayoutController.STATE_PROCESS_REPEATING_HEADER)
{
final OfficeGroup group = (OfficeGroup) getElement();
final OfficeGroupSection header =
(OfficeGroupSection) group.findFirstChild
(OfficeNamespaces.OOREPORT_NS, "group-header");
final OfficeGroupLayoutController controller =
(OfficeGroupLayoutController) clone();
controller.state =
OfficeGroupLayoutController.STATE_PROCESS_REPEATING_FOOTER;
if (header == null || header.isRepeatSection() == false)
{
return controller;
}
controller.waitForJoin = true;
return processChild(controller, header, getFlowController());
}
if (state == OfficeGroupLayoutController.STATE_PROCESS_REPEATING_FOOTER)
{
final OfficeGroup group = (OfficeGroup) getElement();
final OfficeGroupSection footer =
(OfficeGroupSection) group.findFirstChild
(OfficeNamespaces.OOREPORT_NS, "group-footer");
final OfficeGroupLayoutController controller =
(OfficeGroupLayoutController) clone();
controller.state =
OfficeGroupLayoutController.STATE_PROCESS_VARIABLES;
if (footer == null || footer.isRepeatSection() == false)
{
return controller;
}
controller.waitForJoin = true;
return processChild(controller, footer, getFlowController());
}
if (state == OfficeGroupLayoutController.STATE_PROCESS_VARIABLES)
{
// todo: Fill the variables section with something sensible ..
final VariablesDeclarationSection variables =
new VariablesDeclarationSection();
final OfficeGroupLayoutController controller =
(OfficeGroupLayoutController) clone();
controller.state =
OfficeGroupLayoutController.STATE_PROCESS_NORMAL_FLOW;
controller.waitForJoin = true;
return processChild(controller, variables, getFlowController());
}
return super.processContent(target);
}
protected void resetSectionForRepeat()
{
super.resetSectionForRepeat();
state = STATE_PROCESS_VARIABLES;
}
/**
* Joins with a delegated process flow. This is generally called from a child
* flow and should *not* (I mean it!) be called from outside. If you do,
* you'll suffer.
*
* @param flowController the flow controller of the parent.
* @return the joined layout controller that incorperates all changes from the
* delegate.
*/
public LayoutController join(final FlowController flowController)
{
if (waitForJoin)
{
final OfficeGroupLayoutController derived = (OfficeGroupLayoutController) clone();
derived.setProcessingState(ElementLayoutController.OPENED);
derived.setFlowController(flowController);
derived.waitForJoin = false;
return derived;
}
return super.join(flowController);
}
public boolean isNormalFlowProcessing ()
{
return state == OfficeGroupLayoutController.STATE_PROCESS_NORMAL_FLOW;
}
private String computeVariablesPrefix()
{
int count = 0;
LayoutController lc = this;
while (lc != null)
{
if (lc instanceof OfficeGroupLayoutController)
{
count += 1;
}
lc = lc.getParent();
}
return "auto_group_" + count + "_";
}
public VariablesCollection getVariablesCollection()
{
return variablesCollection;
}
}

View File

@@ -0,0 +1,88 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeGroupSectionLayoutController.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
import org.jfree.report.flow.layoutprocessor.LayoutController;
import org.jfree.report.flow.FlowController;
import org.jfree.report.flow.ReportTarget;
import org.jfree.report.structure.Element;
import org.jfree.report.DataSourceException;
import org.jfree.layouting.util.AttributeMap;
import com.sun.star.report.pentaho.OfficeNamespaces;
/**
* This layoutcontroller simply checks, whether the parent layout controller
* is a OfficeGroupLayoutController and whether this layout controller is
* processing the normal flow or an repeating section. If a repeating section
* is being processed, an marker attribute is added to the element's call
* to OutputProcessor.startElement() and OutputProcessor.endElement().
*
* @author Thomas Morgner
* @since 19.03.2007
*/
public class OfficeGroupSectionLayoutController extends SectionLayoutController
{
public OfficeGroupSectionLayoutController()
{
}
protected AttributeMap computeAttributes(final FlowController fc,
final Element element,
final ReportTarget target)
throws DataSourceException
{
final AttributeMap attrs = super.computeAttributes(fc, element, target);
final LayoutController controller = getParent();
if (controller instanceof OfficeGroupLayoutController == false)
{
return attrs;
}
final OfficeGroupLayoutController oglc =
(OfficeGroupLayoutController) controller;
if (oglc.isNormalFlowProcessing())
{
return attrs;
}
attrs.setAttribute(OfficeNamespaces.INTERNAL_NS, "repeated-section", "true");
return attrs;
}
}

View File

@@ -0,0 +1,54 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeRepeatingStructureLayoutController.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
import org.jfree.report.flow.layoutprocessor.LayoutController;
/**
* Todo: Document me!
*
* @author Thomas Morgner
* @since 22.03.2007
*/
public interface OfficeRepeatingStructureLayoutController extends LayoutController
{
public boolean isNormalFlowProcessing();
public VariablesCollection getVariablesCollection();
}

View File

@@ -0,0 +1,255 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeReportLayoutController.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
import com.sun.star.report.pentaho.model.OfficeReport;
import com.sun.star.report.pentaho.model.VariablesDeclarationSection;
import org.jfree.report.DataSourceException;
import org.jfree.report.ReportDataFactoryException;
import org.jfree.report.ReportProcessingException;
import org.jfree.report.flow.FlowController;
import org.jfree.report.flow.ReportContext;
import org.jfree.report.flow.ReportTarget;
import org.jfree.report.flow.layoutprocessor.ElementLayoutController;
import org.jfree.report.flow.layoutprocessor.LayoutController;
import org.jfree.report.flow.layoutprocessor.LayoutControllerFactory;
import org.jfree.report.structure.Node;
/**
* Todo: Document me!
*
* @author Thomas Morgner
* @since 06.03.2007
*/
public class OfficeReportLayoutController extends ElementLayoutController
implements OfficeRepeatingStructureLayoutController
{
private static final int STATE_NOT_STARTED = 0;
private static final int STATE_TEMPLATES = 1;
private static final int STATE_PAGE_HEADER_DONE = 2;
private static final int STATE_PAGE_FOOTER_DONE = 3;
private static final int STATE_COLUMN_HEADER_DONE = 4;
private static final int STATE_COLUMN_FOOTER_DONE = 5;
private static final int STATE_INITIAL_VARIABLES_DONE = 6;
private static final int STATE_REPORT_HEADER_DONE = 7;
private static final int STATE_REPORT_BODY_DONE = 8;
private static final int STATE_REPORT_FOOTER_VARIABLES = 9;
private static final int STATE_REPORT_FOOTER_DONE = 10;
private int state;
private VariablesCollection variablesCollection;
public OfficeReportLayoutController()
{
}
/**
* Initializes the layout controller. This method is called exactly once. It
* is the creators responsibility to call this method.
* <p/>
* Calling initialize after the first advance must result in a
* IllegalStateException.
*
* @param node the currently processed object or layout node.
* @param flowController the current flow controller.
* @param parent the parent layout controller that was responsible for
* instantiating this controller.
* @throws org.jfree.report.DataSourceException
* if there was a problem reading data from the datasource.
* @throws org.jfree.report.ReportProcessingException
* if there was a general problem during the report processing.
* @throws org.jfree.report.ReportDataFactoryException
* if a query failed.
*/
public void initialize(final Object node, final FlowController flowController,
final LayoutController parent)
throws DataSourceException, ReportDataFactoryException,
ReportProcessingException
{
super.initialize(node, flowController, parent);
variablesCollection = new VariablesCollection("auto_report_");
}
/**
* Processes any content in this element. This method is called when the
* processing state is 'OPENED'. The returned layout controller will retain
* the 'OPENED' state as long as there is more content available. Once all
* content has been processed, the returned layout controller should carry a
* 'FINISHED' state.
*
* @param target the report target that receives generated events.
* @return the new layout controller instance representing the new state.
*
* @throws org.jfree.report.DataSourceException
* if there was a problem reading data from the datasource.
* @throws org.jfree.report.ReportProcessingException
* if there was a general problem during the report processing.
* @throws org.jfree.report.ReportDataFactoryException
* if a query failed.
*/
protected LayoutController processContent(final ReportTarget target)
throws DataSourceException, ReportProcessingException,
ReportDataFactoryException
{
final OfficeReport or = (OfficeReport) getElement();
switch (state)
{
case OfficeReportLayoutController.STATE_NOT_STARTED:
{
return delegateToTemplace(OfficeReportLayoutController.STATE_TEMPLATES);
}
case OfficeReportLayoutController.STATE_TEMPLATES:
{
return delegateSection(or.getPageHeader(),
OfficeReportLayoutController.STATE_PAGE_HEADER_DONE);
}
case OfficeReportLayoutController.STATE_PAGE_HEADER_DONE:
{
return delegateSection(or.getPageFooter(),
OfficeReportLayoutController.STATE_PAGE_FOOTER_DONE);
}
case OfficeReportLayoutController.STATE_PAGE_FOOTER_DONE:
{
return delegateSection(or.getColumnHeader(),
OfficeReportLayoutController.STATE_COLUMN_HEADER_DONE);
}
case OfficeReportLayoutController.STATE_COLUMN_HEADER_DONE:
{
return delegateSection(or.getColumnFooter(),
OfficeReportLayoutController.STATE_COLUMN_FOOTER_DONE);
}
case OfficeReportLayoutController.STATE_COLUMN_FOOTER_DONE:
{
return delegateSection(new VariablesDeclarationSection(),
OfficeReportLayoutController.STATE_INITIAL_VARIABLES_DONE);
}
case OfficeReportLayoutController.STATE_INITIAL_VARIABLES_DONE:
{
return delegateSection(or.getReportHeader(),
OfficeReportLayoutController.STATE_REPORT_HEADER_DONE);
}
case OfficeReportLayoutController.STATE_REPORT_HEADER_DONE:
{
return delegateSection(or.getBodySection(),
OfficeReportLayoutController.STATE_REPORT_BODY_DONE);
}
case OfficeReportLayoutController.STATE_REPORT_BODY_DONE:
{
return delegateSection(new VariablesDeclarationSection(),
OfficeReportLayoutController.STATE_REPORT_FOOTER_VARIABLES);
}
case OfficeReportLayoutController.STATE_REPORT_FOOTER_VARIABLES:
{
return delegateSection(or.getReportFooter(),
OfficeReportLayoutController.STATE_REPORT_FOOTER_DONE);
}
case OfficeReportLayoutController.STATE_REPORT_FOOTER_DONE:
{
final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone();
olc.setProcessingState(ElementLayoutController.FINISHING);
return olc;
}
default:
{
throw new IllegalStateException();
}
}
}
private LayoutController delegateToTemplace(final int nextState)
throws ReportProcessingException, ReportDataFactoryException,
DataSourceException
{
final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone();
olc.state = nextState;
final OfficeTableTemplateLayoutController templateLc = new OfficeTableTemplateLayoutController();
templateLc.initialize(getElement(), getFlowController(), olc);
return templateLc;
}
private LayoutController delegateSection(final Node n, final int nextState)
throws ReportProcessingException, ReportDataFactoryException,
DataSourceException
{
final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone();
olc.state = nextState;
if (n == null)
{
return olc;
}
final FlowController flowController = getFlowController();
final ReportContext reportContext = flowController.getReportContext();
final LayoutControllerFactory layoutControllerFactory =
reportContext.getLayoutControllerFactory();
return layoutControllerFactory.create(flowController, n, olc);
}
/**
* Joins with a delegated process flow. This is generally called from a child
* flow and should *not* (I mean it!) be called from outside. If you do,
* you'll suffer.
*
* @param flowController the flow controller of the parent.
* @return the joined layout controller that incorperates all changes from the
* delegate.
*/
public LayoutController join(final FlowController flowController)
{
final OfficeReportLayoutController derived = (OfficeReportLayoutController) clone();
derived.setFlowController(flowController);
return derived;
}
public boolean isNormalFlowProcessing()
{
return state != OfficeReportLayoutController.STATE_PAGE_HEADER_DONE &&
state != OfficeReportLayoutController.STATE_PAGE_FOOTER_DONE;
}
public VariablesCollection getVariablesCollection()
{
return variablesCollection;
}
}

View File

@@ -0,0 +1,86 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeTableLayoutController.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
import org.jfree.report.flow.FlowController;
import org.jfree.report.flow.ReportTarget;
import org.jfree.report.structure.Element;
import org.jfree.report.structure.Section;
import org.jfree.report.structure.Node;
import org.jfree.report.DataSourceException;
import org.jfree.report.util.IntegerCache;
import org.jfree.layouting.util.AttributeMap;
import com.sun.star.report.pentaho.OfficeNamespaces;
/**
* Creation-Date: 24.04.2007, 14:40:20
*
* @author Thomas Morgner
*/
public class OfficeTableLayoutController extends SectionLayoutController
{
public OfficeTableLayoutController()
{
}
protected AttributeMap computeAttributes(final FlowController fc, final Element element, final ReportTarget target)
throws DataSourceException
{
final AttributeMap attributeMap = super.computeAttributes(fc, element, target);
final Section s = (Section) element;
int rowCount = 0;
final Node[] nodeArray = s.getNodeArray();
for (int i = 0; i < nodeArray.length; i++)
{
final Node node = nodeArray[i];
if (node instanceof Element == false)
{
continue;
}
final Element child = (Element) node;
if (OfficeNamespaces.TABLE_NS.equals(child.getNamespace()) &&
"table-row".equals(child.getType()))
{
rowCount += 1;
}
}
attributeMap.setAttribute(OfficeNamespaces.INTERNAL_NS, "table-row-count", IntegerCache.getInteger(rowCount));
return attributeMap;
}
}

View File

@@ -0,0 +1,176 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeTableTemplateLayoutController.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
import java.util.ArrayList;
import com.sun.star.report.pentaho.OfficeNamespaces;
import com.sun.star.report.pentaho.model.OfficeGroup;
import com.sun.star.report.pentaho.model.OfficeReport;
import org.jfree.report.DataSourceException;
import org.jfree.report.ReportDataFactoryException;
import org.jfree.report.ReportProcessingException;
import org.jfree.report.flow.FlowController;
import org.jfree.report.flow.layoutprocessor.LayoutController;
import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
import org.jfree.report.structure.Element;
import org.jfree.report.structure.Node;
import org.jfree.report.structure.Section;
/**
* Creation-Date: 24.04.2007, 16:06:52
*
* @author Thomas Morgner
*/
public class OfficeTableTemplateLayoutController extends SectionLayoutController
{
private Node[] nodes;
public OfficeTableTemplateLayoutController()
{
}
/**
* Initializes the layout controller. This method is called exactly once. It is the creators responsibility to call
* this method.
* <p/>
* Calling initialize after the first advance must result in a IllegalStateException.
*
* @param node the currently processed object or layout node.
* @param flowController the current flow controller.
* @param parent the parent layout controller that was responsible for instantiating this controller.
* @throws org.jfree.report.DataSourceException
* if there was a problem reading data from the datasource.
* @throws org.jfree.report.ReportProcessingException
* if there was a general problem during the report processing.
* @throws org.jfree.report.ReportDataFactoryException
* if a query failed.
*/
public void initialize(final Object node, final FlowController flowController, final LayoutController parent)
throws DataSourceException, ReportDataFactoryException, ReportProcessingException
{
final Section section = new Section();
section.setNamespace(OfficeNamespaces.INTERNAL_NS);
section.setType("template");
super.initialize(section, flowController, parent);
final OfficeReport report = (OfficeReport) node;
final ArrayList tables = new ArrayList();
if (report.getReportHeader() != null)
{
addFromSection(tables, (Section) report.getReportHeader());
}
addFromBody(tables, (Section) report.getBodySection());
if (report.getReportFooter() != null)
{
addFromSection(tables, (Section) report.getReportFooter());
}
this.nodes = (Node[]) tables.toArray(new Node[tables.size()]);
}
private void addFromBody(final ArrayList tables, final Section section)
{
final Node[] nodeArray = section.getNodeArray();
for (int i = 0; i < nodeArray.length; i++)
{
final Node node = nodeArray[i];
if (node instanceof Section == false)
{
continue;
}
final Section child = (Section) node;
if (node instanceof OfficeGroup)
{
addFromGroup(tables, child);
}
else
{
addFromSection(tables, child);
}
}
}
private void addFromGroup(final ArrayList tables, final Section section)
{
final Node[] nodeArray = section.getNodeArray();
for (int i = 0; i < nodeArray.length; i++)
{
final Node node = nodeArray[i];
if (node instanceof Section == false)
{
continue;
}
final Section element = (Section) node;
if (OfficeNamespaces.INTERNAL_NS.equals(element.getNamespace()) && "group-body".equals(element.getType()))
{
addFromBody(tables, element);
}
else
{
addFromSection(tables, element);
}
}
}
private void addFromSection(final ArrayList tables, final Section section)
{
final Node[] nodeArray = section.getNodeArray();
for (int i = 0; i < nodeArray.length; i++)
{
final Node node = nodeArray[i];
if (node instanceof Element == false)
{
continue;
}
final Element element = (Element) node;
if (OfficeNamespaces.TABLE_NS.equals(element.getNamespace()) &&
"table".equals(element.getType()))
{
tables.add(element);
}
}
}
public Node[] getNodes()
{
return nodes;
}
}

View File

@@ -0,0 +1,215 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: TableCellLayoutController.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
import com.sun.star.report.pentaho.OfficeNamespaces;
import com.sun.star.report.pentaho.model.FormatCondition;
import com.sun.star.report.pentaho.model.FormattedTextElement;
import com.sun.star.report.pentaho.model.ReportElement;
import org.jfree.layouting.util.AttributeMap;
import org.jfree.report.DataSourceException;
import org.jfree.report.DataFlags;
import org.jfree.report.expressions.Expression;
import org.jfree.report.flow.FlowController;
import org.jfree.report.flow.ReportTarget;
import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil;
import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
import org.jfree.report.structure.Element;
import org.jfree.report.structure.Node;
import org.jfree.report.structure.Section;
import org.jfree.util.ObjectUtilities;
/**
* Before writing the table cell, we have to evaluate the childs of the cell. The cell itself can either be empty or it
* has a one ore more paragraphs inside. The paragraph contains a single report element, but may contain additional
* other content.
*
* @author Thomas Morgner
* @noinspection CloneableClassWithoutClone
* @since 05.03.2007
*/
public class TableCellLayoutController extends SectionLayoutController
{
public TableCellLayoutController()
{
}
protected AttributeMap computeAttributes(final FlowController fc,
final Element element,
final ReportTarget target)
throws DataSourceException
{
final AttributeMap attributeMap = super.computeAttributes(fc, element, target);
final String definedStyle = (String) attributeMap.getAttribute(OfficeNamespaces.TABLE_NS, "style-name");
attributeMap.setAttribute(OfficeNamespaces.TABLE_NS, "style-name", getDisplayStyleName((Section) element, definedStyle));
try
{
final DataFlags value = computeValue();
if (value != null)
{
FormatValueUtility.applyValueForCell(value.getValue(), attributeMap);
}
}
catch (Exception e)
{
// ignore ..
}
return attributeMap;
}
private DataFlags computeValue() throws DataSourceException
{
// Search for the first FormattedTextElement
final Section cell = (Section) getElement();
final FormattedTextElement element = findFormattedTextElement(cell);
if (element == null)
{
return null;
}
return FormatValueUtility.computeDataFlag(element, getFlowController());
}
private FormattedTextElement findFormattedTextElement(final Section section)
{
final Node[] nodeArray = section.getNodeArray();
for (int i = 0; i < nodeArray.length; i++)
{
final Node node = nodeArray[i];
if (node instanceof FormattedTextElement)
{
return (FormattedTextElement) node;
}
if (node instanceof Section)
{
final FormattedTextElement retval = findFormattedTextElement((Section) node);
if (retval != null)
{
return retval;
}
}
}
return null;
}
private String getDisplayStyleName(final Section section,
final String defaultStyle)
{
if (section.isEnabled() == false)
{
return defaultStyle;
}
if (section.getNodeCount() == 0)
{
return defaultStyle;
}
final Node[] nodes = section.getNodeArray();
for (int i = 0; i < nodes.length; i++)
{
final Node child = nodes[i];
if (child instanceof ReportElement)
{
final ReportElement element = (ReportElement) child;
if (element.isEnabled() == false)
{
continue;
}
if (element.getFormatConditionCount() == 0)
{
continue;
}
final Expression displayCond = element.getDisplayCondition();
if (displayCond != null)
{
try
{
if (Boolean.FALSE.equals(LayoutControllerUtil.evaluateExpression
(getFlowController(), element, displayCond)))
{
continue;
}
}
catch (DataSourceException e)
{
// ignore silently ..
}
}
final FormatCondition[] conditions = element.getFormatConditions();
for (int j = 0; j < conditions.length; j++)
{
final FormatCondition formCond = conditions[j];
if (formCond.isEnabled() == false)
{
continue;
}
try
{
final Object o = LayoutControllerUtil.evaluateExpression
(getFlowController(), element, formCond.getFormula());
if (Boolean.TRUE.equals(o))
{
return formCond.getStyleName();
}
}
catch (DataSourceException e)
{
// ignore silently ..
}
}
}
if (child instanceof Section)
{
final String childFormatCondition =
getDisplayStyleName((Section) child, defaultStyle);
if (ObjectUtilities.equal(childFormatCondition, defaultStyle) == false)
{
return childFormatCondition;
}
}
}
return defaultStyle;
}
}

View File

@@ -0,0 +1,108 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: VariablesCollection.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
import java.util.ArrayList;
import com.sun.star.report.pentaho.model.FormattedTextElement;
/**
* A variables collection is used to collect all FormattedTextElement objects
* of a repeated header or footer. Later, for each of these elements a variable
* setter is inserted into a hidden (in fact just very small) paragraph. These
* variables can later be read using the 'variable-get' construct.
*
* From the idea, this is equal to the 'strings' declaration of CSS3, although
* this code is explicit instead of declarative.
*
* @author Thomas Morgner
* @since 22.03.2007
*/
public class VariablesCollection
{
private VariablesCollection parent;
private String namePrefix;
private ArrayList variables;
public VariablesCollection(final String namePrefix)
{
this(namePrefix, null);
}
public VariablesCollection(final String namePrefix, final VariablesCollection parent)
{
if (namePrefix == null)
{
throw new NullPointerException("NamePrefix cannot be null");
}
this.namePrefix = namePrefix;
this.parent = parent;
this.variables = new ArrayList();
}
public VariablesCollection getParent()
{
return parent;
}
public String getNamePrefix()
{
return namePrefix;
}
public String addVariable (final FormattedTextElement element)
{
variables.add(element);
final int size = variables.size();
return namePrefix + size;
}
public FormattedTextElement[] getVariables ()
{
return (FormattedTextElement[])
variables.toArray(new FormattedTextElement[variables.size()]);
}
public int getVariablesCount ()
{
return variables.size();
}
}

View File

@@ -0,0 +1,186 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: VariablesDeclarationLayoutController.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.layoutprocessor;
import com.sun.star.report.pentaho.OfficeNamespaces;
import com.sun.star.report.pentaho.model.FormattedTextElement;
import org.jfree.layouting.util.AttributeMap;
import org.jfree.report.DataSourceException;
import org.jfree.report.JFreeReportInfo;
import org.jfree.report.ReportDataFactoryException;
import org.jfree.report.ReportProcessingException;
import org.jfree.report.expressions.FormulaExpression;
import org.jfree.report.flow.FlowController;
import org.jfree.report.flow.ReportTarget;
import org.jfree.report.flow.layoutprocessor.AbstractLayoutController;
import org.jfree.report.flow.layoutprocessor.LayoutController;
import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil;
import org.jfree.report.structure.Element;
/**
* Writes a full variables-declaration section.
*
* @author Thomas Morgner
* @since 20.03.2007
*/
public class VariablesDeclarationLayoutController
extends AbstractLayoutController
{
private boolean processed;
public VariablesDeclarationLayoutController()
{
}
private OfficeRepeatingStructureLayoutController getRepeatingParent()
{
LayoutController parent = getParent();
while (parent != null)
{
if (parent instanceof OfficeRepeatingStructureLayoutController)
{
return (OfficeRepeatingStructureLayoutController) parent;
}
parent = parent.getParent();
}
return null;
}
/**
* Advances the processing position.
*
* @param target the report target that receives generated events.
* @return the new layout controller instance representing the new state.
*
* @throws org.jfree.report.DataSourceException
* if there was a problem reading data from the datasource.
* @throws org.jfree.report.ReportProcessingException
* if there was a general problem during the report processing.
* @throws org.jfree.report.ReportDataFactoryException
* if a query failed.
*/
public LayoutController advance(final ReportTarget target)
throws DataSourceException, ReportDataFactoryException,
ReportProcessingException
{
if (processed)
{
throw new IllegalStateException("Already processed.");
}
final VariablesDeclarationLayoutController vlc =
(VariablesDeclarationLayoutController) clone();
vlc.processed = true;
final OfficeRepeatingStructureLayoutController orslc = getRepeatingParent();
if (orslc == null)
{
// There is no repeating parent. What the heck are we doing here ..
return vlc;
}
final VariablesCollection collection = orslc.getVariablesCollection();
if (collection.getVariablesCount() == 0)
{
// no processing necessary, as the header or footer contain no variables at all ..
return vlc;
}
final Element node = (Element) getNode();
final AttributeMap vdSection = node.getAttributeMap();
target.startElement(vdSection);
final FormattedTextElement[] variables = collection.getVariables();
for (int i = 0; i < variables.length; i++)
{
final FormattedTextElement variable = variables[i];
final String varName = collection.getNamePrefix() + (i + 1);
final AttributeMap map = generateVariableSetSection(variable);
map.setAttribute(OfficeNamespaces.TEXT_NS, "name", varName);
target.startElement(map);
target.endElement(map);
}
target.endElement(vdSection);
return vlc;
}
private AttributeMap generateVariableSetSection(final FormattedTextElement variable)
throws DataSourceException
{
final AttributeMap variableSection = new AttributeMap();
variableSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TEXT_NS);
variableSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, "variable-set");
variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "display", "none");
final FormulaExpression valueExpression = variable.getValueExpression();
final Object value = LayoutControllerUtil.evaluateExpression(getFlowController(), variable, valueExpression);
FormatValueUtility.applyValueForVariable(value, variableSection);
variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "formula", "ooow:" + String.valueOf(value));
return variableSection;
}
/**
* Checks, whether the layout controller would be advanceable. If this method
* returns true, it is generally safe to call the 'advance()' method.
*
* @return true, if the layout controller is advanceable, false otherwise.
*/
public boolean isAdvanceable()
{
return processed == false;
}
/**
* Joins with a delegated process flow. This is generally called from a child
* flow and should *not* (I mean it!) be called from outside. If you do,
* you'll suffer.
*
* @param flowController the flow controller of the parent.
* @return the joined layout controller that incorperates all changes from the
* delegate.
*/
public LayoutController join(final FlowController flowController)
throws DataSourceException, ReportDataFactoryException,
ReportProcessingException
{
throw new UnsupportedOperationException
("Join is not supported in this layout controller");
}
}

View File

@@ -0,0 +1,184 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: InputRepositoryLoader.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.loader;
import java.net.URL;
import java.util.Map;
import java.util.HashMap;
import com.sun.star.report.InputRepository;
import org.jfree.resourceloader.ResourceData;
import org.jfree.resourceloader.ResourceKey;
import org.jfree.resourceloader.ResourceKeyCreationException;
import org.jfree.resourceloader.ResourceLoader;
import org.jfree.resourceloader.ResourceLoadingException;
import org.jfree.resourceloader.ResourceManager;
import org.jfree.resourceloader.loader.LoaderUtils;
public class InputRepositoryLoader implements ResourceLoader
{
private InputRepository inputRepository;
private ResourceManager resourceManager;
public InputRepositoryLoader (final InputRepository inputRepository)
{
if (inputRepository == null)
{
throw new NullPointerException();
}
this.inputRepository = inputRepository;
}
/**
* Checks, whether this resource loader implementation was responsible for
* creating this key.
*
* @param key
* @return
*/
public boolean isSupportedKey(final ResourceKey key)
{
if (InputRepositoryLoader.class.getName().equals(key.getSchema()))
{
return true;
}
return false;
}
/**
* Creates a new resource key from the given object and the factory keys.
*
* @param value
* @param factoryKeys
* @return the created key or null, if the format was not recognized.
* @throws org.jfree.resourceloader.ResourceKeyCreationException
* if creating the key failed.
*/
public ResourceKey createKey(final Object value,
final Map factoryKeys)
throws ResourceKeyCreationException
{
if (value instanceof String == false)
{
return null;
}
final String strVal = (String) value;
if (strVal.startsWith("sun:oo://") == false)
{
return null;
}
return new ResourceKey(InputRepositoryLoader.class.getName(),
new InputResourceKey(inputRepository.getId(), strVal), factoryKeys);
}
/**
* Derives a new resource key from the given key. If neither a path nor new
* factory-keys are given, the parent key is returned.
*
* @param parent the parent
* @param path the derived path (can be null).
* @param factoryKeys the optional factory keys (can be null).
* @return the derived key.
* @throws org.jfree.resourceloader.ResourceKeyCreationException
* if the key cannot be derived for any reason.
*/
public ResourceKey deriveKey(final ResourceKey parent,
final String path,
final Map factoryKeys)
throws ResourceKeyCreationException
{
if (isSupportedKey(parent) == false)
{
throw new ResourceKeyCreationException("Assertation: Unsupported parent key type");
}
final InputResourceKey parentKey = (InputResourceKey) parent.getIdentifier();
final String resource;
if (path.startsWith("sun:oo://"))
{
resource = path;
}
else if (path.startsWith("/"))
{
resource = "sun:oo:/" + path;
}
else
{
resource = LoaderUtils.mergePaths(parentKey.getPath(), path);
}
final Map map;
if (factoryKeys != null)
{
map = new HashMap();
map.putAll(parent.getFactoryParameters());
map.putAll(factoryKeys);
}
else
{
map = parent.getFactoryParameters();
}
return new ResourceKey(parent.getSchema(),
new InputResourceKey(parentKey.getInputRepositoryId(), resource), map);
}
public URL toURL(final ResourceKey key)
{
return null;
}
public ResourceData load (final ResourceKey key)
throws ResourceLoadingException
{
if (isSupportedKey(key) == false)
{
throw new ResourceLoadingException("None of my keys.");
}
return new InputRepositoryResourceData(key, inputRepository);
}
public void setResourceManager (final ResourceManager manager)
{
this.resourceManager = manager;
}
public ResourceManager getResourceManager ()
{
return resourceManager;
}
}

View File

@@ -0,0 +1,94 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: InputRepositoryResourceData.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.loader;
import java.io.IOException;
import java.io.InputStream;
import com.sun.star.report.InputRepository;
import org.jfree.resourceloader.ResourceKey;
import org.jfree.resourceloader.ResourceLoadingException;
import org.jfree.resourceloader.ResourceManager;
import org.jfree.resourceloader.loader.AbstractResourceData;
public class InputRepositoryResourceData extends AbstractResourceData
{
private InputRepository inputRepository;
private ResourceKey key;
private String resourceIdentifer;
public InputRepositoryResourceData (final ResourceKey key,
final InputRepository repository)
{
this.key = key;
this.inputRepository = repository;
final InputResourceKey rkey = (InputResourceKey) key.getIdentifier();
final String identifier = rkey.getPath();
this.resourceIdentifer = identifier.substring("sun:oo://".length());
}
public Object getAttribute (String key)
{
// we dont support attributes here ..
return null;
}
public ResourceKey getKey ()
{
return key;
}
public InputStream getResourceAsStream (ResourceManager caller)
throws ResourceLoadingException
{
try
{
return inputRepository.createInputStream(resourceIdentifer);
}
catch (IOException e)
{
throw new ResourceLoadingException
("Failed to create input stream for " + resourceIdentifer, e);
}
}
public long getVersion (ResourceManager caller)
{
return inputRepository.getVersion(resourceIdentifer);
}
}

View File

@@ -0,0 +1,77 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: InputResourceKey.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.loader;
import java.io.Serializable;
/**
* Creation-Date: Feb 22, 2007, 8:51:42 PM
*
* @author Thomas Morgner
*/
public class InputResourceKey implements Serializable
{
private static final long serialVersionUID = 2819901838705793075L;
private Object inputRepositoryId;
private String path;
public InputResourceKey(final Object inputRepositoryId, final String path)
{
this.inputRepositoryId = inputRepositoryId;
this.path = path;
}
public Object getInputRepositoryId()
{
return inputRepositoryId;
}
public String getPath()
{
return path;
}
public String toString()
{
return "InputResourceKey{" +
"inputRepositoryId=" + inputRepositoryId +
", path='" + path + '\'' +
'}';
}
}

View File

@@ -0,0 +1,114 @@
#*************************************************************************
#
# OpenOffice.org - a multi-platform office productivity suite
#
# $RCSfile: makefile.mk,v $
#
# $Revision: 1.2 $
#
# last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
#
# The Contents of this file are made available subject to
# the terms of GNU Lesser General Public License Version 2.1.
#
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2005 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
#
#*************************************************************************
PRJ = ..$/..$/..$/..$/..$/..
PRJNAME = reportdesign
TARGET = $(PRJNAME)
PACKAGE = com$/sun$/star$/report$/pentaho
# we have circular dependencies
nodep=true
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
#----- compile .java files -----------------------------------------
JARFILES = ridl.jar unoil.jar jurt.jar juh.jar jut.jar java_uno.jar jcommon-1.0.10.jar libxml-0.9.5.jar jfreereport-0.9.0-05.jar libloader-0.3.4.jar sac.jar liblayout-0.2.6.jar jcommon-serializer-0.1.0.jar libfonts-0.2.6.jar libformula-0.1.8.jar
JAVAFILES := $(shell $(FIND) . -name "*.java")
# JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:s/.java/.class/))
#----- copy .properties and .css files -----------------------------------------
# external find gives / for 4nt too...
# PROPERTYFILES := $(subst,/,$/ $(subst,./,$(CLASSDIR)$/$(PACKAGE)$/ $(shell $(FIND) . -name "*.properties")))
PROPERTYFILES := $(CLASSDIR)$/$(PACKAGE)$/configuration.properties \
$(CLASSDIR)$/$(PACKAGE)$/module.properties \
$(CLASSDIR)$/$(PACKAGE)$/parser$/selectors.properties
# CSSFILES := $(subst,./,$(CLASSDIR)$/$(PACKAGE)$/ $(shell $(FIND) . -name "*.css"))
CSSFILES := $(CLASSDIR)$/$(PACKAGE)$/oasis-datastyle.css\
$(CLASSDIR)$/$(PACKAGE)$/oasis-draw.css\
$(CLASSDIR)$/$(PACKAGE)$/oasis-form.css\
$(CLASSDIR)$/$(PACKAGE)$/oasis-style.css\
$(CLASSDIR)$/$(PACKAGE)$/oasis-table.css\
$(CLASSDIR)$/$(PACKAGE)$/oasis-text.css\
$(CLASSDIR)$/$(PACKAGE)$/smil.css\
$(CLASSDIR)$/$(PACKAGE)$/star-office.css\
$(CLASSDIR)$/$(PACKAGE)$/star-report.css\
$(CLASSDIR)$/$(PACKAGE)$/star-rpt.css\
$(CLASSDIR)$/$(PACKAGE)$/svg.css\
$(CLASSDIR)$/$(PACKAGE)$/xsl-fo.css
XSDFILES := $(CLASSDIR)$/$(PACKAGE)$/parser$/rpt-schema-v1.0-os.xsd \
$(CLASSDIR)$/$(PACKAGE)$/styles$/stylemapper.xsd
XMLFILES := $(CLASSDIR)$/$(PACKAGE)$/styles$/stylemapper.xml
TXTFILES := $(CLASSDIR)$/$(PACKAGE)$/parser$/style-mapping.txt
#----- make a jar from compiled files ------------------------------
JARCLASSDIRS = .
JARTARGET = $(TARGET).jar
JARCOMPRESS = TRUE
CUSTOMMANIFESTFILE = Manifest.mf
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
.IF "$(JARTARGETN)"!=""
$(JARTARGETN) : $(PROPERTYFILES) $(CSSFILES) $(XSDFILES) $(TXTFILES) $(XMLFILES)
.ENDIF # "$(JARTARGETN)"!=""
$(CLASSDIR)$/$(PACKAGE)$/%.properties : %.properties
@@-$(MKDIRHIER) $(@:d)
$(COPY) $< $@
$(CLASSDIR)$/$(PACKAGE)$/%.css : %.css
@@-$(MKDIRHIER) $(@:d)
$(COPY) $< $@
$(CLASSDIR)$/$(PACKAGE)$/%.xsd : %.xsd
@@-$(MKDIRHIER) $(@:d)
$(COPY) $< $@
$(CLASSDIR)$/$(PACKAGE)$/%.xml : %.xml
@@-$(MKDIRHIER) $(@:d)
$(COPY) $< $@
$(CLASSDIR)$/$(PACKAGE)$/%.txt : %.txt
@@-$(MKDIRHIER) $(@:d)
$(COPY) $< $@

View File

@@ -0,0 +1,66 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: DataStyle.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.structure.Section;
import com.sun.star.report.pentaho.OfficeNamespaces;
/**
* Represents an automatic or manual data style definition.
*
* @author Thomas Morgner
* @since 02.03.2007
*/
public class DataStyle extends Section
{
public DataStyle()
{
}
public String getStyleName()
{
return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name");
}
public void setStyleName(final String name)
{
setAttribute(OfficeNamespaces.STYLE_NS, "name", name);
}
}

View File

@@ -0,0 +1,62 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: FixedTextElement.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.structure.Section;
/**
* Todo: Document me!
*
* @author Thomas Morgner
* @since 02.03.2007
*/
public class FixedTextElement extends ReportElement
{
private Section content;
public FixedTextElement()
{
content = new Section();
content.setVirtual(true);
}
public Section getContent()
{
return content;
}
}

View File

@@ -0,0 +1,83 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: FontFaceDeclsSection.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import java.util.HashMap;
import com.sun.star.report.pentaho.OfficeNamespaces;
import org.jfree.report.structure.Element;
/**
* Todo: Document me!
*
* @author Thomas Morgner
* @since 13.03.2007
*/
public class FontFaceDeclsSection extends Element
{
private HashMap fontFaces;
public FontFaceDeclsSection()
{
fontFaces = new HashMap();
setType("font-face-decls");
setNamespace(OfficeNamespaces.OFFICE_NS);
}
public void addFontFace(final FontFaceElement style)
{
fontFaces.put (style.getStyleName(), style);
}
public FontFaceElement getFontFace (final String name)
{
return (FontFaceElement) fontFaces.get(name);
}
public FontFaceElement[] getAllFontFaces()
{
return (FontFaceElement[]) fontFaces.values().toArray
(new FontFaceElement[fontFaces.size()]);
}
public boolean containsFont(final String fontName)
{
return fontFaces.containsKey(fontName);
}
}

View File

@@ -0,0 +1,66 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: FontFaceElement.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.structure.Section;
import com.sun.star.report.pentaho.OfficeNamespaces;
/**
* Represents an automatic or manual data style definition.
*
* @author Thomas Morgner
* @since 02.03.2007
*/
public class FontFaceElement extends Section
{
public FontFaceElement()
{
}
public String getStyleName()
{
return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name");
}
public void setStyleName(final String name)
{
setAttribute(OfficeNamespaces.STYLE_NS, "name", name);
}
}

View File

@@ -0,0 +1,78 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: FormatCondition.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.expressions.FormulaExpression;
/**
* The format condition defines, what style-format is applied to an element.
*
* @author Thomas Morgner
* @since 02.03.2007
*/
public class FormatCondition
{
private FormulaExpression formula;
private String styleName;
private boolean enabled;
public FormatCondition(final FormulaExpression formula,
final String styleName,
final boolean enabled)
{
this.formula = formula;
this.styleName = styleName;
this.enabled = enabled;
}
public FormulaExpression getFormula()
{
return formula;
}
public String getStyleName()
{
return styleName;
}
public boolean isEnabled()
{
return enabled;
}
}

View File

@@ -0,0 +1,69 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: FormattedTextElement.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.expressions.FormulaExpression;
/**
* A formatted text element takes a formula, evaluates it and formats the
* given element using some arbitary style. (As this is totally undocumented,
* we leave this out for now. Either we'll insert a field there or we call
* an UNO-component to do the formatting.
*
* @author Thomas Morgner
* @since 02.03.2007
*/
public class FormattedTextElement extends ReportElement
{
private FormulaExpression valueExpression;
public FormattedTextElement()
{
}
public FormulaExpression getValueExpression()
{
return valueExpression;
}
public void setValueExpression(final FormulaExpression valueExpression)
{
this.valueExpression = valueExpression;
}
}

View File

@@ -0,0 +1,91 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ImageElement.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.expressions.FormulaExpression;
import com.sun.star.report.pentaho.OfficeNamespaces;
/**
* Todo: Document me!
*
* @author Thomas Morgner
* @since 02.03.2007
*/
public class ImageElement extends ReportElement
{
private FormulaExpression formula;
public ImageElement()
{
}
public FormulaExpression getFormula()
{
return formula;
}
public void setFormula(final FormulaExpression formula)
{
this.formula = formula;
}
public boolean isScale()
{
return "true".equals(getAttribute(OfficeNamespaces.OOREPORT_NS, "scale"));
}
public void setScale(final boolean scale)
{
setAttribute(OfficeNamespaces.OOREPORT_NS, "scale", String.valueOf(scale));
}
public boolean isPreserveIRI()
{
return "true".equals(getAttribute(OfficeNamespaces.OOREPORT_NS, "preserve-IRI"));
}
public void setPreserveIRI(final boolean preserveIRI)
{
setAttribute(OfficeNamespaces.OOREPORT_NS, "preserve-IRI", String.valueOf(preserveIRI));
}
public String getImageData()
{
return (String) getAttribute(OfficeNamespaces.FORM_NS, "image-data");
}
}

View File

@@ -0,0 +1,53 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeDetailSection.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.structure.DetailSection;
/**
* A Marker-Class.
*
* @author Thomas Morgner
* @since 02.03.2007
*/
public class OfficeDetailSection extends DetailSection
{
public OfficeDetailSection()
{
}
}

View File

@@ -0,0 +1,70 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeDocument.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.JFreeReport;
/**
* An office document represents the root of the report processing. In
* OpenOffice reports, this is the only child of the report object.
*
* @author Thomas Morgner
* @since 02.03.2007
*/
public class OfficeDocument extends JFreeReport
{
private OfficeStylesCollection stylesCollection;
public OfficeDocument()
{
}
public OfficeStylesCollection getStylesCollection()
{
return stylesCollection;
}
public void setStylesCollection(final OfficeStylesCollection stylesCollection)
{
if (stylesCollection == null)
{
throw new NullPointerException();
}
this.stylesCollection = stylesCollection;
}
}

View File

@@ -0,0 +1,67 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeGroup.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.structure.Group;
import com.sun.star.report.pentaho.OfficeNamespaces;
/**
* An office group is a virtual section that contains the group header, footer
* and either a detail section or another group.
*
* @author Thomas Morgner
* @since 02.03.2007
*/
public class OfficeGroup extends Group
{
public OfficeGroup()
{
}
public boolean isStartNewColumn ()
{
return "true".equals
(getAttribute(OfficeNamespaces.OOREPORT_NS, "start-new-column"));
}
public boolean isResetPageNumber ()
{
return "true".equals
(getAttribute(OfficeNamespaces.OOREPORT_NS, "reset-page-number"));
}
}

View File

@@ -0,0 +1,62 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeGroupSection.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.structure.Section;
import com.sun.star.report.pentaho.OfficeNamespaces;
/**
* A group header or footer. If such a section is marked as sticky, it will be
* repeated on each new page.
*
* @author Thomas Morgner
* @since 02.03.2007
*/
public class OfficeGroupSection extends Section
{
public OfficeGroupSection()
{
}
public boolean isRepeatSection ()
{
final Object repeatFlag =
getAttribute(OfficeNamespaces.OOREPORT_NS, "repeat-section");
return "true".equals(repeatFlag);
}
}

View File

@@ -0,0 +1,78 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeMasterPage.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.structure.Section;
import com.sun.star.report.pentaho.OfficeNamespaces;
/**
* A master page. A master page can contain header and footer and is linked
* to a page-layout.
*
* @author Thomas Morgner
* @since 13.03.2007
*/
public class OfficeMasterPage extends Section
{
public OfficeMasterPage()
{
}
public String getStyleName()
{
return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name");
}
public void setStyleName(final String name)
{
setAttribute(OfficeNamespaces.STYLE_NS, "name", name);
}
public String getPageLayout()
{
return (String) getAttribute(OfficeNamespaces.STYLE_NS, "page-layout-name");
}
public void setPageLayout(final String name)
{
setAttribute(OfficeNamespaces.STYLE_NS, "page-layout-name", name);
}
}

View File

@@ -0,0 +1,92 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeMasterStyles.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import java.util.HashMap;
import org.jfree.report.structure.Element;
import org.jfree.report.structure.Section;
/**
* The master-styles section can have either a master-page, handout-master
* or draw-layer-set. (The latter ones are ignored for the reporting purposes,
* they are PowerPoint related.)
*
* There is no documentation how the system selects a master-page if there is
* no master-page assigned to the paragraph. However, it seems as if the
* master-page called 'Standard' is used as initial default.
*
* @author Thomas Morgner
* @since 13.03.2007
*/
public class OfficeMasterStyles extends Element
{
private HashMap masterPages;
private Section otherNodes;
public OfficeMasterStyles()
{
masterPages = new HashMap();
otherNodes = new Section();
}
public void addMasterPage (final OfficeMasterPage masterPage)
{
if (masterPage == null)
{
throw new NullPointerException();
}
this.masterPages.put(masterPage.getStyleName(), masterPage);
}
public OfficeMasterPage getMasterPage (final String name)
{
return (OfficeMasterPage) masterPages.get (name);
}
public OfficeMasterPage[] getAllMasterPages()
{
return (OfficeMasterPage[]) masterPages.values().toArray
(new OfficeMasterPage[masterPages.size()]);
}
public Section getOtherNodes()
{
return otherNodes;
}
}

View File

@@ -0,0 +1,136 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeReport.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.structure.Element;
import org.jfree.report.structure.Node;
/**
* A office report is an ordered section. It contains several root-level bands
* which need to be processed in a given order.
*
* A report can have named expression attached. These expressions will be
* computed at the global scope and will be available for all child elements.
*
* @author Thomas Morgner
* @since 02.03.2007
*/
public class OfficeReport extends Element
{
private Node pageHeader;
private Node pageFooter;
private Node columnHeader;
private Node columnFooter;
private Node reportHeader;
private Node reportFooter;
private Node bodySection;
public OfficeReport()
{
}
public Node getPageHeader()
{
return pageHeader;
}
public void setPageHeader(final Node pageHeader)
{
this.pageHeader = pageHeader;
}
public Node getPageFooter()
{
return pageFooter;
}
public void setPageFooter(final Node pageFooter)
{
this.pageFooter = pageFooter;
}
public Node getColumnHeader()
{
return columnHeader;
}
public void setColumnHeader(final Node columnHeader)
{
this.columnHeader = columnHeader;
}
public Node getColumnFooter()
{
return columnFooter;
}
public void setColumnFooter(final Node columnFooter)
{
this.columnFooter = columnFooter;
}
public Node getReportHeader()
{
return reportHeader;
}
public void setReportHeader(final Node reportHeader)
{
this.reportHeader = reportHeader;
}
public Node getReportFooter()
{
return reportFooter;
}
public void setReportFooter(final Node reportFooter)
{
this.reportFooter = reportFooter;
}
public Node getBodySection()
{
return bodySection;
}
public void setBodySection(final Node bodySection)
{
this.bodySection = bodySection;
}
}

View File

@@ -0,0 +1,139 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeStyle.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import com.sun.star.report.pentaho.OfficeNamespaces;
import org.jfree.report.structure.Element;
import org.jfree.report.structure.Section;
/**
* Represents an automatic or manual style definition.
*
* @author Thomas Morgner
* @since 02.03.2007
*/
public class OfficeStyle extends Section
{
public OfficeStyle()
{
setNamespace(OfficeNamespaces.STYLE_NS);
setType("style");
}
public String getStyleName()
{
return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name");
}
public void setStyleName(final String name)
{
setAttribute(OfficeNamespaces.STYLE_NS, "name", name);
}
/**
* A parent style name must be a common style (it cannot be an automatic
* style) and has to exist. If no parent style is given, an implementation
* specific default style is used.
*
* @return
*/
public String getStyleParent()
{
return (String) getAttribute(OfficeNamespaces.STYLE_NS, "parent-style-name");
}
public void setStyleParent(final String parentName)
{
setAttribute(OfficeNamespaces.STYLE_NS, "parent-style-name", parentName);
}
public String getStyleFamily()
{
return (String) getAttribute(OfficeNamespaces.STYLE_NS, "family");
}
public void setStyleFamily(final String family)
{
setAttribute(OfficeNamespaces.STYLE_NS, "family", family);
}
// public String getMasterPageName()
// {
// return (String) getAttribute(OfficeNamespaces.STYLE_NS, "master-page-name");
// }
public Element getParagraphProperties ()
{
return findFirstChild(OfficeNamespaces.STYLE_NS, "paragraph-properties");
}
public Element getTextProperties ()
{
return findFirstChild(OfficeNamespaces.STYLE_NS, "text-properties");
}
public Element getTableRowProperties ()
{
return findFirstChild(OfficeNamespaces.STYLE_NS, "table-row-properties");
}
public Element getTableProperties ()
{
return findFirstChild(OfficeNamespaces.STYLE_NS, "table-properties");
}
public Element getTableColumnProperties ()
{
return findFirstChild(OfficeNamespaces.STYLE_NS, "table-column-properties");
}
public Element getSectionProperties ()
{
return findFirstChild(OfficeNamespaces.STYLE_NS, "section-properties");
}
public Element getTableCellProperties ()
{
return findFirstChild(OfficeNamespaces.STYLE_NS, "table-cell-properties");
}
public Element getGraphicProperties ()
{
return findFirstChild(OfficeNamespaces.STYLE_NS, "graphic-properties");
}
}

View File

@@ -0,0 +1,214 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeStyles.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import org.jfree.report.structure.Element;
/**
* Holds one style type, either an automatic, common or master style. This is a
* marker container that defines the nature of the styles contained within this
* container. (Yeah, it is awkward, but that's how the document model describes
* it.)
*
* The style family can be one of paragraph, text, section, table, table-column,
* table-row, table-cell, table-page, chart, default, drawing-page, graphic,
* presentation, control and ruby.
*
* @author Thomas Morgner
* @since 07.03.2007
*/
public class OfficeStyles extends Element
{
public static class StyleKey implements Serializable
{
private static final long serialVersionUID = 4931878927362887477L;
private String family;
private String name;
public StyleKey(final String family, final String name)
{
if (family == null)
{
throw new NullPointerException();
}
this.family = family;
this.name = name;
}
public String getFamily()
{
return family;
}
public String getName()
{
return name;
}
public boolean equals(final Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null || getClass() != obj.getClass())
{
return false;
}
final StyleKey styleKey = (StyleKey) obj;
if (!family.equals(styleKey.family))
{
return false;
}
if (name != null ? !name.equals(styleKey.name) : styleKey.name != null)
{
return false;
}
return true;
}
public int hashCode()
{
int result = family.hashCode();
result = 31 * result + (name != null ? name.hashCode() : 0);
return result;
}
}
private HashMap pageStyles;
private HashMap dataStyles;
private HashMap styles;
private ArrayList otherChilds;
public OfficeStyles()
{
this.styles = new HashMap();
this.dataStyles = new HashMap();
this.pageStyles = new HashMap();
this.otherChilds = new ArrayList();
}
public OfficeStyle getStyle(final String family, final String name)
{
return (OfficeStyle) styles.get(new StyleKey(family, name));
}
public void addStyle (final OfficeStyle style)
{
if (style == null)
{
throw new NullPointerException();
}
final String styleFamily = style.getStyleFamily();
if (styleFamily == null)
{
throw new NullPointerException();
}
if (style.getStyleName() == null)
{
throw new NullPointerException();
}
styles.put(new StyleKey(styleFamily, style.getStyleName()), style);
}
public void addPageStyle (final PageLayout style)
{
pageStyles.put(style.getStyleName(), style);
}
public PageLayout getPageStyle (final String name)
{
return (PageLayout) pageStyles.get (name);
}
public void addDataStyle(final DataStyle style)
{
dataStyles.put (style.getStyleName(), style);
}
public DataStyle getDataStyle (final String name)
{
return (DataStyle) dataStyles.get(name);
}
public void addOtherNode (final Element node)
{
otherChilds.add(node);
}
public DataStyle[] getAllDataStyles()
{
return (DataStyle[]) dataStyles.values().toArray
(new DataStyle[dataStyles.size()]);
}
public PageLayout[] getAllPageStyles()
{
return (PageLayout[]) pageStyles.values().toArray
(new PageLayout[pageStyles.size()]);
}
public OfficeStyle[] getAllStyles()
{
return (OfficeStyle[]) styles.values().toArray
(new OfficeStyle[styles.size()]);
}
public Element[] getOtherStyles()
{
return (Element[]) otherChilds.toArray(new Element[otherChilds.size()]);
}
public boolean containsStyle(final String family, final String name)
{
return styles.containsKey(new StyleKey(family, name));
}
public boolean containsDataStyle(final String styleName)
{
return dataStyles.containsKey(styleName);
}
}

View File

@@ -0,0 +1,132 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeStylesCollection.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import com.sun.star.report.pentaho.OfficeNamespaces;
import org.jfree.report.structure.Element;
/**
* Holds all style-definitions and provides some simplified lookup methods to
* grab them by their type and name.
* <p/>
* For now, we are only interested in 'style:style' nodes. Each of these nodes
* has a style-name and a style-family. Each style declaration can have a parent
* style, from which properties are inherited.
* <p/>
* Style names are unique within the family, no matter whether the style is an
* automatic style, an common style or a master style.
* <p/>
* The contents of this element are the union of the 'styles.xml' file (if it
* exists), the font-declarations and auto-styles of the document-content.xml
* and the styles declared in the main document.
*
* @author Thomas Morgner
* @since 06.03.2007
*/
public class OfficeStylesCollection extends Element
{
// Font-face declarations are copied as is. We simply merge them by adding
// them all in one set. This may result in duplicate entries, but as the
// fileformat does not forbid that, it therefore must be ok.
private FontFaceDeclsSection fontFaceDecls;
private OfficeStyles automaticStyles;
private OfficeStyles commonStyles;
private OfficeMasterStyles masterStyles;
public OfficeStylesCollection()
{
fontFaceDecls = new FontFaceDeclsSection();
automaticStyles = new OfficeStyles();
automaticStyles.setType("automatic-styles");
automaticStyles.setNamespace(OfficeNamespaces.OFFICE_NS);
commonStyles = new OfficeStyles();
commonStyles.setType("styles");
commonStyles.setNamespace(OfficeNamespaces.OFFICE_NS);
masterStyles = new OfficeMasterStyles();
masterStyles.setType("master-styles");
masterStyles.setNamespace(OfficeNamespaces.OFFICE_NS);
}
public OfficeStyle getStyle(final String family, final String name)
{
final OfficeStyle commonStyle = commonStyles.getStyle(family, name);
if (commonStyle != null)
{
return commonStyle;
}
final OfficeStyle autoStyle = automaticStyles.getStyle(family, name);
if (autoStyle != null)
{
return autoStyle;
}
// And later: Autogenerate one of the default styles.
// However, at this moment, we dont have a clue about the default styles
// at all. Maybe we should add them to make this implementation more robust
// against invalid documents.
return null;
}
public boolean containsStyle (final String family, final String name)
{
return (getStyle(family, name) != null);
}
public OfficeStyles getAutomaticStyles()
{
return automaticStyles;
}
public OfficeStyles getCommonStyles()
{
return commonStyles;
}
public OfficeMasterStyles getMasterStyles()
{
return masterStyles;
}
public FontFaceDeclsSection getFontFaceDecls()
{
return fontFaceDecls;
}
}

View File

@@ -0,0 +1,52 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: OfficeTableSection.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.structure.Section;
/**
* Creation-Date: 24.04.2007, 15:55:17
*
* @author Thomas Morgner
*/
public class OfficeTableSection extends Section
{
public OfficeTableSection()
{
}
}

View File

@@ -0,0 +1,79 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: PageLayout.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.structure.Section;
import org.jfree.report.structure.Element;
import com.sun.star.report.pentaho.OfficeNamespaces;
/**
* A page layout describes the physical properties of a page. It is equal to
* an @page rule in CSS.
*
* @author Thomas Morgner
* @since 13.03.2007
*/
public class PageLayout extends Section
{
public PageLayout()
{
setNamespace(OfficeNamespaces.STYLE_NS);
setType("page-layout");
}
public String getStyleName()
{
return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name");
}
public void setStyleName(final String name)
{
setAttribute(OfficeNamespaces.STYLE_NS, "name", name);
}
public Section getHeaderStyle ()
{
return (Section) findFirstChild(OfficeNamespaces.STYLE_NS, "header-style");
}
public Section getFooterStyle ()
{
return (Section) findFirstChild(OfficeNamespaces.STYLE_NS, "footer-style");
}
}

View File

@@ -0,0 +1,85 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: PageSection.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.structure.Section;
import org.jfree.layouting.util.AttributeMap;
import com.sun.star.report.pentaho.OfficeNamespaces;
/**
* This represents either a page header or page footer.
*
* @author Thomas Morgner
* @since 02.03.2007
*/
public class PageSection extends Section
{
public PageSection()
{
}
public static boolean isPrintWithReportHeader(final AttributeMap attrs)
{
final String pagePrintOption = (String) attrs.getAttribute
(OfficeNamespaces.OOREPORT_NS, "page-print-option");
if ("not-with-report-header".equals(pagePrintOption))
{
return false;
}
if ("not-with-report-header-nor-footer".equals(pagePrintOption))
{
return false;
}
return true;
}
public static boolean isPrintWithReportFooter(final AttributeMap attrs)
{
final String pagePrintOption = (String) attrs.getAttribute
(OfficeNamespaces.OOREPORT_NS, "page-print-option");
if ("not-with-report-footer".equals(pagePrintOption))
{
return false;
}
if ("not-with-report-header-nor-footer".equals(pagePrintOption))
{
return false;
}
return true;
}
}

View File

@@ -0,0 +1,56 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: RawText.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import org.jfree.report.structure.StaticText;
/**
* A marker implementation. If encountered by the OfficeRawTarget, this text
* will be written without being normalized. Such text represents a page
* header or footer.
*
* @author Thomas Morgner
* @since 13.03.2007
*/
public class RawText extends StaticText
{
public RawText(final String text)
{
super(text);
}
}

View File

@@ -0,0 +1,119 @@
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ReportElement.java,v $
*
* $Revision: 1.2 $
*
* last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2007 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
* Copyright 2007 by Pentaho Corporation
*
* 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
*
************************************************************************/
package com.sun.star.report.pentaho.model;
import java.util.ArrayList;
import org.jfree.report.structure.Element;
import com.sun.star.report.pentaho.OfficeNamespaces;
/**
* A report element is the base class for all content generating elements in a
* report.
*
* @author Thomas Morgner
* @since 02.03.2007
*/
public abstract class ReportElement extends Element
{
private ArrayList formatConditions;
protected ReportElement()
{
formatConditions = new ArrayList();
}
/**
* Checks the current group and prints this element only if the current row is
* the first row for that particular group.
*
* @return true, if the element should only be printed in the first row of the
* current group, false otherwise.
*/
public boolean isPrintWhenGroupChanges()
{
return "true".equals(getAttribute
(OfficeNamespaces.OOREPORT_NS, "print-when-group-changes"));
}
public void setPrintWhenGroupChanges(final boolean printWhenGroupChanges)
{
setAttribute(OfficeNamespaces.OOREPORT_NS, "print-when-group-changes",
String.valueOf(printWhenGroupChanges));
}
/**
* Checks, whether the printed value has been changed since the last run. The
* element will only be printed, if there was at least one change.
*
* @return true, if repeated values should be printed, false if repeated
* values should be surpressed.
*/
public boolean isPrintRepeatedValues()
{
return "true".equals(getAttribute
(OfficeNamespaces.OOREPORT_NS, "print-repeated-values"));
}
public void setPrintRepeatedValues(final boolean printRepeatedValues)
{
setAttribute(OfficeNamespaces.OOREPORT_NS, "print-repeated-values",
String.valueOf(printRepeatedValues));
}
public void addFormatCondition(final FormatCondition formatCondition)
{
if (formatCondition == null)
{
throw new NullPointerException();
}
this.formatConditions.add(formatCondition);
}
public FormatCondition[] getFormatConditions ()
{
return (FormatCondition[]) this.formatConditions.toArray
(new FormatCondition[this.formatConditions.size()]);
}
public int getFormatConditionCount ()
{
return formatConditions.size();
}
}

Some files were not shown because too many files have changed in this diff Show More