diff options
author | Kurt Zenker <kz@openoffice.org> | 2009-03-02 18:32:56 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2009-03-02 18:32:56 +0000 |
commit | b4a760e24188a3cd38c50a42d447185066e92c72 (patch) | |
tree | c0db507376c7e4c2fbd112e90a8d234b85a0f49b | |
parent | 35c9e15439867c34394c1525c44904a4471fb09d (diff) |
CWS-TOOLING: integrate CWS rptfix04_OOO310
2009-02-23 01:59:54 +0100 rene r268341 : #i10000# fix system-jfreereport build
2009-02-13 10:17:16 +0100 oj r267696 : #i98549# integrate zip form pentaho package
2009-02-03 14:48:34 +0100 oj r267330 : set formula locale to doc locale
2009-02-03 14:45:54 +0100 oj r267329 : set formula locale to doc locale
2009-02-03 11:50:03 +0100 oj r267311 : set formula locale to doc locale
2009-02-03 08:55:02 +0100 oj r267297 : unix line ends
2009-01-28 11:21:24 +0100 rene r267043 : #i98549# s/DESIGN/BUILDER/ also for Sun
2009-01-27 17:17:50 +0100 rene r267012 : merge builfix from trunk
2009-01-27 14:16:30 +0100 rene r266991 : #i10000# fix rebase which left out the whole changes in former config_office; sync variable names (s/LIB_//) and some other things
2009-01-27 10:01:09 +0100 oj r266959 : CWS-TOOLING: rebase CWS rptfix04 to trunk@266944 (milestone: DEV300:m40)
2009-01-27 08:00:16 +0100 oj r266951 : conflict in mergeinfo
2009-01-26 12:23:03 +0100 oj r266914 : #i98383# fix grouping
2009-01-23 22:03:03 +0100 rene r266852 : fix --enable-report-builder description
2009-01-23 10:37:27 +0100 oj r266778 : set escape processing when set at query
2009-01-23 09:17:16 +0100 fs r266770 : add CWS name to version
2009-01-21 13:57:35 +0100 oj r266669 : merge for build bots
2009-01-20 09:07:24 +0100 oj r266552 : CWS-TOOLING: rebase CWS rptfix04 to trunk@266428 (milestone: DEV300:m39)
2009-01-20 08:34:16 +0100 oj r266551 : rebase
2009-01-20 08:33:59 +0100 oj r266550 : rebase
2009-01-20 08:32:50 +0100 oj r266549 : rebase
2009-01-20 08:30:13 +0100 oj r266548 : rebase
2009-01-20 08:29:30 +0100 oj r266547 : rebase
2009-01-20 08:22:33 +0100 oj r266546 : merge short cuts from dba31g
2009-01-19 21:04:08 +0100 rene r266525 : #i10000# we need officecfg for component-update.dtd
2009-01-19 21:01:26 +0100 rene r266524 : #i10000# fix import
2009-01-19 20:26:20 +0100 rene r266523 : #i10000# remove svn conflicts markers; fix build
2009-01-19 14:23:56 +0100 rene r266496 : libbase depends on apache-commons..
2009-01-19 14:00:42 +0100 oj r266495 : merge from m39
2009-01-19 12:39:00 +0100 oj r266489 : CWS-TOOLING: rebase CWS rptfix04 to trunk@266428 (milestone: DEV300:m39)
2009-01-16 11:47:04 +0100 oj r266410 : #i97560# add , between expressions
2009-01-09 17:11:38 +0100 rene r266103 : don't show "checking which Apache commons-* libs to use" when we neither build the wiki editor nor the SRB
2009-01-09 16:48:02 +0100 rene r266099 : #i10000# reportbuilder needs apache-commons
2009-01-09 15:43:35 +0100 oj r266093 : use of new nspaces
2009-01-09 15:41:34 +0100 oj r266092 : use of new nspaces
2009-01-09 14:44:15 +0100 rene r266088 : fix typo/description
2009-01-09 12:48:51 +0100 rene r266074 : #i10000# fix install
2009-01-09 11:52:53 +0100 rene r266070 : #i10000# more build fixes
2009-01-09 10:53:13 +0100 rene r266062 : #i10000# ENABLE_REPORTBUILDER also in set_soenv.in, fix typo
2009-01-09 10:40:24 +0100 rene r266060 : #i10000# configure fix for new reportbuilder module, typo fix at libfonts
2009-01-09 10:01:52 +0100 rene r266055 : #i10000# adapt to current configure.in
2009-01-09 09:59:32 +0100 oj r266054 : add new pentaho jars
2009-01-09 09:47:54 +0100 oj r266049 : merge changes from DEV300_m39
2009-01-09 09:14:08 +0100 oj r266048 : merge from DEV300_m39
2009-01-09 08:28:43 +0100 oj r266045 : merge changes from dba31g
2009-01-09 07:58:10 +0100 oj r266044 : replace JCOMMON with LIB
2009-01-08 13:42:24 +0100 oj r266005 : move ext to reportbuilder
2009-01-08 13:41:38 +0100 oj r266004 : add dep for license
2009-01-08 13:27:56 +0100 oj r266001 : new module for Sun report Builder extension
2009-01-07 12:58:13 +0100 oj r265960 : CWS-TOOLING: rebase CWS rptfix04 to trunk@265758 (milestone: DEV300:m38)
2008-12-15 13:47:18 +0100 oj r265481 : new pentaho resources
2008-12-15 10:04:01 +0100 oj r265462 : integrate new pentaho sources
2008-12-15 10:02:54 +0100 oj r265461 : #i96888# fix date time function
2008-12-12 09:23:29 +0100 oj r265389 : #97174# check of res < 0 removed
2008-12-12 09:15:54 +0100 oj r265388 : #i9716# fix for DayFunction
2008-12-11 12:24:24 +0100 oj r265281 : integrate new pentaho sources
2008-12-11 11:49:16 +0100 oj r265273 : integrate new pentaho sources
2008-12-11 09:34:07 +0100 oj r265248 : integrate new pentaho sources
2008-12-10 18:58:06 +0100 oj r265227 : introduce new pentaho sources
2008-12-10 18:56:43 +0100 oj r265226 : introduce new pentaho sources
2008-12-10 18:54:26 +0100 oj r265225 : introduce new pentaho sources
2008-12-10 18:42:59 +0100 oj r265221 : introduce new pentaho sources
2008-12-10 17:24:23 +0100 oj r265212 : introduce new pentaho sources
2008-12-10 17:24:07 +0100 oj r265211 : new pentaho sources
2008-12-10 17:23:00 +0100 oj r265210 : introduce new pentaho sources
277 files changed, 3 insertions, 31623 deletions
diff --git a/reportdesign/images/em42.png b/reportdesign/images/em42.png Binary files differdeleted file mode 100644 index 31f48ea8f..000000000 --- a/reportdesign/images/em42.png +++ /dev/null diff --git a/reportdesign/images/em42_hc.png b/reportdesign/images/em42_hc.png Binary files differdeleted file mode 100644 index 3870cc470..000000000 --- a/reportdesign/images/em42_hc.png +++ /dev/null diff --git a/reportdesign/java/com/sun/star/report/DataRow.java b/reportdesign/java/com/sun/star/report/DataRow.java deleted file mode 100644 index 097a7985b..000000000 --- a/reportdesign/java/com/sun/star/report/DataRow.java +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DataRow.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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; -} diff --git a/reportdesign/java/com/sun/star/report/DataSource.java b/reportdesign/java/com/sun/star/report/DataSource.java deleted file mode 100644 index a5e8a9459..000000000 --- a/reportdesign/java/com/sun/star/report/DataSource.java +++ /dev/null @@ -1,51 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DataSource.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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; -} diff --git a/reportdesign/java/com/sun/star/report/DataSourceException.java b/reportdesign/java/com/sun/star/report/DataSourceException.java deleted file mode 100644 index 5e38ed38d..000000000 --- a/reportdesign/java/com/sun/star/report/DataSourceException.java +++ /dev/null @@ -1,97 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DataSourceException.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report; - -/** - * 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); - } -} diff --git a/reportdesign/java/com/sun/star/report/DataSourceFactory.java b/reportdesign/java/com/sun/star/report/DataSourceFactory.java deleted file mode 100644 index 68f3d410c..000000000 --- a/reportdesign/java/com/sun/star/report/DataSourceFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DataSourceFactory.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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; -} diff --git a/reportdesign/java/com/sun/star/report/ImageService.java b/reportdesign/java/com/sun/star/report/ImageService.java deleted file mode 100644 index a7d9b7830..000000000 --- a/reportdesign/java/com/sun/star/report/ImageService.java +++ /dev/null @@ -1,62 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ImageService.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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; -} - diff --git a/reportdesign/java/com/sun/star/report/InputRepository.java b/reportdesign/java/com/sun/star/report/InputRepository.java deleted file mode 100644 index c8122cac5..000000000 --- a/reportdesign/java/com/sun/star/report/InputRepository.java +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: InputRepository.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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(final String name) throws IOException; - - /** allows to acces sub repositories inside this repository - * - * @param name describes the path to the sub repository - * @return the sub repository - * @throws java.io.IOException when the sub repository doesn't exist. - */ - public InputRepository openInputRepository(final 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(final String name); - - public boolean exists(final String name); - - public boolean isReadable(final String name); - - public void closeInputRepository(); -} diff --git a/reportdesign/java/com/sun/star/report/JobDefinitionException.java b/reportdesign/java/com/sun/star/report/JobDefinitionException.java deleted file mode 100644 index fd2bddb5f..000000000 --- a/reportdesign/java/com/sun/star/report/JobDefinitionException.java +++ /dev/null @@ -1,67 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: JobDefinitionException.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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); - } -} diff --git a/reportdesign/java/com/sun/star/report/JobProgressIndicator.java b/reportdesign/java/com/sun/star/report/JobProgressIndicator.java deleted file mode 100644 index 94d224c99..000000000 --- a/reportdesign/java/com/sun/star/report/JobProgressIndicator.java +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: JobProgressIndicator.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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(); -} diff --git a/reportdesign/java/com/sun/star/report/JobProperties.java b/reportdesign/java/com/sun/star/report/JobProperties.java deleted file mode 100644 index 0ebadb172..000000000 --- a/reportdesign/java/com/sun/star/report/JobProperties.java +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: JobProperties.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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(); -} diff --git a/reportdesign/java/com/sun/star/report/OfficeToken.java b/reportdesign/java/com/sun/star/report/OfficeToken.java deleted file mode 100644 index 25f13262a..000000000 --- a/reportdesign/java/com/sun/star/report/OfficeToken.java +++ /dev/null @@ -1,64 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeToken.java,v $ - * $Revision: 1.2 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package com.sun.star.report; - -/** - * - * @author Ocke Janssen - */ -public class OfficeToken { - public static final String GRAPHIC = "graphic"; - public static final String GRAPHICS = "Graphics"; - public static final String GRAPHIC_PROPERTIES = "graphic-properties"; - public static final String PARAGRAPH = "paragraph"; - public static final String TRUE = "true"; - public static final String FALSE = "false"; - public static final String FRAME = "frame"; - public static final String STYLE_NAME = "style-name"; - public static final String BACKGROUND_COLOR = "background-color"; - public static final String COVERED_TABLE_CELL = "covered-table-cell"; - public static final String TABLE = "table"; - public static final String TABLE_COLUMN = "table-column"; - public static final String TABLE_COLUMNS = "table-columns"; - public static final String TABLE_HEADER_COLUMNS = "table-header-columns"; - public static final String TABLE_HEADER_ROWS = "table-header-rows"; - public static final String TABLE_ROWS = "table-rows"; - public static final String TABLE_ROW = "table-row"; - public static final String TABLE_CELL = "table-cell"; - public static final String P = "p"; - public static final String OBJECT_OLE = "object-ole"; - public static final String IMAGE = "image"; - public static final String IMAGE_DATA = "image-data"; - public static final String PRESERVE_IRI = "preserve-IRI"; - public static final String SCALE = "scale"; - public static final String NAME = "name"; - public static final String SHAPES = "shapes"; -} diff --git a/reportdesign/java/com/sun/star/report/OutputRepository.java b/reportdesign/java/com/sun/star/report/OutputRepository.java deleted file mode 100644 index a35df96a6..000000000 --- a/reportdesign/java/com/sun/star/report/OutputRepository.java +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OutputRepository.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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(final String name, final String mimeType) throws IOException; - - /** allows to acces sub repositories inside this repository - * - * @param name describes the path to the sub repository - * @return the sub repository - * @throws java.io.IOException when the sub repository doesn't exist. - */ - public OutputRepository openOutputRepository(final String name, final String mimeType) throws IOException; - - public boolean exists(final String name); - - public boolean existsStorage(final String name); - - public boolean isWritable(final String name); - - public void closeOutputRepository(); -} diff --git a/reportdesign/java/com/sun/star/report/ParameterMap.java b/reportdesign/java/com/sun/star/report/ParameterMap.java deleted file mode 100644 index c663375ca..000000000 --- a/reportdesign/java/com/sun/star/report/ParameterMap.java +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ParameterMap.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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(); -} diff --git a/reportdesign/java/com/sun/star/report/ReportAddIn.java b/reportdesign/java/com/sun/star/report/ReportAddIn.java deleted file mode 100644 index 378832bda..000000000 --- a/reportdesign/java/com/sun/star/report/ReportAddIn.java +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportAddIn.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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); -} diff --git a/reportdesign/java/com/sun/star/report/ReportEngine.java b/reportdesign/java/com/sun/star/report/ReportEngine.java deleted file mode 100644 index 1ebc354d0..000000000 --- a/reportdesign/java/com/sun/star/report/ReportEngine.java +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportEngine.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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; -} diff --git a/reportdesign/java/com/sun/star/report/ReportEngineMetaData.java b/reportdesign/java/com/sun/star/report/ReportEngineMetaData.java deleted file mode 100644 index de07d41f4..000000000 --- a/reportdesign/java/com/sun/star/report/ReportEngineMetaData.java +++ /dev/null @@ -1,62 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportEngineMetaData.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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); -} diff --git a/reportdesign/java/com/sun/star/report/ReportEngineParameterNames.java b/reportdesign/java/com/sun/star/report/ReportEngineParameterNames.java deleted file mode 100644 index 6e61844da..000000000 --- a/reportdesign/java/com/sun/star/report/ReportEngineParameterNames.java +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportEngineParameterNames.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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 INPUT_REPORTJOB_FACTORY = "input.reportjob-factory"; - public static final String INPUT_MASTER_COLUMNS = "input.master-columns"; - public static final String INPUT_MASTER_VALUES = "input.master-values"; - public static final String INPUT_DETAIL_COLUMNS = "input.detail-columns"; - public static final String MIMETYPE = "output.mimetype"; - public static final String AUTHOR = "Author"; - public static final String TITLE = "Title"; - - private ReportEngineParameterNames () - { - } -} diff --git a/reportdesign/java/com/sun/star/report/ReportExecutionException.java b/reportdesign/java/com/sun/star/report/ReportExecutionException.java deleted file mode 100644 index 2243f53c8..000000000 --- a/reportdesign/java/com/sun/star/report/ReportExecutionException.java +++ /dev/null @@ -1,90 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportExecutionException.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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); - } -} diff --git a/reportdesign/java/com/sun/star/report/ReportExpression.java b/reportdesign/java/com/sun/star/report/ReportExpression.java deleted file mode 100644 index 363e5ff74..000000000 --- a/reportdesign/java/com/sun/star/report/ReportExpression.java +++ /dev/null @@ -1,54 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportExpression.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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); -} diff --git a/reportdesign/java/com/sun/star/report/ReportExpressionMetaData.java b/reportdesign/java/com/sun/star/report/ReportExpressionMetaData.java deleted file mode 100644 index 34507e142..000000000 --- a/reportdesign/java/com/sun/star/report/ReportExpressionMetaData.java +++ /dev/null @@ -1,50 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportExpressionMetaData.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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); -} diff --git a/reportdesign/java/com/sun/star/report/ReportFunction.java b/reportdesign/java/com/sun/star/report/ReportFunction.java deleted file mode 100644 index 8afc5a5df..000000000 --- a/reportdesign/java/com/sun/star/report/ReportFunction.java +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportFunction.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report; - -/** - * 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); -} diff --git a/reportdesign/java/com/sun/star/report/ReportJob.java b/reportdesign/java/com/sun/star/report/ReportJob.java deleted file mode 100644 index 2d5117479..000000000 --- a/reportdesign/java/com/sun/star/report/ReportJob.java +++ /dev/null @@ -1,92 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportJob.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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); -} diff --git a/reportdesign/java/com/sun/star/report/ReportJobDefinition.java b/reportdesign/java/com/sun/star/report/ReportJobDefinition.java deleted file mode 100644 index 891403785..000000000 --- a/reportdesign/java/com/sun/star/report/ReportJobDefinition.java +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportJobDefinition.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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(); -} diff --git a/reportdesign/java/com/sun/star/report/ReportJobFactory.java b/reportdesign/java/com/sun/star/report/ReportJobFactory.java deleted file mode 100644 index 730e93fb0..000000000 --- a/reportdesign/java/com/sun/star/report/ReportJobFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportJobFactory.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report; - -import com.sun.star.beans.NamedValue; -import com.sun.star.lang.IllegalArgumentException; -import com.sun.star.uno.Exception; - -/** - * - * @author Ocke Janssen - */ -public interface ReportJobFactory -{ - - public ReportJob createReportJob(final NamedValue[] namedValue) throws IllegalArgumentException, ReportExecutionException, Exception; -} diff --git a/reportdesign/java/com/sun/star/report/SDBCReportData.java b/reportdesign/java/com/sun/star/report/SDBCReportData.java deleted file mode 100644 index 10ad230b8..000000000 --- a/reportdesign/java/com/sun/star/report/SDBCReportData.java +++ /dev/null @@ -1,375 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: SDBCReportData.java,v $ - * $Revision: 1.6.32.1 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report; - -import com.sun.star.beans.UnknownPropertyException; -import com.sun.star.beans.XPropertySet; -import com.sun.star.container.XIndexAccess; -import com.sun.star.container.XNameAccess; -import com.sun.star.lang.IndexOutOfBoundsException; -import com.sun.star.lang.WrappedTargetException; -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.sdbcx.XColumnsSupplier; -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 final XRowSet rowSet; - private final 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; - - if (rowSet == null) - { - rowCount = 0; - columnCount = 0; - columnTypes = new int[1]; - columnNames = new String[1]; - } - else - { - final XParametersSupplier xSuppParams = (XParametersSupplier) UnoRuntime.queryInterface( - XParametersSupplier.class, rowSet); - if (xSuppParams != null) - { - parameters = xSuppParams.getParameters(); - } - - final XColumnsSupplier columnsSup = (XColumnsSupplier)UnoRuntime.queryInterface(XColumnsSupplier.class, rowSet); - final XNameAccess columns = columnsSup.getColumns(); - final String[] columnNamesList = columns.getElementNames(); - final XResultSetMetaDataSupplier sup = (XResultSetMetaDataSupplier) UnoRuntime.queryInterface(XResultSetMetaDataSupplier.class, rowSet); - final XResultSetMetaData resultSetMetaData = sup.getMetaData(); - - columnCount = resultSetMetaData.getColumnCount(); - firstParameterIndex = columnCount + 1; - if (parameters != null) - columnCount += parameters.getCount(); - - columnTypes = new int[columnCount]; - columnNames = new String[columnCount]; - - for (int i = 1; i <= columnCount; ++i) - { - if (i < firstParameterIndex) - { - columnNames[i - 1] = columnNamesList[i - 1];// resultSetMetaData.getColumnName(i); - columnTypes[i - 1] = resultSetMetaData.getColumnType(i); - } - else - { - try - { - final 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 - { - if (rowSet == null) - return false; - 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 - { - if (rowSet == null) - return false; - 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) - { - final java.sql.Date date; - if (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()); - } - else - { - date = null; - } - 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); - final StringBuffer str2 = new StringBuffer("0000"); - 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) - { - final java.sql.Time time; - if (obj instanceof Time) - { - final Time unoTime = (Time) obj; - time = java.sql.Time.valueOf(getTimeString(unoTime.Hours, unoTime.Minutes, unoTime.Seconds).toString()); - } - else - { - time = null; - } - return time; - } - - static private Timestamp getTimestamp(final Object obj) - { - final Timestamp ts; - if (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()); - } - else - { - ts = null; - } - return ts; - } - - public Object getObject(final int column) throws DataSourceException - { - if (rowSet == null) - return null; - try - { - final boolean isParameterValue = (parameters != null) && (column >= firstParameterIndex); - Object obj; - final boolean wasNull; - if (isParameterValue) - { - final XPropertySet paramCol = (XPropertySet) UnoRuntime.queryInterface( - XPropertySet.class, parameters.getByIndex(column - firstParameterIndex)); - obj = paramCol.getPropertyValue("Value"); - wasNull = obj == null; - } - else - { - obj = row.getObject(column, null); - wasNull = row.wasNull(); - } - - if (wasNull) - { - obj = null; - } - else - { - obj = convertObject(columnTypes[column - 1], obj); - } - return obj; - } - catch (SQLException ex) - { - throw new DataSourceException(ex.getMessage(), ex); - } - catch (UnknownPropertyException ex) - { - throw new DataSourceException(ex.getMessage(), ex); - } - catch (IndexOutOfBoundsException ex) - { - throw new DataSourceException(ex.getMessage(), ex); - } - catch (WrappedTargetException ex) - { - throw new DataSourceException(ex.getMessage(), ex); - } - } - - private Object convertObject(final int type, final Object obj) - { - final Object ret; - switch (type) - { - case DataType.DATE: - ret = getDate(obj); - break; - case DataType.TIME: - ret = getTime(obj); - break; - case DataType.TIMESTAMP: - ret = getTimestamp(obj); - break; - case DataType.DECIMAL: - case DataType.NUMERIC: - if (!(obj instanceof Any)) - { - ret = new java.math.BigDecimal((String) obj); - } - else - { - ret = obj; - } - break; - default: - ret = obj; - break; - } - return ret; - } -} diff --git a/reportdesign/java/com/sun/star/report/SDBCReportDataFactory.java b/reportdesign/java/com/sun/star/report/SDBCReportDataFactory.java deleted file mode 100644 index f224ec431..000000000 --- a/reportdesign/java/com/sun/star/report/SDBCReportDataFactory.java +++ /dev/null @@ -1,637 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: SDBCReportDataFactory.java,v $ - * $Revision: 1.9.18.1 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report; - -import com.sun.star.beans.PropertyVetoException; -import com.sun.star.beans.UnknownPropertyException; -import com.sun.star.beans.XPropertySet; -import com.sun.star.container.NoSuchElementException; -import com.sun.star.container.XIndexAccess; -import com.sun.star.lang.IllegalArgumentException; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.sdbc.XConnection; -import com.sun.star.container.XNameAccess; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.sdb.CommandType; -import com.sun.star.sdb.XCompletedExecution; -import com.sun.star.sdb.XParametersSupplier; -import com.sun.star.sdb.XQueriesSupplier; -import com.sun.star.sdb.XSingleSelectQueryComposer; -import com.sun.star.sdb.tools.XConnectionTools; -import com.sun.star.sdbc.SQLException; -import com.sun.star.sdbc.XParameters; -import com.sun.star.sdbc.XPreparedStatement; -import com.sun.star.uno.Exception; -import java.util.Map; - -import com.sun.star.sdbc.XRowSet; -import com.sun.star.sdbcx.XColumnsSupplier; -import com.sun.star.sdbcx.XTablesSupplier; -import com.sun.star.task.XInteractionHandler; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XComponentContext; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import org.jfree.util.Log; - -/** - * Very primitive implementation, just to show how this could be used ... - * - */ -public class SDBCReportDataFactory implements DataSourceFactory -{ - - public static final String COMMAND_TYPE = "command-type"; - public static final String ESCAPE_PROCESSING = "escape-processing"; - public static final String GROUP_EXPRESSIONS = "group-expressions"; - public static final String MASTER_VALUES = "master-values"; - public static final String MASTER_COLUMNS = "master-columns"; - public static final String DETAIL_COLUMNS = "detail-columns"; - public static final String UNO_FILTER = "Filter"; - private static final String APPLY_FILTER = "ApplyFilter"; - private static final String UNO_COMMAND = "Command"; - private static final String UNO_ORDER = "Order"; - private static final String UNO_APPLY_FILTER = "ApplyFilter"; - private static final String UNO_COMMAND_TYPE = "CommandType"; - private final XConnection connection; - private final XComponentContext m_cmpCtx; - private static final int FAILED = 0; - private static final int DONE = 1; - private static final int RETRIEVE_COLUMNS = 2; - private static final int RETRIEVE_OBJECT = 3; - private static final int HANDLE_QUERY = 4; - private static final int HANDLE_TABLE = 5; - private static final int HANDLE_SQL = 6; - - public SDBCReportDataFactory(final XComponentContext cmpCtx, final XConnection connection) - { - this.connection = connection; - m_cmpCtx = cmpCtx; - } - - public DataSource queryData(final String command, final Map parameters) throws DataSourceException - { - try - { - if ( command == null ) - { - return new SDBCReportData(null); - } - int commandType = CommandType.COMMAND; - final String commandTypeValue = (String) parameters.get(COMMAND_TYPE); - if ( commandTypeValue != null ) - { - if ( commandTypeValue.equals("query") ) - { - commandType = CommandType.QUERY; - } - else if ( commandTypeValue.equals("table") ) - { - commandType = CommandType.TABLE; - } - else - { - commandType = CommandType.COMMAND; - } - } - final XRowSet rowSet = createRowSet(command, commandType, parameters); - final XPropertySet rowSetProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, rowSet); - - final XConnectionTools tools = (XConnectionTools) UnoRuntime.queryInterface(XConnectionTools.class, connection); - fillOrderStatement(command, commandType, parameters, tools, rowSetProp); - - if ( command.length() != 0 ) - { - final int oldParameterCount = fillParameter(parameters, tools, command, commandType, rowSet); - - final XCompletedExecution execute = (XCompletedExecution) UnoRuntime.queryInterface(XCompletedExecution.class, rowSet); - if ( execute != null && oldParameterCount > 0 ) - { - final XInteractionHandler handler = (XInteractionHandler) UnoRuntime.queryInterface(XInteractionHandler.class, m_cmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.sdb.InteractionHandler", m_cmpCtx)); - execute.executeWithCompletion(handler); - } - else - { - rowSet.execute(); - } - } - return new SDBCReportData(rowSet); - } catch ( Exception ex ) - { - throw new DataSourceException(ex.getMessage(), ex); - } - } - - private String getOrderStatement(final int commandType, final String command, final List groupExpressions) - { - final StringBuffer order = new StringBuffer(); - final int count = groupExpressions.size(); - if ( count != 0 ) - { - try - { - final String quote = connection.getMetaData().getIdentifierQuoteString(); - final XComponent[] hold = new XComponent[1]; - final XNameAccess columns = getFieldsByCommandDescriptor(commandType, command, hold); - - for (int i = 0; i < count; i++) - { - final Object[] pair = (Object[]) groupExpressions.get(i); - String expression = (String) pair[0]; - - if ( columns.hasByName(expression) ) - { - expression = quote + expression + quote; - } - expression = expression.trim(); // Trim away white spaces - - if ( expression.length() > 0 ) - { - order.append(expression); - if ( order.length() > 0 ) - { - order.append(' '); - } - final String sorting = (String) pair[1]; - if ( sorting == null || sorting.equals(OfficeToken.FALSE) ) - { - order.append("DESC"); - } - if ( (i + 1) < count ) - { - order.append(' '); - } - } - } - } catch ( IndexOutOfBoundsException ex ) - { - Log.error("ReportProcessing failed", ex); - } catch ( SQLException ex ) - { - Log.error("ReportProcessing failed", ex); - } - } - return order.toString(); - } - - private XNameAccess getFieldsByCommandDescriptor(final int commandType, final String command, final XComponent[] out) throws SQLException - { - final Class[] parameter = new Class[3]; - parameter[0] = Integer.class; - parameter[1] = String.class; - parameter[2] = out.getClass(); - final XConnectionTools tools = (XConnectionTools) UnoRuntime.queryInterface(XConnectionTools.class, connection); - try - { - tools.getClass().getMethod("getFieldsByCommandDescriptor", parameter); - return tools.getFieldsByCommandDescriptor(commandType, command, out); - } catch ( NoSuchMethodException ex ) - { - } - - XNameAccess xFields = null; - // some kind of state machine to ease the sharing of code - int eState = FAILED; - switch ( commandType ) - { - case CommandType.TABLE: - eState = HANDLE_TABLE; - break; - case CommandType.QUERY: - eState = HANDLE_QUERY; - break; - case CommandType.COMMAND: - eState = HANDLE_SQL; - break; - } - - // needed in various states: - XNameAccess xObjectCollection = null; - XColumnsSupplier xSupplyColumns = null; - - try - { - // go! - while ((DONE != eState) && (FAILED != eState)) - { - switch ( eState ) - { - case HANDLE_TABLE: - { - // initial state for handling the tables - - // get the table objects - final XTablesSupplier xSupplyTables = (XTablesSupplier) UnoRuntime.queryInterface(XTablesSupplier.class, connection); - if ( xSupplyTables != null ) - { - xObjectCollection = xSupplyTables.getTables(); - // if something went wrong 'til here, then this will be handled in the next state - - // next state: get the object - } - eState = RETRIEVE_OBJECT; - } - break; - - case HANDLE_QUERY: - { - // initial state for handling the tables - - // get the table objects - final XQueriesSupplier xSupplyQueries = (XQueriesSupplier) UnoRuntime.queryInterface(XQueriesSupplier.class, connection); - if ( xSupplyQueries != null ) - { - xObjectCollection = xSupplyQueries.getQueries(); - // if something went wrong 'til here, then this will be handled in the next state - - // next state: get the object - } - eState = RETRIEVE_OBJECT; - } - break; - - case RETRIEVE_OBJECT: - // here we should have an object (aka query or table) collection, and are going - // to retrieve the desired object - - // next state: default to FAILED - eState = FAILED; - - if ( xObjectCollection != null && xObjectCollection.hasByName(command) ) - { - xSupplyColumns = (XColumnsSupplier) UnoRuntime.queryInterface(XColumnsSupplier.class, xObjectCollection.getByName(command)); - - // next: go for the columns - eState = RETRIEVE_COLUMNS; - } - break; - - case RETRIEVE_COLUMNS: - // next state: default to FAILED - eState = FAILED; - - if ( xSupplyColumns != null ) - { - xFields = xSupplyColumns.getColumns(); - // that's it - eState = DONE; - } - break; - - case HANDLE_SQL: - { - String sStatementToExecute = command; - - // well, the main problem here is to handle statements which contain a parameter - // If we would simply execute a parametrized statement, then this will fail because - // we cannot supply any parameter values. - // Thus, we try to analyze the statement, and to append a WHERE 0=1 filter criterion - // This should cause every driver to not really execute the statement, but to return - // an empty result set with the proper structure. We then can use this result set - // to retrieve the columns. - - try - { - final XMultiServiceFactory xComposerFac = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, connection); - - if ( xComposerFac != null ) - { - final XSingleSelectQueryComposer xComposer = (XSingleSelectQueryComposer) UnoRuntime.queryInterface(XSingleSelectQueryComposer.class, xComposerFac.createInstance("com.sun.star.sdb.SingleSelectQueryComposer")); - if ( xComposer != null ) - { - xComposer.setQuery(sStatementToExecute); - - // Now set the filter to a dummy restriction which will result in an empty - // result set. - xComposer.setFilter("0=1"); - - sStatementToExecute = xComposer.getQuery(); - } - } - } catch ( com.sun.star.uno.Exception ex ) - { - // silent this error, this was just a try. If we're here, we did not change sStatementToExecute, - // so it will still be _rCommand, which then will be executed without being touched - } - - // now execute - final XPreparedStatement xStatement = connection.prepareStatement(sStatementToExecute); - // transfer ownership of this temporary object to the caller - out[0] = (XComponent) UnoRuntime.queryInterface(XComponent.class, xStatement); - - // set the "MaxRows" to 0. This is just in case our attempt to append a 0=1 filter - // failed - in this case, the MaxRows restriction should at least ensure that there - // is no data returned (which would be potentially expensive) - final XPropertySet xStatementProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xStatement); - try - { - if ( xStatementProps != null ) - { - xStatementProps.setPropertyValue("MaxRows", new Integer(0)); - } - } catch ( com.sun.star.uno.Exception ex ) - { - // oh damn. Not much of a chance to recover, we will no retrieve the complete - // full blown result set - } - - xSupplyColumns = (XColumnsSupplier) UnoRuntime.queryInterface(XColumnsSupplier.class, xStatement.executeQuery()); - // this should have given us a result set which does not contain any data, but - // the structural information we need - - // so the next state is to get the columns - eState = RETRIEVE_COLUMNS; - } - break; - default: - eState = FAILED; - } - } - } catch ( com.sun.star.uno.Exception ex ) - { - } - return xFields; - } - - private XSingleSelectQueryComposer getComposer(final XConnectionTools tools, - final String command, - final int commandType) - { - final Class[] parameter = new Class[2]; - parameter[0] = int.class; - parameter[1] = String.class; - try - { - final Object[] param = new Object[2]; - param[0] = new Integer(commandType); - param[1] = command; - return (XSingleSelectQueryComposer) tools.getClass().getMethod("getComposer", parameter).invoke(tools, param); - } catch ( NoSuchMethodException ex ) - { - } catch ( IllegalAccessException ex ) - { - // should not happen - // assert False - } catch ( java.lang.reflect.InvocationTargetException ex ) - { - // should not happen - // assert False - } - try - { - final XMultiServiceFactory factory = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, connection); - final XSingleSelectQueryComposer out = (XSingleSelectQueryComposer) UnoRuntime.queryInterface(XSingleSelectQueryComposer.class, factory.createInstance("com.sun.star.sdb.SingleSelectQueryAnalyzer")); - final String quote = connection.getMetaData().getIdentifierQuoteString(); - String statement = command; - switch ( commandType ) - { - case CommandType.TABLE: - statement = "SELECT * FROM " + quote + command + quote; - break; - case CommandType.QUERY: - { - final XQueriesSupplier xSupplyQueries = (XQueriesSupplier) UnoRuntime.queryInterface(XQueriesSupplier.class, connection); - final XNameAccess queries = xSupplyQueries.getQueries(); - if ( queries.hasByName(command) ) - { - final XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, queries.getByName(command)); - final Boolean escape = (Boolean) prop.getPropertyValue("EscapeProcessing"); - if (escape.booleanValue()) - { - statement = (String) prop.getPropertyValue(UNO_COMMAND); - final XSingleSelectQueryComposer composer = getComposer(tools, statement, CommandType.COMMAND); - if (composer != null) - { - final String order = (String) prop.getPropertyValue(UNO_ORDER); - if (order != null && order.length() != 0) - { - composer.setOrder(order); - } - final Boolean applyFilter = (Boolean) prop.getPropertyValue(UNO_APPLY_FILTER); - if (applyFilter.booleanValue()) - { - final String filter = (String) prop.getPropertyValue(UNO_FILTER); - if (filter != null && filter.length() != 0) - { - composer.setFilter(filter); - } - } - statement = composer.getQuery(); - } - } - } - } - break; - case CommandType.COMMAND: - statement = command; - break; - } - out.setElementaryQuery(statement); - return out; - } catch ( Exception e ) - { - } - return null; - } - - int fillParameter(final Map parameters, - final XConnectionTools tools, - final String command, - final int commandType, final XRowSet rowSet) - throws SQLException, - UnknownPropertyException, - PropertyVetoException, - IllegalArgumentException, - WrappedTargetException - { - int oldParameterCount = 0; - - final XSingleSelectQueryComposer composer = getComposer(tools, command, commandType); - if ( composer != null ) - { - final XPropertySet rowSetProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, rowSet); - if ( ((Boolean)rowSetProp.getPropertyValue(APPLY_FILTER)).booleanValue() ) - { - composer.setFilter((String)rowSetProp.getPropertyValue("Filter")); - } - // get old parameter count - final XParametersSupplier paraSup = (XParametersSupplier) UnoRuntime.queryInterface(XParametersSupplier.class, composer); - if ( paraSup != null ) - { - final XIndexAccess params = paraSup.getParameters(); - if ( params != null ) - { - oldParameterCount = params.getCount(); - } - } - final ArrayList masterValues = (ArrayList) parameters.get(MASTER_VALUES); - if ( masterValues != null && !masterValues.isEmpty() ) - { - // Vector masterColumns = (Vector) parameters.get("master-columns"); - final ArrayList detailColumns = (ArrayList) parameters.get(DETAIL_COLUMNS); - if ( oldParameterCount < detailColumns.size() ) - { - // create the new filter - final String quote = connection.getMetaData().getIdentifierQuoteString(); - final StringBuffer oldFilter = new StringBuffer(); - oldFilter.append(composer.getFilter()); - if ( oldFilter.length() != 0 ) - { - oldFilter.append(" AND "); - } - int newParamterCounter = 1; - for (final Iterator it = detailColumns.iterator(); it.hasNext(); - ++newParamterCounter) - { - final String detail = (String) it.next(); - //String master = (String) masterIt.next(); - oldFilter.append(quote); - oldFilter.append(detail); - oldFilter.append(quote); - oldFilter.append(" = :link_"); - oldFilter.append(newParamterCounter); - if ( it.hasNext() ) - { - oldFilter.append(" AND "); - } - } - - composer.setFilter(oldFilter.toString()); - } - else - oldParameterCount = 0; - - final String sQuery = composer.getQuery(); - rowSetProp.setPropertyValue(UNO_COMMAND, sQuery); - rowSetProp.setPropertyValue(UNO_COMMAND_TYPE, - new Integer(CommandType.COMMAND)); - - final XParameters para = (XParameters) UnoRuntime.queryInterface(XParameters.class, rowSet); - - for (int i = 0; - i < masterValues.size(); - i++) - { - Object object = masterValues.get(i); - if ( object instanceof BigDecimal ) - { - object = ((BigDecimal) object).toString(); - } - para.setObject(oldParameterCount + i + 1, object); - } - } - } - - return oldParameterCount; - } - - private final XRowSet createRowSet(final String command, - final int commandType, final Map parameters) - throws Exception - { - final XRowSet rowSet = (XRowSet) UnoRuntime.queryInterface(XRowSet.class, m_cmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.sdb.RowSet", m_cmpCtx)); - final XPropertySet rowSetProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, rowSet); - - rowSetProp.setPropertyValue("ActiveConnection", connection); - final Boolean escapeProcessing = (Boolean)parameters.get(ESCAPE_PROCESSING); - rowSetProp.setPropertyValue("EscapeProcessing", escapeProcessing); - rowSetProp.setPropertyValue(UNO_COMMAND_TYPE, new Integer(commandType)); - rowSetProp.setPropertyValue(UNO_COMMAND, command); - - final String filter = (String) parameters.get(UNO_FILTER); - if ( filter != null ) - { - rowSetProp.setPropertyValue("Filter", filter); - rowSetProp.setPropertyValue(APPLY_FILTER, Boolean.valueOf(filter.length() != 0)); - } - else - { - rowSetProp.setPropertyValue(APPLY_FILTER, Boolean.FALSE); - } - return rowSet; - } - - void fillOrderStatement(final String command, - final int commandType, final Map parameters, - final XConnectionTools tools, - final XPropertySet rowSetProp) - throws SQLException, - UnknownPropertyException, - PropertyVetoException, - IllegalArgumentException, - WrappedTargetException, - NoSuchElementException - { - final StringBuffer order = new StringBuffer(getOrderStatement(commandType, command, (ArrayList) parameters.get(GROUP_EXPRESSIONS))); - if ( order.length() > 0 && commandType != CommandType.TABLE ) - { - String statement = command; - final XSingleSelectQueryComposer composer = getComposer(tools, command, commandType); - if ( composer != null ) - { - statement = composer.getQuery(); - composer.setQuery(statement); - final String sOldOrder = composer.getOrder(); - if ( sOldOrder.length() > 0 ) - { - order.append(','); - order.append(sOldOrder); - composer.setOrder(""); - statement = composer.getQuery(); - } - } - else - { - if ( commandType == CommandType.QUERY ) - { - final XQueriesSupplier xSupplyQueries = (XQueriesSupplier) UnoRuntime.queryInterface(XQueriesSupplier.class, connection); - final XNameAccess queries = xSupplyQueries.getQueries(); - if ( queries.hasByName(command) ) - { - final XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, queries.getByName(command)); - final String queryCommand = (String) prop.getPropertyValue(UNO_COMMAND); - statement = "SELECT * FROM (" + queryCommand + ")"; - } - } - else - { - statement = "SELECT * FROM (" + command + ")"; - } - } - rowSetProp.setPropertyValue(UNO_COMMAND, statement); - rowSetProp.setPropertyValue(UNO_COMMAND_TYPE, new Integer(CommandType.COMMAND)); - } - rowSetProp.setPropertyValue("Order", order.toString()); - } -} - diff --git a/reportdesign/java/com/sun/star/report/SOImageService.java b/reportdesign/java/com/sun/star/report/SOImageService.java deleted file mode 100644 index 621419ade..000000000 --- a/reportdesign/java/com/sun/star/report/SOImageService.java +++ /dev/null @@ -1,182 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: SOImageService.java,v $ - * $Revision: 1.7 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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 final 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[]{new PropertyValue()}; - // 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 = 2540 / 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 = 2540 / dpi; - dim.setSize(imageSize.Width * fac, imageSize.Height * fac); - } - } - } - catch (Exception 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 - { - 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")) - { - return (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 null; - } - - 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)); - } -} diff --git a/reportdesign/java/com/sun/star/report/StorageRepository.java b/reportdesign/java/com/sun/star/report/StorageRepository.java deleted file mode 100644 index d6602bff0..000000000 --- a/reportdesign/java/com/sun/star/report/StorageRepository.java +++ /dev/null @@ -1,338 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StorageRepository.java,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report; - -import com.sun.star.beans.PropertyVetoException; -import com.sun.star.beans.UnknownPropertyException; -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 com.sun.star.lang.IllegalArgumentException; -import com.sun.star.lang.WrappedTargetException; -import java.io.*; -import com.sun.star.embed.XStorage; -import com.sun.star.embed.XTransactedObject; -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; -import org.jfree.util.Log; - -/** - * A directory holds all the contents here. - * - * - * @author Ocke Janssen - */ -public class StorageRepository implements InputRepository, OutputRepository -{ - - private static final String REPORT_PROCESSING_FAILED = "ReportProcessing failed"; - private XStorage input; - private XStorage output; - - /** - * - * @param input - * @param output - * @throws java.io.IOException - */ - public StorageRepository(final XStorage input, final XStorage output) - { - this.input = input; - this.output = output; - } - - public StorageRepository(final XStorage storage, final boolean isOutput) - { - if (isOutput) - { - this.output = storage; - } - else - { - this.input = storage; - } - } - - public InputStream createInputStream(final String name) throws IOException - { - if (input == null) - { - throw new IOException("input is NULL"); - } - 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(final String name, final String mimeType) throws IOException - { - if (output == null) - { - throw new IOException("output is NULL"); - } - 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(final String name) - { - try - { - return output.isStreamElement(name); - } - catch (InvalidStorageException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (com.sun.star.lang.IllegalArgumentException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (NoSuchElementException ex) - { - // We expect this exception, no need to log it. - } - return false; - } - - public boolean isWritable(final String name) - { - return true; - } - - public Object getId() - { - return "1"; - } - - public long getVersion(final String name) - { - return 1; - } - - public boolean isReadable(final String name) - { - try - { - if (input != null) - { - return input.isStreamElement(name); - } - } - catch (InvalidStorageException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (com.sun.star.lang.IllegalArgumentException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (NoSuchElementException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - return false; - } - - public InputRepository openInputRepository(final String name) throws IOException - { - try - { - final String temp = shortenName(name); - if (!input.isStorageElement(temp)) - { - throw new IOException(); - } - final XStorage storage = (XStorage) UnoRuntime.queryInterface(XStorage.class, input.openStorageElement(temp, ElementModes.READ)); - return new StorageRepository(storage, false); - } - catch (NoSuchElementException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (WrappedTargetException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (InvalidStorageException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (IllegalArgumentException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (com.sun.star.io.IOException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - throw new IOException(); - } - - final String shortenName(final String name) - { - final String temp; - if (name.startsWith("./")) - { - temp = name.substring(2); - } - else - { - temp = name; - } - return temp; - } - - public OutputRepository openOutputRepository(final String name, final String mimeType) throws IOException - { - try - { - final String temp = shortenName(name); - final XStorage storage = (XStorage) UnoRuntime.queryInterface(XStorage.class, output.openStorageElement(temp, ElementModes.WRITE)); - if (mimeType != null) - { - final XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, storage); - prop.setPropertyValue("MediaType", mimeType); - } - return new StorageRepository(storage, true); - } - catch (UnknownPropertyException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (PropertyVetoException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (IllegalArgumentException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (WrappedTargetException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (InvalidStorageException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (com.sun.star.io.IOException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - - throw new IOException(); - } - - public void closeInputRepository() - { - if (input != null) - { - input.dispose(); - } - } - - public void closeOutputRepository() - { - if (output != null) - { - try - { - final XTransactedObject obj = (XTransactedObject) UnoRuntime.queryInterface(XTransactedObject.class, output); - if (obj != null) - { - obj.commit(); - } - } - catch (com.sun.star.io.IOException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (WrappedTargetException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - output.dispose(); - } - - } - - public boolean existsStorage(final String name) - { - try - { - return output.isStorageElement(name); - } - catch (InvalidStorageException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (com.sun.star.lang.IllegalArgumentException ex) - { - Log.error(REPORT_PROCESSING_FAILED, ex); - } - catch (NoSuchElementException ex) - { - // We expect this exception, no need to log it. - } - return false; - } -} diff --git a/reportdesign/java/com/sun/star/report/function/metadata/Author-Function.properties b/reportdesign/java/com/sun/star/report/function/metadata/Author-Function.properties deleted file mode 100644 index 4dfc3e01f..000000000 --- a/reportdesign/java/com/sun/star/report/function/metadata/Author-Function.properties +++ /dev/null @@ -1,33 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: Author-Function.properties,v $ -# -# $Revision: 1.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -display-name=AUTHOR -description=Returns the author of the report.
\ No newline at end of file diff --git a/reportdesign/java/com/sun/star/report/function/metadata/Author-Function_en_US.properties b/reportdesign/java/com/sun/star/report/function/metadata/Author-Function_en_US.properties deleted file mode 100644 index 4dfc3e01f..000000000 --- a/reportdesign/java/com/sun/star/report/function/metadata/Author-Function_en_US.properties +++ /dev/null @@ -1,33 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: Author-Function.properties,v $ -# -# $Revision: 1.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -display-name=AUTHOR -description=Returns the author of the report.
\ No newline at end of file diff --git a/reportdesign/java/com/sun/star/report/function/metadata/AuthorFunction.java b/reportdesign/java/com/sun/star/report/function/metadata/AuthorFunction.java deleted file mode 100644 index e27f8aa51..000000000 --- a/reportdesign/java/com/sun/star/report/function/metadata/AuthorFunction.java +++ /dev/null @@ -1,67 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: AuthorFunction.java,v $ - * $Revision: 1.2 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.function.metadata; - -import com.sun.star.report.ReportEngineParameterNames; -import org.jfree.formula.EvaluationException; -import org.jfree.formula.FormulaContext; -import org.jfree.formula.LibFormulaErrorValue; -import org.jfree.formula.function.Function; -import org.jfree.formula.function.ParameterCallback; -import org.jfree.formula.lvalues.TypeValuePair; -import org.jfree.formula.typing.coretypes.TextType; - -/** - * - * @author Ocke Janssen - */ -public class AuthorFunction implements Function -{ - - public AuthorFunction() - { - } - - public String getCanonicalName() - { - return "AUTHOR"; - } - - public TypeValuePair evaluate(final FormulaContext context,final ParameterCallback parameters) - throws EvaluationException - { - if (parameters.getParameterCount() != 0) - { - throw new EvaluationException(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE); - } - - return new TypeValuePair(TextType.TYPE, context.getConfiguration().getConfigProperty(ReportEngineParameterNames.AUTHOR)); - } -} diff --git a/reportdesign/java/com/sun/star/report/function/metadata/AuthorFunctionDescription.java b/reportdesign/java/com/sun/star/report/function/metadata/AuthorFunctionDescription.java deleted file mode 100644 index dffb95bcb..000000000 --- a/reportdesign/java/com/sun/star/report/function/metadata/AuthorFunctionDescription.java +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: AuthorFunctionDescription.java,v $ - * $Revision: 1.2 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.function.metadata; - -import org.jfree.formula.function.AbstractFunctionDescription; -import org.jfree.formula.function.FunctionCategory; -import org.jfree.formula.typing.Type; -import org.jfree.formula.typing.coretypes.NumberType; -import org.jfree.formula.typing.coretypes.TextType; - -/** - * - * @author Ocke Janssen - */ -public class AuthorFunctionDescription extends AbstractFunctionDescription -{ - - public AuthorFunctionDescription() - { - super("com.sun.star.report.function.metadata.Author-Function"); - } - - public FunctionCategory getCategory() - { - return MetaDataFunctionCategory.CATEGORY; - } - - public int getParameterCount() - { - return 0; - } - - public Type getParameterType(final int position) - { - return null; - } - - public Type getValueType() - { - return TextType.TYPE; - } - - public boolean isParameterMandatory(final int position) - { - return false; - } -} diff --git a/reportdesign/java/com/sun/star/report/function/metadata/MetaDataFunctionCategory.java b/reportdesign/java/com/sun/star/report/function/metadata/MetaDataFunctionCategory.java deleted file mode 100644 index 3a5b43aee..000000000 --- a/reportdesign/java/com/sun/star/report/function/metadata/MetaDataFunctionCategory.java +++ /dev/null @@ -1,48 +0,0 @@ -/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: MetaDataFunctionCategory.java,v $
- * $Revision: 1.2 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package com.sun.star.report.function.metadata;
-
-import org.jfree.formula.function.AbstractFunctionCategory;
-import org.jfree.formula.function.FunctionCategory;
-
-/**
- *
- * @author Ocke Janssen
- */
-public class MetaDataFunctionCategory extends AbstractFunctionCategory
-{
-
- public static final FunctionCategory CATEGORY = new MetaDataFunctionCategory();
-
- private MetaDataFunctionCategory()
- {
- super("com.sun.star.report.function.metadata.category");
- }
-}
diff --git a/reportdesign/java/com/sun/star/report/function/metadata/Title-Function.properties b/reportdesign/java/com/sun/star/report/function/metadata/Title-Function.properties deleted file mode 100644 index ef678be15..000000000 --- a/reportdesign/java/com/sun/star/report/function/metadata/Title-Function.properties +++ /dev/null @@ -1,33 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: Title-Function.properties,v $ -# -# $Revision: 1.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -display-name=TITLE -description=Returns the title of the report.
\ No newline at end of file diff --git a/reportdesign/java/com/sun/star/report/function/metadata/Title-Function_en_US.properties b/reportdesign/java/com/sun/star/report/function/metadata/Title-Function_en_US.properties deleted file mode 100644 index ef678be15..000000000 --- a/reportdesign/java/com/sun/star/report/function/metadata/Title-Function_en_US.properties +++ /dev/null @@ -1,33 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: Title-Function.properties,v $ -# -# $Revision: 1.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -display-name=TITLE -description=Returns the title of the report.
\ No newline at end of file diff --git a/reportdesign/java/com/sun/star/report/function/metadata/TitleFunction.java b/reportdesign/java/com/sun/star/report/function/metadata/TitleFunction.java deleted file mode 100644 index d083e1912..000000000 --- a/reportdesign/java/com/sun/star/report/function/metadata/TitleFunction.java +++ /dev/null @@ -1,67 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TitleFunction.java,v $ - * $Revision: 1.2 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.function.metadata; - -import com.sun.star.report.ReportEngineParameterNames; -import org.jfree.formula.EvaluationException; -import org.jfree.formula.FormulaContext; -import org.jfree.formula.LibFormulaErrorValue; -import org.jfree.formula.function.Function; -import org.jfree.formula.function.ParameterCallback; -import org.jfree.formula.lvalues.TypeValuePair; -import org.jfree.formula.typing.coretypes.TextType; - -/** - * - * @author Ocke Janssen - */ -public class TitleFunction implements Function -{ - - public TitleFunction() - { - } - - public String getCanonicalName() - { - return "TITLE"; - } - - public TypeValuePair evaluate(final FormulaContext context,final ParameterCallback parameters) - throws EvaluationException - { - if (parameters.getParameterCount() != 0) - { - throw new EvaluationException(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE); - } - - return new TypeValuePair(TextType.TYPE, context.getConfiguration().getConfigProperty(ReportEngineParameterNames.TITLE)); - } -} diff --git a/reportdesign/java/com/sun/star/report/function/metadata/TitleFunctionDescription.java b/reportdesign/java/com/sun/star/report/function/metadata/TitleFunctionDescription.java deleted file mode 100644 index 8f56aca03..000000000 --- a/reportdesign/java/com/sun/star/report/function/metadata/TitleFunctionDescription.java +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TitleFunctionDescription.java,v $ - * $Revision: 1.2 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.function.metadata; - -import org.jfree.formula.function.AbstractFunctionDescription; -import org.jfree.formula.function.FunctionCategory; -import org.jfree.formula.typing.Type; -import org.jfree.formula.typing.coretypes.NumberType; -import org.jfree.formula.typing.coretypes.TextType; - -/** - * - * @author Ocke Janssen - */ -public class TitleFunctionDescription extends AbstractFunctionDescription -{ - - public TitleFunctionDescription() - { - super("com.sun.star.report.function.metadata.Title-Function"); - } - - public FunctionCategory getCategory() - { - return MetaDataFunctionCategory.CATEGORY; - } - - public int getParameterCount() - { - return 0; - } - - public Type getParameterType(final int position) - { - return null; - } - - public Type getValueType() - { - return TextType.TYPE; - } - - public boolean isParameterMandatory(final int position) - { - return false; - } -} diff --git a/reportdesign/java/com/sun/star/report/function/metadata/category.properties b/reportdesign/java/com/sun/star/report/function/metadata/category.properties deleted file mode 100644 index 7240967b7..000000000 --- a/reportdesign/java/com/sun/star/report/function/metadata/category.properties +++ /dev/null @@ -1,33 +0,0 @@ -#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2008 by Sun Microsystems, Inc.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# $RCSfile: category.properties,v $
-#
-# $Revision: 1.2 $
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-display-name=Document Information
-description=Contains functions to access document information.
diff --git a/reportdesign/java/com/sun/star/report/function/metadata/category_en_US.properties b/reportdesign/java/com/sun/star/report/function/metadata/category_en_US.properties deleted file mode 100644 index 44b7ed1d5..000000000 --- a/reportdesign/java/com/sun/star/report/function/metadata/category_en_US.properties +++ /dev/null @@ -1,33 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: category.properties,v $ -# -# $Revision: 1.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -display-name=MetaData -description=Contains functions about meta data
\ No newline at end of file diff --git a/reportdesign/java/com/sun/star/report/function/metadata/makefile.mk b/reportdesign/java/com/sun/star/report/function/metadata/makefile.mk deleted file mode 100644 index 5b038b858..000000000 --- a/reportdesign/java/com/sun/star/report/function/metadata/makefile.mk +++ /dev/null @@ -1,68 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.3.22.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = ..$/..$/..$/..$/..$/..$/.. -PRJNAME = reportdesign -TARGET= rpt_java_css_metadata -PACKAGE = com$/sun$/star$/report$/function$/metadata - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk -#----- compile .java files ----------------------------------------- - -.IF "$(SYSTEM_JFREEREPORT)" == "YES" -CLASSPATH!:==$(CLASSPATH)$(PATH_SEPERATOR)$(JCOMMON_JAR)$(PATH_SEPERATOR)$(LIBFORMULA_JAR) -.ELSE -JARFILES += jcommon-1.0.10.jar libformula-0.1.14.jar -.ENDIF - -JAVAFILES := AuthorFunction.java \ - AuthorFunctionDescription.java \ - TitleFunction.java \ - TitleFunctionDescription.java \ - MetaDataFunctionCategory.java - -# PROPERTYFILES := $(shell @$(FIND) . -name "*.properties") -PROPERTYFILES := $(CLASSDIR)$/$(PACKAGE)$/category.properties \ - $(CLASSDIR)$/$(PACKAGE)$/category_en_US.properties \ - $(CLASSDIR)$/$(PACKAGE)$/Author-Function.properties \ - $(CLASSDIR)$/$(PACKAGE)$/Author-Function_en_US.properties \ - $(CLASSDIR)$/$(PACKAGE)$/Title-Function.properties \ - $(CLASSDIR)$/$(PACKAGE)$/Title-Function_en_US.properties - -# --- Targets ------------------------------------------------------ -.INCLUDE : target.mk - -ALLTAR : $(PROPERTYFILES) - -$(CLASSDIR)$/$(PACKAGE)$/%.properties : %.properties - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ diff --git a/reportdesign/java/com/sun/star/report/makefile.mk b/reportdesign/java/com/sun/star/report/makefile.mk deleted file mode 100644 index 6da38dddd..000000000 --- a/reportdesign/java/com/sun/star/report/makefile.mk +++ /dev/null @@ -1,78 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.8.46.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = ..$/..$/..$/..$/.. -PRJNAME = reportdesign -TARGET=rpt_java_css -PACKAGE = com$/sun$/star$/report - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk -#----- compile .java files ----------------------------------------- - -JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar -.IF "$(SYSTEM_JFREEREPORT)" == "YES" -XCLASSPATH!:==$(XCLASSPATH)$(PATH_SEPERATOR)$(JCOMMON_JAR) -.ELSE -JARFILES += jcommon-1.0.10.jar -.ENDIF - -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\ - ReportJobFactory.java\ - ReportJobDefinition.java\ - ImageService.java\ - SOImageService.java\ - StorageRepository.java\ - SDBCReportData.java\ - SDBCReportDataFactory.java \ - OfficeToken.java - - -# --- Targets ------------------------------------------------------ -.INCLUDE : target.mk diff --git a/reportdesign/java/com/sun/star/report/pentaho/DefaultNameGenerator.java b/reportdesign/java/com/sun/star/report/pentaho/DefaultNameGenerator.java deleted file mode 100644 index 72c20de43..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/DefaultNameGenerator.java +++ /dev/null @@ -1,149 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DefaultNameGenerator.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho; - -import java.io.IOException; - -import com.sun.star.report.OutputRepository; - -public class DefaultNameGenerator -{ - - private final OutputRepository outputRepository; - - public DefaultNameGenerator(final OutputRepository outputRepository) - { - if (outputRepository == null) - { - throw new NullPointerException(); - } - this.outputRepository = outputRepository; - } - - public String generateName(final String namePrefix, final String mimeType) - throws IOException - { - return generateName(namePrefix, mimeType, true); - } - - public String generateStorageName(final String namePrefix, final String mimeType) - throws IOException - { - return generateName(namePrefix, mimeType, false); - } - - /** - * 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. - */ - private String generateName(final String namePrefix, final String mimeType, final boolean isStream) - throws IOException - { - final String name; - if (namePrefix != null) - { - name = namePrefix; - } - else - { - name = "file"; - } - - String firstFileName = name; - final String suffix; - if (mimeType != null) - { - suffix = getSuffixForType(mimeType); - firstFileName += "." + suffix; - } - else - { - suffix = null; - } - boolean exists; - if (isStream) - { - exists = outputRepository.exists(firstFileName); - } - else - { - exists = outputRepository.existsStorage(firstFileName); - } - if (exists) - { - int counter = 0; - while (exists) - { - if (counter < 0) // wraparound should not happen.. - { - throw new IOException(); - } - firstFileName = name + counter; - if (suffix != null) - { - firstFileName += "." + suffix; - } - if (isStream) - { - exists = outputRepository.exists(firstFileName); - } - else - { - exists = outputRepository.existsStorage(firstFileName); - } - counter += 1; - } - } - return firstFileName; - } - - 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"; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/Manifest.mf b/reportdesign/java/com/sun/star/report/pentaho/Manifest.mf deleted file mode 100644 index 891e556cd..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/Manifest.mf +++ /dev/null @@ -1,7 +0,0 @@ -RegistrationClassName: com.sun.star.report.pentaho.SOReportJobFactory -Class-Path: reportbuilderwizard.jar - flute-1.3-jfree-20061107.jar jcommon-1.0.10.jar - jcommon-serializer-0.2.0.jar libfonts-0.3.3.jar libformula-0.1.14.jar - liblayout-0.2.8.jar libloader-0.3.6.jar librepository-0.1.4.jar - libxml-0.9.9.jar pentaho-reporting-flow-engine-0.9.2.jar sac.jar -UNO-Type-Path: diff --git a/reportdesign/java/com/sun/star/report/pentaho/OfficeNamespaces.java b/reportdesign/java/com/sun/star/report/pentaho/OfficeNamespaces.java deleted file mode 100644 index 47c791834..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/OfficeNamespaces.java +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeNamespaces.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho; - -/** - * 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"; - /** - * @deprecated - */ - public static final String NUMBER_NS = DATASTYLE_NS; - - private OfficeNamespaces() - { - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/PentahoFormulaContext.java b/reportdesign/java/com/sun/star/report/pentaho/PentahoFormulaContext.java deleted file mode 100644 index ce991e144..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/PentahoFormulaContext.java +++ /dev/null @@ -1,102 +0,0 @@ -/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: PentahoFormulaContext.java,v $
- * $Revision: 1.2 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package com.sun.star.report.pentaho;
-
-import org.jfree.formula.ContextEvaluationException;
-import org.jfree.formula.FormulaContext;
-import org.jfree.formula.LocalizationContext;
-import org.jfree.formula.function.FunctionRegistry;
-import org.jfree.formula.operators.OperatorFactory;
-import org.jfree.formula.typing.Type;
-import org.jfree.formula.typing.TypeRegistry;
-import org.jfree.formula.typing.coretypes.AnyType;
-import org.jfree.report.util.ReportParameters;
-import org.jfree.util.Configuration;
-
-/**
- *
- * @author Ocke Janssen
- */
-public class PentahoFormulaContext implements FormulaContext
-{
-
- final private FormulaContext backend;
- final private Configuration config;
-
- public PentahoFormulaContext(final FormulaContext backend, final Configuration _config)
- {
- this.backend = backend;
- config = _config;
- }
-
- public LocalizationContext getLocalizationContext()
- {
- return backend.getLocalizationContext();
- }
-
- public Configuration getConfiguration()
- {
- return config;
- }
-
- public FunctionRegistry getFunctionRegistry()
- {
- return backend.getFunctionRegistry();
- }
-
- public TypeRegistry getTypeRegistry()
- {
- return backend.getTypeRegistry();
- }
-
- public OperatorFactory getOperatorFactory()
- {
- return backend.getOperatorFactory();
- }
-
- public Type resolveReferenceType(final Object name) throws ContextEvaluationException
- {
- return backend.resolveReferenceType(name);
- }
-
- public Object resolveReference(final Object name) throws ContextEvaluationException
- {
- if (name == null)
- {
- throw new NullPointerException();
- }
- return backend.resolveReference(name);
- }
-
- public boolean isReferenceDirty(final Object name) throws ContextEvaluationException
- {
- return backend.isReferenceDirty(name);
- }
-}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/PentahoReportAddIn.java b/reportdesign/java/com/sun/star/report/pentaho/PentahoReportAddIn.java deleted file mode 100644 index 47498cf66..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/PentahoReportAddIn.java +++ /dev/null @@ -1,63 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: PentahoReportAddIn.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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(final int expression) - { - return (expression == 0) ? new SumExpression() : null; - } - - public int getExpressionCount() - { - return 1; - } - - public ReportExpressionMetaData getMetaData(final int expression) - { - // todo implement me - return null; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/PentahoReportEngine.java b/reportdesign/java/com/sun/star/report/pentaho/PentahoReportEngine.java deleted file mode 100644 index cc793a97a..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/PentahoReportEngine.java +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: PentahoReportEngine.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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 final 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); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java b/reportdesign/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java deleted file mode 100644 index 686be22f1..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java +++ /dev/null @@ -1,146 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: PentahoReportEngineMetaData.java,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho; - -import com.sun.star.report.ReportJobFactory; -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 java.util.List; -import java.util.Map; -import java.util.Set; -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 OPENDOCUMENT_CHART = "application/vnd.oasis.opendocument.chart"; - public final static String CONTENT_TYPE = "content-type"; - public static final String DEBUG = "raw/text+xml"; - private final Set mandatoryParameters; - private final Map parameterTypes; - private final 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); - mandatoryParameters.add(ReportEngineParameterNames.INPUT_REPORTJOB_FACTORY); - mandatoryParameters.add(ReportEngineParameterNames.INPUT_MASTER_COLUMNS); - mandatoryParameters.add(ReportEngineParameterNames.INPUT_MASTER_VALUES); - mandatoryParameters.add(ReportEngineParameterNames.INPUT_DETAIL_COLUMNS); - mandatoryParameters.add(ReportEngineParameterNames.AUTHOR); - mandatoryParameters.add(ReportEngineParameterNames.TITLE); - - - 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); - parameterTypes.put(ReportEngineParameterNames.INPUT_REPORTJOB_FACTORY, ReportJobFactory.class); - parameterTypes.put(ReportEngineParameterNames.INPUT_MASTER_COLUMNS, List.class); - parameterTypes.put(ReportEngineParameterNames.INPUT_MASTER_VALUES, List.class); - parameterTypes.put(ReportEngineParameterNames.INPUT_DETAIL_COLUMNS, List.class); - parameterTypes.put(ReportEngineParameterNames.AUTHOR, String.class); - parameterTypes.put(ReportEngineParameterNames.TITLE, String.class); - - enumerationValues = new HashNMap(); - enumerationValues.add(CONTENT_TYPE, - PentahoReportEngineMetaData.OPENDOCUMENT_TEXT); - enumerationValues.add(CONTENT_TYPE, - PentahoReportEngineMetaData.OPENDOCUMENT_SPREADSHEET); - enumerationValues.add(CONTENT_TYPE, - PentahoReportEngineMetaData.OPENDOCUMENT_CHART); - 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); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/PentahoReportJob.java b/reportdesign/java/com/sun/star/report/pentaho/PentahoReportJob.java deleted file mode 100644 index 06d7fa45f..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/PentahoReportJob.java +++ /dev/null @@ -1,397 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: PentahoReportJob.java,v $ - * $Revision: 1.8.16.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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.SDBCReportDataFactory; -import com.sun.star.report.pentaho.loader.InputRepositoryLoader; -import com.sun.star.report.pentaho.model.OfficeDetailSection; -import com.sun.star.report.pentaho.model.OfficeDocument; -import com.sun.star.report.pentaho.model.OfficeGroup; -import com.sun.star.report.pentaho.model.OfficeReport; -import com.sun.star.report.pentaho.output.chart.ChartRawReportProcessor; -import com.sun.star.report.pentaho.output.text.TextRawReportProcessor; -import com.sun.star.report.pentaho.output.spreadsheet.SpreadsheetRawReportProcessor; -import java.util.List; -import org.jfree.formula.DefaultFormulaContext; -import org.jfree.formula.function.FunctionCategory; -import org.jfree.formula.function.FunctionRegistry; -import org.jfree.formula.lvalues.ContextLookup; -import org.jfree.formula.lvalues.FormulaFunction; -import org.jfree.formula.lvalues.LValue; -import org.jfree.formula.lvalues.Term; -import org.jfree.formula.parser.FormulaParser; -import org.jfree.formula.parser.ParseException; -import org.jfree.report.expressions.Expression; -import org.jfree.report.expressions.FormulaExpression; -import org.jfree.report.flow.DefaultReportJob; -import org.jfree.report.flow.ReportProcessor; -import org.jfree.report.flow.raw.XmlPrintReportProcessor; -import org.jfree.report.structure.Node; -import org.jfree.report.structure.Section; -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 final List listeners; - private final DataSourceFactory dataSourceFactory; - private final OutputRepository outputRepository; - private final JobProperties jobProperties; - private OfficeDocument report; - private final ResourceManager resourceManager; - private final String outputName; - private final ImageService imageService; - private final InputRepository inputRepository; - private final ReportJobDefinition definition; - private final List masterValues; - private final List detailColumns; - - public ReportJobDefinition getDefinition() - { - return definition; - } - - public PentahoReportJob(final ReportJobDefinition definition) - throws JobDefinitionException - { - if (definition == null) - { - throw new NullPointerException(); - } - - this.definition = definition; - 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.masterValues = (ArrayList) jobProperties.getProperty(ReportEngineParameterNames.INPUT_MASTER_VALUES); - this.detailColumns = (ArrayList) jobProperties.getProperty(ReportEngineParameterNames.INPUT_DETAIL_COLUMNS); - - 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 tempReport = (OfficeDocument) res.getResource(); - tempReport.setDataFactory(new StarReportDataFactory(dataSourceFactory)); - tempReport.setJobProperties(definition.getProcessingParameters().copy()); - final ReportParameters inputParameters = tempReport.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 tempReport; - } - - 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; - } - - public void removeProgressIndicator(final JobProgressIndicator indicator) - { - listeners.remove(indicator); - } - - private void collectGroupExpressions(final Node[] nodes, final List expressions, final FormulaParser parser, final Expression reportFunctions[]) - { - for (int i = 0; i < nodes.length; i++) - { - final Node node = nodes[i]; - if (node instanceof OfficeGroup) - { - final OfficeGroup group = (OfficeGroup) node; - final FormulaExpression exp = (FormulaExpression) group.getGroupingExpression(); - - try - { - final String expression = exp.getFormulaExpression(); - if ( expression == null) - continue; - final FormulaFunction function = (FormulaFunction) parser.parse(expression); - final LValue[] parameters = function.getChildValues(); - if (parameters.length > 0) - { - String name = parameters[0].toString(); - for (int j = 0; j < reportFunctions.length; j++) - { - if (reportFunctions[j] instanceof FormulaExpression) - { - final FormulaExpression reportExp = (FormulaExpression) reportFunctions[j]; - - if (reportExp.getName().equals(name)) - { - final LValue val = (LValue) parser.parse(reportExp.getFormulaExpression()); - if (val instanceof FormulaFunction) - { - final FormulaFunction reportFunction = (FormulaFunction) val; - - final ContextLookup context = (ContextLookup) reportFunction.getChildValues()[0]; - name = context.getName(); - } - else if (val instanceof Term) - { - final Term term = (Term) val; - final ContextLookup context = (ContextLookup) term.getHeadValue().getChildValues()[0]; - name = context.getName(); - } - break; - } - } - } - - final Object[] pair = new Object[2]; - pair[0] = name; - pair[1] = group.getAttribute(OfficeNamespaces.OOREPORT_NS, "sort-ascending"); - expressions.add(pair); - } - } - catch (ParseException ex) - { - Log.error("ReportProcessing failed", ex); - } - if (node instanceof Section) - { - final Section section = (Section) node; - collectGroupExpressions(section.getNodeArray(), expressions, parser, reportFunctions); - } - - } - else if (node instanceof OfficeDetailSection) - { - return; - } - - } - } - - private void setMetaDataProperties(DefaultReportJob job) - { - job.getConfiguration().setConfigProperty(ReportEngineParameterNames.AUTHOR, (String) jobProperties.getProperty(ReportEngineParameterNames.AUTHOR)); - job.getConfiguration().setConfigProperty(ReportEngineParameterNames.TITLE, (String) jobProperties.getProperty(ReportEngineParameterNames.TITLE)); - } - /** - * 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); - setMetaDataProperties(job); - final String contentType = (String) jobProperties.getProperty(ReportEngineParameterNames.CONTENT_TYPE); - //noinspection OverlyBroadCatchBlock - try - { - final ReportParameters parameters = job.getParameters(); - - if (masterValues != null && detailColumns != null) - { - parameters.put(SDBCReportDataFactory.MASTER_VALUES, masterValues); - parameters.put(SDBCReportDataFactory.DETAIL_COLUMNS, detailColumns); - } - - final Node[] nodes = report.getNodeArray(); - - final FormulaParser parser = new FormulaParser(); - final ArrayList expressions = new ArrayList(); - final OfficeReport officeReport = (OfficeReport) ((Section) nodes[0]).getNode(0); - final Section reportBody = (Section) officeReport.getBodySection(); - collectGroupExpressions(reportBody.getNodeArray(), expressions, parser, officeReport.getExpressions()); - parameters.put(SDBCReportDataFactory.GROUP_EXPRESSIONS, expressions); - final String command = (String) officeReport.getAttribute(OfficeNamespaces.OOREPORT_NS, "command"); - final String commandType = (String) officeReport.getAttribute(OfficeNamespaces.OOREPORT_NS, SDBCReportDataFactory.COMMAND_TYPE); - final String escapeProcessing = (String) officeReport.getAttribute(OfficeNamespaces.OOREPORT_NS, SDBCReportDataFactory.ESCAPE_PROCESSING); - report.setQuery(command); - parameters.put(SDBCReportDataFactory.COMMAND_TYPE, commandType); - parameters.put(SDBCReportDataFactory.ESCAPE_PROCESSING,new Boolean(!("false".equals(escapeProcessing)))); - - final String filter = (String) officeReport.getAttribute(OfficeNamespaces.OOREPORT_NS, "filter"); - parameters.put(SDBCReportDataFactory.UNO_FILTER, filter); - - 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) - { - String message = e.getMessage(); - if ( message.length() == 0 ) - message = "Failed to process the report"; - throw new ReportExecutionException(message, e); - } - - } - - protected ReportProcessor getProcessorForContentType(final String mimeType) - throws ReportExecutionException - { - final ReportProcessor ret; - - if (PentahoReportEngineMetaData.OPENDOCUMENT_SPREADSHEET.equals(mimeType)) - { - ret = new SpreadsheetRawReportProcessor(inputRepository, outputRepository, outputName, imageService, dataSourceFactory); - } - else if (PentahoReportEngineMetaData.OPENDOCUMENT_TEXT.equals(mimeType)) - { - ret = new TextRawReportProcessor(inputRepository, outputRepository, outputName, imageService, dataSourceFactory); - } - else if (PentahoReportEngineMetaData.OPENDOCUMENT_CHART.equals(mimeType)) - { - ret = new ChartRawReportProcessor(inputRepository, outputRepository, outputName, imageService, dataSourceFactory); - } - else if (PentahoReportEngineMetaData.DEBUG.equals(mimeType)) - { - ret = new XmlPrintReportProcessor(System.out, "ISO-8859-1"); - } - else - { - throw new ReportExecutionException("Invalid mime-type"); - } - - return ret; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java b/reportdesign/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java deleted file mode 100644 index 20c3a0361..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java +++ /dev/null @@ -1,155 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: SOFormulaOpCodeMapper.java,v $ - * - * $Revision: 1.7 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho; - -import com.sun.star.lang.XServiceInfo; -import com.sun.star.uno.XComponentContext; -import com.sun.star.lib.uno.helper.WeakBase; -import com.sun.star.sheet.FormulaLanguage; -import com.sun.star.sheet.FormulaMapGroup; -import com.sun.star.sheet.FormulaOpCodeMapEntry; -import com.sun.star.sheet.FormulaToken; -import java.util.ArrayList; -import java.util.Map; - -public final class SOFormulaOpCodeMapper extends WeakBase - implements com.sun.star.sheet.XFormulaOpCodeMapper, XServiceInfo -{ - - private final XComponentContext m_xContext; - private static final String __serviceName = "com.sun.star.report.pentaho.SOFormulaOpCodeMapper"; - private final SOFormulaParser parser; - // attributes - final private int m_OpCodeExternal = 0; - final private int m_OpCodeUnknown = 0; - - public SOFormulaOpCodeMapper(XComponentContext context, SOFormulaParser parser) - { - m_xContext = context; - this.parser = parser; - } - - - // com.sun.star.sheet.XFormulaOpCodeMapper: - public int getOpCodeExternal() - { - return m_OpCodeExternal; - } - - public int getOpCodeUnknown() - { - return m_OpCodeUnknown; - } - - public com.sun.star.sheet.FormulaToken[] getMappings(String[] Names, int Language) throws com.sun.star.lang.IllegalArgumentException - { - if ( Language != FormulaLanguage.ODFF ) - throw new IllegalArgumentException(); - final ArrayList token = new ArrayList(); - final Map parserNames = parser.getNames(); - for (int i = 0; i < Names.length; i++) - { - if ( parserNames.containsKey(Names[i]) ) - { - token.add(((FormulaOpCodeMapEntry) parserNames.get(Names[i])).Token); - } - - } - return (com.sun.star.sheet.FormulaToken[]) token.toArray(new FormulaToken[token.size()]); - } - - public com.sun.star.sheet.FormulaOpCodeMapEntry[] getAvailableMappings(int Language, int Groups) throws com.sun.star.lang.IllegalArgumentException - { - if ( Language != FormulaLanguage.ODFF ) - throw new IllegalArgumentException(); - final ArrayList token = new ArrayList(); - if ( Groups == FormulaMapGroup.SPECIAL ) - { - return (com.sun.star.sheet.FormulaOpCodeMapEntry[]) parser.getSpecialOpCodes().toArray(new FormulaOpCodeMapEntry[parser.getSpecialOpCodes().size()]); - } - else - { - if ( (Groups & FormulaMapGroup.ARRAY_SEPARATORS) != 0 ) - { - token.addAll(parser.getGroup(SOFormulaParser.ARRAY_SEPARATORS).values()); - } - if ( (Groups & FormulaMapGroup.SEPARATORS) != 0 ) - { - token.addAll(parser.getGroup(SOFormulaParser.SEPARATORS).values()); - } - if ( (Groups & FormulaMapGroup.ARRAY_SEPARATORS) != 0 ) - { - token.addAll(parser.getGroup(SOFormulaParser.ARRAY_SEPARATORS).values()); - } - if ( (Groups & FormulaMapGroup.UNARY_OPERATORS) != 0 ) - { - token.addAll(parser.getGroup(SOFormulaParser.UNARY_OPERATORS).values()); - } - if ( (Groups & FormulaMapGroup.BINARY_OPERATORS) != 0 ) - { - token.addAll(parser.getGroup(SOFormulaParser.BINARY_OPERATORS).values()); - } - if ( (Groups & FormulaMapGroup.FUNCTIONS) != 0 ) - { - token.addAll(parser.getGroup(SOFormulaParser.FUNCTIONS).values()); - } - } - - return (com.sun.star.sheet.FormulaOpCodeMapEntry[]) token.toArray(new FormulaOpCodeMapEntry[token.size()]); - } - - public String getImplementationName() - { - return SOFormulaOpCodeMapper.class.getName(); - } - - public boolean supportsService(String sServiceName) - { - return sServiceName.equals(__serviceName); - } - - 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 - }; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/SOFormulaParser.java b/reportdesign/java/com/sun/star/report/pentaho/SOFormulaParser.java deleted file mode 100644 index e0f285113..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/SOFormulaParser.java +++ /dev/null @@ -1,429 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: SOFormulaParser.java,v $ - * - * $Revision: 1.7 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho; - -import com.sun.star.lang.XServiceInfo; -import com.sun.star.sheet.XFormulaOpCodeMapper; -import com.sun.star.uno.Exception; -import com.sun.star.uno.XComponentContext; -import com.sun.star.lib.uno.helper.ComponentBase; -import com.sun.star.uno.Type; -import com.sun.star.lib.uno.helper.PropertySetMixin; -import com.sun.star.sheet.FormulaLanguage; -import com.sun.star.sheet.FormulaMapGroup; -import com.sun.star.sheet.FormulaMapGroupSpecialOffset; -import com.sun.star.sheet.FormulaOpCodeMapEntry; -import com.sun.star.sheet.FormulaToken; -import com.sun.star.uno.Any; -import com.sun.star.uno.UnoRuntime; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Vector; -import org.jfree.formula.DefaultFormulaContext; -import org.jfree.formula.function.FunctionRegistry; -import org.jfree.formula.parser.FormulaParser; -import org.jfree.formula.parser.GeneratedFormulaParserConstants; -import org.jfree.formula.parser.GeneratedFormulaParserTokenManager; -import org.jfree.formula.parser.JavaCharStream; -import org.jfree.formula.parser.ParseException; -import org.jfree.formula.parser.Token; -import org.jfree.formula.parser.TokenMgrError; -import org.jfree.util.Configuration; - -public final class SOFormulaParser extends ComponentBase - implements com.sun.star.report.meta.XFormulaParser, XServiceInfo -{ - - public static final int SEPARATORS = 0; - public static final int ARRAY_SEPARATORS = 1; - public static final int UNARY_OPERATORS = 2; - public static final int BINARY_OPERATORS = 3; - public static final int FUNCTIONS = 4; - private final XComponentContext m_xContext; - private final PropertySetMixin m_prophlp; - private static final String __serviceName = "com.sun.star.report.meta.FormulaParser"; - private static final String OPERATORS = "org.jfree.formula.operators."; - - // attributes - final private List m_OpCodeMap = new ArrayList(); - private XFormulaOpCodeMapper formulaOpCodeMapper = null; - private final Map parserAllOpCodes = new HashMap(); - private final Map parserNames = new HashMap(); - private final Map[] groupOpCodes = new HashMap[5]; - private final Vector specialOpCodes = new Vector(); - - public Vector getSpecialOpCodes() - { - return specialOpCodes; - } - private int ownTokenCounter = 1000; - private final FormulaOpCodeMapEntry opCodePush; - private final FormulaParser parser; - - public SOFormulaParser(XComponentContext context) - { - - m_xContext = context; - final ClassLoader cl = java.lang.Thread.currentThread().getContextClassLoader(); - Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); - - parser = new FormulaParser(); - try - { - final XFormulaOpCodeMapper mapper = (XFormulaOpCodeMapper) UnoRuntime.queryInterface(XFormulaOpCodeMapper.class, m_xContext.getServiceManager().createInstanceWithContext("simple.formula.FormulaOpCodeMapperObj", m_xContext)); - FormulaOpCodeMapEntry[] opCodes = mapper.getAvailableMappings(FormulaLanguage.ODFF, FormulaMapGroup.FUNCTIONS); - final DefaultFormulaContext defaultContext = new DefaultFormulaContext(); - final FunctionRegistry functionRegistry = defaultContext.getFunctionRegistry(); - - String[] names = functionRegistry.getFunctionNames(); - addOpCodes(names, opCodes, FUNCTIONS); - names = getOperators(defaultContext, OPERATORS); - opCodes = mapper.getAvailableMappings(FormulaLanguage.ODFF, FormulaMapGroup.UNARY_OPERATORS); - addOpCodes(names, opCodes, UNARY_OPERATORS); - opCodes = mapper.getAvailableMappings(FormulaLanguage.ODFF, FormulaMapGroup.BINARY_OPERATORS); - addOpCodes(names, opCodes, BINARY_OPERATORS); - - names = GeneratedFormulaParserConstants.tokenImage.clone(); - for (int i = 0; i < names.length; i++) - { - final String token = names[i]; - if ( token != null && token.length() > 0 && token.charAt(0) == '"' ) - { - names[i] = token.substring(1, token.length() - 1); - } - } - opCodes = mapper.getAvailableMappings(FormulaLanguage.ODFF, FormulaMapGroup.SEPARATORS); - addOpCodes(names, opCodes, SEPARATORS, false); - - opCodes = mapper.getAvailableMappings(FormulaLanguage.ODFF, FormulaMapGroup.ARRAY_SEPARATORS); - addOpCodes(names, opCodes, ARRAY_SEPARATORS, false); - - opCodes = mapper.getAvailableMappings(FormulaLanguage.ODFF, FormulaMapGroup.SPECIAL); - names = new String[opCodes.length]; - - for (int i = 0; i < opCodes.length; i++) - { - final FormulaOpCodeMapEntry opCode = opCodes[i]; - parserAllOpCodes.put(opCode.Token.OpCode, opCode); - specialOpCodes.add(opCode); - } - // addOpCodes(names, opCodes,SPECIAL,false); - } catch ( Exception ex ) - { - ex.printStackTrace(); - } - opCodePush = (FormulaOpCodeMapEntry) specialOpCodes.get(FormulaMapGroupSpecialOffset.PUSH); - Thread.currentThread().setContextClassLoader(cl); - // use the last parameter of the PropertySetMixin constructor - // for your optional attributes if necessary. See the documentation - // of the PropertySetMixin helper for further information. - // Ensure that your attributes are initialized correctly! - m_prophlp = new PropertySetMixin(m_xContext, this, - new Type(com.sun.star.report.meta.XFormulaParser.class), null); - } - ; - - // com.sun.star.sheet.XFormulaParser: - public com.sun.star.sheet.FormulaToken[] parseFormula(String aFormula) - { - final ArrayList tokens = new ArrayList(); - if ( !"=".equals(aFormula) ) - { - String formula; - if ( aFormula.charAt(0) == '=' ) - formula = aFormula.substring(1); - else - formula = aFormula; - final ArrayList images = new ArrayList(); - try - { - int brackets = 0; - final GeneratedFormulaParserTokenManager tokenParser = new GeneratedFormulaParserTokenManager(new JavaCharStream(new StringReader(formula), 1, 1)); - Token token = tokenParser.getNextToken(); - while (token.kind != GeneratedFormulaParserConstants.EOF) - { - final FormulaToken formulaToken; - images.add(token.image); - final String upper = token.image.toUpperCase(); - if ( parserNames.containsKey(upper) ) - { - if ( token.image.equals("(")) - brackets++; - else if ( token.image.equals(")")) - --brackets; - final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) parserNames.get(upper); - formulaToken = opCode.Token; - } - else if ( token.kind == GeneratedFormulaParserConstants.WHITESPACE ) - { - final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) specialOpCodes.get(FormulaMapGroupSpecialOffset.SPACES); - formulaToken = opCode.Token; - } - else - { - formulaToken = new FormulaToken(); - formulaToken.OpCode = opCodePush.Token.OpCode; - formulaToken.Data = new Any(Type.STRING, token.image); - } - - tokens.add(formulaToken); - token = tokenParser.getNextToken(); - } - if ( brackets > 0 ) - { - final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) parserNames.get(")"); - while ( brackets-- != 0 ) - { - formula = formula.concat(")"); - images.add(")"); - tokens.add(opCode.Token); - } - - } - - parser.parse(formula); - } catch ( ParseException ex ) - { - boolean found = false; - // error occured so all token must be bad - for (int i = 0; i < tokens.size(); i++) - { - if ( !found && images.get(i).equals(ex.currentToken.image) ) - found = true; - if ( found ) - { - final FormulaToken dest = new FormulaToken(); - dest.OpCode = ((FormulaOpCodeMapEntry) specialOpCodes.get(FormulaMapGroupSpecialOffset.BAD)).Token.OpCode; - dest.Data = new Any(Type.STRING, images.get(i)); - tokens.remove(i); - tokens.add(i, dest); - } - } - } catch ( java.lang.Exception e ) - { - } catch ( TokenMgrError e ) - { - } - } - FormulaToken[] ret = (FormulaToken[]) tokens.toArray(new FormulaToken[tokens.size()]); - return ret; - } - - public String printFormula(com.sun.star.sheet.FormulaToken[] aTokens) - { - final StringBuffer ret = new StringBuffer(); - for (int i = 0; i < aTokens.length; i++) - { - final FormulaToken formulaToken = aTokens[i]; - if ( formulaToken.OpCode == opCodePush.Token.OpCode && !formulaToken.Data.equals(Any.VOID) ) - { - ret.append(formulaToken.Data); - } - else if ( parserAllOpCodes.containsKey(formulaToken.OpCode) ) - { - final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) parserAllOpCodes.get(formulaToken.OpCode); - if ( opCode.Name.length() > 0 ) - ret.append(opCode.Name); - else if ( !formulaToken.Data.equals(Any.VOID) ) - ret.append(formulaToken.Data); - } - } - return ret.toString(); - } - - // com.sun.star.beans.XPropertySet: - public com.sun.star.beans.XPropertySetInfo getPropertySetInfo() - { - return m_prophlp.getPropertySetInfo(); - } - - public void setPropertyValue(String aPropertyName, Object aValue) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.beans.PropertyVetoException, com.sun.star.lang.IllegalArgumentException, com.sun.star.lang.WrappedTargetException - { - m_prophlp.setPropertyValue(aPropertyName, aValue); - } - - public Object getPropertyValue(String aPropertyName) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - return m_prophlp.getPropertyValue(aPropertyName); - } - - public void addPropertyChangeListener(String aPropertyName, com.sun.star.beans.XPropertyChangeListener xListener) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - m_prophlp.addPropertyChangeListener(aPropertyName, xListener); - } - - public void removePropertyChangeListener(String aPropertyName, com.sun.star.beans.XPropertyChangeListener xListener) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - m_prophlp.removePropertyChangeListener(aPropertyName, xListener); - } - - public void addVetoableChangeListener(String aPropertyName, com.sun.star.beans.XVetoableChangeListener xListener) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - m_prophlp.addVetoableChangeListener(aPropertyName, xListener); - } - - public void removeVetoableChangeListener(String aPropertyName, com.sun.star.beans.XVetoableChangeListener xListener) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - m_prophlp.removeVetoableChangeListener(aPropertyName, xListener); - } - - // com.sun.star.report.meta.XFormulaParser: - public com.sun.star.sheet.FormulaOpCodeMapEntry[] getOpCodeMap() - { - return (com.sun.star.sheet.FormulaOpCodeMapEntry[]) m_OpCodeMap.toArray(new FormulaOpCodeMapEntry[m_OpCodeMap.size()]); - } - - public void setOpCodeMap(com.sun.star.sheet.FormulaOpCodeMapEntry[] the_value) - { -// m_prophlp.prepareSet("OpCodeMap", null); -// synchronized (this) -// { -// m_OpCodeMap.clear(); -// } - } - - public String getImplementationName() - { - return SOFormulaParser.class.getName(); - } - - public boolean supportsService(String sServiceName) - { - return sServiceName.equals(__serviceName); - } - - 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 - }; - } - - public XFormulaOpCodeMapper getFormulaOpCodeMapper() - { - if ( formulaOpCodeMapper == null ) - { - formulaOpCodeMapper = new SOFormulaOpCodeMapper(m_xContext, this); - } - - return formulaOpCodeMapper; - } - - private void addOpCodes(String[] names, FormulaOpCodeMapEntry[] opCodes, int group) - { - addOpCodes(names, opCodes, group, true); - } - - private void addOpCodes(String[] names, FormulaOpCodeMapEntry[] opCodes, int group, boolean add) - { - groupOpCodes[group] = new HashMap(); - for (int j = 0; j < names.length; j++) - { - FormulaOpCodeMapEntry opCode = null; - int i = 0; - for (; i < opCodes.length; i++) - { - opCode = opCodes[i]; - if ( names[j].equals(opCode.Name) ) - { - break; - } - } - if ( i >= opCodes.length ) - { - if ( !add ) - continue; - final FormulaToken token = new FormulaToken(ownTokenCounter++, Any.VOID); - opCode = new FormulaOpCodeMapEntry(names[j], token); - } - parserNames.put(names[j], opCode); - parserAllOpCodes.put(opCode.Token.OpCode, opCode); - groupOpCodes[group].put(opCode.Token.OpCode, opCode); - } - } - - final public Map getNames() - { - return parserNames; - } - - final public Map getGroup(int group) - { - return groupOpCodes[group]; - } - - private String[] getOperators(DefaultFormulaContext defaultContext, final String _kind) - { - final ArrayList ops = new ArrayList(); - final Configuration configuration = defaultContext.getConfiguration(); - final Iterator iter = configuration.findPropertyKeys(_kind); - while (iter.hasNext()) - { - final String configKey = (String) iter.next(); - if ( configKey.endsWith(".class") == false ) - { - continue; - } - final String operatorClass = configuration.getConfigProperty(configKey); - if ( operatorClass == null ) - { - continue; - } - if ( operatorClass.length() == 0 ) - { - continue; - } - final String tokenKey = configKey.substring(0, configKey.length() - ".class".length()) + ".token"; - final String token = configuration.getConfigProperty(tokenKey); - if ( token == null ) - { - continue; - } - ops.add(token.trim()); - } - return (String[]) ops.toArray(new String[ops.size()]); - } -} - diff --git a/reportdesign/java/com/sun/star/report/pentaho/SOFunctionManager.java b/reportdesign/java/com/sun/star/report/pentaho/SOFunctionManager.java deleted file mode 100644 index ca2e3b0b3..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/SOFunctionManager.java +++ /dev/null @@ -1,198 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: XFunctionManager.java,v $ - * - * $Revision: 1.7 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho; - -import com.sun.star.container.NoSuchElementException; -import com.sun.star.lang.IndexOutOfBoundsException; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.lang.XServiceInfo; -import com.sun.star.report.meta.XFunctionDescription; -import com.sun.star.uno.XComponentContext; -import com.sun.star.lib.uno.helper.ComponentBase; -import com.sun.star.report.meta.XFunctionCategory; -import com.sun.star.report.meta.XFunctionManager; -import org.jfree.formula.DefaultFormulaContext; -import org.jfree.formula.function.FunctionCategory; -import org.jfree.formula.function.FunctionDescription; -import org.jfree.formula.function.FunctionRegistry; -import org.jfree.formula.lvalues.LValue; -import org.jfree.formula.parser.FormulaParser; -import org.jfree.formula.parser.ParseException; - -/** - * 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 final class SOFunctionManager extends ComponentBase implements XFunctionManager, XServiceInfo -{ - - private final XComponentContext m_xContext; - /** - * The service name, that must be used to get an instance of this service. - */ - private static final String __serviceName = - "com.sun.star.report.meta.FunctionManager"; - final private FunctionCategory[] categories; - final private FunctionRegistry functionRegistry; - final private DefaultFormulaContext defaultContext; - - public SOFunctionManager(XComponentContext context) - { - m_xContext = context; - final ClassLoader cl = java.lang.Thread.currentThread().getContextClassLoader(); - Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); - defaultContext = new DefaultFormulaContext(); - functionRegistry = defaultContext.getFunctionRegistry(); - categories = functionRegistry.getCategories(); - Thread.currentThread().setContextClassLoader(cl); - - } - - /** - * 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 SOFunctionManager.class.getName(); - } - - // com.sun.star.container.XElementAccess: - public com.sun.star.uno.Type getElementType() - { - return new com.sun.star.uno.Type(XFunctionCategory.class); - } - - public boolean hasElements() - { - return categories.length != 0; - } - - // com.sun.star.container.XIndexAccess: - public int getCount() - { - return categories.length; - } - - public Object getByIndex(int Index) throws com.sun.star.lang.IndexOutOfBoundsException, com.sun.star.lang.WrappedTargetException - { - return getCategory(Index); - } - - // com.sun.star.report.meta.XFunctionManager: - public com.sun.star.report.meta.XFunctionCategory getCategory(int position) throws com.sun.star.lang.IndexOutOfBoundsException, com.sun.star.lang.WrappedTargetException - { - if ( position >= categories.length ) - throw new com.sun.star.lang.IndexOutOfBoundsException(); - return new StarFunctionCategory(defaultContext,m_xContext, functionRegistry, position, categories[position]); - } - - public int getFunctionStartAtIndex(String formula, int position) - { - int nStartPos = -1; - try - { - final FormulaParser parser = new FormulaParser(); - final LValue x = parser.parse(formula); - String part = x.toString(); - while ( part.length() < position ) - { - final LValue[] children = x.getChildValues(); - if ( children != null ) - { - for(int i = 0; i < children.length;++i) - { - part = children[i].toString(); - } - } - } - } catch ( ParseException ex ) - { - } - return nStartPos; - } - - public XFunctionDescription getFunctionByName(String arg0) throws NoSuchElementException - { - final FunctionDescription func = functionRegistry.getMetaData(arg0); - if ( func == null ) - throw new NoSuchElementException(); - int i = 0; - for (; i < categories.length; i++) - { - if ( categories[i] == func.getCategory() ) - break; - } - try - { - return new StarFunctionDescription(defaultContext, m_xContext, getCategory(i), functionRegistry, func); - } - catch ( Exception ex ) - { - } - return null; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/SOReportJobFactory.java b/reportdesign/java/com/sun/star/report/pentaho/SOReportJobFactory.java deleted file mode 100644 index 626aedbdf..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/SOReportJobFactory.java +++ /dev/null @@ -1,385 +0,0 @@ -/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: SOReportJobFactory.java,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package com.sun.star.report.pentaho;
-
-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.IllegalArgumentException;
-import com.sun.star.lang.XInitialization;
-import com.sun.star.lang.XServiceInfo;
-import com.sun.star.lang.WrappedTargetException;
-import com.sun.star.lang.XSingleComponentFactory;
-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.ReportExecutionException;
-import com.sun.star.report.ReportJob;
-import com.sun.star.report.ReportJobDefinition;
-import com.sun.star.report.ReportJobFactory;
-import com.sun.star.report.SDBCReportDataFactory;
-import com.sun.star.report.SOImageService;
-import com.sun.star.report.StorageRepository;
-import com.sun.star.report.XReportDefinition;
-import com.sun.star.report.pentaho.SOReportJobFactory._SOReportJobFactory;
-import com.sun.star.sdbc.XConnection;
-import com.sun.star.sdbc.XRowSet;
-import com.sun.star.task.XJob;
-import com.sun.star.uno.Exception;
-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, ReportJobFactory
- {
-
- /**
- * 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 final PropertySetMixin m_prophlp;
- /**
- * The initial component contextr, that gives access to the service manager, supported singletons, ... It's
- * often later used
- */
- private final XComponentContext m_cmpCtx;
- private XConnection activeConnection;
- private XReportDefinition report;
-
- public _SOReportJobFactory( XComponentContext xCompContext)
- {
- m_cmpCtx = xCompContext;
- m_prophlp = new PropertySetMixin(m_cmpCtx, this,
- new Type(XJob.class),
- null); // no optionals
- }
-
- /**
- * 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
- {
- final ReportJob job = createReportJob(namedValue);
- job.execute();
- }
- catch (java.lang.Exception e)
- {
- Log.error("ReportProcessing failed", e);
- throw new com.sun.star.lang.WrappedTargetException(e.getMessage(), this,null);
- }
- catch (java.lang.IncompatibleClassChangeError e2)
- {
- Log.error("Detected an IncompatibleClassChangeError");
- throw new com.sun.star.lang.WrappedTargetException("caught a " + e2.getClass().getName(), this, new com.sun.star.uno.Exception(e2.getLocalizedMessage()));
- }
- Thread.currentThread().setContextClassLoader(cl);
-
- return null;
- }
-
- public ReportJob createReportJob(final NamedValue[] namedValue) throws IllegalArgumentException, ReportExecutionException, Exception
- {
- XStorage input = null;
- XStorage output = null;
- XRowSet rowSet = null;
- String mimetype = null;
- String author = null;
- String title = null;
-
- for (int i = 0; i < namedValue.length; ++i)
- {
- final NamedValue aProps = namedValue[i];
- if ("ActiveConnection".equalsIgnoreCase(aProps.Name))
- {
- activeConnection = (XConnection) UnoRuntime.queryInterface(XConnection.class, aProps.Value);
- }
- else if ("ReportDefinition".equalsIgnoreCase(aProps.Name))
- {
- report = (XReportDefinition) UnoRuntime.queryInterface(XReportDefinition.class, aProps.Value);
- }
- 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 ("RowSet".equalsIgnoreCase(aProps.Name))
- {
- rowSet = (XRowSet) UnoRuntime.queryInterface(XRowSet.class, aProps.Value);
- }
- else if ("mimetype".equalsIgnoreCase(aProps.Name))
- {
- mimetype = (String) aProps.Value;
- }
- else if (ReportEngineParameterNames.AUTHOR.equalsIgnoreCase(aProps.Name))
- {
- author = (String) aProps.Value;
- }
- else if (ReportEngineParameterNames.TITLE.equalsIgnoreCase(aProps.Name))
- {
- title = (String) aProps.Value;
- }
- }
-
- if (input == null || output == null)
- {
- throw new com.sun.star.lang.IllegalArgumentException();
- }
-
- if (rowSet == null)
- {
- if (report == null || activeConnection == null)
- {
- throw new com.sun.star.lang.IllegalArgumentException();
- }
- mimetype = report.getMimeType();
- }
- else
- {
- final XPropertySet set = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, rowSet);
- if ( set == null )
- {
- throw new com.sun.star.lang.IllegalArgumentException();
- }
- activeConnection = (XConnection) UnoRuntime.queryInterface(XConnection.class,set.getPropertyValue("ActiveConnection"));
- }
- if (mimetype == null)
- {
- mimetype = PentahoReportEngineMetaData.OPENDOCUMENT_TEXT;
- }
-
- final DataSourceFactory dataFactory = new SDBCReportDataFactory(m_cmpCtx, activeConnection);
- final StorageRepository storageRepository = new StorageRepository(input, output);
-
- final String inputName = "content.xml";
- final String outputName = "content.xml";
-
- final PentahoReportEngine engine = new PentahoReportEngine();
- final ReportJobDefinition definition = engine.createJobDefinition();
- final JobProperties procParms = definition.getProcessingParameters();
- 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));
- procParms.setProperty(ReportEngineParameterNames.INPUT_REPORTJOB_FACTORY, this);
- if ( author != null)
- procParms.setProperty(ReportEngineParameterNames.AUTHOR, author);
- if ( title != null)
- procParms.setProperty(ReportEngineParameterNames.TITLE, title);
-
- return engine.createJob(definition);
- }
-
- // 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());
- }
- else if (sImplName.equals(SOFunctionManager.class.getName()))
- {
- xFactory = Factory.createComponentFactory(SOFunctionManager.class,SOFunctionManager.getServiceNames());
- }
- else if (sImplName.equals(SOFormulaParser.class.getName()))
- {
- xFactory = Factory.createComponentFactory(SOFormulaParser.class,SOFormulaParser.getServiceNames());
- }
- }
- catch (java.lang.IncompatibleClassChangeError 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(SOFunctionManager.class.getName(),
- SOFunctionManager.getServiceNames(),
- regKey)
- &&
- Factory.writeRegistryServiceInfo(_SOReportJobFactory.class.getName(),
- _SOReportJobFactory.getServiceNames(),
- regKey)
- &&
- Factory.writeRegistryServiceInfo(SOFormulaParser.class.getName(),
- SOFormulaParser.getServiceNames(),
- regKey)
- ;
- }
-}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/StarFunctionCategory.java b/reportdesign/java/com/sun/star/report/pentaho/StarFunctionCategory.java deleted file mode 100644 index db3345e65..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/StarFunctionCategory.java +++ /dev/null @@ -1,162 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StarFunctionCategory.java,v $ - * - * $Revision: 1.7 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho; - -import com.sun.star.uno.XComponentContext; -import com.sun.star.lib.uno.helper.WeakBase; -import com.sun.star.uno.Type; -import com.sun.star.lib.uno.helper.PropertySetMixin; -import com.sun.star.report.meta.XFunctionDescription; -import java.util.Locale; -import java.util.MissingResourceException; -import org.jfree.formula.DefaultFormulaContext; -import org.jfree.formula.function.FunctionCategory; -import org.jfree.formula.function.FunctionRegistry; - - -public final class StarFunctionCategory extends WeakBase - implements com.sun.star.report.meta.XFunctionCategory -{ - private final XComponentContext m_xContext; - private final PropertySetMixin m_prophlp; - // attributes - private final int m_Number; - private final FunctionCategory category; - private final FunctionRegistry functionRegistry; - private final String functions[]; - private final DefaultFormulaContext defaultContext; - private final Locale defaultLocale; - - public StarFunctionCategory( DefaultFormulaContext defaultContext,final XComponentContext context,final FunctionRegistry functionRegistry,final int _number,final FunctionCategory category ) - { - this.defaultContext = defaultContext; - m_xContext = context; - m_Number = _number; - this.category = category; - this.functionRegistry = functionRegistry; - Locale locale; - try - { - category.getDisplayName(defaultContext.getLocalizationContext().getLocale()); - locale = defaultContext.getLocalizationContext().getLocale(); - } - catch(MissingResourceException e) - { - locale = Locale.ENGLISH; - } - this.defaultLocale = locale; - - functions = functionRegistry.getFunctionNamesByCategory(category); - // use the last parameter of the PropertySetMixin constructor - // for your optional attributes if necessary. See the documentation - // of the PropertySetMixin helper for further information. - // Ensure that your attributes are initialized correctly! - m_prophlp = new PropertySetMixin(m_xContext, this, - new Type(com.sun.star.report.meta.XFunctionCategory.class), null); - }; - - // com.sun.star.beans.XPropertySet: - public com.sun.star.beans.XPropertySetInfo getPropertySetInfo() - { - return m_prophlp.getPropertySetInfo(); - } - - public void setPropertyValue(String aPropertyName, Object aValue) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.beans.PropertyVetoException, com.sun.star.lang.IllegalArgumentException,com.sun.star.lang.WrappedTargetException - { - m_prophlp.setPropertyValue(aPropertyName, aValue); - } - - public Object getPropertyValue(String aPropertyName) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - return m_prophlp.getPropertyValue(aPropertyName); - } - - public void addPropertyChangeListener(String aPropertyName, com.sun.star.beans.XPropertyChangeListener xListener) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - m_prophlp.addPropertyChangeListener(aPropertyName, xListener); - } - - public void removePropertyChangeListener(String aPropertyName, com.sun.star.beans.XPropertyChangeListener xListener) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - m_prophlp.removePropertyChangeListener(aPropertyName, xListener); - } - - public void addVetoableChangeListener(String aPropertyName, com.sun.star.beans.XVetoableChangeListener xListener) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - m_prophlp.addVetoableChangeListener(aPropertyName, xListener); - } - - public void removeVetoableChangeListener(String aPropertyName, com.sun.star.beans.XVetoableChangeListener xListener) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - m_prophlp.removeVetoableChangeListener(aPropertyName, xListener); - } - - // com.sun.star.container.XElementAccess: - public com.sun.star.uno.Type getElementType() - { - return new com.sun.star.uno.Type(XFunctionDescription.class); - } - - public boolean hasElements() - { - return functions.length != 0; - } - - // com.sun.star.container.XIndexAccess: - public int getCount() - { - return functions.length; - } - - public Object getByIndex(int Index) throws com.sun.star.lang.IndexOutOfBoundsException, com.sun.star.lang.WrappedTargetException - { - return getFunction(Index); - } - - // com.sun.star.report.meta.XFunctionCategory: - public int getNumber() - { - return m_Number; - } - - public String getName() - { - return category.getDisplayName(defaultLocale); - } - - public com.sun.star.report.meta.XFunctionDescription getFunction(int position) throws com.sun.star.lang.IndexOutOfBoundsException, com.sun.star.lang.WrappedTargetException - { - if ( position >= functions.length ) - throw new IndexOutOfBoundsException(); - return new StarFunctionDescription(defaultContext,m_xContext,this,functionRegistry,functionRegistry.getMetaData(functions[position])); - } - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/StarFunctionDescription.java b/reportdesign/java/com/sun/star/report/pentaho/StarFunctionDescription.java deleted file mode 100644 index d5c5dbf56..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/StarFunctionDescription.java +++ /dev/null @@ -1,191 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StarFunctionDescription.java,v $ - * - * $Revision: 1.7 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho; - -import com.sun.star.uno.XComponentContext; -import com.sun.star.lib.uno.helper.WeakBase; -import com.sun.star.uno.Type; -import com.sun.star.lib.uno.helper.PropertySetMixin; -import com.sun.star.report.meta.XFunctionCategory; -import com.sun.star.sheet.FunctionArgument; -import java.util.Locale; -import java.util.MissingResourceException; -import org.jfree.formula.DefaultFormulaContext; -import org.jfree.formula.function.FunctionDescription; -import org.jfree.formula.function.FunctionRegistry; - -public final class StarFunctionDescription extends WeakBase - implements com.sun.star.report.meta.XFunctionDescription -{ - - private final XComponentContext m_xContext; - private final PropertySetMixin m_prophlp; - // attributes -// final private com.sun.star.report.meta.XFunctionCategory m_Category; - private final FunctionDescription functionDescription; - private final FunctionRegistry functionRegistry; - private final XFunctionCategory category; - private final Locale defaultLocale; - - public StarFunctionDescription(final DefaultFormulaContext defaultContext, final XComponentContext context, final XFunctionCategory category, final FunctionRegistry functionRegistry, final FunctionDescription functionDescription) - { - m_xContext = context; - this.category = category; - Locale locale; - try - { - functionDescription.getDisplayName(defaultContext.getLocalizationContext().getLocale()); - locale = defaultContext.getLocalizationContext().getLocale(); - } catch ( MissingResourceException e ) - { - locale = Locale.ENGLISH; - } - this.defaultLocale = locale; - - this.functionDescription = functionDescription; - this.functionRegistry = functionRegistry; - // use the last parameter of the PropertySetMixin constructor - // for your optional attributes if necessary. See the documentation - // of the PropertySetMixin helper for further information. - // Ensure that your attributes are initialized correctly! - m_prophlp = new PropertySetMixin(m_xContext, this, - new Type(com.sun.star.report.meta.XFunctionDescription.class), null); - } - ; - - // com.sun.star.beans.XPropertySet: - public com.sun.star.beans.XPropertySetInfo getPropertySetInfo() - { - return m_prophlp.getPropertySetInfo(); - } - - public void setPropertyValue(String aPropertyName, Object aValue) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.beans.PropertyVetoException, com.sun.star.lang.IllegalArgumentException, com.sun.star.lang.WrappedTargetException - { - m_prophlp.setPropertyValue(aPropertyName, aValue); - } - - public Object getPropertyValue(String aPropertyName) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - return m_prophlp.getPropertyValue(aPropertyName); - } - - public void addPropertyChangeListener(String aPropertyName, com.sun.star.beans.XPropertyChangeListener xListener) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - m_prophlp.addPropertyChangeListener(aPropertyName, xListener); - } - - public void removePropertyChangeListener(String aPropertyName, com.sun.star.beans.XPropertyChangeListener xListener) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - m_prophlp.removePropertyChangeListener(aPropertyName, xListener); - } - - public void addVetoableChangeListener(String aPropertyName, com.sun.star.beans.XVetoableChangeListener xListener) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - m_prophlp.addVetoableChangeListener(aPropertyName, xListener); - } - - public void removeVetoableChangeListener(String aPropertyName, com.sun.star.beans.XVetoableChangeListener xListener) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException - { - m_prophlp.removeVetoableChangeListener(aPropertyName, xListener); - } - - // com.sun.star.report.meta.XFunctionDescription: - public com.sun.star.report.meta.XFunctionCategory getCategory() - { - return category; - } - - public String getName() - { - return functionDescription.getDisplayName(defaultLocale); - } - - public String getDescription() - { - return functionDescription.getDescription(defaultLocale); - } - - public String getSignature() - { - final int count = functionDescription.getParameterCount(); - final StringBuffer signature = new StringBuffer(getName()); - signature.append("("); - for (int i = 0; i < count; i++) - { - signature.append(functionDescription.getParameterDisplayName(i, defaultLocale)); - if ( i != (count - 1) ) - signature.append(";"); - } - signature.append(")"); - return signature.toString(); - } - - public com.sun.star.sheet.FunctionArgument[] getArguments() - { - int count = functionDescription.getParameterCount(); - final boolean infinite = functionDescription.isInfiniteParameterCount(); - if ( infinite ) - { - count = 30; - } - final FunctionArgument[] args = new FunctionArgument[count]; - for (int i = 0; i < args.length; i++) - { - final int pos = infinite ? 0 : i; - args[i] = new FunctionArgument(); - args[i].Description = functionDescription.getParameterDescription(pos, defaultLocale); - args[i].Name = functionDescription.getParameterDisplayName(pos, defaultLocale); - args[i].IsOptional = !functionDescription.isParameterMandatory(pos); - } - return args; - } - - public String createFormula(String[] arguments) throws com.sun.star.lang.DisposedException, com.sun.star.lang.IllegalArgumentException, com.sun.star.uno.Exception - { - final boolean infinite = functionDescription.isInfiniteParameterCount(); - final int count = functionDescription.getParameterCount(); - if ( !infinite && arguments.length > count ) - throw new com.sun.star.lang.IllegalArgumentException(); - - final StringBuffer formula = new StringBuffer(getName()); - formula.append("("); - for (int i = 0; i < arguments.length; ++i) - { - if ( arguments[i].length() == 0 ) - break; - formula.append(arguments[i]); - if ( i < (arguments.length - 1) && arguments[i+1].length() != 0 ) - formula.append(";"); - } - formula.append(")"); - return formula.toString(); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/StarReportData.java b/reportdesign/java/com/sun/star/report/pentaho/StarReportData.java deleted file mode 100644 index 48fa9c329..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/StarReportData.java +++ /dev/null @@ -1,170 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StarReportData.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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 final DataSource dataSource; - private int currentRow; - private final 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 - { - final boolean ret = dataSource.absolute(row); - if (ret) - { - currentRow = row; - } - return ret; - } - 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()) - { - 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; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/StarReportDataFactory.java b/reportdesign/java/com/sun/star/report/pentaho/StarReportDataFactory.java deleted file mode 100644 index bbbc092a3..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/StarReportDataFactory.java +++ /dev/null @@ -1,126 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StarReportDataFactory.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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 final 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) - { - String message = dse.getMessage(); - if ( message.length() == 0 ) - message = "Failed to create report data wrapper"; - throw new ReportDataFactoryException(message,dse); - } - catch (org.jfree.report.DataSourceException e) - { - String message = e.getMessage(); - if ( message.length() == 0 ) - message = "Failed to query data"; - throw new ReportDataFactoryException(message); - } - } - - 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(); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/StarReportModule.java b/reportdesign/java/com/sun/star/report/pentaho/StarReportModule.java deleted file mode 100644 index 6988239d2..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/StarReportModule.java +++ /dev/null @@ -1,62 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StarReportModule.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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 (final SubSystem subSystem) - throws ModuleInitializeException - { - - - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/configuration.properties b/reportdesign/java/com/sun/star/report/pentaho/configuration.properties deleted file mode 100644 index 1b463ad90..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/configuration.properties +++ /dev/null @@ -1,158 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: configuration.properties,v $ -# -# $Revision: 1.6 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - - -## -# 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-chart.Uri=urn:oasis:names:tc:opendocument:xmlns:chart:1.0 -org.jfree.report.namespaces.oasis-chart.Default-Style=res://com/sun/star/report/pentaho/oasis-chart.css -org.jfree.report.namespaces.oasis-chart.Prefix=chart -org.jfree.report.namespaces.oasis-chart.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 -com.sun.star.report.pentaho.output.tag.oasis-data.currency-symbol=deny - -com.sun.star.report.pentaho.output.namespace.oasis-draw=urn:oasis:names:tc:opendocument:xmlns:drawing:1.0 -com.sun.star.report.pentaho.output.default.oasis-draw=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.ObjectOleElement=com.sun.star.report.pentaho.layoutprocessor.ObjectOleLayoutController -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 -org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.OfficeGroupInstanceSection=com.sun.star.report.pentaho.layoutprocessor.OfficeGroupInstanceSectionLayoutController diff --git a/reportdesign/java/com/sun/star/report/pentaho/expressions/SumExpression.java b/reportdesign/java/com/sun/star/report/pentaho/expressions/SumExpression.java deleted file mode 100644 index 8caff015b..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/expressions/SumExpression.java +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: SumExpression.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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 (final DataRow row) - { - - return null; - } - - public void setParameters (final Object[] parameters) - { - this.parameters = parameters; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/expressions/SumExpressionMetaData.java b/reportdesign/java/com/sun/star/report/pentaho/expressions/SumExpressionMetaData.java deleted file mode 100644 index bc9a16cb6..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/expressions/SumExpressionMetaData.java +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: SumExpressionMetaData.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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 (final Locale l) - { - // todo implement me - return null; - } - - public String getDisplayName (final 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 (final int param,final Locale locale) - { - // todo implement me - return null; - } - - public String getParameterDisplayName (final int param,final Locale locale) - { - // todo implement me - return null; - } - - public String getParameterName (final int param) - { - // todo implement me - return null; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java deleted file mode 100644 index d145b0388..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java +++ /dev/null @@ -1,270 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: AbstractReportElementLayoutController.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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. - - // 2. Print repeated values. This never applies to static text or static - // elements. - if ((text.isPrintWhenGroupChanges() && !isGroupChanged()) || (!text.isPrintRepeatedValues() && !isValueChanged())) - { - // if this is set to true, then we print the element only if this is the - // first occurrence in this group. - // or - // If this is set to true, we evaluate the formula of the element and - // try to derive whether there was a change. - 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) - { - // 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)) - { - parent = parent.getParent(); - } - else - { - 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(); - } - else if (!(element instanceof Group)) - { - parent = parent.getParent(); - } - else if (skipNext) - { - skipNext = false; - parent = parent.getParent(); - } - else - { - 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 && 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; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java deleted file mode 100644 index 518363cf6..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java +++ /dev/null @@ -1,91 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FixedTextLayoutController.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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(); - return reportDataRow.getCursor() == 0; - } - - 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); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java deleted file mode 100755 index 8ef2b24da..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java +++ /dev/null @@ -1,167 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FormatValueUtility.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -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.OfficeToken; -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 final String BOOLEAN_VALUE = "boolean-value"; - private static final String STRING_VALUE = "string-value"; - - public static final String VALUE_TYPE = "value-type"; - private static SimpleDateFormat dateFormat; - - private FormatValueUtility() - { - } - - public static String applyValueForVariable(final Object value, final AttributeMap variableSection) - { - String ret = null; - if (value instanceof Date) - { - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "date"); - ret = formatDate((Date) value); - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", ret); - } - 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, OfficeToken.TRUE); - } - else - { - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS,BOOLEAN_VALUE, OfficeToken.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, ""); - } - return ret; - } - - 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, OfficeToken.TRUE); - } - else - { - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS,BOOLEAN_VALUE, OfficeToken.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); - } - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java deleted file mode 100644 index 3f31fd3b5..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java +++ /dev/null @@ -1,216 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FormattedTextLayoutController.java,v $ - * $Revision: 1.7 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.layoutprocessor; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import com.sun.star.report.pentaho.model.FormattedTextElement; -import com.sun.star.report.pentaho.model.OfficeDocument; -import com.sun.star.report.pentaho.model.OfficeStyle; -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.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 -{ - - public FormattedTextLayoutController() - { - } - - 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 dataStyleName = computeValueStyle(); - if (dataStyleName != null) - { - variablesGet.setAttribute(OfficeNamespaces.STYLE_NS, "data-style-name", dataStyleName); - } - - final String valueType = computeValueType(); - variablesGet.setAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.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 OfficeDocument getDocument() - { - LayoutController parent = getParent(); - while (parent != null) - { - final Object node = parent.getNode(); - if (node instanceof OfficeDocument) - { - return (OfficeDocument) node; - } - parent = parent.getParent(); - } - return null; - } - - private Element getParentTableCell() - { - LayoutController parent = getParent(); - while (parent != null) - { - if (parent instanceof TableCellLayoutController) - { - final TableCellLayoutController cellController = (TableCellLayoutController) parent; - return cellController.getElement(); - } - parent = parent.getParent(); - } - return null; - } - - private String computeValueStyle() - { - final Element tce = getParentTableCell(); - if (tce == null) - { - return null; - } - - final String cellStyleName = (String) tce.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); - if (cellStyleName == null) - { - return null; - } - final OfficeDocument document = getDocument(); - if (document == null) - { - return null; - } - - final OfficeStyle style = document.getStylesCollection().getStyle("table-cell", cellStyleName); - return (String) style.getAttribute(OfficeNamespaces.STYLE_NS, "data-style-name"); - } - - private String computeValueType() - { - final Element tce = getParentTableCell(); - if (tce == null) - { - // NO particular format means: Fallback to string and hope and pray .. - throw new IllegalStateException("A formatted text element must be a child of a Table-Cell."); - } - - final String type = (String) tce.getAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE); - if (type == null) - { - Log.error("The Table-Cell does not have a office:value attribute defined. Your content will be messed up."); - return "string"; - } - return type; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementContext.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementContext.java deleted file mode 100644 index 4c19b9d79..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementContext.java +++ /dev/null @@ -1,94 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ImageElementContext.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.layoutprocessor; - -/** - * Todo: Document me! - * - * @author Thomas Morgner - * @since 30.03.2007 - */ -public class ImageElementContext -{ - private final int colSpan; - private final 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]; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java deleted file mode 100644 index cbda06613..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java +++ /dev/null @@ -1,331 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ImageElementLayoutController.java,v $ - * $Revision: 1.7 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.layoutprocessor; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -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.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, OfficeToken.IMAGE); - image.setAttribute(OfficeNamespaces.INTERNAL_NS, OfficeToken.SCALE, String.valueOf(scale)); - image.setAttribute(OfficeNamespaces.INTERNAL_NS, OfficeToken.PRESERVE_IRI, String.valueOf(preserveIri)); - image.setAttribute(OfficeNamespaces.INTERNAL_NS, "image-context", createContext()); - image.setAttribute(OfficeNamespaces.INTERNAL_NS, OfficeToken.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-columns-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, OfficeToken.COVERED_TABLE_CELL); - 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, OfficeToken.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); - addColumnStyles(context, columns, columnPos, colSpan); - // finally search the styles for the row now. - final int rowPos = findNodeInSection(table, tableRow, null); - if (rowPos == -1) - { - Log.warn("Table-Cell is not a direct child of the table-row. Unable to calculate the image-size."); - return null; - } - - addRowStyles(context, table,rowPos,rowSpan); - this.context = context; - } - return this.context; - } - - private int findNodeInSection(final Section tableRow, - final Element tableCell, - final String secondType) - { - 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)) - { - continue; - } - final Element child = (Element) node; - /* - if (! OfficeToken.COVERED_TABLE_CELL.equals(child.getType()) && - (ObjectUtilities.equal(child.getNamespace(), namespace) == false || - ObjectUtilities.equal(child.getType(), type) == false)) - */ - if (!ObjectUtilities.equal(child.getNamespace(), namespace) || - (!ObjectUtilities.equal(child.getType(), type) && (secondType == null || !ObjectUtilities.equal(child.getType(), secondType)))) - { - 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; - } - } - - void addColumnStyles(final ImageElementContext context, final Section columns, final int columnPos, final int colSpan) - { - 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) || - !ObjectUtilities.equal(column.getType(), OfficeToken.TABLE_COLUMN)) - { - continue; - } - if (columnCounter >= columnPos) - { - final String colStyle = (String) column.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); - context.setColStyle(columnCounter - columnPos, colStyle); - } - - columnCounter += 1; - - if (columnCounter >= (columnPos + colSpan)) - { - break; - } - - } - } - - void addRowStyles(final ImageElementContext context, final Section table, final int rowPos, final int rowSpan) - { - 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) || - !ObjectUtilities.equal(row.getType(), OfficeToken.TABLE_ROW)) - { - continue; - } - if (rowCounter >= rowPos) - { - final String rowStyle = (String) row.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); - context.setRowStyle(rowCounter - rowPos, rowStyle); - } - - rowCounter += 1; - - if (rowCounter >= (rowPos + rowSpan)) - { - break; - } - } - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java deleted file mode 100644 index 8cddecd48..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java +++ /dev/null @@ -1,125 +0,0 @@ -/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: ObjectOleLayoutController.java,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package com.sun.star.report.pentaho.layoutprocessor;
-
-import com.sun.star.report.SDBCReportDataFactory;
-import com.sun.star.report.pentaho.OfficeNamespaces;
-import com.sun.star.report.OfficeToken;
-import com.sun.star.report.pentaho.model.ObjectOleElement;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.jfree.report.DataSourceException;
-import org.jfree.report.ReportDataFactoryException;
-import org.jfree.report.ReportProcessingException;
-import org.jfree.report.flow.ReportTarget;
-import org.jfree.report.flow.layoutprocessor.LayoutController;
-import org.jfree.layouting.util.AttributeMap;
-import org.jfree.report.DataFlags;
-import org.jfree.report.DataRow;
-import org.jfree.report.JFreeReportInfo;
-import org.jfree.report.structure.Element;
-
-/**
- *
- * @author Ocke Janssen
- */
-public class ObjectOleLayoutController extends AbstractReportElementLayoutController
-{
-
- public ObjectOleLayoutController()
- {
- }
-
- protected boolean isValueChanged()
- {
- final ObjectOleElement element = (ObjectOleElement) getNode();
- final List masterfields = element.getMasterfields();
- final DataRow view = getFlowController().getMasterRow().getGlobalView();
- for (final Iterator iter = masterfields.iterator(); iter.hasNext();)
- {
- final String master = (String) iter.next();
- try
- {
- final DataFlags flags = view.getFlags(master);
- if (flags != null && flags.isChanged())
- {
- return true;
- }
- }
- catch (DataSourceException e)
- {
- // ignore .. assume that the reference has not changed.
- }
- }
- return false;
- }
-
- protected LayoutController delegateContentGeneration(final ReportTarget target) throws ReportProcessingException, ReportDataFactoryException, DataSourceException
- {
- final ObjectOleElement element = (ObjectOleElement) getNode();
- final String url = element.getUrl();
- if (url != null)
- {
- final AttributeMap ole = new AttributeMap();
- ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.INTERNAL_NS);
- ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, OfficeToken.OBJECT_OLE);
- ole.setAttribute(OfficeNamespaces.INTERNAL_NS, "href", url);
- ole.setAttribute(OfficeNamespaces.INTERNAL_NS, "class-id", element.getClassid());
- final List masterfields = element.getMasterfields();
- final List values = new ArrayList();
- final DataRow view = getFlowController().getMasterRow().getGlobalView();
- for (final Iterator iter = masterfields.iterator(); iter.hasNext();)
- {
- final String master = (String) iter.next();
- try
- {
- final DataFlags flags = view.getFlags(master);
- if (flags != null)
- {
- values.add(flags.getValue());
- }
- }
- catch (DataSourceException e)
- {
- // ignore .. assume that the reference has not changed.
- }
- }
- ole.setAttribute(OfficeNamespaces.INTERNAL_NS, SDBCReportDataFactory.MASTER_COLUMNS, masterfields);
- ole.setAttribute(OfficeNamespaces.INTERNAL_NS, SDBCReportDataFactory.MASTER_VALUES, values);
- ole.setAttribute(OfficeNamespaces.INTERNAL_NS, SDBCReportDataFactory.DETAIL_COLUMNS, element.getDetailfields());
-
- target.startElement(ole);
- target.endElement(ole);
- }
-
- return join(getFlowController());
- }
-}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeDetailLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeDetailLayoutController.java deleted file mode 100644 index 7edfc130c..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeDetailLayoutController.java +++ /dev/null @@ -1,164 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeDetailLayoutController.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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()) - { - 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); - } - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupInstanceSectionLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupInstanceSectionLayoutController.java deleted file mode 100644 index 267d05735..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupInstanceSectionLayoutController.java +++ /dev/null @@ -1,159 +0,0 @@ -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.layoutprocessor.ElementLayoutController; -import org.jfree.report.flow.layoutprocessor.LayoutControllerFactory; -import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil; -import org.jfree.report.flow.FlowController; -import org.jfree.report.flow.ReportTarget; -import org.jfree.report.flow.ReportContext; -import org.jfree.report.DataSourceException; -import org.jfree.report.ReportDataFactoryException; -import org.jfree.report.ReportProcessingException; -import org.jfree.report.expressions.Expression; -import org.jfree.report.structure.Element; -import org.jfree.report.structure.Node; -import org.jfree.layouting.util.AttributeMap; -import com.sun.star.report.pentaho.model.VariablesDeclarationSection; -import com.sun.star.report.pentaho.model.OfficeGroupSection; -import com.sun.star.report.pentaho.OfficeNamespaces; - -/** - * Creation-Date: 25.07.2007, 14:50:45 - * - * @author Thomas Morgner - */ -public class OfficeGroupInstanceSectionLayoutController extends SectionLayoutController -{ - public static final int STATE_PROCESS_VARIABLES = 2; - public static final int STATE_PROCESS_NORMAL_FLOW = 3; - private int state; - private boolean waitForJoin; - - public OfficeGroupInstanceSectionLayoutController() - { - } - - public void initialize(final Object node, final FlowController flowController, final LayoutController parent) - throws DataSourceException, ReportDataFactoryException, ReportProcessingException - { - super.initialize(node, flowController, parent); - state = STATE_PROCESS_VARIABLES; - } - - protected LayoutController processContent(final ReportTarget target) - throws DataSourceException, ReportProcessingException, ReportDataFactoryException - { - if (state == OfficeGroupInstanceSectionLayoutController.STATE_PROCESS_VARIABLES) - { - // todo: Fill the variables section with something sensible .. - final VariablesDeclarationSection variables = new VariablesDeclarationSection(); - final OfficeGroupInstanceSectionLayoutController controller = - (OfficeGroupInstanceSectionLayoutController) clone(); - controller.state = - OfficeGroupLayoutController.STATE_PROCESS_NORMAL_FLOW; - controller.waitForJoin = true; - return processChild(controller, variables, getFlowController()); - } - return super.processContent(target); - } - - // isDisplayable is private in version 0.9.1, so until the upgrade we keep this copy of the method - // todo: Delete it unce the sun-cvs contains version 0.9.2. - protected LayoutController processChild(final SectionLayoutController derived, - final Node node, - final FlowController flowController) - throws DataSourceException, ReportProcessingException, - ReportDataFactoryException - { - final ReportContext reportContext = flowController.getReportContext(); - final LayoutControllerFactory layoutControllerFactory = reportContext.getLayoutControllerFactory(); - if (isDisplayable(node)) - { - derived.setProcessingState(ElementLayoutController.WAITING_FOR_JOIN); - return layoutControllerFactory.create(flowController, node, derived); - } - else - { - derived.setProcessingState(ElementLayoutController.WAITING_FOR_JOIN); - final LayoutController childLc = layoutControllerFactory.create(flowController, node, derived); - return LayoutControllerUtil.skipInvisibleElement(childLc); - } - } - - protected boolean isDisplayable(final Node node) throws DataSourceException - { - if (! (node instanceof OfficeGroupSection) ) - { - return _isDisplayable(node); - } - - final OfficeGroupSection section = (OfficeGroupSection) node; - if (section.isRepeatSection()) - { - return false; - } - return _isDisplayable(node); - } - - protected boolean _isDisplayable(final Node node) - throws DataSourceException - { - // temp method until the pending upgrade to 0.9.2. Later we just call super.isDisplayable(..) instead. - if (!node.isEnabled()) - { - return false; - } - - final Expression expression = node.getDisplayCondition(); - if (expression == null) - { - return true; - } - - final Object result = LayoutControllerUtil.evaluateExpression(getFlowController(), node, expression); - if (Boolean.TRUE.equals(result)) - { - return true; - } - return false; - } - - 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 OfficeGroupInstanceSectionLayoutController derived = (OfficeGroupInstanceSectionLayoutController) clone(); - derived.setProcessingState(ElementLayoutController.OPENED); - derived.setFlowController(flowController); - derived.waitForJoin = false; - return derived; - } - return super.join(flowController); - } - - protected AttributeMap computeAttributes(final FlowController fc, final Element element, final ReportTarget target) - throws DataSourceException - { - final AttributeMap map = super.computeAttributes(fc, element, target); - map.setAttribute(OfficeNamespaces.INTERNAL_NS, "iteration-count", new Integer(getIterationCount())); - return map; - } - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java deleted file mode 100644 index 4e4a6f926..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java +++ /dev/null @@ -1,208 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeGroupLayoutController.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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 org.jfree.layouting.util.AttributeMap; -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.ElementLayoutController; -import org.jfree.report.flow.layoutprocessor.LayoutController; -import org.jfree.report.flow.layoutprocessor.SectionLayoutController; -import org.jfree.report.structure.Element; - -/** - * 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_NORMAL_FLOW = 3; - private boolean waitForJoin; - private int state; - private VariablesCollection variablesCollection; - private boolean repeatHeader; - private boolean repeatFooter; - - 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()); - - - final OfficeGroup group = (OfficeGroup) getElement(); - final OfficeGroupSection header = group.getHeader(); - repeatHeader = (header != null && header.isRepeatSection()); - - final OfficeGroupSection footer = group.getFooter(); - repeatFooter = (footer != null && footer.isRepeatSection()); - } - - - protected LayoutController processContent(final ReportTarget target) - throws DataSourceException, ReportProcessingException, - ReportDataFactoryException - { - if (state == OfficeGroupLayoutController.STATE_PROCESS_REPEATING_HEADER) - { - - final OfficeGroupLayoutController controller = - (OfficeGroupLayoutController) clone(); - controller.state = - OfficeGroupLayoutController.STATE_PROCESS_REPEATING_FOOTER; - - if (!repeatHeader) - { - return controller; - } - - final OfficeGroup group = (OfficeGroup) getElement(); - final OfficeGroupSection header = group.getHeader(); - controller.waitForJoin = true; - return processChild(controller, header, getFlowController()); - } - - if (state == OfficeGroupLayoutController.STATE_PROCESS_REPEATING_FOOTER) - { - - final OfficeGroupLayoutController controller = - (OfficeGroupLayoutController) clone(); - controller.state = OfficeGroupLayoutController.STATE_PROCESS_NORMAL_FLOW; - - if (!repeatFooter) - { - return controller; - } - - final OfficeGroup group = (OfficeGroup) getElement(); - final OfficeGroupSection footer = group.getFooter(); - controller.waitForJoin = true; - return processChild(controller, footer, getFlowController()); - } - - return super.processContent(target); - } - - /** - * 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; - } - - protected AttributeMap computeAttributes(final FlowController fc, final Element element, final ReportTarget target) - throws DataSourceException - { - final AttributeMap map = super.computeAttributes(fc, element, target); - final String value = String.valueOf(repeatHeader || repeatFooter); - map.setAttribute(OfficeNamespaces.INTERNAL_NS, "repeating-header-or-footer", value); - return map; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupSectionLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupSectionLayoutController.java deleted file mode 100644 index b50747ac2..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupSectionLayoutController.java +++ /dev/null @@ -1,113 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeGroupSectionLayoutController.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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.layoutprocessor.ElementLayoutController; -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.report.ReportProcessingException; -import org.jfree.report.ReportDataFactoryException; -import org.jfree.layouting.util.AttributeMap; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import com.sun.star.report.pentaho.model.OfficeGroupSection; - -/** - * 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 LayoutController startElement(final ReportTarget target) - throws DataSourceException, ReportProcessingException, ReportDataFactoryException - { - final OfficeGroupSection section = (OfficeGroupSection) getElement(); - if (!section.isRepeatSection()) - { - return super.startElement(target); - } - - final LayoutController controller = getParent(); - if (!(controller instanceof OfficeGroupLayoutController)) - { - return super.startElement(target); - } - final OfficeGroupLayoutController oglc = (OfficeGroupLayoutController) controller; - if (!oglc.isNormalFlowProcessing()) - { - return super.startElement(target); - } - - // Skip the processing if the section is a repeating header or footer and we are processing the normal flow .. - final ElementLayoutController clone = (ElementLayoutController) this.clone(); - clone.setProcessingState(ElementLayoutController.FINISHED); - return clone; - } - - 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)) - { - return attrs; - } - final OfficeGroupLayoutController oglc = (OfficeGroupLayoutController) controller; - if (oglc.isNormalFlowProcessing()) - { - return attrs; - } - - attrs.setAttribute(OfficeNamespaces.INTERNAL_NS, "repeated-section", OfficeToken.TRUE); - return attrs; - } - - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficePageSectionLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficePageSectionLayoutController.java deleted file mode 100644 index 77552620b..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficePageSectionLayoutController.java +++ /dev/null @@ -1,28 +0,0 @@ -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.DataSourceException; -import org.jfree.layouting.util.AttributeMap; -import com.sun.star.report.pentaho.OfficeNamespaces; - -/** - * Todo: Document Me - * - * @author Thomas Morgner - */ -public class OfficePageSectionLayoutController extends SectionLayoutController -{ - public OfficePageSectionLayoutController() - { - } - - protected AttributeMap computeAttributes(final FlowController flowController, final Element element, final ReportTarget reportTarget) throws DataSourceException - { - final AttributeMap map = super.computeAttributes(flowController, element, reportTarget); - map.setAttribute(OfficeNamespaces.INTERNAL_NS, "role", "spreadsheet-section"); - return map; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeRepeatingStructureLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeRepeatingStructureLayoutController.java deleted file mode 100644 index 3230f8e1d..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeRepeatingStructureLayoutController.java +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeRepeatingStructureLayoutController.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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(); - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeReportLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeReportLayoutController.java deleted file mode 100644 index dc94334db..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeReportLayoutController.java +++ /dev/null @@ -1,277 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeReportLayoutController.java,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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_SPREADSHEET_PAGE_HEADER_DONE = 4; - private static final int STATE_SPREADSHEET_PAGE_FOOTER_DONE = 5; - private static final int STATE_COLUMN_HEADER_DONE = 6; - private static final int STATE_COLUMN_FOOTER_DONE = 7; - private static final int STATE_INITIAL_VARIABLES_DONE = 8; - private static final int STATE_REPORT_HEADER_DONE = 9; - private static final int STATE_REPORT_BODY_DONE = 10; - private static final int STATE_REPORT_FOOTER_VARIABLES = 11; - private static final int STATE_REPORT_FOOTER_DONE = 12; - - 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 delegateToTemplates(OfficeReportLayoutController.STATE_TEMPLATES); - } - case OfficeReportLayoutController.STATE_TEMPLATES: - { - return delegateSection(or.getPageHeader(), - OfficeReportLayoutController.STATE_PAGE_HEADER_DONE); - } - case OfficeReportLayoutController.STATE_PAGE_HEADER_DONE: - { - return delegateSpreadsheetSection(or.getPageHeader(), - OfficeReportLayoutController.STATE_SPREADSHEET_PAGE_HEADER_DONE); - } - case OfficeReportLayoutController.STATE_SPREADSHEET_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: - { - return delegateSpreadsheetSection(or.getPageFooter(), - OfficeReportLayoutController.STATE_SPREADSHEET_PAGE_FOOTER_DONE); - } - case OfficeReportLayoutController.STATE_SPREADSHEET_PAGE_FOOTER_DONE: - { - final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone(); - olc.setProcessingState(ElementLayoutController.FINISHING); - return olc; - } - default: - { - throw new IllegalStateException("Invalid processing state encountered."); - } - } - } - - private LayoutController delegateSpreadsheetSection(final Node node, final int nextState) - throws DataSourceException, ReportProcessingException, ReportDataFactoryException - { - final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone(); - olc.state = nextState; - - if (node == null) - { - return olc; - } - - final OfficePageSectionLayoutController templateLc = new OfficePageSectionLayoutController(); - templateLc.initialize(node, getFlowController(), olc); - return templateLc; - } - - private LayoutController delegateToTemplates(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; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableLayoutController.java deleted file mode 100644 index 2aff294d0..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableLayoutController.java +++ /dev/null @@ -1,79 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeTableLayoutController.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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; -import com.sun.star.report.OfficeToken; - -/** - * 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) - { - final Element child = (Element) node; - if (OfficeNamespaces.TABLE_NS.equals(child.getNamespace()) && - OfficeToken.TABLE_ROW.equals(child.getType())) - { - rowCount += 1; - } - } - } - attributeMap.setAttribute(OfficeNamespaces.INTERNAL_NS, "table-row-count", IntegerCache.getInteger(rowCount)); - return attributeMap; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java deleted file mode 100644 index 5c0d0a5dd..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java +++ /dev/null @@ -1,190 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeTableTemplateLayoutController.java,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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 java.util.List; -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.getPageHeader() != null) - { - addFromSection(tables, (Section) report.getPageHeader()); - } - if (report.getReportHeader() != null) - { - addFromSection(tables, (Section) report.getReportHeader()); - } - addPBody(tables, (Section) report.getPreBodySection()); - addFromBody(tables, (Section) report.getBodySection()); - addPBody(tables, (Section) report.getPostBodySection()); - if (report.getReportFooter() != null) - { - addFromSection(tables, (Section) report.getReportFooter()); - } - if (report.getPageFooter() != null) - { - addFromSection(tables, (Section) report.getPageFooter()); - } - - this.nodes = (Node[]) tables.toArray(new Node[tables.size()]); - } - - private void addPBody(final List tables, final Section section) - { - if (section != null) - { - // tables.add(section); - final Node[] nodeArray = section.getNodeArray(); - for (int i = 0; i < nodeArray.length; i++) - { - final Node node = nodeArray[i]; - tables.add(node); - } - - } - } - - private void addFromBody(final List 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) - { - final Section child = (Section) node; - if (node instanceof OfficeGroup) - { - addFromGroup(tables, child); - } - else - { - addFromSection(tables, child); - } - } - } - } - - private void addFromGroup(final List 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) - { - 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 List 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) - { - final Element element = (Element) node; - if (OfficeNamespaces.TABLE_NS.equals(element.getNamespace()) && - "table".equals(element.getType())) - { - tables.add(element); - } - } - } - } - - public Node[] getNodes() - { - return nodes; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java deleted file mode 100644 index 52d3331eb..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java +++ /dev/null @@ -1,192 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TableCellLayoutController.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.layoutprocessor; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -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, OfficeToken.STYLE_NAME); - attributeMap.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.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; - } - else 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() || 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 && child.isEnabled()) - { - final ReportElement element = (ReportElement) child; - if (element.getFormatConditionCount() > 0) - { - 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()) - { - 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)) - { - return childFormatCondition; - } - } - } - return defaultStyle; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java deleted file mode 100644 index daac07b26..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java +++ /dev/null @@ -1,103 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: VariablesCollection.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.layoutprocessor; - -import java.util.ArrayList; - -import com.sun.star.report.pentaho.model.FormattedTextElement; -import java.util.List; - -/** - * 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 List 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(); - } - - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesDeclarationLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesDeclarationLayoutController.java deleted file mode 100644 index c15e72ccf..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesDeclarationLayoutController.java +++ /dev/null @@ -1,190 +0,0 @@ -/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: VariablesDeclarationLayoutController.java,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-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;
-import java.util.Date;
-import java.text.SimpleDateFormat;
-
-/**
- * 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);
- String formula = FormatValueUtility.applyValueForVariable(value, variableSection);
- if ( formula == null )
- formula = "" + value;
- if (value instanceof Date)
- {
- final Date date = (Date)value;
- final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy;MM;dd");
- formula = "Date(" + dateFormat.format(date) + ")";
- }
- variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "formula", "ooow:" + formula);
- 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;
- }
-
- /**
- * 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");
- }
-}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java b/reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java deleted file mode 100644 index 157f02d57..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java +++ /dev/null @@ -1,172 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: InputRepositoryLoader.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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 final 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) - { - return InputRepositoryLoader.class.getName().equals(key.getSchema()); - } - - /** - * 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) - { - final String strVal = (String) value; - if (strVal.startsWith("sun:oo://")) - { - return new ResourceKey(InputRepositoryLoader.class.getName(), - new InputResourceKey(inputRepository.getId(), strVal), factoryKeys); - } - } - return null; - } - - /** - * 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)) - { - 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.charAt(0) == '/') - { - 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)) - { - 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; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryResourceData.java b/reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryResourceData.java deleted file mode 100644 index 01ddfd0e6..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryResourceData.java +++ /dev/null @@ -1,88 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: InputRepositoryResourceData.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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 final InputRepository inputRepository; - private final ResourceKey key; - private final 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 (final String key) - { - // we dont support attributes here .. - return null; - } - - public ResourceKey getKey () - { - return key; - } - - public InputStream getResourceAsStream (final 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 (final ResourceManager caller) - { - return inputRepository.getVersion(resourceIdentifer); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/loader/InputResourceKey.java b/reportdesign/java/com/sun/star/report/pentaho/loader/InputResourceKey.java deleted file mode 100644 index 1cf097a8e..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/loader/InputResourceKey.java +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: InputResourceKey.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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 final Object inputRepositoryId; - private final 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 + '\'' + - '}'; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/makefile.mk b/reportdesign/java/com/sun/star/report/pentaho/makefile.mk deleted file mode 100644 index 0b2f6c3bc..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/makefile.mk +++ /dev/null @@ -1,124 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.7.58.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = ..$/..$/..$/..$/..$/.. -PRJNAME = reportdesign -TARGET=sun-report-builder -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 java_uno.jar -.IF "$(SYSTEM_JFREEREPORT)" == "YES" -XCLASSPATH!:=$(PATH_SEPERATOR)$(FLUTE_JAR)$(XCLASSPATH)$(PATH_SEPERATOR)$(JCOMMON_JAR)$(PATH_SEPERATOR)$(LIBXML_JAR)$(PATH_SEPERATOR)$(JFREEREPORT_JAR)$(PATH_SEPERATOR)$(LIBLOADER_JAR)$(PATH_SEPERATOR)$(SAC_JAR)$(PATH_SEPERATOR)$(LIBLAYOUT_JAR)$(PATH_SEPERATOR)$(JCOMMON_SERIALIZER_JAR)$(PATH_SEPERATOR)$(LIBFONTS_JAR)$(PATH_SEPERATOR)$(LIBFORMULA_JAR)$(PATH_SEPERATOR)$(LIBREPOSITORY_JAR) -COMP=fix_system_jfreereport -.ELSE -JARFILES += flute-1.3-jfree-20061107.jar jcommon-1.0.10.jar jcommon-serializer-0.2.0.jar libfonts-0.3.3.jar libformula-0.1.14.jar liblayout-0.2.8.jar libloader-0.3.6.jar librepository-0.1.4.jar libxml-0.9.9.jar pentaho-reporting-flow-engine-0.9.2.jar sac.jar -.ENDIF - -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) : $(COMP) $(PROPERTYFILES) $(CSSFILES) $(XSDFILES) $(TXTFILES) $(XMLFILES) -.ENDIF # "$(JARTARGETN)"!="" - -fix_system_jfreereport: - @echo "Fix Java Class-Path entry for JFree JFreeReport libraries from system." - @$(SED) '/flute/,/sac/d' -i ../../../../../../$(INPATH)/class/sun-report-builder/META-INF/MANIFEST.MF - @$(SED) -r -e "s#^Class-Path.*#\0\n file://$(JCOMMON_JAR)\n file://$(SAC_JAR)\n file://$(LIBXML_JAR)\n\ - file://$(FLUTE_JAR)\n file://$(JFREEREPORT_JAR)\n file://$(LIBLAYOUT_JAR)\n file://$(LIBLOADER_JAR)\n file://$(LIBFORMULA_JAR)\n\ - file://$(LIBREPOSITORY_JAR)\n file://$(LIBFONTS_JAR)\n file://$(JCOMMON_SERIALIZER_JAR)#" \ - -i ../../../../../../$(INPATH)/class/sun-report-builder/META-INF/MANIFEST.MF - -$(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) $< $@ - diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/DataStyle.java b/reportdesign/java/com/sun/star/report/pentaho/model/DataStyle.java deleted file mode 100644 index ac8815a12..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/DataStyle.java +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DataStyle.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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); - } - - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/FixedTextElement.java b/reportdesign/java/com/sun/star/report/pentaho/model/FixedTextElement.java deleted file mode 100644 index aefd15266..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/FixedTextElement.java +++ /dev/null @@ -1,56 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FixedTextElement.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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 final Section content; - - public FixedTextElement() - { - content = new Section(); - content.setVirtual(true); - } - - public Section getContent() - { - return content; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java b/reportdesign/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java deleted file mode 100644 index f93bfcfb0..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java +++ /dev/null @@ -1,78 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FontFaceDeclsSection.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.model; - -import java.util.HashMap; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import java.util.Map; -import org.jfree.report.structure.Element; - -/** - * Todo: Document me! - * - * @author Thomas Morgner - * @since 13.03.2007 - */ -public class FontFaceDeclsSection extends Element -{ - private final Map 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); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/FontFaceElement.java b/reportdesign/java/com/sun/star/report/pentaho/model/FontFaceElement.java deleted file mode 100644 index 9cfb2c87a..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/FontFaceElement.java +++ /dev/null @@ -1,60 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FontFaceElement.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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); - } - - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/FormatCondition.java b/reportdesign/java/com/sun/star/report/pentaho/model/FormatCondition.java deleted file mode 100644 index 57e73a2aa..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/FormatCondition.java +++ /dev/null @@ -1,72 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FormatCondition.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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 final FormulaExpression formula; - private final String styleName; - private final 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; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/FormattedTextElement.java b/reportdesign/java/com/sun/star/report/pentaho/model/FormattedTextElement.java deleted file mode 100644 index 99cbed95f..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/FormattedTextElement.java +++ /dev/null @@ -1,63 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FormattedTextElement.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/ImageElement.java b/reportdesign/java/com/sun/star/report/pentaho/model/ImageElement.java deleted file mode 100644 index 71c0b61c2..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/ImageElement.java +++ /dev/null @@ -1,86 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ImageElement.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.model; - -import org.jfree.report.expressions.FormulaExpression; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; - -/** - * 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 OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.SCALE)); - } - - public void setScale(final boolean scale) - { - setAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.SCALE, String.valueOf(scale)); - } - - public boolean isPreserveIRI() - { - return OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.PRESERVE_IRI)); - } - - public void setPreserveIRI(final boolean preserveIRI) - { - setAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.PRESERVE_IRI, String.valueOf(preserveIRI)); - } - - public String getImageData() - { - return (String) getAttribute(OfficeNamespaces.FORM_NS, OfficeToken.IMAGE_DATA); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/ObjectOleElement.java b/reportdesign/java/com/sun/star/report/pentaho/model/ObjectOleElement.java deleted file mode 100644 index c8b19fa8c..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/ObjectOleElement.java +++ /dev/null @@ -1,82 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ObjectOleElement.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.model; - -import java.util.ArrayList; -import java.util.List; - -/** - * - * @author Ocke Janssen - */ -public class ObjectOleElement extends ReportElement{ - - private String url; - private final List masterfields; - private final List detailfields; - private String classid; - - public String getClassid() { - return classid; - } - - public List getDetailfields() { - return detailfields; - } - - public List getMasterfields() { - return masterfields; - } - - public ObjectOleElement() - { - masterfields = new ArrayList(); - detailfields = new ArrayList(); - } - - public String getUrl() { - return url; - } - - public void setClassId(final String classid) { - this.classid = classid; - } - public void setUrl(final String _url ){ - url = _url; - } - - public void addMasterDetailFields(final String master,final String detail){ - if ( master != null ){ - masterfields.add(master); - detailfields.add(detail == null ? master : detail); - } - } - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeDetailSection.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeDetailSection.java deleted file mode 100644 index 5d69c1803..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeDetailSection.java +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeDetailSection.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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() - { - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeDocument.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeDocument.java deleted file mode 100644 index a1bd7f336..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeDocument.java +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeDocument.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.model; - -import com.sun.star.report.JobProperties; -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; - private JobProperties jobProperties; - - public JobProperties getJobProperties() { - return jobProperties; - } - - public void setJobProperties(final JobProperties jobProperties) { - this.jobProperties = jobProperties; - } - - public OfficeDocument() - { - } - - public OfficeStylesCollection getStylesCollection() - { - return stylesCollection; - } - - public void setStylesCollection(final OfficeStylesCollection stylesCollection) - { - if (stylesCollection == null) - { - throw new NullPointerException(); - } - this.stylesCollection = stylesCollection; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroup.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroup.java deleted file mode 100644 index 5db4df04e..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroup.java +++ /dev/null @@ -1,98 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeGroup.java,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.model; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import org.jfree.report.expressions.Expression; -import org.jfree.report.structure.Section; - -/** - * 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 Section -{ - public OfficeGroup() - { - } - - public boolean isStartNewColumn () - { - return OfficeToken.TRUE.equals - (getAttribute(OfficeNamespaces.OOREPORT_NS, "start-new-column")); - } - - public boolean isResetPageNumber () - { - return OfficeToken.TRUE.equals - (getAttribute(OfficeNamespaces.OOREPORT_NS, "reset-page-number")); - } - - public OfficeGroupSection getHeader() - { - final OfficeGroupInstanceSection instanceSection = - (OfficeGroupInstanceSection) findFirstChild(OfficeNamespaces.INTERNAL_NS, "group-instance"); - if (instanceSection == null) - { - return null; - } - return (OfficeGroupSection) instanceSection.findFirstChild - (OfficeNamespaces.OOREPORT_NS, "group-header"); - - } - - public OfficeGroupSection getFooter() - { - final OfficeGroupInstanceSection instanceSection = - (OfficeGroupInstanceSection) findFirstChild(OfficeNamespaces.INTERNAL_NS, "group-instance"); - if (instanceSection == null) - { - return null; - } - return (OfficeGroupSection) instanceSection.findFirstChild - (OfficeNamespaces.OOREPORT_NS, "group-footer"); - - } - public Expression getGroupingExpression(){ - final OfficeGroupInstanceSection instanceSection = - (OfficeGroupInstanceSection) findFirstChild(OfficeNamespaces.INTERNAL_NS, "group-instance"); - if (instanceSection == null) - { - return null; - } - return instanceSection.getGroupingExpression(); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroupInstanceSection.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroupInstanceSection.java deleted file mode 100644 index 26ec1d8f9..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroupInstanceSection.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.sun.star.report.pentaho.model; - -import org.jfree.report.structure.Group; - -/** - * Creation-Date: 25.07.2007, 14:41:54 - * - * @author Thomas Morgner - */ -public class OfficeGroupInstanceSection extends Group -{ - public OfficeGroupInstanceSection() - { - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroupSection.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroupSection.java deleted file mode 100644 index 6bedfacc8..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroupSection.java +++ /dev/null @@ -1,56 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeGroupSection.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.model; - -import org.jfree.report.structure.Section; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; - -/** - * 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 OfficeToken.TRUE.equals(repeatFlag); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeMasterPage.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeMasterPage.java deleted file mode 100644 index 154d17dac..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeMasterPage.java +++ /dev/null @@ -1,72 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeMasterPage.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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); - } - - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java deleted file mode 100644 index 72d5818d4..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java +++ /dev/null @@ -1,87 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeMasterStyles.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.model; - -import java.util.HashMap; - -import java.util.Map; -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 final Map masterPages; - private final 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; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeReport.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeReport.java deleted file mode 100644 index 055eea0d0..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeReport.java +++ /dev/null @@ -1,131 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeReport.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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; - private Node preBodySection; - private Node postBodySection; - - public Node getPostBodySection() { - return postBodySection; - } - - public void setPostBodySection(final Node postBodySection) { - this.postBodySection = postBodySection; - } - - public Node getPreBodySection() { - return preBodySection; - } - - public void setPreBodySection(final Node preBodySection) { - this.preBodySection = preBodySection; - } - - 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; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStyle.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStyle.java deleted file mode 100644 index ad891b1c8..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStyle.java +++ /dev/null @@ -1,134 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeStyle.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.model; - -import com.sun.star.report.OfficeToken; -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, OfficeToken.GRAPHIC_PROPERTIES); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStyles.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStyles.java deleted file mode 100644 index 467834998..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStyles.java +++ /dev/null @@ -1,199 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeStyles.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.model; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; - -import java.util.List; -import java.util.Map; -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 final String family; - private final 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) - { - if (obj == null || getClass() != obj.getClass()) - { - return false; - } - - final StyleKey styleKey = (StyleKey) obj; - - if (!family.equals(styleKey.family) || ( 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 final Map pageStyles; - private final Map dataStyles; - private final Map styles; - private final List 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); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStylesCollection.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStylesCollection.java deleted file mode 100644 index f1536ea2e..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStylesCollection.java +++ /dev/null @@ -1,126 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeStylesCollection.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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 final FontFaceDeclsSection fontFaceDecls; - private final OfficeStyles automaticStyles; - private final OfficeStyles commonStyles; - private final 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; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeTableSection.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeTableSection.java deleted file mode 100644 index fec17486d..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeTableSection.java +++ /dev/null @@ -1,46 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeTableSection.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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() - { - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/PageLayout.java b/reportdesign/java/com/sun/star/report/pentaho/model/PageLayout.java deleted file mode 100644 index 15cafd50e..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/PageLayout.java +++ /dev/null @@ -1,72 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: PageLayout.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.model; - -import org.jfree.report.structure.Section; -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"); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/PageSection.java b/reportdesign/java/com/sun/star/report/pentaho/model/PageSection.java deleted file mode 100644 index dcd8c9079..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/PageSection.java +++ /dev/null @@ -1,62 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: PageSection.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -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 -{ - - private static final String NOT_WITH_REPORT_HEADER_NOR_FOOTER = "not-with-report-header-nor-footer"; - - public PageSection() - { - } - - public static boolean isPrintWithReportHeader(final AttributeMap attrs) - { - final String pagePrintOption = (String) attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "page-print-option"); - return !("not-with-report-header".equals(pagePrintOption) || NOT_WITH_REPORT_HEADER_NOR_FOOTER.equals(pagePrintOption)); - } - - public static boolean isPrintWithReportFooter(final AttributeMap attrs) - { - final String pagePrintOption = (String) attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "page-print-option"); - return !("not-with-report-footer".equals(pagePrintOption) || NOT_WITH_REPORT_HEADER_NOR_FOOTER.equals(pagePrintOption)); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/RawText.java b/reportdesign/java/com/sun/star/report/pentaho/model/RawText.java deleted file mode 100644 index 19edd4ffc..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/RawText.java +++ /dev/null @@ -1,50 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: RawText.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -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); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/ReportElement.java b/reportdesign/java/com/sun/star/report/pentaho/model/ReportElement.java deleted file mode 100644 index ae77fa837..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/ReportElement.java +++ /dev/null @@ -1,115 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportElement.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.model; - -import java.util.ArrayList; - -import org.jfree.report.structure.Element; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import java.util.List; - -/** - * 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 final List 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 OfficeToken.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 OfficeToken.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(); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/TableCellElement.java b/reportdesign/java/com/sun/star/report/pentaho/model/TableCellElement.java deleted file mode 100644 index d3bc48ad0..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/TableCellElement.java +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TableCellElement.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.model; - -import org.jfree.report.structure.Section; - -/** - * Todo: Document me! - * - * @author Thomas Morgner - * @since 05.03.2007 - */ -public class TableCellElement extends Section -{ - - public TableCellElement() - { - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/VariablesDeclarationSection.java b/reportdesign/java/com/sun/star/report/pentaho/model/VariablesDeclarationSection.java deleted file mode 100644 index 5dbaca75d..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/model/VariablesDeclarationSection.java +++ /dev/null @@ -1,57 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: VariablesDeclarationSection.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.model; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import org.jfree.report.structure.Section; - -/** - * A paragraph that contains variables-declarations. This paragraph will be - * printed in the first cell of the first table (if there's one). - * - * The VariablesDeclarationSection is an auto-generated structure element that - * has no model-representation. The section itself is empty and simply acts - * as flag for the output-processor. The output processor itself is responsible - * to maintain the variables. - * - * @author Thomas Morgner - * @since 19.03.2007 - */ -public class VariablesDeclarationSection extends Section -{ - - public VariablesDeclarationSection() - { - setNamespace(OfficeNamespaces.INTERNAL_NS); - setType("variables-section"); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/module.properties b/reportdesign/java/com/sun/star/report/pentaho/module.properties deleted file mode 100644 index 19f36b516..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/module.properties +++ /dev/null @@ -1,48 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: module.properties,v $ -# -# $Revision: 1.3 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - - -module-info: - name: factory-report-sun - producer: The JFreeReport project - www.jfree.org/jfreereport - description: XML-Parsers for StarOffice report definitions. These definitions\ - are basicly similiar to the old JFreeReport format, with some limited absolute\ - positioning capabilities. - version.major: 0 - version.minor: 90 - version.patchlevel: 0 - -depends: - module: org.jfree.report.modules.factories.report.base.ReportFactoryBaseModule - version.major: 0 - version.minor: 90 - version.patchlevel: 0 - diff --git a/reportdesign/java/com/sun/star/report/pentaho/oasis-datastyle.css b/reportdesign/java/com/sun/star/report/pentaho/oasis-datastyle.css deleted file mode 100644 index 01fa9d16f..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/oasis-datastyle.css +++ /dev/null @@ -1,5 +0,0 @@ -@namespace url("urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"); - -/** - * All default styles for data-styles elements. - */ diff --git a/reportdesign/java/com/sun/star/report/pentaho/oasis-draw.css b/reportdesign/java/com/sun/star/report/pentaho/oasis-draw.css deleted file mode 100644 index 87fe33829..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/oasis-draw.css +++ /dev/null @@ -1,5 +0,0 @@ -@namespace url("urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"); - -/** - * All default styles for draw elements. - */ diff --git a/reportdesign/java/com/sun/star/report/pentaho/oasis-form.css b/reportdesign/java/com/sun/star/report/pentaho/oasis-form.css deleted file mode 100644 index b9f4967ea..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/oasis-form.css +++ /dev/null @@ -1,5 +0,0 @@ -@namespace url("urn:oasis:names:tc:opendocument:xmlns:form:1.0"); - -/** - * All default styles for form elements. - */ diff --git a/reportdesign/java/com/sun/star/report/pentaho/oasis-style.css b/reportdesign/java/com/sun/star/report/pentaho/oasis-style.css deleted file mode 100644 index 6e5f9c8f5..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/oasis-style.css +++ /dev/null @@ -1,10 +0,0 @@ -@namespace url("urn:oasis:names:tc:opendocument:xmlns:style:1.0"); - -/** - * All default styles for style elements. (They should not be visible anyway, - * but better be complete than be sorry afterwards.) - */ - -raw-styles { - display:none; -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/oasis-table.css b/reportdesign/java/com/sun/star/report/pentaho/oasis-table.css deleted file mode 100644 index efddd2919..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/oasis-table.css +++ /dev/null @@ -1,37 +0,0 @@ -@namespace url("urn:oasis:names:tc:opendocument:xmlns:table:1.0"); - -table { - display: table; -} - -table-columns { - display: table-column-group; -} - -table-column { - display: table-column; -} - -table-row { - display: table-row; -} - -table-cell { - display: table-cell; -} - -table-cell[number-cols-spanned], -table-cell[number-cols-spanned], -table-columns[number-cols-spanned], -table-column[number-cols-spanned] { - -x-liblayout-colspan: attr(number-cols-spanned); -} - -table-cell[number-rows-spanned], -table-cell[number-rows-spanned] { - -x-liblayout-rowspan: attr(number-rows-spanned); -} - - - - diff --git a/reportdesign/java/com/sun/star/report/pentaho/oasis-text.css b/reportdesign/java/com/sun/star/report/pentaho/oasis-text.css deleted file mode 100644 index c8b6acc03..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/oasis-text.css +++ /dev/null @@ -1,9 +0,0 @@ -@namespace url("urn:oasis:names:tc:opendocument:xmlns:text:1.0"); - -/** - * All default styles for form elements. - */ - -p { - display: block; -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/ImageProducer.java b/reportdesign/java/com/sun/star/report/pentaho/output/ImageProducer.java deleted file mode 100644 index 159c5436d..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/ImageProducer.java +++ /dev/null @@ -1,457 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ImageProducer.java,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.output; - -import java.awt.Image; -import java.awt.Dimension; -import java.io.BufferedInputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.sql.Blob; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Arrays; - -import com.sun.star.report.InputRepository; -import com.sun.star.report.OutputRepository; -import com.sun.star.report.ImageService; -import com.sun.star.report.ReportExecutionException; -import com.sun.star.report.pentaho.DefaultNameGenerator; -import com.keypoint.PngEncoder; -import java.util.Map; -import org.jfree.io.IOUtils; -import org.jfree.layouting.input.style.values.CSSNumericType; -import org.jfree.layouting.input.style.values.CSSNumericValue; -import org.jfree.util.Log; -import org.jfree.util.WaitingImageObserver; - -/** - * This class manages the images embedded in a report. - * - * @author Thomas Morgner - * @since 31.03.2007 - */ -public class ImageProducer -{ - - public static class OfficeImage - { - - private final CSSNumericValue width; - private final CSSNumericValue height; - private final String embeddableLink; - - public OfficeImage(final String embeddableLink, final CSSNumericValue width, final CSSNumericValue height) - { - this.embeddableLink = embeddableLink; - this.width = width; - this.height = height; - } - - public CSSNumericValue getWidth() - { - return width; - } - - public CSSNumericValue getHeight() - { - return height; - } - - public String getEmbeddableLink() - { - return embeddableLink; - } - } - - private static class ByteDataImageKey - { - - private final byte[] keyData; - private Integer hashCode; - - protected ByteDataImageKey(final byte[] keyData) - { - if (keyData == null) - { - throw new NullPointerException(); - } - this.keyData = keyData; - } - - public boolean equals(final Object o) - { - if (this != o) - { - if (o == null || getClass() != o.getClass()) - { - return false; - } - - final ByteDataImageKey key = (ByteDataImageKey) o; - if (!Arrays.equals(keyData, key.keyData)) - { - return false; - } - } - - return true; - } - - public int hashCode() - { - if (hashCode != null) - { - return hashCode.intValue(); - } - - final int length = Math.min(keyData.length, 512); - int hashValue = 0; - for (int i = 0; i < length; i++) - { - final byte b = keyData[i]; - hashValue = b + hashValue * 23; - } - this.hashCode = new Integer(hashValue); - return hashValue; - } - } - private final Map imageCache; - private final InputRepository inputRepository; - private final OutputRepository outputRepository; - private final ImageService imageService; - private final DefaultNameGenerator nameGenerator; - - public ImageProducer(final InputRepository inputRepository, - final OutputRepository outputRepository, - final ImageService imageService) - { - if (inputRepository == null) - { - throw new NullPointerException(); - } - if (outputRepository == null) - { - throw new NullPointerException(); - } - if (imageService == null) - { - throw new NullPointerException(); - } - - this.inputRepository = inputRepository; - this.outputRepository = outputRepository; - this.imageService = imageService; - this.imageCache = new HashMap(); - this.nameGenerator = new DefaultNameGenerator(outputRepository); - } - - /** - * Image-Data can be one of the following types: String, URL, URI, byte-array, blob. - * - * @param imageData - * @param preserveIRI - * @return - */ - public OfficeImage produceImage(final Object imageData, - final boolean preserveIRI) - { - - Log.debug("Want to produce image " + imageData); - if (imageData instanceof String) - { - return produceFromString((String) imageData, preserveIRI); - } - - if (imageData instanceof URL) - { - return produceFromURL((URL) imageData, preserveIRI); - } - - if (imageData instanceof Blob) - { - return produceFromBlob((Blob) imageData); - } - - if (imageData instanceof byte[]) - { - return produceFromByteArray((byte[]) imageData); - } - - if (imageData instanceof Image) - { - return produceFromImage((Image) imageData); - } - // not usable .. - return null; - } - - private OfficeImage produceFromImage(final Image image) - { - // quick caching ... use a weak list ... - final WaitingImageObserver obs = new WaitingImageObserver(image); - obs.waitImageLoaded(); - - final PngEncoder encoder = new PngEncoder(image, PngEncoder.ENCODE_ALPHA, PngEncoder.FILTER_NONE, 5); - final byte[] data = encoder.pngEncode(); - return produceFromByteArray(data); - } - - private OfficeImage produceFromBlob(final Blob blob) - { - try - { - final InputStream inputStream = blob.getBinaryStream(); - final int length = (int) blob.length(); - - final ByteArrayOutputStream bout = new ByteArrayOutputStream(length); - try - { - IOUtils.getInstance().copyStreams(inputStream, bout); - } finally - { - inputStream.close(); - } - return produceFromByteArray(bout.toByteArray()); - } - catch (IOException e) - { - Log.warn("Failed to produce image from Blob", e); - } - catch (SQLException e) - { - Log.warn("Failed to produce image from Blob", e); - } - return null; - } - - private OfficeImage produceFromByteArray(final byte[] data) - { - final ByteDataImageKey imageKey = new ByteDataImageKey(data); - final OfficeImage o = (OfficeImage) imageCache.get(imageKey); - if (o != null) - { - return o; - } - - try - { - final String mimeType = imageService.getMimeType(data); - final Dimension dims = imageService.getImageSize(data); - - // copy the image into the local output-storage - // todo: Implement data-fingerprinting so that we can detect the mime-type - final String name = nameGenerator.generateName("Pictures/image", mimeType); - final OutputStream outputStream = outputRepository.createOutputStream(name, mimeType); - final ByteArrayInputStream bin = new ByteArrayInputStream(data); - - try - { - IOUtils.getInstance().copyStreams(bin, outputStream); - } finally - { - outputStream.close(); - } - - final CSSNumericValue widthVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getWidth() / 100.0); - final CSSNumericValue heightVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getHeight() / 100.0); - final OfficeImage officeImage = new OfficeImage(name, widthVal, heightVal); - imageCache.put(imageKey, officeImage); - return officeImage; - } - catch (IOException e) - { - Log.warn("Failed to load image from local input-repository", e); - } - catch (ReportExecutionException e) - { - Log.warn("Failed to create image from local input-repository", e); - } - return null; - } - - private OfficeImage produceFromString(final String source, - final boolean preserveIRI) - { - - try - { - final URL url = new URL(source); - return produceFromURL(url, preserveIRI); - } - catch (MalformedURLException e) - { - // ignore .. but we had to try this .. - } - - final OfficeImage o = (OfficeImage) imageCache.get(source); - if (o != null) - { - return o; - } - - // Next, check whether this is a local path. - if (inputRepository.isReadable(source)) - { - // cool, the file exists. Let's try to read it. - try - { - final ByteArrayOutputStream bout = new ByteArrayOutputStream(8192); - final InputStream inputStream = inputRepository.createInputStream(source); - try - { - IOUtils.getInstance().copyStreams(inputStream, bout); - } finally - { - inputStream.close(); - } - final byte[] data = bout.toByteArray(); - final Dimension dims = imageService.getImageSize(data); - final String mimeType = imageService.getMimeType(data); - - final CSSNumericValue widthVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getWidth() / 100.0); - final CSSNumericValue heightVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getHeight() / 100.0); - - final String filename = copyToOutputRepository(mimeType, source, data); - final OfficeImage officeImage = new OfficeImage(filename, widthVal, heightVal); - imageCache.put(source, officeImage); - return officeImage; - } - catch (IOException e) - { - Log.warn("Failed to load image from local input-repository", e); - } - catch (ReportExecutionException e) - { - Log.warn("Failed to create image from local input-repository", e); - } - } - - // Return the image as broken image instead .. - final OfficeImage officeImage = new OfficeImage(source, null, null); - imageCache.put(source, officeImage); - return officeImage; - } - - private OfficeImage produceFromURL(final URL url, - final boolean preserveIRI) - { - final OfficeImage o = (OfficeImage) imageCache.get(url); - if (o != null) - { - return o; - } - - try - { - final ByteArrayOutputStream bout = new ByteArrayOutputStream(8192); - final URLConnection urlConnection = url.openConnection(); - final InputStream inputStream = new BufferedInputStream(urlConnection.getInputStream()); - try - { - IOUtils.getInstance().copyStreams(inputStream, bout); - } finally - { - inputStream.close(); - } - final byte[] data = bout.toByteArray(); - - final Dimension dims = imageService.getImageSize(data); - final String mimeType = imageService.getMimeType(data); - final CSSNumericValue widthVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getWidth() / 100.0); - final CSSNumericValue heightVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getHeight() / 100.0); - - if (preserveIRI) - { - final OfficeImage retval = new OfficeImage(url.toString(), widthVal, heightVal); - imageCache.put(url, retval); - return retval; - } - - final String file = url.getFile(); - final String name = copyToOutputRepository(mimeType, file, data); - final OfficeImage officeImage = new OfficeImage(name, widthVal, heightVal); - imageCache.put(url, officeImage); - return officeImage; - } - catch (IOException e) - { - Log.warn("Failed to load image from local input-repository" + e); - } - catch (ReportExecutionException e) - { - Log.warn("Failed to create image from local input-repository" + e); - } - - if (!preserveIRI) - { - final OfficeImage image = new OfficeImage(url.toString(), null, null); - imageCache.put(url, image); - return image; - } - - // OK, everything failed; the image is not - repeat it - not usable. - return null; - } - - private String copyToOutputRepository(final String urlMimeType, final String file, final byte[] data) - throws IOException, ReportExecutionException - { - final String mimeType; - if (urlMimeType == null) - { - mimeType = imageService.getMimeType(data); - } - else - { - mimeType = urlMimeType; - } - - // copy the image into the local output-storage - final String name = nameGenerator.generateName("Pictures/image", mimeType); - final OutputStream outputStream = outputRepository.createOutputStream(name, mimeType); - final ByteArrayInputStream bin = new ByteArrayInputStream(data); - - try - { - IOUtils.getInstance().copyStreams(bin, outputStream); - } finally - { - outputStream.close(); - } - return name; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java b/reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java deleted file mode 100644 index 623a4a77b..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java +++ /dev/null @@ -1,1636 +0,0 @@ -/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: OfficeDocumentReportTarget.java,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package com.sun.star.report.pentaho.output;
-
-import com.sun.star.report.DataSourceFactory;
-import java.awt.Image;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.zip.DeflaterOutputStream;
-import java.util.zip.InflaterInputStream;
-
-import com.sun.star.report.ImageService;
-import com.sun.star.report.InputRepository;
-import com.sun.star.report.OutputRepository;
-import com.sun.star.report.SDBCReportDataFactory;
-import com.sun.star.report.pentaho.OfficeNamespaces;
-import com.sun.star.report.OfficeToken;
-import com.sun.star.report.pentaho.layoutprocessor.ImageElementContext;
-import com.sun.star.report.pentaho.model.OfficeDocument;
-import com.sun.star.report.pentaho.model.OfficeStyle;
-import com.sun.star.report.pentaho.model.OfficeStyles;
-import com.sun.star.report.pentaho.model.OfficeStylesCollection;
-import com.sun.star.report.pentaho.styles.LengthCalculator;
-import com.sun.star.report.pentaho.styles.StyleMapper;
-import java.util.ArrayList;
-import org.jfree.io.IOUtils;
-import org.jfree.layouting.input.style.parser.CSSValueFactory;
-import org.jfree.layouting.input.style.parser.StyleSheetParserUtil;
-import org.jfree.layouting.input.style.values.CSSNumericValue;
-import org.jfree.layouting.layouter.style.CSSValueResolverUtility;
-import org.jfree.layouting.namespace.NamespaceDefinition;
-import org.jfree.layouting.namespace.Namespaces;
-import org.jfree.layouting.util.AttributeMap;
-import org.jfree.report.DataFlags;
-import org.jfree.report.DataSourceException;
-import org.jfree.report.JFreeReportBoot;
-import org.jfree.report.JFreeReportInfo;
-import org.jfree.report.ReportProcessingException;
-import org.jfree.report.flow.AbstractReportTarget;
-import org.jfree.report.flow.ReportJob;
-import org.jfree.report.flow.ReportStructureRoot;
-import org.jfree.report.flow.ReportTargetUtil;
-import org.jfree.report.structure.Element;
-import org.jfree.report.structure.Section;
-import org.jfree.report.util.AttributeNameGenerator;
-import org.jfree.report.util.IntegerCache;
-import org.jfree.report.util.MemoryByteArrayOutputStream;
-import org.jfree.resourceloader.ResourceException;
-import org.jfree.resourceloader.ResourceKey;
-import org.jfree.resourceloader.ResourceManager;
-import org.jfree.util.FastStack;
-import org.jfree.util.LineBreakIterator;
-import org.jfree.util.Log;
-import org.jfree.xmlns.common.AttributeList;
-import org.jfree.xmlns.writer.DefaultTagDescription;
-import org.jfree.xmlns.writer.XmlWriter;
-import org.jfree.xmlns.writer.XmlWriterSupport;
-import org.w3c.css.sac.LexicalUnit;
-
-/**
- * Todo: Document me!
- *
- * @author Thomas Morgner
- * @since 08.03.2007
- */
-public abstract class OfficeDocumentReportTarget extends AbstractReportTarget
-{
-
- public static final String HORIZONTAL_POS = "horizontal-pos";
- public static final String TAG_DEF_PREFIX = "com.sun.star.report.pentaho.output.";
- public static final int ROLE_NONE = 0;
- public static final int ROLE_REPORT_HEADER = 1;
- public static final int ROLE_REPORT_FOOTER = 2;
- public static final int ROLE_GROUP_HEADER = 3;
- public static final int ROLE_GROUP_FOOTER = 4;
- public static final int ROLE_REPEATING_GROUP_HEADER = 5;
- public static final int ROLE_REPEATING_GROUP_FOOTER = 6;
- public static final int ROLE_PAGE_HEADER = 7;
- public static final int ROLE_PAGE_FOOTER = 8;
- public static final int ROLE_DETAIL = 9;
- public static final int ROLE_VARIABLES = 10;
- public static final int ROLE_TEMPLATE = 11;
- public static final int ROLE_SPREADSHEET_PAGE_HEADER = 12;
- public static final int ROLE_SPREADSHEET_PAGE_FOOTER = 13;
- public static final int STATE_IN_DOCUMENT = 0;
- public static final int STATE_IN_BODY = 1;
- public static final int STATE_IN_CONTENT = 2;
- public static final int STATE_IN_GROUP = 3;
- public static final int STATE_IN_GROUP_BODY = 4;
- public static final int STATE_IN_SECTION = 5;
- public static final int STATE_IN_OTHER = 6;
- public static final int STATE_IN_GROUP_INSTANCE = 7;
- public static final String FAILED = "Failed";
- public static final String VERTICAL_POS = "vertical-pos";
- private static final String ZERO_CM = "0cm";
-
- protected static class BufferState
- {
-
- private final XmlWriter xmlWriter;
- private final MemoryByteArrayOutputStream xmlBuffer;
- private final OfficeStylesCollection stylesCollection;
-
- protected BufferState(final XmlWriter xmlWriter,
- final MemoryByteArrayOutputStream xmlBuffer,
- final OfficeStylesCollection stylesCollection)
- {
- this.stylesCollection = stylesCollection;
- this.xmlWriter = xmlWriter;
- this.xmlBuffer = xmlBuffer;
- }
-
- public OfficeStylesCollection getStylesCollection()
- {
- return stylesCollection;
- }
-
- public XmlWriter getXmlWriter()
- {
- return xmlWriter;
- }
-
- public String getXmlBuffer() throws ReportProcessingException
- {
- try
- {
- final byte[] zippedData = xmlBuffer.getRaw();
- final InputStreamReader reader = new InputStreamReader(new InflaterInputStream(new ByteArrayInputStream(zippedData, 0, xmlBuffer.getLength())), "UTF-16");
- final StringWriter writer = new StringWriter((zippedData.length / 2) + 1);
- IOUtils.getInstance().copyWriter(reader, writer);
- return writer.toString();
- }
- catch (IOException e)
- {
- throw new ReportProcessingException("Failed to copy buffer", e);
- }
- }
-
- public Reader getXmlAsReader() throws ReportProcessingException
- {
- try
- {
- final byte[] zippedData = xmlBuffer.getRaw();
- return new InputStreamReader(new InflaterInputStream(new ByteArrayInputStream(zippedData, 0, xmlBuffer.getLength())), "UTF-16");
- }
- catch (IOException e)
- {
- throw new ReportProcessingException("Failed to copy buffer", e);
- }
- }
- }
-
- protected static class GroupContext
- {
-
- private final GroupContext parent;
- private int iterationCount;
- private boolean groupWithRepeatingSection;
-
- protected GroupContext(final GroupContext parent)
- {
- this.parent = parent;
- }
-
- public GroupContext getParent()
- {
- return parent;
- }
-
- public int getIterationCount()
- {
- return iterationCount;
- }
-
- public void setIterationCount(final int iterationCount)
- {
- this.iterationCount = iterationCount;
- }
-
- public boolean isGroupWithRepeatingSection()
- {
- return groupWithRepeatingSection;
- }
-
- public void setGroupWithRepeatingSection(final boolean groupWithRepeatingSection)
- {
- this.groupWithRepeatingSection = groupWithRepeatingSection;
- }
-
- public String toString()
- {
- return "GroupContext{" +
- "parent=" + parent +
- ", iterationCount=" + iterationCount +
- ", groupWithRepeatingSection=" + groupWithRepeatingSection +
- '}';
- }
- }
- private final FastStack states;
- private int currentRole;
- private final FastStack xmlWriters;
- private XmlWriter rootXmlWriter;
- /**
- * This styles-collection contains all styles that were predefined in the report definition file. The common styles
- * and the master-styles will be written unmodified, the automatic styles will be ignored.
- */
- private OfficeStylesCollection predefinedStylesCollection;
- /**
- * This styles-collection contains all master-styles that have been generated by the report definition process. It
- * also contains all automatic styles that have been generated for the page-bands (and the pagebands as well).
- */
- private OfficeStylesCollection globalStylesCollection;
- /**
- * The content styles collection contains all automatic styles that have been generated for the normal-flow content.
- */
- private OfficeStylesCollection contentStylesCollection;
- private final OutputRepository outputRepository;
- private final InputRepository inputRepository;
- private final AttributeNameGenerator tableNameGenerator;
- private final AttributeNameGenerator frameNameGenerator;
- private final AttributeNameGenerator autoStyleNameGenerator;
- private final String target;
- private static final int INITIAL_BUFFER_SIZE = 40960;
- private StyleMapper styleMapper;
- private StyleSheetParserUtil styleSheetParserUtil;
- private final AttributeNameGenerator imageNames;
- private final ImageProducer imageProducer;
- private final OleProducer oleProducer;
- private GroupContext groupContext;
- private static final boolean DEBUG_ELEMENTS =
- JFreeReportBoot.getInstance().getExtendedConfig().getBoolProperty("com.sun.star.report.pentaho.output.DebugElements");
-
- protected OfficeDocumentReportTarget(final ReportJob reportJob,
- final ResourceManager resourceManager,
- final ResourceKey baseResource,
- final InputRepository inputRepository,
- final OutputRepository outputRepository,
- final String target,
- final ImageService imageService,
- final DataSourceFactory datasourcefactory)
- throws ReportProcessingException
- {
- super(reportJob, resourceManager, baseResource);
- if (imageService == null)
- {
- throw new NullPointerException("ImageService must not be null");
- }
- if (target == null)
- {
- throw new NullPointerException("Target-Name must not be null");
- }
-
- this.target = target;
-
- this.tableNameGenerator = new AttributeNameGenerator();
- this.frameNameGenerator = new AttributeNameGenerator();
- this.autoStyleNameGenerator = new AttributeNameGenerator();
- this.outputRepository = outputRepository;
- this.inputRepository = inputRepository;
- this.states = new FastStack();
- this.xmlWriters = new FastStack();
- this.imageNames = new AttributeNameGenerator();
-
- this.imageProducer = new ImageProducer(inputRepository, outputRepository, imageService);
- this.oleProducer = new OleProducer(inputRepository, outputRepository, imageService, datasourcefactory);
-
- try
- {
- final ResourceManager realResourceManager = getResourceManager();
- styleMapper = StyleMapper.loadInstance(realResourceManager);
- }
- catch (ResourceException e)
- {
- throw new ReportProcessingException("Failed to load style-mapper", e);
- }
- }
-
- protected abstract String getTargetMimeType();
-
- protected OutputRepository getOutputRepository()
- {
- return outputRepository;
- }
-
- protected InputRepository getInputRepository()
- {
- return inputRepository;
- }
-
- /**
- * Starts the output of a new office document. This method writes the generic 'office:document-content' tag along with
- * all known namespace declarations.
- *
- * @param report the report object.
- * @throws DataSourceException if there was an error accessing the datasource
- * @throws ReportProcessingException if some other error occured.
- */
- public void startReport(final ReportStructureRoot report)
- throws DataSourceException, ReportProcessingException
- {
- imageNames.reset();
- this.groupContext = new GroupContext(null);
-
- final DefaultTagDescription tagDescription = createTagDescription();
- try
- {
- final OutputStream outputStream = outputRepository.createOutputStream(target, "text/xml");
- final Writer writer = new OutputStreamWriter(outputStream, "UTF-8");
-
- this.rootXmlWriter = new XmlWriter(writer, tagDescription);
- this.rootXmlWriter.setAlwaysAddNamespace(true);
-
- final AttributeList rootAttributes = new AttributeList();
- rootAttributes.addNamespaceDeclaration("office", OfficeNamespaces.OFFICE_NS);
- rootAttributes.addNamespaceDeclaration("style", OfficeNamespaces.STYLE_NS);
- rootAttributes.addNamespaceDeclaration("text", OfficeNamespaces.TEXT_NS);
- rootAttributes.addNamespaceDeclaration("table", OfficeNamespaces.TABLE_NS);
- rootAttributes.addNamespaceDeclaration("draw", OfficeNamespaces.DRAWING_NS);
- rootAttributes.addNamespaceDeclaration("fo", OfficeNamespaces.FO_NS);
- rootAttributes.addNamespaceDeclaration("xlink", OfficeNamespaces.XLINK_NS);
- rootAttributes.addNamespaceDeclaration("dc", OfficeNamespaces.PURL_NS);
- rootAttributes.addNamespaceDeclaration("meta", OfficeNamespaces.META_NS);
- rootAttributes.addNamespaceDeclaration("number", OfficeNamespaces.DATASTYLE_NS);
- rootAttributes.addNamespaceDeclaration("svg", OfficeNamespaces.SVG_NS);
- rootAttributes.addNamespaceDeclaration("chart", OfficeNamespaces.CHART_NS);
- rootAttributes.addNamespaceDeclaration("dr3d", OfficeNamespaces.DR3D_NS);
- rootAttributes.addNamespaceDeclaration("math", OfficeNamespaces.MATHML_NS);
- rootAttributes.addNamespaceDeclaration("form", OfficeNamespaces.FORM_NS);
- rootAttributes.addNamespaceDeclaration("script", OfficeNamespaces.SCRIPT_NS);
- rootAttributes.addNamespaceDeclaration("ooo", OfficeNamespaces.OO2004_NS);
- rootAttributes.addNamespaceDeclaration("ooow", OfficeNamespaces.OOW2004_NS);
- rootAttributes.addNamespaceDeclaration("oooc", OfficeNamespaces.OOC2004_NS);
- rootAttributes.addNamespaceDeclaration("dom", OfficeNamespaces.XML_EVENT_NS);
- rootAttributes.addNamespaceDeclaration("xforms", OfficeNamespaces.XFORMS_NS);
- rootAttributes.addNamespaceDeclaration("xsd", OfficeNamespaces.XSD_NS);
- rootAttributes.addNamespaceDeclaration("xsi", OfficeNamespaces.XSI_NS);
- rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.0");
-
- this.rootXmlWriter.writeXmlDeclaration("UTF-8");
- this.rootXmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "document-content", rootAttributes, XmlWriterSupport.OPEN);
-
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_DOCUMENT));
-
- autoStyleNameGenerator.reset();
- tableNameGenerator.reset();
- frameNameGenerator.reset();
-
- final OfficeDocument reportDoc = (OfficeDocument) report;
- predefinedStylesCollection = reportDoc.getStylesCollection();
-
- final OfficeStyles commonStyles = predefinedStylesCollection.getCommonStyles();
- if (!commonStyles.containsStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS))
- {
- final OfficeStyle graphicsDefaultStyle = new OfficeStyle();
- graphicsDefaultStyle.setStyleFamily(OfficeToken.GRAPHIC);
- graphicsDefaultStyle.setStyleName(OfficeToken.GRAPHICS);
- final Element graphicProperties = produceFirstChild(graphicsDefaultStyle, OfficeNamespaces.STYLE_NS, OfficeToken.GRAPHIC_PROPERTIES);
- graphicProperties.setAttribute(OfficeNamespaces.TEXT_NS, "anchor-type", OfficeToken.PARAGRAPH);
- graphicProperties.setAttribute(OfficeNamespaces.SVG_NS, "x", ZERO_CM);
- graphicProperties.setAttribute(OfficeNamespaces.SVG_NS, "y", ZERO_CM);
- graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "wrap", "dynamic");
- graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "number-wrapped-paragraphs", "no-limit");
- graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "wrap-contour", OfficeToken.FALSE);
- graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, VERTICAL_POS, "from-top"); // changed for chart
-
- graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "vertical-rel", OfficeToken.PARAGRAPH);
- graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, HORIZONTAL_POS, "from-left"); // changed for chart
-
- graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "horizontal-rel", OfficeToken.PARAGRAPH);
- commonStyles.addStyle(graphicsDefaultStyle);
- }
-
- // Make sure that later generated styles do not overwrite existing styles.
- fillStyleNameGenerator(predefinedStylesCollection);
-
- contentStylesCollection = new OfficeStylesCollection();
- globalStylesCollection = new OfficeStylesCollection();
-
- startBuffering(contentStylesCollection, true);
- }
- catch (IOException e)
- {
- throw new ReportProcessingException(FAILED, e);
- }
- }
-
- protected AttributeNameGenerator getAutoStyleNameGenerator()
- {
- return autoStyleNameGenerator;
- }
-
- private void fillStyleNameGenerator(final OfficeStylesCollection stylesCollection)
- {
- final OfficeStyles commonStyles = stylesCollection.getCommonStyles();
- final OfficeStyle[] allCommonStyles = commonStyles.getAllStyles();
- for (int i = 0; i < allCommonStyles.length; i++)
- {
- final OfficeStyle style = allCommonStyles[i];
- autoStyleNameGenerator.generateName(style.getStyleName());
- }
-
- final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles();
- final OfficeStyle[] allAutoStyles = autoStyles.getAllStyles();
- for (int i = 0; i < allAutoStyles.length; i++)
- {
- final OfficeStyle style = allAutoStyles[i];
- autoStyleNameGenerator.generateName(style.getStyleName());
- }
- }
-
- public OfficeStylesCollection getPredefinedStylesCollection()
- {
- return predefinedStylesCollection;
- }
-
- public OfficeStylesCollection getGlobalStylesCollection()
- {
- return globalStylesCollection;
- }
-
- public OfficeStylesCollection getContentStylesCollection()
- {
- return contentStylesCollection;
- }
-
- /**
- * Returns the XML-Writer tag description. This description defines whether an element can have character data inside.
- * Such element will disable the indention, as in that case the additional whitespaces might alter the meaning of the
- * element's contents.
- *
- * @return the tag description library.
- */
- protected DefaultTagDescription createTagDescription()
- {
- final DefaultTagDescription tagDescription = new DefaultTagDescription();
- tagDescription.configure(JFreeReportBoot.getInstance().getGlobalConfig(),
- OfficeDocumentReportTarget.TAG_DEF_PREFIX);
- return tagDescription;
- }
-
- /**
- * Returns the current processing state.
- *
- * @return the processing state.
- */
- protected int getCurrentState()
- {
- if (states.isEmpty())
- {
- throw new IllegalStateException();
- }
- final Integer o = (Integer) states.peek();
- return o.intValue();
- }
-
- /**
- * Starts the processing of an element and updates the processing state. This will select an apropriate handler method
- * for the call and will call one of the start* methods.
- *
- * @param attrs the attribute map for the current element
- * @throws DataSourceException
- * @throws ReportProcessingException
- */
- public final void startElement(final AttributeMap attrs)
- throws DataSourceException, ReportProcessingException
- {
- // todo
- if (DEBUG_ELEMENTS)
- {
- Log.debug("Starting " + getCurrentState() + '/' + states.size() + ' ' +
- ReportTargetUtil.getNamespaceFromAttribute(attrs) + " -> " +
- ReportTargetUtil.getElemenTypeFromAttribute(attrs));
- }
- try
- {
- switch (getCurrentState())
- {
- case OfficeDocumentReportTarget.STATE_IN_DOCUMENT:
- {
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OFFICE_NS, "body", attrs))
- {
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_BODY));
- startBody(attrs);
- }
- else
- {
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_OTHER));
- if (!isFilteredNamespace(ReportTargetUtil.getNamespaceFromAttribute(attrs)))
- {
- startOther(attrs);
- }
- }
- break;
- }
- case OfficeDocumentReportTarget.STATE_IN_BODY:
- {
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OFFICE_NS, "report", attrs))
- {
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_CONTENT));
- startContent(attrs);
- }
- else
- {
- throw new IllegalStateException("The 'office:body' element must have exactly one child of type 'report'");
- }
- break;
- }
- case OfficeDocumentReportTarget.STATE_IN_CONTENT:
- {
- // Either a ordinary section or a group ..
- // A group.
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, "report-body", attrs))
- {
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_GROUP_BODY));
- startGroupBody(attrs);
- }
- else
- {
- // Either a template-section, page-header, page-footer, report-header, report-footer
- // or variables-section
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_SECTION));
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, "template", attrs))
- {
- currentRole = OfficeDocumentReportTarget.ROLE_TEMPLATE;
- }
- else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "page-header", attrs))
- {
- if ("spreadsheet-section".equals(attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "role")))
- {
- currentRole = OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER;
- }
- else
- {
- currentRole = OfficeDocumentReportTarget.ROLE_PAGE_HEADER;
- }
- }
- else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "page-footer", attrs))
- {
- if ("spreadsheet-section".equals(attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "role")))
- {
- currentRole = OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER;
- }
- else
- {
- currentRole = OfficeDocumentReportTarget.ROLE_PAGE_FOOTER;
- }
- }
- else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "report-header", attrs))
- {
- currentRole = OfficeDocumentReportTarget.ROLE_REPORT_HEADER;
- }
- else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "report-footer", attrs))
- {
- currentRole = OfficeDocumentReportTarget.ROLE_REPORT_FOOTER;
- }
- else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, "variables-section", attrs))
- {
- currentRole = OfficeDocumentReportTarget.ROLE_VARIABLES;
- }
- else
- {
- throw new IllegalStateException("Expected either 'template', 'report-body', " +
- "'report-header', 'report-footer', 'variables-section', 'page-header' or 'page-footer'");
- }
- startReportSection(attrs, currentRole);
- }
- break;
- }
- case OfficeDocumentReportTarget.STATE_IN_GROUP_BODY:
- {
- // We now expect either an other group or a detail band.
-
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "group", attrs))
- {
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_GROUP));
- groupContext = new GroupContext(groupContext);
- startGroup(attrs);
- }
- else
- {
- // Either a variables-section, or a detail-band
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_SECTION));
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "detail", attrs))
- {
- currentRole = OfficeDocumentReportTarget.ROLE_DETAIL;
- }
- else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, "variables-section", attrs))
- {
- currentRole = OfficeDocumentReportTarget.ROLE_VARIABLES;
- }
- else
- {
- throw new IllegalStateException("Expected either 'group', 'detail' or 'variables-section'");
- }
- startReportSection(attrs, currentRole);
- }
- break;
- }
- case OfficeDocumentReportTarget.STATE_IN_GROUP:
- {
- // A group can carry a repeating group header/footer or a group-instance section.
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, "group-instance", attrs))
- {
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_GROUP_INSTANCE));
- startGroupInstance(attrs);
- }
- else
- {
- // repeating group header/footer, but *no* variables section
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_SECTION));
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "group-header", attrs) &&
- OfficeToken.TRUE.equals(attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "repeated-section")))
- {
- currentRole = OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER;
- }
- else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "group-footer", attrs) &&
- OfficeToken.TRUE.equals(attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "repeated-section")))
- {
- currentRole = OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER;
- }
- else
- {
- throw new IllegalStateException("Expected either 'group-instance', " +
- "'repeating group-header' or 'repeating group-footer'");
- }
- startReportSection(attrs, currentRole);
- }
- break;
- }
- case OfficeDocumentReportTarget.STATE_IN_GROUP_INSTANCE:
- {
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, "group-body", attrs))
- {
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_GROUP_BODY));
- startGroupBody(attrs);
- }
- else
- {
- // Either a group-header or group-footer or variables-section
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_SECTION));
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "group-header", attrs))
- {
- currentRole = OfficeDocumentReportTarget.ROLE_GROUP_HEADER;
- }
- else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "group-footer", attrs))
- {
- currentRole = OfficeDocumentReportTarget.ROLE_GROUP_FOOTER;
- }
- else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, "variables-section", attrs))
- {
- currentRole = OfficeDocumentReportTarget.ROLE_VARIABLES;
- }
- else
- {
- throw new IllegalStateException("Expected either 'group-body', 'group-header', 'group-footer' or 'variables-section'");
- }
- startReportSection(attrs, currentRole);
- }
- break;
- }
- case OfficeDocumentReportTarget.STATE_IN_SECTION:
- {
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_OTHER));
- startOther(attrs);
- break;
- }
- case OfficeDocumentReportTarget.STATE_IN_OTHER:
- {
- states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_OTHER));
- startOther(attrs);
- break;
- }
- default:
- throw new IllegalStateException("Failure: " + getCurrentState());
- }
- }
- catch (IOException ioe)
- {
- Log.error("ReportProcessing failed", ioe);
- throw new ReportProcessingException("Failed to write content", ioe);
- }
-// finally
-// {
-// Log.debug ("Started " + getNamespaceFromAttribute(attrs) + ":" +
-// getElemenTypeFromAttribute(attrs) + " -> " + getCurrentState());
-// }
- }
-
- protected GroupContext getGroupContext()
- {
- return groupContext;
- }
-
- protected void performStyleProcessing(final AttributeMap attrs)
- throws ReportProcessingException
- {
- final OfficeStylesCollection stylesCollection = getStylesCollection();
- final OfficeStylesCollection predefCollection = getPredefinedStylesCollection();
- final OfficeStylesCollection globalStylesCollection = getGlobalStylesCollection();
-
- final String elementNamespace =
- ReportTargetUtil.getNamespaceFromAttribute(attrs);
- final String elementName =
- ReportTargetUtil.getElemenTypeFromAttribute(attrs);
-
- final String[] namespaces = attrs.getNameSpaces();
- for (int i = 0; i < namespaces.length; i++)
- {
- final String attrNamespace = namespaces[i];
- if (isFilteredNamespace(attrNamespace))
- {
- continue;
- }
-
- final Map attributes = attrs.getAttributes(attrNamespace);
- final Iterator iterator = attributes.entrySet().iterator();
- while (iterator.hasNext())
- {
- final Map.Entry entry = (Map.Entry) iterator.next();
- final String attrName = (String) entry.getKey();
- final String attrValue = String.valueOf(entry.getValue());
-
- final String styleFamily = styleMapper.getStyleFamilyFor(elementNamespace, elementName, attrNamespace, attrName);
- if (styleFamily == null)
- {
- // None of the known style attributes.
- continue;
- }
-
- if (styleMapper.isListOfStyles(elementNamespace, elementName, attrNamespace, attrName))
- {
- // ignored for now.
- Log.warn("List of styles is not yet implemented.");
- continue;
- }
-
- // Copy styles is only called once per style.
- StyleUtilities.copyStyle(styleFamily, attrValue, stylesCollection, globalStylesCollection, predefCollection);
- }
- }
- }
-
- protected void startBody(final AttributeMap attrs)
- throws IOException
- {
- getXmlWriter().writeTag(OfficeNamespaces.OFFICE_NS, "body", XmlWriterSupport.OPEN);
- }
-
- private final boolean allowBuffering(final int role)
- {
- return (role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER ||
- role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER ||
- role == OfficeDocumentReportTarget.ROLE_TEMPLATE);
- }
-
- protected void startReportSection(final AttributeMap attrs, final int role)
- throws IOException, DataSourceException, ReportProcessingException
- {
- if (allowBuffering(role))
- {
- startBuffering(new OfficeStylesCollection(), true);
- }
- }
-
- protected abstract void startContent(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException;
-
- protected void startGroup(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- final Object repeatingHeaderOrFooter = attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "repeating-header-or-footer");
- if (OfficeToken.TRUE.equals(repeatingHeaderOrFooter))
- {
- getGroupContext().setGroupWithRepeatingSection(true);
- }
-
- final Object iterationCount = attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "iteration-count");
- if (iterationCount instanceof Number)
- {
- final Number itNumber = (Number) iterationCount;
- getGroupContext().setIterationCount(itNumber.intValue());
- }
- }
-
- protected void startGroupInstance(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- }
-
- protected void startGroupBody(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- }
-
- protected abstract void startOther(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException;
-
- public void processText(final String text)
- throws DataSourceException, ReportProcessingException
- {
- try
- {
- final XmlWriter xmlWriter = getXmlWriter();
- final LineBreakIterator lb = new LineBreakIterator(text);
- while (lb.hasNext())
- {
- final String line = (String) lb.next();
- final String normalizedText = XmlWriterSupport.normalize(line, false);
- xmlWriter.writeText(normalizedText);
- if (lb.hasNext())
- {
- xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "line-break", XmlWriterSupport.CLOSE);
- }
- }
- }
- catch (IOException e)
- {
- throw new ReportProcessingException(FAILED, e);
- }
- }
-
- protected boolean isFilteredNamespace(final String namespace)
- {
- if (Namespaces.LIBLAYOUT_NAMESPACE.equals(namespace))
- {
- return true;
- }
- if (JFreeReportInfo.REPORT_NAMESPACE.equals(namespace))
- {
- return true;
- }
- if (OfficeNamespaces.INTERNAL_NS.equals(namespace))
- {
- return true;
- }
- if (JFreeReportInfo.COMPATIBILITY_NAMESPACE.equals(namespace))
- {
- return true;
- }
- if (OfficeNamespaces.OOREPORT_NS.equals(namespace))
- {
- return true;
- }
- return false;
- }
-
- public void processContent(final DataFlags value)
- throws DataSourceException, ReportProcessingException
- {
- final Object rawvalue = value.getValue();
- if (rawvalue == null)
- {
- return;
- }
-
- // special handler for image (possibly also for URL ..)
- if (rawvalue instanceof Image)
- {
- // do nothing yet. We should define something for that later ..
- return;
- }
-
- final XmlWriter xmlWriter = getXmlWriter();
- final String text = String.valueOf(rawvalue);
- try
- {
- final LineBreakIterator lb = new LineBreakIterator(text);
- while (lb.hasNext())
- {
- final String line = (String) lb.next();
- final String normalizedText = XmlWriterSupport.normalize(line, false);
- xmlWriter.writeText(normalizedText);
- if (lb.hasNext())
- {
- xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "line-break", XmlWriterSupport.CLOSE);
- }
- }
- }
- catch (IOException e)
- {
- throw new ReportProcessingException(FAILED, e);
- }
- }
-
- public final void endElement(final AttributeMap attrs)
- throws DataSourceException, ReportProcessingException
- {
- // final int oldState = getCurrentState();
- try
- {
-
- switch (getCurrentState())
- {
- case OfficeDocumentReportTarget.STATE_IN_OTHER:
- {
- endOther(attrs);
- break;
- }
- case OfficeDocumentReportTarget.STATE_IN_SECTION:
- {
- endReportSection(attrs, currentRole);
- currentRole = OfficeDocumentReportTarget.ROLE_NONE;
- break;
- }
- case OfficeDocumentReportTarget.STATE_IN_GROUP:
- {
- endGroup(attrs);
- groupContext = groupContext.getParent();
- break;
- }
- case OfficeDocumentReportTarget.STATE_IN_GROUP_INSTANCE:
- {
- endGroupInstance(attrs);
- break;
- }
- case OfficeDocumentReportTarget.STATE_IN_GROUP_BODY:
- {
- endGroupBody(attrs);
- break;
- }
- case OfficeDocumentReportTarget.STATE_IN_CONTENT:
- {
- endContent(attrs);
- break;
- }
- case OfficeDocumentReportTarget.STATE_IN_BODY:
- {
- endBody(attrs);
- break;
- }
- case OfficeDocumentReportTarget.STATE_IN_DOCUMENT:
- {
- throw new IllegalStateException("This cannot be.");
- }
- default:
- {
- throw new IllegalStateException("Invalid state encountered.");
- }
- }
- }
- catch (IOException ioe)
- {
- throw new ReportProcessingException("IO Error while writing content",
- ioe);
- } finally
- {
- states.pop();
-
- if (DEBUG_ELEMENTS)
- {
- Log.debug("Finished " + getCurrentState() + "/" + states.size() + " " +
- ReportTargetUtil.getNamespaceFromAttribute(attrs) + ":" +
- ReportTargetUtil.getElemenTypeFromAttribute(attrs));
- }
-
- }
- }
-
- protected void endGroupBody(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- }
-
- protected void endGroupInstance(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- }
-
- public int getCurrentRole()
- {
- return currentRole;
- }
-
- protected abstract void endOther(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException;
-
- protected void endReportSection(final AttributeMap attrs,
- final int role)
- throws IOException, DataSourceException, ReportProcessingException
- {
- if (allowBuffering(role))
- {
- finishBuffering();
- }
- }
-
- protected void endGroup(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- }
-
- protected abstract void endContent(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException;
-
- protected void endBody(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- getXmlWriter().writeCloseTag();
- }
-
- public void endReport(final ReportStructureRoot report)
- throws DataSourceException, ReportProcessingException
- {
- if (xmlWriters.size() != 1)
- {
- throw new IllegalStateException("Invalid writer-stack state");
- }
-
- try
- {
- final StylesWriter inlineStylesWriter = new StylesWriter(rootXmlWriter);
- inlineStylesWriter.writeContentStyles(predefinedStylesCollection, contentStylesCollection);
-
- final BufferState state = finishBuffering();
- this.rootXmlWriter.writeStream(state.getXmlAsReader());
-
- final OutputStream stylesOutStream =
- outputRepository.createOutputStream("styles.xml", "text/xml");
- final OutputStreamWriter osw =
- new OutputStreamWriter(stylesOutStream, "UTF-8");
- final StylesWriter stylesWriter = new StylesWriter(osw);
- stylesWriter.writeGlobalStyles(predefinedStylesCollection, globalStylesCollection);
- stylesWriter.close();
-
- this.rootXmlWriter.writeCloseTag();
- this.rootXmlWriter.close();
- }
- catch (IOException e)
- {
- throw new ReportProcessingException(FAILED, e);
- }
- }
-
- public XmlWriter getXmlWriter()
- {
- final BufferState bufferState = (BufferState) xmlWriters.peek();
- return bufferState.getXmlWriter();
- }
-
- public OfficeStylesCollection getStylesCollection()
- {
- final BufferState bufferState = (BufferState) xmlWriters.peek();
- return bufferState.getStylesCollection();
- }
-
- public void startBuffering(final OfficeStylesCollection stylesCollection,
- final boolean indent) throws ReportProcessingException
- {
- final XmlWriter currentWriter;
- if (xmlWriters.isEmpty())
- {
- currentWriter = rootXmlWriter;
- }
- else
- {
- final BufferState bufferState = (BufferState) xmlWriters.peek();
- currentWriter = bufferState.getXmlWriter();
- }
-
- try
- {
- final MemoryByteArrayOutputStream out =
- new MemoryByteArrayOutputStream(INITIAL_BUFFER_SIZE, 256 * INITIAL_BUFFER_SIZE);
- final DeflaterOutputStream deflateOut = new DeflaterOutputStream(out);
- final OutputStreamWriter xmlBuffer = new OutputStreamWriter(deflateOut, "UTF-16");
- // final StringWriter xmlBuffer = new StringWriter
- // (OfficeDocumentReportTarget.INITIAL_BUFFER_SIZE);
- final XmlWriter contentXmlWriter = new XmlWriter(xmlBuffer, createTagDescription());
- contentXmlWriter.copyNamespaces(currentWriter);
- if (indent)
- {
- contentXmlWriter.setAdditionalIndent(currentWriter.getCurrentIndentLevel());
- contentXmlWriter.setWriteFinalLinebreak(true);
- }
- else
- {
- contentXmlWriter.setWriteFinalLinebreak(false);
- }
- contentXmlWriter.setAlwaysAddNamespace(true);
- xmlWriters.push(new BufferState(contentXmlWriter, out, stylesCollection));
- }
- catch (IOException ioe)
- {
- throw new ReportProcessingException("Unable to create the buffer");
- }
- }
-
- public BufferState finishBuffering() throws ReportProcessingException
- {
- final BufferState state = (BufferState) xmlWriters.pop();
- try
- {
- state.getXmlWriter().close();
- }
- catch (IOException e)
- {
- Log.error("ReportProcessing failed", e);
- }
- return state;
- }
-
- public void commit()
- throws ReportProcessingException
- {
- // do not call flush before the report is fully finished. Every flush
- // causes the Office-Backend to fully ZIP all contents (it acts like a
- // 'Save' call from the UI) and that's expensive like hell
- }
-
- public NamespaceDefinition getNamespaceByUri(final String uri)
- {
- return null;
- }
-
- protected AttributeList buildAttributeList(final AttributeMap attrs)
- {
- final AttributeList attrList = new AttributeList();
- final String[] namespaces = attrs.getNameSpaces();
- for (int i = 0; i < namespaces.length; i++)
- {
- final String attrNamespace = namespaces[i];
- if (isFilteredNamespace(attrNamespace))
- {
- continue;
- }
-
- final Map localAttributes = attrs.getAttributes(attrNamespace);
- final Iterator entries = localAttributes.entrySet().iterator();
- while (entries.hasNext())
- {
- final Map.Entry entry = (Map.Entry) entries.next();
- final String key = String.valueOf(entry.getKey());
- if (OfficeNamespaces.TABLE_NS.equals(attrNamespace) &&
- "name".equals(key))
- {
- final String tableName = String.valueOf(entry.getValue());
- final String saneName = sanitizeName(tableName);
- attrList.setAttribute(attrNamespace, key,
- tableNameGenerator.generateName(saneName));
- }
- else if (OfficeNamespaces.DRAWING_NS.equals(attrNamespace) &&
- "name".equals(key))
- {
- final String objectName = String.valueOf(entry.getValue());
- attrList.setAttribute(attrNamespace, key,
- frameNameGenerator.generateName(objectName));
- }
- else
- {
- attrList.setAttribute(attrNamespace, key, String.valueOf(entry.getValue()));
- }
- }
- }
- return attrList;
- }
-
- protected String sanitizeName(final String name)
- {
- // A table name cannot contain spaces and should only contain
- // ascii-characters.
- if (name == null)
- {
- return "";
- }
- final char[] chars = name.toCharArray();
- final StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < chars.length; i++)
- {
- final char aChar = chars[i];
- if (Character.isWhitespace(aChar))
- {
- buffer.append('_');
- }
- else
- {
- buffer.append(aChar);
- }
- }
- return buffer.toString();
- }
-
- /**
- * Returns the length in point. This method is f**king slow, it eats half of the processing time. I surely should
- * replace it with something more efficient later.
- *
- * @param text
- * @return
- */
- protected CSSNumericValue parseLength(final String text)
- {
- if (styleSheetParserUtil == null)
- {
- styleSheetParserUtil = StyleSheetParserUtil.getInstance();
- }
-
- final LexicalUnit cssValue = styleSheetParserUtil.parseLexicalStyleValue(
- text);
- return CSSValueFactory.createLengthValue(cssValue);
- }
-
- protected boolean isRepeatingSection()
- {
- return (currentRole == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER ||
- currentRole == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER ||
- currentRole == OfficeDocumentReportTarget.ROLE_PAGE_FOOTER ||
- currentRole == OfficeDocumentReportTarget.ROLE_PAGE_HEADER ||
- currentRole == OfficeDocumentReportTarget.ROLE_VARIABLES);
-
- }
-
- protected OfficeStyle deriveStyle(final String styleFamily, final String styleName)
- throws ReportProcessingException
- {
- // autogenerate a style. The style has already been added to the current
- // auto-collection.
- final OfficeStyle style = StyleUtilities.deriveStyle(styleFamily, styleName,
- getStylesCollection(), getGlobalStylesCollection(),
- getPredefinedStylesCollection(), getAutoStyleNameGenerator());
- return style;
- }
-
- protected void startImageProcessing(final AttributeMap attrs)
- throws ReportProcessingException
- {
- final Object imageData = attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, OfficeToken.IMAGE_DATA);
- final boolean preserveIRI = OfficeToken.TRUE.equals(attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, OfficeToken.PRESERVE_IRI));
-
- // for the first shot, do nothing fancy ..
- final ImageProducer.OfficeImage image = imageProducer.produceImage(imageData, preserveIRI);
- if (image != null)
- {
- final ImageElementContext imageContext = (ImageElementContext) attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "image-context");
-
- // When scaling, we have to create an image-style.
- final CSSNumericValue width = image.getWidth(); // always in 100th of a mm
-
- final CSSNumericValue height = image.getHeight(); // always in 100th of a mm
-
- Log.debug("Image " + imageData + " Width: " + width + ", Height: " + height);
- if (width == null || height == null)
- {
- return;
- }
-
- CSSNumericValue imageAreaWidthVal;
- CSSNumericValue imageAreaHeightVal;
- String styleName = null;
- if (imageContext != null)
- {
- imageAreaWidthVal = computeImageWidth(imageContext);
- imageAreaHeightVal = computeImageHeight(imageContext);
-
- if (imageAreaWidthVal == null || imageAreaHeightVal == null)
- {
- Log.debug("Image data returned from context is invalid. Maybe this is not an image?");
- return;
- }
- else
- {
- // compute the clip-area ..
- final CSSNumericValue normalizedImageWidth =
- CSSValueResolverUtility.convertLength(width, imageAreaWidthVal.getType());
- final CSSNumericValue normalizedImageHeight =
- CSSValueResolverUtility.convertLength(height, imageAreaHeightVal.getType());
-
- final boolean scale = OfficeToken.TRUE.equals(attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, OfficeToken.SCALE));
- if (!scale && normalizedImageWidth.getValue() > 0 && normalizedImageHeight.getValue() > 0)
- {
- final double clipWidth = normalizedImageWidth.getValue() - imageAreaWidthVal.getValue();
- final double clipHeight = normalizedImageHeight.getValue() - imageAreaHeightVal.getValue();
- if (clipWidth > 0 && clipHeight > 0)
- {
- final OfficeStyle imageStyle = deriveStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS);
- final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, OfficeToken.GRAPHIC_PROPERTIES);
- final StringBuffer buffer = new StringBuffer();
- buffer.append("rect(");
- buffer.append(clipHeight / 2);
- buffer.append(imageAreaHeightVal.getType().getType());
- buffer.append(' ');
- buffer.append(clipWidth / 2);
- buffer.append(imageAreaWidthVal.getType().getType());
- buffer.append(' ');
- buffer.append(clipHeight / 2);
- buffer.append(imageAreaHeightVal.getType().getType());
- buffer.append(' ');
- buffer.append(clipWidth / 2);
- buffer.append(imageAreaWidthVal.getType().getType());
- buffer.append(')');
- graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());
-
- styleName = imageStyle.getStyleName();
- getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
- }
- else if (clipWidth > 0)
- {
- final OfficeStyle imageStyle = deriveStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS);
- final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, OfficeToken.GRAPHIC_PROPERTIES);
- final StringBuffer buffer = new StringBuffer();
- buffer.append("rect(0cm ");
- buffer.append(clipWidth / 2);
- buffer.append(imageAreaWidthVal.getType().getType());
- buffer.append(" 0cm ");
- buffer.append(clipWidth / 2);
- buffer.append(imageAreaWidthVal.getType().getType());
- buffer.append(')');
- graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());
-
- styleName = imageStyle.getStyleName();
- getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
- imageAreaHeightVal = normalizedImageHeight;
- }
- else if (clipHeight > 0)
- {
- final OfficeStyle imageStyle = deriveStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS);
- final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, OfficeToken.GRAPHIC_PROPERTIES);
- final StringBuffer buffer = new StringBuffer();
- buffer.append("rect(");
- buffer.append(clipHeight / 2);
- buffer.append(imageAreaHeightVal.getType().getType());
- buffer.append(" 0cm ");
- buffer.append(clipHeight / 2);
- buffer.append(imageAreaHeightVal.getType().getType());
- buffer.append(" 0cm)");
- graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());
-
- styleName = imageStyle.getStyleName();
- getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
- imageAreaWidthVal = normalizedImageWidth;
- }
- else
- {
- imageAreaWidthVal = normalizedImageWidth;
- imageAreaHeightVal = normalizedImageHeight;
- }
- }
- }
- // If we do scale, then we simply use the given image-area-size as valid image size and dont
- // care about the image itself ..
- }
- else
- {
- Log.debug("There is no image-context, so we have to rely on the image's natural bounds. " +
- "This may go awfully wrong.");
- imageAreaWidthVal = image.getWidth();
- imageAreaHeightVal = image.getHeight();
- }
-
- final AttributeList frameList = new AttributeList();
- frameList.setAttribute(OfficeNamespaces.DRAWING_NS, "name", imageNames.generateName("Image"));
- if (styleName != null)
- {
- frameList.setAttribute(OfficeNamespaces.DRAWING_NS, OfficeToken.STYLE_NAME, styleName);
- }
- frameList.setAttribute(OfficeNamespaces.TEXT_NS, "anchor-type", OfficeToken.PARAGRAPH);
- frameList.setAttribute(OfficeNamespaces.SVG_NS, "z-index", "0");
- frameList.setAttribute(OfficeNamespaces.SVG_NS, "x", ZERO_CM);
- frameList.setAttribute(OfficeNamespaces.SVG_NS, "y", ZERO_CM);
-
- Log.debug("Image " + imageData + " A-Width: " + imageAreaWidthVal + ", A-Height: " + imageAreaHeightVal);
-
- if (imageAreaWidthVal != null)
- {
- frameList.setAttribute(OfficeNamespaces.SVG_NS,
- "width", imageAreaWidthVal.getValue() + imageAreaWidthVal.getType().getType());
- }
-
- if (imageAreaHeightVal != null)
- {
- frameList.setAttribute(OfficeNamespaces.SVG_NS,
- "height", imageAreaHeightVal.getValue() + imageAreaHeightVal.getType().getType());
- }
-
-
- final AttributeList imageList = new AttributeList();
- imageList.setAttribute(OfficeNamespaces.XLINK_NS, "href", image.getEmbeddableLink());
- imageList.setAttribute(OfficeNamespaces.XLINK_NS, "type", "simple");
- imageList.setAttribute(OfficeNamespaces.XLINK_NS, "show", "embed");
- imageList.setAttribute(OfficeNamespaces.XLINK_NS, "actuate", "onLoad");
-
-
- try
- {
- getXmlWriter().writeTag(OfficeNamespaces.DRAWING_NS, "frame", frameList, XmlWriterSupport.OPEN);
- getXmlWriter().writeTag(OfficeNamespaces.DRAWING_NS, OfficeToken.IMAGE, imageList, XmlWriterSupport.CLOSE);
- getXmlWriter().writeCloseTag();
- }
- catch (IOException ioe)
- {
- throw new ReportProcessingException(FAILED, ioe);
- }
- }
- }
-
- private CSSNumericValue computeImageWidth(final ImageElementContext imageElementContext)
- {
- final LengthCalculator calculator = new LengthCalculator();
- final String[] strings = imageElementContext.getColStyles();
- for (int i = 0; i < strings.length; i++)
- {
- final String styleName = strings[i];
- final CSSNumericValue value = computeColumnWidth(styleName);
- if (value != null)
- {
- calculator.add(value);
- }
- }
- return calculator.getResult();
- }
-
- private CSSNumericValue computeImageHeight(final ImageElementContext imageElementContext)
- {
- final LengthCalculator calculator = new LengthCalculator();
- final String[] strings = imageElementContext.getRowStyles();
- for (int i = 0; i < strings.length; i++)
- {
- final String styleName = strings[i];
- final CSSNumericValue value = computeRowHeight(styleName);
- if (value != null)
- {
- calculator.add(value);
- }
- }
- return calculator.getResult();
- }
-
- protected CSSNumericValue computeRowHeight(final String rowStyle)
- {
- final OfficeStylesCollection contentStyles = getContentStylesCollection();
- final OfficeStyle style = contentStyles.getStyle(OfficeToken.TABLE_ROW, rowStyle);
- if (style != null)
- {
- final Element element = style.getTableRowProperties();
- if (element != null)
- {
- final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
- if (height != null)
- {
- return parseLength(height);
- }
- }
-
- final String styleParent = style.getStyleParent();
- if (styleParent != null)
- {
- return computeRowHeight(styleParent);
- }
- }
-
- final OfficeStylesCollection globalStyles = getGlobalStylesCollection();
- final OfficeStyle globalStyle = globalStyles.getStyle(OfficeToken.TABLE_ROW, rowStyle);
- if (globalStyle != null)
- {
- final Element element = globalStyle.getTableRowProperties();
- if (element != null)
- {
- final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
- if (height != null)
- {
- return parseLength(height);
- }
- }
- final String styleParent = globalStyle.getStyleParent();
- if (styleParent != null)
- {
- return computeRowHeight(styleParent);
- }
- }
-
- final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
- final OfficeStyle predefStyle = predefStyles.getStyle(OfficeToken.TABLE_ROW, rowStyle);
- if (predefStyle != null)
- {
- final Element element = predefStyle.getTableRowProperties();
- if (element != null)
- {
- final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
- if (height != null)
- {
- return parseLength(height);
- }
- }
- final String styleParent = predefStyle.getStyleParent();
- if (styleParent != null)
- {
- return computeRowHeight(styleParent);
- }
- }
- // not found.
- return null;
- }
-
- protected CSSNumericValue computeColumnWidth(final String colStyle)
- {
- final OfficeStylesCollection contentStyles = getContentStylesCollection();
- final OfficeStyle style = contentStyles.getStyle(OfficeToken.TABLE_COLUMN, colStyle);
- if (style != null)
- {
- final Element element = style.getTableColumnProperties();
- if (element != null)
- {
- final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "column-width");
- if (height != null)
- {
- return parseLength(height);
- }
- }
-
- final String styleParent = style.getStyleParent();
- if (styleParent != null)
- {
- return computeRowHeight(styleParent);
- }
- }
-
- final OfficeStylesCollection globalStyles = getGlobalStylesCollection();
- final OfficeStyle globalStyle = globalStyles.getStyle(OfficeToken.TABLE_COLUMN, colStyle);
- if (globalStyle != null)
- {
- final Element element = globalStyle.getTableColumnProperties();
- if (element != null)
- {
- final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "column-width");
- if (height != null)
- {
- return parseLength(height);
- }
- }
- final String styleParent = globalStyle.getStyleParent();
- if (styleParent != null)
- {
- return computeRowHeight(styleParent);
- }
- }
-
- final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
- final OfficeStyle predefStyle = predefStyles.getStyle(OfficeToken.TABLE_COLUMN, colStyle);
- if (predefStyle != null)
- {
- final Element element = predefStyle.getTableColumnProperties();
- if (element != null)
- {
- final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "column-width");
- if (height != null)
- {
- return parseLength(height);
- }
- }
- final String styleParent = predefStyle.getStyleParent();
- if (styleParent != null)
- {
- return computeRowHeight(styleParent);
- }
- }
- // not found.
- return null;
- }
-
- protected Element produceFirstChild(final Section style,
- final String nameSpace,
- final String type)
- {
- Element paragraphProps = style.findFirstChild(nameSpace, type);
- if (paragraphProps == null)
- {
- paragraphProps = new Section();
- paragraphProps.setNamespace(nameSpace);
- paragraphProps.setType(type);
- style.addNode(paragraphProps);
- }
- return paragraphProps;
- }
-
- protected void startChartProcessing(final AttributeMap attrs)
- throws ReportProcessingException
- {
- final String classId = (String) attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "class-id");
- final String chartUrl = (String) attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "href");
- final ArrayList masterColumns = (ArrayList) attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, SDBCReportDataFactory.MASTER_COLUMNS);
- final ArrayList masterValues = (ArrayList) attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, SDBCReportDataFactory.MASTER_VALUES);
- final ArrayList detailColumns = (ArrayList) attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, SDBCReportDataFactory.DETAIL_COLUMNS);
- final String href = oleProducer.produceOle(chartUrl, masterColumns, masterValues, detailColumns);
-
- final AttributeList oleList = new AttributeList();
- oleList.setAttribute(OfficeNamespaces.DRAWING_NS, "class-id", classId);
- oleList.setAttribute(OfficeNamespaces.XLINK_NS, "href", "./" + href);
- oleList.setAttribute(OfficeNamespaces.XLINK_NS, "type", "simple");
- oleList.setAttribute(OfficeNamespaces.XLINK_NS, "show", "embed");
- oleList.setAttribute(OfficeNamespaces.XLINK_NS, "actuate", "onLoad");
-
- try
- {
- getXmlWriter().writeTag(OfficeNamespaces.DRAWING_NS, OfficeToken.OBJECT_OLE, oleList, XmlWriterSupport.CLOSE);
- }
- catch (IOException ioe)
- {
- throw new ReportProcessingException(FAILED, ioe);
- }
-
-
- }
-}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/OleProducer.java b/reportdesign/java/com/sun/star/report/pentaho/output/OleProducer.java deleted file mode 100644 index 8a21fbdfc..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/OleProducer.java +++ /dev/null @@ -1,119 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OleProducer.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.output; - -import com.sun.star.report.DataSourceFactory; -import com.sun.star.report.ImageService; -import com.sun.star.report.InputRepository; -import com.sun.star.report.JobProperties; -import com.sun.star.report.OutputRepository; -import com.sun.star.report.ReportEngineParameterNames; -import com.sun.star.report.ReportExecutionException; -import com.sun.star.report.ReportJobDefinition; -import com.sun.star.report.pentaho.DefaultNameGenerator; -import com.sun.star.report.pentaho.PentahoReportEngine; -import com.sun.star.report.pentaho.PentahoReportEngineMetaData; -import java.io.IOException; -import java.util.List; -import org.jfree.util.Log; - -/** - * - * @author Ocke Janssen - */ -public class OleProducer { - - private final InputRepository inputRepository; - private final OutputRepository outputRepository; - private final DefaultNameGenerator nameGenerator; - private final DataSourceFactory dataSourceFactory; - private final ImageService imageService; - - - public OleProducer(final InputRepository inputRepository, - final OutputRepository outputRepository,final ImageService imageService,final DataSourceFactory dataSourceFactory) { - if (inputRepository == null) { - throw new NullPointerException(); - } - if (outputRepository == null) { - throw new NullPointerException(); - } - - this.inputRepository = inputRepository; - this.outputRepository = outputRepository; - this.nameGenerator = new DefaultNameGenerator(outputRepository); - this.dataSourceFactory = dataSourceFactory; - this.imageService = imageService; - } - - String produceOle(final String source,final List masterColumns,final List masterValues,final List detailColumns) { - InputRepository subInputRepository = null; - OutputRepository subOutputRepository = null; - String output = ""; - try { - subInputRepository = inputRepository.openInputRepository(source); - output = nameGenerator.generateStorageName("Object", null); - subOutputRepository = outputRepository.openOutputRepository(output, PentahoReportEngineMetaData.OPENDOCUMENT_CHART); - try { - - final PentahoReportEngine engine = new PentahoReportEngine(); - final ReportJobDefinition definition = engine.createJobDefinition(); - final JobProperties procParms = definition.getProcessingParameters(); - - procParms.setProperty(ReportEngineParameterNames.INPUT_REPOSITORY, subInputRepository); - procParms.setProperty(ReportEngineParameterNames.OUTPUT_REPOSITORY, subOutputRepository); - procParms.setProperty(ReportEngineParameterNames.INPUT_NAME, "content.xml"); - procParms.setProperty(ReportEngineParameterNames.OUTPUT_NAME, "content.xml"); - procParms.setProperty(ReportEngineParameterNames.CONTENT_TYPE, PentahoReportEngineMetaData.OPENDOCUMENT_CHART); - procParms.setProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY, dataSourceFactory); - procParms.setProperty(ReportEngineParameterNames.INPUT_MASTER_COLUMNS, masterColumns); - procParms.setProperty(ReportEngineParameterNames.INPUT_MASTER_VALUES, masterValues); - procParms.setProperty(ReportEngineParameterNames.INPUT_DETAIL_COLUMNS, detailColumns); - procParms.setProperty(ReportEngineParameterNames.IMAGE_SERVICE, imageService); - - engine.createJob(definition).execute(); - } catch (ReportExecutionException ex) { - Log.error("ReportProcessing failed", ex); - } catch (IOException ex) { - Log.error("ReportProcessing failed", ex); - } - } catch (IOException ex) { - Log.error("ReportProcessing failed", ex); - } finally { - if (subInputRepository != null) { - subInputRepository.closeInputRepository(); - } - if (subOutputRepository != null) { - subOutputRepository.closeOutputRepository(); - } - } - return output; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/StyleUtilities.java b/reportdesign/java/com/sun/star/report/pentaho/output/StyleUtilities.java deleted file mode 100644 index c611628b3..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/StyleUtilities.java +++ /dev/null @@ -1,610 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StyleUtilities.java,v $ - * $Revision: 1.9 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.output; - -import java.util.HashSet; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.pentaho.model.DataStyle; -import com.sun.star.report.pentaho.model.FontFaceDeclsSection; -import com.sun.star.report.pentaho.model.FontFaceElement; -import com.sun.star.report.pentaho.model.OfficeStyle; -import com.sun.star.report.pentaho.model.OfficeStyles; -import com.sun.star.report.pentaho.model.OfficeStylesCollection; -import java.util.ArrayList; -import java.util.Set; -import org.jfree.report.ReportProcessingException; -import org.jfree.report.structure.Element; -import org.jfree.report.structure.Section; -import org.jfree.report.util.AttributeNameGenerator; -import org.jfree.util.Log; - -/** - * Todo: Document me! - * - * @author Thomas Morgner - * @since 13.03.2007 - */ -public class StyleUtilities -{ - - private static final String STYLE = "style"; - - private StyleUtilities() - { - } - - /** - * Copies the specififed style (keyed by its family and name) into the current styles collection. This copies the - * style and all inherited styles into the target collection. Inherited common styles will be always be added to the - * common collection (which will be written into the 'styles.xml' later). - * <p/> - * This method does nothing if the specified style already exists in the styles collection. - * - * @param styleFamily the family of the style to copy - * @param styleName the unique name of the style. - * @param stylesCollection the current styles collection - * @param commonCollection the global styles collection - * @param predefCollection the predefined styles from where to copy the styles. - * @throws ReportProcessingException if the style copying failed. - */ - public static void copyStyle(final String styleFamily, - final String styleName, - final OfficeStylesCollection stylesCollection, - final OfficeStylesCollection commonCollection, - final OfficeStylesCollection predefCollection) - throws ReportProcessingException - { - copyStyle(styleFamily, styleName, stylesCollection, - commonCollection, predefCollection, new HashSet()); - } - - /** - * Copies the specififed style (keyed by its family and name) into the current styles collection. This copies the - * style and all inherited styles into the target collection. Inherited common styles will be always be added to the - * common collection (which will be written into the 'styles.xml' later). - * <p/> - * This method does nothing if the specified style already exists in the styles collection. - * - * @param styleFamily the family of the style to copy - * @param styleName the unique name of the style. - * @param stylesCollection the current styles collection - * @param commonCollection the global styles collection - * @param predefCollection the predefined styles from where to copy the styles. - * @param inheritanceTracker a collection of all styles that have been touched. This is used to prevent infinite - * loops and duplicates. - * @throws ReportProcessingException if the style copying failed. - */ - private static void copyStyle(final String styleFamily, - final String styleName, - final OfficeStylesCollection stylesCollection, - final OfficeStylesCollection commonCollection, - final OfficeStylesCollection predefCollection, - final Set inheritanceTracker) - throws ReportProcessingException - { - if (inheritanceTracker.contains(styleName)) - { - return; - } - inheritanceTracker.add(styleName); - - if (stylesCollection.containsStyle(styleFamily, styleName) || - commonCollection.getCommonStyles().containsStyle(styleFamily, styleName)) - { - // fine, there's already a copy of the stylesheet. - return; - } - - final OfficeStyle predefCommonStyle = - predefCollection.getCommonStyles().getStyle(styleFamily, styleName); - if (predefCommonStyle != null) - { - // so we have an style from the predefined collection. - // copy it an add it to the current stylescollection - final OfficeStyles commonStyles = commonCollection.getCommonStyles(); - - copyStyleInternal(predefCommonStyle, commonStyles, stylesCollection, - commonCollection, predefCollection, styleFamily, inheritanceTracker); - return; - } - - final OfficeStyle predefAutoStyle = - predefCollection.getAutomaticStyles().getStyle(styleFamily, styleName); - if (predefAutoStyle != null) - { - // so we have an style from the predefined collection. - // copy it an add it to the current stylescollection - final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles(); - copyStyleInternal(predefAutoStyle, autoStyles, stylesCollection, - commonCollection, predefCollection, styleFamily, inheritanceTracker); - return; - } - - // There is no automatic style either. Now this means that someone - // messed up the fileformat. Lets create a new empty style for this. - final OfficeStyle autostyle = new OfficeStyle(); - autostyle.setNamespace(OfficeNamespaces.STYLE_NS); - autostyle.setType(STYLE); - autostyle.setStyleFamily(styleFamily); - autostyle.setStyleName(styleName); - - final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles(); - autoStyles.addStyle(autostyle); - } - - private static OfficeStyle copyStyleInternal( - final OfficeStyle predefCommonStyle, - final OfficeStyles styles, - final OfficeStylesCollection stylesCollection, - final OfficeStylesCollection commonCollection, - final OfficeStylesCollection predefCollection, - final String styleFamily, - final Set inheritanceTracker) - throws ReportProcessingException - { - try - { - final OfficeStyle preStyle = (OfficeStyle) predefCommonStyle.clone(); - styles.addStyle(preStyle); - performFontFaceProcessing(preStyle, stylesCollection, predefCollection); - performDataStyleProcessing(preStyle, stylesCollection, predefCollection); - - // Lookup the parent style .. - final String styleParent = preStyle.getStyleParent(); - final OfficeStyle inherited = - stylesCollection.getStyle(styleFamily, styleParent); - if (inherited != null) - { - // OK, recurse (and hope that we dont run into an infinite loop) .. - copyStyle(styleFamily, styleParent, stylesCollection, - commonCollection, predefCollection, inheritanceTracker); - } - else if (styleParent != null) - { - Log.warn("Inconsistent styles: " + styleFamily + ":" + styleParent + " does not exist."); - } - return preStyle; - } catch (CloneNotSupportedException e) - { - throw new ReportProcessingException("Failed to derive a stylesheet", e); - } - } - - private static void performFontFaceProcessing(final OfficeStyle style, - final OfficeStylesCollection stylesCollection, - final OfficeStylesCollection predefCollection) - throws ReportProcessingException - { - final Element textProperties = style.getTextProperties(); - if (textProperties == null) - { - return; - } - - try - { - final FontFaceDeclsSection currentFonts = stylesCollection.getFontFaceDecls(); - final FontFaceDeclsSection predefFonts = predefCollection.getFontFaceDecls(); - - final String fontName = (String) textProperties.getAttribute(OfficeNamespaces.STYLE_NS, "font-name"); - if (fontName != null && !currentFonts.containsFont(fontName)) - { - final FontFaceElement element = predefFonts.getFontFace(fontName); - if (element != null) - { - currentFonts.addFontFace((FontFaceElement) element.clone()); - } - } - - final String fontNameAsian = (String) textProperties.getAttribute(OfficeNamespaces.STYLE_NS, - "font-name-asian"); - if (fontNameAsian != null && !currentFonts.containsFont(fontNameAsian)) - { - final FontFaceElement element = predefFonts.getFontFace( - fontNameAsian); - if (element != null) - { - currentFonts.addFontFace((FontFaceElement) element.clone()); - } - } - - final String fontNameComplex = (String) textProperties.getAttribute(OfficeNamespaces.STYLE_NS, - "font-name-complex"); - if (fontNameComplex != null && !currentFonts.containsFont(fontNameComplex)) - { - final FontFaceElement element = predefFonts.getFontFace( - fontNameComplex); - if (element != null) - { - currentFonts.addFontFace((FontFaceElement) element.clone()); - } - } - } catch (CloneNotSupportedException e) - { - throw new ReportProcessingException("Failed to clone font-face element"); - } - } - - private static void performDataStyleProcessing(final OfficeStyle style, - final OfficeStylesCollection stylesCollection, - final OfficeStylesCollection predefCollection) - throws ReportProcessingException - { - final Section derivedStyle = performDataStyleProcessing(style, stylesCollection, predefCollection, "data-style-name"); - if (derivedStyle != null) - { - try - { - final Section styleMap = (Section) derivedStyle.findFirstChild(OfficeNamespaces.STYLE_NS,"map"); - if (styleMap != null) - { - performDataStyleProcessing(styleMap, stylesCollection, predefCollection, "apply-style-name"); - } - } catch (Exception e) - { - } - } - } - - private static Section performDataStyleProcessing(final Section style, - final OfficeStylesCollection stylesCollection, - final OfficeStylesCollection predefCollection, - final String attributeName) - throws ReportProcessingException - { - final Object attribute = style.getAttribute(OfficeNamespaces.STYLE_NS, attributeName); - final DataStyle derivedStyle; - if (attribute != null) - { - final String styleName = String.valueOf(attribute); - if (!stylesCollection.getAutomaticStyles().containsDataStyle(styleName) && - !stylesCollection.getCommonStyles().containsDataStyle(styleName)) - { - try - { - final OfficeStyles automaticStyles = predefCollection.getAutomaticStyles(); - final DataStyle autoDataStyle = automaticStyles.getDataStyle(styleName); - if (autoDataStyle != null) - { - derivedStyle = (DataStyle) autoDataStyle.clone(); - stylesCollection.getAutomaticStyles().addDataStyle(derivedStyle); - } - else - { - final OfficeStyles commonStyles = predefCollection.getCommonStyles(); - final DataStyle commonDataStyle = commonStyles.getDataStyle(styleName); - if (commonDataStyle != null) - { - derivedStyle = (DataStyle) commonDataStyle.clone(); - stylesCollection.getCommonStyles().addDataStyle(derivedStyle); - } - else - { - Log.warn("Dangling data style: " + styleName); - derivedStyle = null; - } - } - } catch (CloneNotSupportedException e) - { - throw new ReportProcessingException("Failed to copy style. This should not have happened."); - } - } - else - { - derivedStyle = null; - } - } - else - { - derivedStyle = null; - } - return derivedStyle; - } - - /** - * Derives the named style. If the style is a common style, a new automatic style is generated and inserted into the - * given stylesCollection. If the named style is an automatic style, the style is copied and inserted as new automatic - * style. - * <p/> - * After the style has been created, the style's inheritance hierarchy will be copied as well. - * <p/> - * If there is no style with the given name and family, a new empty automatic style will be created. - * - * @param styleFamily the family of the style to copy - * @param styleName the unique name of the style. - * @param stylesCollection the current styles collection - * @param commonCollection the global styles collection - * @param predefCollection the predefined styles from where to copy the styles. - * @param generator the style-name-generator of the current report-target - * @return the derived style instance. - * @throws ReportProcessingException if the style copying failed. - */ - public static OfficeStyle deriveStyle(final String styleFamily, - final String styleName, - final OfficeStylesCollection stylesCollection, - final OfficeStylesCollection commonCollection, - final OfficeStylesCollection predefCollection, - final AttributeNameGenerator generator) - throws ReportProcessingException - { - if (styleFamily == null) - { - throw new NullPointerException("StyleFamily must not be null"); - } - if (styleName != null) - { - - final OfficeStyle currentAuto = - stylesCollection.getAutomaticStyles().getStyle(styleFamily, - styleName); - if (currentAuto != null) - { - // handle an automatic style .. - final OfficeStyle derivedStyle = - deriveAutomaticStyle(currentAuto, styleFamily, styleName, - generator, commonCollection, predefCollection); - stylesCollection.getAutomaticStyles().addStyle(derivedStyle); - return derivedStyle; - } - - final OfficeStyle currentCommon = - stylesCollection.getCommonStyles().getStyle(styleFamily, styleName); - if (currentCommon != null) - { - // handle an common style .. - final OfficeStyle derivedStyle = - deriveCommonStyle(currentCommon, styleFamily, styleName, - generator, commonCollection, predefCollection); - stylesCollection.getAutomaticStyles().addStyle(derivedStyle); - return derivedStyle; - } - -// final OfficeStyle commonAuto = -// commonCollection.getAutomaticStyles().getStyle(styleFamily, -// styleName); -// if (commonAuto != null) -// { -// // handle an automatic style .. -// final OfficeStyle derivedStyle = -// deriveAutomaticStyle(commonAuto, styleFamily, styleName, -// generator, commonCollection, predefCollection); -// stylesCollection.getAutomaticStyles().addStyle(derivedStyle); -// return derivedStyle; -// } - - final OfficeStyle commonCommon = - commonCollection.getCommonStyles().getStyle(styleFamily, styleName); - if (commonCommon != null) - { - // handle an common style .. - final OfficeStyle derivedStyle = - deriveCommonStyle(commonCommon, styleFamily, styleName, - generator, commonCollection, predefCollection); - stylesCollection.getAutomaticStyles().addStyle(derivedStyle); - return derivedStyle; - } - - final OfficeStyle predefAuto = - predefCollection.getAutomaticStyles().getStyle(styleFamily, - styleName); - if (predefAuto != null) - { - // handle an automatic style .. - final OfficeStyle derivedStyle = - deriveAutomaticStyle(predefAuto, styleFamily, styleName, - generator, commonCollection, predefCollection); - stylesCollection.getAutomaticStyles().addStyle(derivedStyle); - return derivedStyle; - } - - final OfficeStyle predefCommon = - predefCollection.getCommonStyles().getStyle(styleFamily, styleName); - if (predefCommon != null) - { - // handle an common style .. - final OfficeStyle derivedStyle = - deriveCommonStyle(predefCommon, styleFamily, styleName, - generator, commonCollection, predefCollection); - stylesCollection.getAutomaticStyles().addStyle(derivedStyle); - return derivedStyle; - } - } - - // No such style. Create a new one .. - final OfficeStyle autostyle = new OfficeStyle(); - autostyle.setNamespace(OfficeNamespaces.STYLE_NS); - autostyle.setType(STYLE); - autostyle.setStyleFamily(styleFamily); - if (styleName != null) - { - autostyle.setStyleName(styleName); - } - else - { - autostyle.setStyleName(generator.generateName("derived_anonymous")); - } - - final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles(); - autoStyles.addStyle(autostyle); - return autostyle; - } - - private static OfficeStyle deriveCommonStyle(final OfficeStyle commonStyle, - final String styleFamily, - final String styleName, - final AttributeNameGenerator nameGenerator, - final OfficeStylesCollection commonCollection, - final OfficeStylesCollection predefCollection) - throws ReportProcessingException - { - final OfficeStyle autostyle = new OfficeStyle(); - autostyle.setNamespace(OfficeNamespaces.STYLE_NS); - autostyle.setType(STYLE); - autostyle.setStyleFamily(styleFamily); - autostyle.setStyleName(nameGenerator.generateName("derived_" + styleName)); - autostyle.setStyleParent(styleName); - - // now copy the common style .. - final OfficeStyles commonStyles = commonCollection.getCommonStyles(); - if (!commonStyles.containsStyle(styleFamily, styleName)) - { - copyStyleInternal(commonStyle, commonStyles, - commonCollection, commonCollection, predefCollection, - styleFamily, new HashSet()); - } - return autostyle; - } - - private static OfficeStyle deriveAutomaticStyle(final OfficeStyle commonStyle, - final String styleFamily, - final String styleName, - final AttributeNameGenerator nameGenerator, - final OfficeStylesCollection commonCollection, - final OfficeStylesCollection predefCollection) - throws ReportProcessingException - { - try - { - final OfficeStyle autostyle = (OfficeStyle) commonStyle.clone(); - autostyle.setNamespace(OfficeNamespaces.STYLE_NS); - autostyle.setType(STYLE); - autostyle.setStyleFamily(styleFamily); - autostyle.setStyleName(nameGenerator.generateName("derived_auto_" + styleName)); - - - final String parent = autostyle.getStyleParent(); - if (parent != null) - { - copyStyle(styleFamily, parent, commonCollection, commonCollection, - predefCollection); - } - return autostyle; - } catch (CloneNotSupportedException e) - { - throw new ReportProcessingException( - "Deriving the style failed. Clone error: ", e); - } - } - - public static String queryStyle(final OfficeStylesCollection predefCollection, - final String styleFamily, - final String styleName, - final String sectionName, - final String propertyNamespace, - final String propertyName) - { - return queryStyle(predefCollection, styleFamily, - styleName, sectionName, propertyNamespace, propertyName, new HashSet()); - } - - public static OfficeStyle queryStyleByProperties(final OfficeStylesCollection predefCollection, - final String styleFamily, - final String sectionName, - final ArrayList propertyNamespace, - final ArrayList propertyName, - final ArrayList propertyValues) - { - if (propertyNamespace.size() != propertyName.size()) - { - return null; - } - final OfficeStyle[] styles = predefCollection.getAutomaticStyles().getAllStyles(); - for (int i = 0; i < styles.length; i++) - { - final OfficeStyle officeStyle = styles[i]; - if (officeStyle.getStyleFamily().equals(styleFamily)) - { - final Element section = officeStyle.findFirstChild(OfficeNamespaces.STYLE_NS, sectionName); - if (section != null) - { - int j = 0; - for (; j < propertyNamespace.size(); j++) - { - final String ns = (String) propertyNamespace.get(j); - final String prop = (String) propertyName.get(j); - final Object obj = section.getAttribute(ns, prop); - final Object value = propertyValues.get(j); - if (obj == null || value == null) - { - continue; - } - if (!propertyValues.get(j).equals(obj)) - { - break; - } - } - if (j == propertyName.size()) - { - return officeStyle; - } - } - } - } - return null; - } - - private static String queryStyle(final OfficeStylesCollection predefCollection, - final String styleFamily, - final String styleName, - final String sectionName, - final String propertyNamespace, - final String propertyName, - final Set seenStyles) - { - if (seenStyles.contains(styleName)) - { - return null; - } - seenStyles.add(styleName); - - final OfficeStyle style = predefCollection.getStyle(styleFamily, styleName); - if (style == null) - { - return null; // no such style - - } - final Element section = style.findFirstChild(OfficeNamespaces.STYLE_NS, sectionName); - if (section != null) - { - final Object attribute = section.getAttribute(propertyNamespace, propertyName); - if (attribute != null) - { - return String.valueOf(attribute); - } - } - final String parent = style.getStyleParent(); - if (parent == null) - { - return null; - } - return queryStyle(predefCollection, styleFamily, parent, sectionName, propertyNamespace, propertyName, seenStyles); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/StylesWriter.java b/reportdesign/java/com/sun/star/report/pentaho/output/StylesWriter.java deleted file mode 100644 index 217b77dd0..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/StylesWriter.java +++ /dev/null @@ -1,374 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StylesWriter.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.output; - -import java.io.IOException; -import java.io.Writer; -import java.util.Iterator; -import java.util.Map; -import java.util.TreeMap; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.pentaho.model.FontFaceDeclsSection; -import com.sun.star.report.pentaho.model.FontFaceElement; -import com.sun.star.report.pentaho.model.OfficeStyle; -import com.sun.star.report.pentaho.model.OfficeStyles; -import com.sun.star.report.pentaho.model.OfficeStylesCollection; -import com.sun.star.report.pentaho.model.OfficeMasterStyles; -import com.sun.star.report.pentaho.model.OfficeMasterPage; -import com.sun.star.report.pentaho.model.DataStyle; -import com.sun.star.report.pentaho.model.PageLayout; -import com.sun.star.report.pentaho.model.RawText; -import org.jfree.layouting.namespace.Namespaces; -import org.jfree.layouting.util.AttributeMap; -import org.jfree.report.JFreeReportBoot; -import org.jfree.report.JFreeReportInfo; -import org.jfree.report.ReportProcessingException; -import org.jfree.report.structure.Element; -import org.jfree.report.structure.Node; -import org.jfree.report.structure.Section; -import org.jfree.report.structure.StaticText; -import org.jfree.xmlns.common.AttributeList; -import org.jfree.xmlns.writer.DefaultTagDescription; -import org.jfree.xmlns.writer.XmlWriter; -import org.jfree.xmlns.writer.XmlWriterSupport; - -/** - * This class writes the style collection into a 'styles.xml' document. - * - * @author Thomas Morgner - * @since 09.03.2007 - */ -public class StylesWriter -{ - private final XmlWriter xmlWriter; - private final boolean writeOpeningTag; - - public StylesWriter(final Writer writer) - { - final DefaultTagDescription tagDescription = new DefaultTagDescription(); - tagDescription.configure (JFreeReportBoot.getInstance().getGlobalConfig(), - OfficeDocumentReportTarget.TAG_DEF_PREFIX); - - this.xmlWriter = new XmlWriter(writer, tagDescription); - this.xmlWriter.setAlwaysAddNamespace(true); - this.writeOpeningTag = true; - } - - public StylesWriter(final XmlWriter xmlWriter) - { - this.xmlWriter = xmlWriter; - this.writeOpeningTag = false; - } - - public void writeContentStyles (final OfficeStylesCollection predefined, - final OfficeStylesCollection globals) - throws IOException, ReportProcessingException - { - writeFontFaces(new OfficeStylesCollection[] { globals }); - writeAutomaticStylesSection(new OfficeStylesCollection[] { globals }); - } - - public void writeGlobalStyles (final OfficeStylesCollection predefined, - final OfficeStylesCollection globals) - throws IOException, ReportProcessingException - { - if (writeOpeningTag) - { - performWriteRootTag(); - } - - writeFontFaces(new OfficeStylesCollection[] { globals }); - writeAutomaticStylesSection(new OfficeStylesCollection[] { globals }); - writeCommonStylesSection(new OfficeStylesCollection[] { globals }); - writeMasterStylesSection(new OfficeStylesCollection[] { globals }); - - if (writeOpeningTag) - { - xmlWriter.writeCloseTag(); - } - } - - private void writeMasterStylesSection(final OfficeStylesCollection[] osc) - throws IOException - { - xmlWriter.writeTag - (OfficeNamespaces.OFFICE_NS, "master-styles", XmlWriterSupport.OPEN); - for (int sci = 0; sci < osc.length; sci++) - { - final OfficeStylesCollection collection = osc[sci]; - final OfficeMasterStyles officeStyles = collection.getMasterStyles(); - final OfficeMasterPage[] officeMasterPages = officeStyles.getAllMasterPages(); - for (int i = 0; i < officeMasterPages.length; i++) - { - final OfficeMasterPage masterPage = officeMasterPages[i]; - writeSection(masterPage); - } - - writeSectionChilds(officeStyles.getOtherNodes().getNodeArray()); - } - - xmlWriter.writeCloseTag(); - } - - private void writeCommonStylesSection(final OfficeStylesCollection[] osc) - throws IOException - { - xmlWriter.writeTag - (OfficeNamespaces.OFFICE_NS, "styles", XmlWriterSupport.OPEN); - - for (int sci = 0; sci < osc.length; sci++) - { - final OfficeStylesCollection collection = osc[sci]; - final OfficeStyles officeStyles = collection.getCommonStyles(); - writeStyles(officeStyles); - } - - xmlWriter.writeCloseTag(); - } - - private void writeAutomaticStylesSection(final OfficeStylesCollection[] osc) - throws IOException - { - xmlWriter.writeTag - (OfficeNamespaces.OFFICE_NS, "automatic-styles", XmlWriterSupport.OPEN); - for (int sci = 0; sci < osc.length; sci++) - { - final OfficeStylesCollection collection = osc[sci]; - final OfficeStyles officeStyles = collection.getAutomaticStyles(); - writeStyles(officeStyles); - } - - xmlWriter.writeCloseTag(); - } - - private void writeFontFaces(final OfficeStylesCollection[] osc) - throws IOException - { - xmlWriter.writeTag - (OfficeNamespaces.OFFICE_NS, "font-face-decls", XmlWriterSupport.OPEN); - - final TreeMap fontFaces = new TreeMap(); - for (int sci = 0; sci < osc.length; sci++) - { - final OfficeStylesCollection collection = osc[sci]; - final FontFaceDeclsSection fontFaceDecls = collection.getFontFaceDecls(); - final FontFaceElement[] fontFaceElements = fontFaceDecls.getAllFontFaces(); - for (int i = 0; i < fontFaceElements.length; i++) - { - final FontFaceElement element = fontFaceElements[i]; - fontFaces.put (element.getStyleName(), element); - } - } - - final Iterator values = fontFaces.values().iterator(); - while (values.hasNext()) - { - final FontFaceElement element = (FontFaceElement) values.next(); - writeElement(element); - } - - xmlWriter.writeCloseTag(); - } - - private void writeStyles (final OfficeStyles styles) - throws IOException - { - final OfficeStyle[] allStyles = styles.getAllStyles(); - for (int i = 0; i < allStyles.length; i++) - { - final OfficeStyle style = allStyles[i]; - writeSection(style); - } - - final DataStyle[] allDataStyles = styles.getAllDataStyles(); - for (int i = 0; i < allDataStyles.length; i++) - { - final DataStyle style = allDataStyles[i]; - writeSection(style); - } - - final PageLayout[] allPageStyles = styles.getAllPageStyles(); - for (int i = 0; i < allPageStyles.length; i++) - { - final PageLayout style = allPageStyles[i]; - writeSection(style); - } - - writeSectionChilds(styles.getOtherStyles()); - } - - private void writeElement (final Element element) - throws IOException - { - final String type = element.getType(); - final String namespace = element.getNamespace(); - final AttributeList attrList = buildAttributeList(element.getAttributeMap()); - xmlWriter.writeTag(namespace, type, attrList, XmlWriterSupport.CLOSE); - } - - private void writeSection (final Section section) - throws IOException - { - final String type = section.getType(); - final String namespace = section.getNamespace(); - final AttributeList attrList = buildAttributeList(section.getAttributeMap()); - if (section.getNodeCount() == 0) - { - xmlWriter.writeTag(namespace, type, attrList, XmlWriterSupport.CLOSE); - return; - } - - xmlWriter.writeTag(namespace, type, attrList, XmlWriterSupport.OPEN); - writeSectionChilds(section.getNodeArray()); - - xmlWriter.writeCloseTag(); - } - - private void writeSectionChilds(final Node[] nodes) - throws IOException - { - for (int i = 0; i < nodes.length; i++) - { - final Node node = nodes[i]; - if (node instanceof Section) - { - writeSection((Section) node); - } - else if (node instanceof Element) - { - writeElement((Element) node); - } - else if (node instanceof RawText) - { - final RawText text = (RawText) node; - xmlWriter.writeText(text.getText()); - } - else if (node instanceof StaticText) - { - final StaticText text = (StaticText) node; - xmlWriter.writeText(XmlWriterSupport.normalize(text.getText(), false)); - } - } - } - - protected AttributeList buildAttributeList(final AttributeMap attrs) - { - final AttributeList attrList = new AttributeList(); - final String[] namespaces = attrs.getNameSpaces(); - for (int i = 0; i < namespaces.length; i++) - { - final String attrNamespace = namespaces[i]; - if (isFilteredNamespace(attrNamespace)) - { - continue; - } - - final Map localAttributes = attrs.getAttributes(attrNamespace); - final Iterator entries = localAttributes.entrySet().iterator(); - while (entries.hasNext()) - { - final Map.Entry entry = (Map.Entry) entries.next(); - final String key = String.valueOf(entry.getKey()); - attrList.setAttribute(attrNamespace, key, String.valueOf(entry.getValue())); - } - } - return attrList; - } - - protected boolean isFilteredNamespace(final String namespace) - { - if (Namespaces.LIBLAYOUT_NAMESPACE.equals(namespace)) - { - return true; - } - if (JFreeReportInfo.REPORT_NAMESPACE.equals(namespace)) - { - return true; - } - if (JFreeReportInfo.COMPATIBILITY_NAMESPACE.equals(namespace)) - { - return true; - } - if (OfficeNamespaces.OOREPORT_NS.equals(namespace)) - { - return true; - } - return false; - } - - private void performWriteRootTag() - throws IOException - { - final AttributeList rootAttributes = new AttributeList(); - rootAttributes.addNamespaceDeclaration("office", - OfficeNamespaces.OFFICE_NS); - rootAttributes.addNamespaceDeclaration("style", OfficeNamespaces.STYLE_NS); - rootAttributes.addNamespaceDeclaration("text", OfficeNamespaces.TEXT_NS); - rootAttributes.addNamespaceDeclaration("table", OfficeNamespaces.TABLE_NS); - rootAttributes.addNamespaceDeclaration("draw", OfficeNamespaces.DRAWING_NS); - rootAttributes.addNamespaceDeclaration("fo", OfficeNamespaces.FO_NS); - rootAttributes.addNamespaceDeclaration("xlink", OfficeNamespaces.XLINK_NS); - rootAttributes.addNamespaceDeclaration("dc", OfficeNamespaces.PURL_NS); - rootAttributes.addNamespaceDeclaration("meta", OfficeNamespaces.META_NS); - rootAttributes.addNamespaceDeclaration("number", - OfficeNamespaces.DATASTYLE_NS); - rootAttributes.addNamespaceDeclaration("svg", OfficeNamespaces.SVG_NS); - rootAttributes.addNamespaceDeclaration("chart", OfficeNamespaces.CHART_NS); - rootAttributes.addNamespaceDeclaration("dr3d", OfficeNamespaces.DR3D_NS); - rootAttributes.addNamespaceDeclaration("math", OfficeNamespaces.MATHML_NS); - rootAttributes.addNamespaceDeclaration("form", OfficeNamespaces.FORM_NS); - rootAttributes.addNamespaceDeclaration("script", - OfficeNamespaces.SCRIPT_NS); - rootAttributes.addNamespaceDeclaration("ooo", OfficeNamespaces.OO2004_NS); - rootAttributes.addNamespaceDeclaration("ooow", OfficeNamespaces.OOW2004_NS); - rootAttributes.addNamespaceDeclaration("oooc", OfficeNamespaces.OOC2004_NS); - rootAttributes.addNamespaceDeclaration("dom", - OfficeNamespaces.XML_EVENT_NS); - rootAttributes.addNamespaceDeclaration("xforms", - OfficeNamespaces.XFORMS_NS); - rootAttributes.addNamespaceDeclaration("xsd", OfficeNamespaces.XSD_NS); - rootAttributes.addNamespaceDeclaration("xsi", OfficeNamespaces.XSI_NS); - rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.0"); - - this.xmlWriter.writeXmlDeclaration("UTF-8"); - this.xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, - "document-content", rootAttributes, XmlWriterSupport.OPEN); - } - - public void close() - throws IOException - { - xmlWriter.close(); - } - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/chart/ChartRawReportProcessor.java b/reportdesign/java/com/sun/star/report/pentaho/output/chart/ChartRawReportProcessor.java deleted file mode 100644 index a3895d686..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/chart/ChartRawReportProcessor.java +++ /dev/null @@ -1,107 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ChartRawReportProcessor.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.output.chart; - -import com.sun.star.report.DataSourceFactory; -import com.sun.star.report.ImageService; -import com.sun.star.report.InputRepository; -import com.sun.star.report.OutputRepository; -import org.jfree.report.DataSourceException; -import org.jfree.report.ReportDataFactoryException; -import org.jfree.report.ReportProcessingException; -import org.jfree.report.flow.ReportJob; -import org.jfree.report.flow.ReportStructureRoot; -import org.jfree.report.flow.ReportTarget; -import org.jfree.report.flow.SinglePassReportProcessor; -import org.jfree.resourceloader.ResourceManager; - -/** - * - * @author Ocke Janssen - */ -public class ChartRawReportProcessor extends SinglePassReportProcessor -{ - - private final OutputRepository outputRepository; - private final String targetName; - private final InputRepository inputRepository; - private final ImageService imageService; - private final DataSourceFactory dataSourceFactory; - - public ChartRawReportProcessor(final InputRepository inputRepository, - final OutputRepository outputRepository, - final String targetName, - final ImageService imageService, - final DataSourceFactory dataSourceFactory) - { - if (inputRepository == null) - { - throw new NullPointerException(); - } - if (outputRepository == null) - { - throw new NullPointerException(); - } - if (targetName == null) - { - throw new NullPointerException(); - } - if (imageService == null) - { - throw new NullPointerException(); - } - if (dataSourceFactory == null) - { - throw new NullPointerException(); - } - this.targetName = targetName; - this.inputRepository = inputRepository; - this.outputRepository = outputRepository; - this.imageService = imageService; - this.dataSourceFactory = dataSourceFactory; - } - - protected ReportTarget createReportTarget(final ReportJob job) - throws ReportProcessingException - { - final ReportStructureRoot report = job.getReportStructureRoot(); - final ResourceManager resourceManager = report.getResourceManager(); - - return new ChartRawReportTarget(job, resourceManager, report.getBaseResource(), - inputRepository, outputRepository, targetName, imageService, dataSourceFactory); - } - - public void processReport(final ReportJob job) throws ReportDataFactoryException, DataSourceException, - ReportProcessingException - { - final ReportTarget reportTarget = createReportTarget(job); - processReportRun(job, reportTarget); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java b/reportdesign/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java deleted file mode 100644 index 2d2050a7c..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java +++ /dev/null @@ -1,258 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ChartRawReportTarget.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.output.chart; - -import com.sun.star.report.DataSourceFactory; -import com.sun.star.report.ImageService; -import com.sun.star.report.InputRepository; -import com.sun.star.report.OutputRepository; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import com.sun.star.report.pentaho.PentahoReportEngineMetaData; -import com.sun.star.report.pentaho.output.OfficeDocumentReportTarget; -import java.io.IOException; -import org.jfree.layouting.util.AttributeMap; -import org.jfree.report.DataFlags; -import org.jfree.report.DataSourceException; -import org.jfree.report.ReportProcessingException; -import org.jfree.report.flow.ReportJob; -import org.jfree.report.flow.ReportTargetUtil; -import org.jfree.resourceloader.ResourceKey; -import org.jfree.resourceloader.ResourceManager; -import org.jfree.util.Log; -import org.jfree.util.PrintStreamLogTarget; -import org.jfree.xmlns.common.AttributeList; -import org.jfree.xmlns.writer.XmlWriter; -import org.jfree.xmlns.writer.XmlWriterSupport; - -/** - * - * @author Ocke Janssen - */ -public class ChartRawReportTarget extends OfficeDocumentReportTarget -{ - - private boolean inFilterElements = false; - private boolean tableRowsStarted = false; - private int tableCount = 0; - private int closeTags = 0; - - public ChartRawReportTarget(final ReportJob reportJob, - final ResourceManager resourceManager, - final ResourceKey baseResource, - final InputRepository inputRepository, - final OutputRepository outputRepository, - final String target, - final ImageService imageService, - final DataSourceFactory dataSourceFactory) - throws ReportProcessingException - { - super(reportJob, resourceManager, baseResource, inputRepository, outputRepository, target, imageService, dataSourceFactory); - } - - protected String getTargetMimeType() - { - return "application/vnd.oasis.opendocument.chart"; - } - - protected String getStartContent() - { - return "chart"; - } - - public String getExportDescriptor() - { - return "raw/" + PentahoReportEngineMetaData.OPENDOCUMENT_CHART; - } - - protected void startContent(final AttributeMap attrs) throws IOException, DataSourceException, ReportProcessingException - { - inFilterElements = false; - closeTags = 0; - tableCount = 0; - final XmlWriter xmlWriter = getXmlWriter(); - xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, getStartContent(), null, XmlWriterSupport.OPEN); - ++closeTags; - } - - protected void endContent(final AttributeMap attrs) throws IOException, DataSourceException, ReportProcessingException - { - final XmlWriter xmlWriter = getXmlWriter(); - //xmlWriter.writeCloseTag(); - while (closeTags > 0) - { - xmlWriter.writeCloseTag(); - --closeTags; - } - } - - protected void startReportSection(final AttributeMap attrs, final int role) - throws IOException, DataSourceException, ReportProcessingException - { - } - - protected void endReportSection(final AttributeMap attrs, final int role) - throws IOException, DataSourceException, ReportProcessingException - { - } - - protected void startOther(final AttributeMap attrs) throws IOException, DataSourceException, ReportProcessingException - { - final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs); - if (!isFilteredNamespace(namespace)) - { - final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs); - try - { - processElement(attrs, namespace, elementType); - } - catch (IOException e) - { - throw new ReportProcessingException("Failed", e); - } - } - } - - private boolean isFiltered(final String elementType) - { - return OfficeToken.TABLE_HEADER_COLUMNS.equals(elementType) || - OfficeToken.TABLE_HEADER_ROWS.equals(elementType) || - OfficeToken.TABLE_COLUMNS.equals(elementType); - } - - protected void endOther(final AttributeMap attrs) throws IOException, DataSourceException, ReportProcessingException - { - if ( tableRowsStarted && getCurrentRole() == ROLE_TEMPLATE) - { - return; - } - final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs); - if (!isFilteredNamespace(namespace)) - { - final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs); - // if this is the report namespace, write out a table definition .. - if (OfficeNamespaces.TABLE_NS.equals(namespace)) - { - if (OfficeToken.TABLE.equals(elementType) || - OfficeToken.TABLE_ROWS.equals(elementType)) - { - return; - } - else if (isFiltered(elementType)) - { - inFilterElements = false; - if (tableCount > 1) - { - return; - } - } - } - else if (OfficeNamespaces.CHART_NS.equals(namespace) && "chart".equals(elementType)) - { - return; - } - if (inFilterElements && tableCount > 1) - { - return; - } - final XmlWriter xmlWriter = getXmlWriter(); - xmlWriter.writeCloseTag(); - --closeTags; - } - } - - public void processContent(final DataFlags value) - throws DataSourceException, ReportProcessingException - { - if ( !(tableRowsStarted && getCurrentRole() == ROLE_TEMPLATE)) - { - super.processContent(value); - } - } - - private void processElement(final AttributeMap attrs, final String namespace, final String elementType) - throws IOException, ReportProcessingException - { - if ( tableRowsStarted && getCurrentRole() == ROLE_TEMPLATE) - { - return; - } - if (OfficeNamespaces.TABLE_NS.equals(namespace)) - { - if (OfficeToken.TABLE.equals(elementType)) - { - tableCount += 1; - if (tableCount > 1) - { - return; - } - } - else if (OfficeToken.TABLE_ROWS.equals(elementType)) - { - if (tableCount > 1) - { - return; - } - tableRowsStarted = true; - } - else if (isFiltered(elementType)) - { - inFilterElements = true; - if (tableCount > 1) - { - return; - } - } - } - if (inFilterElements && tableCount > 1) - { - return; - } - - // All styles have to be processed or you will loose the paragraph-styles and inline text-styles. - // .. - performStyleProcessing(attrs); - - final AttributeList attrList = buildAttributeList(attrs); - final XmlWriter xmlWriter = getXmlWriter(); - xmlWriter.writeTag(namespace, elementType, attrList, XmlWriter.OPEN); - ++closeTags; - // System.out.println("elementType = " + elementType); - } - // ///////////////////////////////////////////////////////////////////////// - public void processText(final String text) throws DataSourceException, ReportProcessingException - { - if (inFilterElements && tableCount > 1) - { - return; - } - super.processText(text); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportProcessor.java b/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportProcessor.java deleted file mode 100644 index 8da7088e3..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportProcessor.java +++ /dev/null @@ -1,122 +0,0 @@ -/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: SpreadsheetRawReportProcessor.java,v $
- * $Revision: 1.7 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package com.sun.star.report.pentaho.output.spreadsheet;
-
-import com.sun.star.report.DataSourceFactory;
-import org.jfree.report.DataSourceException;
-import org.jfree.report.ReportDataFactoryException;
-import org.jfree.report.ReportProcessingException;
-import org.jfree.report.flow.AbstractReportProcessor;
-import org.jfree.report.flow.ReportJob;
-import org.jfree.report.flow.ReportStructureRoot;
-import org.jfree.report.flow.ReportTarget;
-import org.jfree.resourceloader.ResourceManager;
-import com.sun.star.report.OutputRepository;
-import com.sun.star.report.InputRepository;
-import com.sun.star.report.ImageService;
-import com.sun.star.report.pentaho.PentahoFormulaContext;
-import org.jfree.report.data.ReportContextImpl;
-import org.jfree.report.flow.ReportContext;
-
-/**
- * @author Michael D'Amour
- */
-public class SpreadsheetRawReportProcessor extends AbstractReportProcessor
-{
-
- private final OutputRepository outputRepository;
- private final String targetName;
- private final InputRepository inputRepository;
- private final ImageService imageService;
- private final DataSourceFactory dataSourceFactory;
-
- public SpreadsheetRawReportProcessor(final InputRepository inputRepository,
- final OutputRepository outputRepository,
- final String targetName,
- final ImageService imageService,
- final DataSourceFactory dataSourceFactory)
- {
- if (outputRepository == null)
- {
- throw new NullPointerException();
- }
- if (targetName == null)
- {
- throw new NullPointerException();
- }
- if (imageService == null)
- {
- throw new NullPointerException();
- }
- if (inputRepository == null)
- {
- throw new NullPointerException();
- }
- if (dataSourceFactory == null)
- {
- throw new NullPointerException();
- }
-
- this.targetName = targetName;
- this.inputRepository = inputRepository;
- this.outputRepository = outputRepository;
- this.imageService = imageService;
- this.dataSourceFactory = dataSourceFactory;
- }
-
- protected ReportTarget createReportTarget(final ReportJob job) throws ReportProcessingException
- {
- final ReportStructureRoot report = job.getReportStructureRoot();
- final ResourceManager resourceManager = report.getResourceManager();
- return new SpreadsheetRawReportTarget(job, resourceManager, report.getBaseResource(), inputRepository, outputRepository, targetName, imageService, dataSourceFactory);
- }
-
- public void processReport(final ReportJob job) throws ReportDataFactoryException, DataSourceException,
- ReportProcessingException
- {
- final ReportTarget reportTarget = createReportTarget(job);
- // first run: collect table cell sizes for all tables
- processReportRun(job, reportTarget);
- // second run: uses table cell data to output a single uniform table
- processReportRun(job, reportTarget);
- }
-
- protected ReportContext createReportContext(final ReportJob job,
- final ReportTarget target)
- {
- final ReportContext context = super.createReportContext(job, target);
- if (context instanceof ReportContextImpl)
- {
- final ReportContextImpl impl = (ReportContextImpl) context;
- impl.setFormulaContext(new PentahoFormulaContext(impl.getFormulaContext(),job.getConfiguration()));
- }
- return context;
- }
-}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java b/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java deleted file mode 100644 index e0122ed99..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java +++ /dev/null @@ -1,942 +0,0 @@ -/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: SpreadsheetRawReportTarget.java,v $
- * $Revision: 1.8 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package com.sun.star.report.pentaho.output.spreadsheet;
-
-import com.sun.star.report.DataSourceFactory;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-
-import com.sun.star.report.InputRepository;
-import com.sun.star.report.OutputRepository;
-import com.sun.star.report.ImageService;
-import com.sun.star.report.pentaho.OfficeNamespaces;
-import com.sun.star.report.OfficeToken;
-import com.sun.star.report.pentaho.PentahoReportEngineMetaData;
-import com.sun.star.report.pentaho.model.OfficeStyle;
-import com.sun.star.report.pentaho.model.OfficeStyles;
-import com.sun.star.report.pentaho.model.OfficeStylesCollection;
-import com.sun.star.report.pentaho.model.OfficeMasterPage;
-import com.sun.star.report.pentaho.model.OfficeMasterStyles;
-import com.sun.star.report.pentaho.model.PageSection;
-import com.sun.star.report.pentaho.output.OfficeDocumentReportTarget;
-import com.sun.star.report.pentaho.output.StyleUtilities;
-import com.sun.star.report.pentaho.output.text.MasterPageFactory;
-import com.sun.star.report.pentaho.styles.LengthCalculator;
-import java.util.Set;
-import org.jfree.layouting.util.AttributeMap;
-import org.jfree.layouting.input.style.values.CSSNumericValue;
-import org.jfree.layouting.input.style.values.CSSNumericType;
-import org.jfree.report.DataFlags;
-import org.jfree.report.DataSourceException;
-import org.jfree.report.ReportProcessingException;
-import org.jfree.report.JFreeReportInfo;
-import org.jfree.report.flow.ReportJob;
-import org.jfree.report.flow.ReportStructureRoot;
-import org.jfree.report.flow.ReportTargetUtil;
-import org.jfree.report.structure.Element;
-import org.jfree.report.structure.Section;
-import org.jfree.report.util.IntegerCache;
-import org.jfree.report.util.TextUtilities;
-import org.jfree.resourceloader.ResourceKey;
-import org.jfree.resourceloader.ResourceManager;
-import org.jfree.util.Log;
-import org.jfree.xmlns.common.AttributeList;
-import org.jfree.xmlns.writer.XmlWriter;
-import org.jfree.xmlns.writer.XmlWriterSupport;
-
-/**
- * Creation-Date: 03.11.2007
- *
- * @author Michael D'Amour
- */
-public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
-{
-
- private boolean paragraphFound = false;
- private boolean paragraphHandled = false;
-
- /**
- * This class represents a column boundary, not in width, but it's actual boundary location. One of the motivations
- * for creating this class was to be able to record the boundaries for each incoming table while consuming as few
- * objects/memory as possible.
- */
- private static class ColumnBoundary implements Comparable
- {
-
- private final Set tableIndices;
- private final float boundary;
-
- private ColumnBoundary(final float boundary)
- {
- this.tableIndices = new HashSet();
- this.boundary = boundary;
- }
-
- public void addTableIndex(final int table)
- {
- tableIndices.add(IntegerCache.getInteger(table));
- }
-
- public float getBoundary()
- {
- return boundary;
- }
-
- public boolean isContainedByTable(final int table)
- {
- final Integer index = IntegerCache.getInteger(table);
- return tableIndices.contains(index);
- }
-
- public int compareTo(final Object arg0)
- {
- if (arg0.equals(this))
- {
- return 0;
- }
- if (arg0 instanceof ColumnBoundary)
- {
- if (boundary > ((ColumnBoundary) arg0).boundary)
- {
- return 1;
- }
- else
- {
- return -1;
- }
- }
- return 1;
- }
-
- public boolean equals(final Object obj)
- {
- if (obj instanceof ColumnBoundary)
- {
- return ((ColumnBoundary) obj).boundary == boundary;
- }
- return false;
- }
- }
- private String tableBackgroundColor; // null means transparent ...
- private static final ColumnBoundary[] EMPTY_COLBOUNDS = new ColumnBoundary[0];
- private boolean elementBoundaryCollectionPass;
- private boolean oleHandled;
- private final List columnBoundaryList;
- private float currentRowBoundaryMarker;
- private ColumnBoundary[] sortedBoundaryArray;
- private ColumnBoundary[] boundariesForTableArray;
- private int tableCounter;
- private int columnCounter;
- private int columnSpanCounter;
- private String unitsOfMeasure;
- final private ArrayList shapes;
- final private ArrayList ole;
- final private ArrayList rowHeights;
-
- public SpreadsheetRawReportTarget(final ReportJob reportJob,
- final ResourceManager resourceManager,
- final ResourceKey baseResource,
- final InputRepository inputRepository,
- final OutputRepository outputRepository,
- final String target,
- final ImageService imageService,
- final DataSourceFactory dataSourceFactory)
- throws ReportProcessingException
- {
- super(reportJob, resourceManager, baseResource, inputRepository, outputRepository, target, imageService, dataSourceFactory);
- columnBoundaryList = new ArrayList();
- elementBoundaryCollectionPass = true;
- rowHeights = new ArrayList();
- shapes = new ArrayList();
- ole = new ArrayList();
- oleHandled = false;
- }
-
- public void startOther(final AttributeMap attrs) throws DataSourceException, ReportProcessingException
- {
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, OfficeToken.OBJECT_OLE, attrs))
- {
- if (isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE)
- {
- ole.add(attrs);
- }
- oleHandled = true;
- return;
- }
- final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs);
- if (isRepeatingSection() || isFilteredNamespace(namespace))
- {
- return;
- }
-
- final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs);
- if (OfficeNamespaces.TEXT_NS.equals(namespace) && OfficeToken.P.equals(elementType) && !paragraphHandled)
- {
- paragraphFound = true;
- return;
- }
-
- if (OfficeNamespaces.DRAWING_NS.equals(namespace) && OfficeToken.FRAME.equals(elementType))
- {
- if (isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE)
- {
- final LengthCalculator len = new LengthCalculator();
- for (int i = 0; i < rowHeights.size(); i++)
- {
- len.add((CSSNumericValue) rowHeights.get(i));
- // val += ((CSSNumericValue)rowHeights.get(i)).getValue();
- }
-
- rowHeights.clear();
- final CSSNumericValue currentRowHeight = len.getResult();
- rowHeights.add(currentRowHeight);
- attrs.setAttribute(OfficeNamespaces.DRAWING_NS, "z-index", String.valueOf(shapes.size()));
- final String y = (String) attrs.getAttribute(OfficeNamespaces.SVG_NS, "y");
- if (y != null)
- {
- len.add(parseLength(y));
- final CSSNumericValue currentY = len.getResult();
- attrs.setAttribute(OfficeNamespaces.SVG_NS, "y", currentY.getValue() + currentY.getType().getType());
- }
- shapes.add(attrs);
- }
- return;
- }
- if (oleHandled)
- {
- if (isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE)
- {
- ole.add(attrs);
- }
- return;
- }
-
- // if this is the report namespace, write out a table definition ..
- if (OfficeNamespaces.TABLE_NS.equals(namespace) && OfficeToken.TABLE.equals(elementType))
- {
- // whenever we see a new table, we increment our tableCounter
- // this is used to keep tracked of the boundary conditions per table
- tableCounter++;
- }
-
- if (isElementBoundaryCollectionPass())
- {
- collectBoundaryForElement(attrs);
- }
- else
- // if (!isElementBoundaryCollectionPass())
- {
- try
- {
- processElement(attrs, namespace, elementType);
- }
- catch (IOException e)
- {
- throw new ReportProcessingException("Failed", e);
- }
- }
- }
-
- protected void startReportSection(final AttributeMap attrs, final int role) throws IOException, DataSourceException, ReportProcessingException
- {
- if ((role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER ||
- role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER) &&
- (!PageSection.isPrintWithReportHeader(attrs) ||
- !PageSection.isPrintWithReportFooter(attrs)))
- {
- startBuffering(new OfficeStylesCollection(), true);
-
- }
- else
- {
- super.startReportSection(attrs, role);
- }
- }
-
- protected void endReportSection(final AttributeMap attrs, final int role) throws IOException, DataSourceException, ReportProcessingException
- {
- if ((role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER ||
- role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER) &&
- (!PageSection.isPrintWithReportHeader(attrs) ||
- !PageSection.isPrintWithReportFooter(attrs)))
- {
- finishBuffering();
- }
- else
- {
- super.endReportSection(attrs, role);
- }
- }
-
- private void handleParagraph()
- {
- if (paragraphFound)
- {
- try
- {
- final XmlWriter xmlWriter = getXmlWriter();
- xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, OfficeToken.P, null, XmlWriterSupport.OPEN);
- paragraphHandled = true;
- paragraphFound = false;
- }
- catch (IOException ex)
- {
- Log.error("ReportProcessing failed", ex);
- }
- }
- }
-
- private void processElement(final AttributeMap attrs, final String namespace, final String elementType)
- throws IOException, ReportProcessingException
- {
- final XmlWriter xmlWriter = getXmlWriter();
-
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE, attrs))
- {
- // a new table means we must clear our "calculated" table boundary array cache
- boundariesForTableArray = null;
-
- final String tableStyle = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
- if (tableStyle == null)
- {
- tableBackgroundColor = null;
- }
- else
- {
- final Object raw = StyleUtilities.queryStyle(getPredefinedStylesCollection(), OfficeToken.TABLE, tableStyle,
- "table-properties", OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR);
- if (raw == null || "transparent".equals(raw))
- {
- tableBackgroundColor = null;
- }
- else
- {
- tableBackgroundColor = String.valueOf(raw);
- }
- }
- return;
- }
-
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMN, attrs) ||
- ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMNS, attrs))
- {
- return;
- }
-
- // covered-table-cell elements may appear in the input from row or column spans. In the event that we hit a
- // column-span we simply ignore these elements because we are going to adjust the span to fit the uniform table.
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.COVERED_TABLE_CELL, attrs))
- {
- if (columnSpanCounter > 0)
- {
- columnSpanCounter--;
- }
-
- if (columnSpanCounter == 0)
- {
- // if we weren't expecting a covered-table-cell, let's use it, it's probably from a row-span
- columnCounter++;
- final int span = getColumnSpanForCell(tableCounter, columnCounter, 1);
- // use the calculated span for the column in the uniform table to create any additional covered-table-cell
- // elements
- for (int i = 0; i < span; i++)
- {
- xmlWriter.writeTag(namespace, OfficeToken.COVERED_TABLE_CELL, null, XmlWriter.CLOSE);
- }
- }
- return;
- }
-
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_ROW, attrs))
- {
- // a new row means our column counter gets reset
- columnCounter = 0;
- // Lets make sure the color of the table is ok ..
- if (tableBackgroundColor != null)
- {
- final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
- final OfficeStyle style = deriveStyle(OfficeToken.TABLE_ROW, styleName);
- Element tableRowProperties = style.getTableRowProperties();
- if (tableRowProperties == null)
- {
- tableRowProperties = new Section();
- tableRowProperties.setNamespace(OfficeNamespaces.STYLE_NS);
- tableRowProperties.setType("table-row-properties");
- tableRowProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, tableBackgroundColor);
- style.addNode(tableRowProperties);
- }
- else
- {
- final Object oldValue = tableRowProperties.getAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR);
- if (oldValue == null || "transparent".equals(oldValue))
- {
- tableRowProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, tableBackgroundColor);
- }
- }
- attrs.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, style.getStyleName());
- }
- }
- else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_CELL, attrs))
- {
- columnCounter++;
- final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
- if (styleName != null)
- {
- final OfficeStyle cellStyle = getPredefinedStylesCollection().getStyle(OfficeToken.TABLE_CELL, styleName);
- if (cellStyle != null)
- {
- final Element props = cellStyle.getTableCellProperties();
- if (props != null)
- {
- final Object raw = props.getAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR);
- if (raw == null || "transparent".equals(raw))
- {
- cellStyle.removeNode(props);
- }
- }
- }
- }
-
- final String numColSpanStr = (String) attrs.getAttribute(namespace, "number-columns-spanned");
- int initialColumnSpan = columnSpanCounter = 1;
- if (numColSpanStr != null)
- {
- initialColumnSpan = Integer.parseInt(numColSpanStr);
- columnSpanCounter = initialColumnSpan;
- }
- final int span = getColumnSpanForCell(tableCounter, columnCounter, initialColumnSpan);
- if (initialColumnSpan > 1)
- {
- // add the initial column span to our column counter index (subtract 1, since it is counted by default)
- columnCounter += initialColumnSpan - 1;
- }
-
- // if (span < initialColumnSpan)
- // {
- // // ColumnBoundary cbs[] = getBoundariesForTable(tableCounter);
- // // for (int i = 0; i < cbs.length; i++)
- // // {
- // // System.out.print(cbs[i].getBoundary() + " ");
- // // }
- // // System.out.println();
- //
- // Log.error("A cell cannot span less than the declared columns: Declared=" + initialColumnSpan + " Computed="
- // + span);
- // }
-
- // there's no point to create number-columns-spanned attributes if we only span 1 column
- if (span > 1)
- {
- attrs.setAttribute(namespace, "number-columns-spanned", "" + span);
- }
- // we must also generate "covered-table-cell" elements for each column spanned
- // but we'll do this in the endElement, after we close this OfficeToken.TABLE_CELL
- }
-
- // All styles have to be processed or you will loose the paragraph-styles and inline text-styles.
- // ..
- performStyleProcessing(attrs);
-
- final AttributeList attrList = buildAttributeList(attrs);
- xmlWriter.writeTag(namespace, elementType, attrList, XmlWriter.OPEN);
- // System.out.println("elementType = " + elementType);
- }
-
- private void collectBoundaryForElement(final AttributeMap attrs)
- {
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMNS, attrs))
- {
- // A table row resets the column counter.
- resetCurrentRowBoundaryMarker();
- }
- else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMN, attrs))
- {
- final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
- if (styleName == null)
- {
- // This should not happen, but if it does, we will ignore that cell.
- return;
- }
-
- final OfficeStyle style = getPredefinedStylesCollection().getStyle(OfficeToken.TABLE_COLUMN, styleName);
- if (style == null)
- {
- // Now this is very bad. It means that there is no style defined with the given name.
- return;
- }
-
- final Element tableColumnProperties = style.getTableColumnProperties();
- String widthStr = (String) tableColumnProperties.getAttribute("column-width");
- widthStr = widthStr.substring(0, widthStr.indexOf(getUnitsOfMeasure(widthStr)));
- addColumnWidthToRowBoundaryMarker(Float.parseFloat(widthStr));
- ColumnBoundary currentRowBoundary = new ColumnBoundary(getCurrentRowBoundaryMarker());
- final List columnBoundaryList_ = getColumnBoundaryList();
- final int idx = columnBoundaryList_.indexOf(currentRowBoundary);
- if (idx == -1)
- {
- columnBoundaryList_.add(currentRowBoundary);
- }
- else
- {
- currentRowBoundary = (ColumnBoundary) columnBoundaryList_.get(idx);
- }
- currentRowBoundary.addTableIndex(tableCounter);
- }
- }
-
- private String getUnitsOfMeasure(final String str)
- {
- if (unitsOfMeasure == null || "".equals(unitsOfMeasure))
- {
- if (str == null || "".equals(str))
- {
- unitsOfMeasure = "cm";
- return unitsOfMeasure;
- }
-
- // build units of measure, set it
- int i = str.length() - 1;
- for (; i >= 0; i--)
- {
- final char c = str.charAt(i);
- if (Character.isDigit(c) || c == '.' || c == ',')
- {
- break;
- }
- }
- unitsOfMeasure = str.substring(i + 1);
- }
- return unitsOfMeasure;
- }
-
- private void createTableShapes() throws ReportProcessingException
- {
- if (!shapes.isEmpty())
- {
- try
- {
- final XmlWriter xmlWriter = getXmlWriter();
- // at this point we need to generate the table-columns section based on our boundary table
- // <table:shapes>
- // <draw:frame />
- // ..
- // </table:shapes>
- xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, OfficeToken.SHAPES, null, XmlWriterSupport.OPEN);
-
-
- for (int i = 0; i < shapes.size(); i++)
- {
- final AttributeMap attrs = (AttributeMap) shapes.get(i);
- final AttributeList attrList = buildAttributeList(attrs);
- attrList.removeAttribute(OfficeNamespaces.DRAWING_NS, OfficeToken.STYLE_NAME);
- xmlWriter.writeTag(OfficeNamespaces.DRAWING_NS, OfficeToken.FRAME, attrList, XmlWriterSupport.OPEN);
- startChartProcessing((AttributeMap) ole.get(i));
-
- xmlWriter.writeCloseTag();
- }
- xmlWriter.writeCloseTag();
- }
- catch (IOException e)
- {
- throw new ReportProcessingException("Failed", e);
- }
- }
- }
-
- private void createTableColumns() throws ReportProcessingException
- {
- try
- {
- final XmlWriter xmlWriter = getXmlWriter();
- // at this point we need to generate the table-columns section based on our boundary table
- // <table-columns>
- // <table-column style-name="coX"/>
- // ..
- // </table-columns>
- // the first boundary is '0' which is a placeholder so we will ignore it
- xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMNS, null, XmlWriterSupport.OPEN);
-
- // blow away current column styles
- // start processing at i=1 because we added a boundary for "0" which is virtual
- final ColumnBoundary[] cba = getSortedColumnBoundaryArray();
- for (int i = 1; i < cba.length; i++)
- {
- final ColumnBoundary cb = cba[i];
- float columnWidth = cb.getBoundary();
- if (i > 1)
- {
- columnWidth -= cba[i - 1].getBoundary();
- }
- final OfficeStyle style = deriveStyle(OfficeToken.TABLE_COLUMN, ("co" + i + "_"));
- final Section tableColumnProperties = new Section();
- tableColumnProperties.setType("table-column-properties");
- tableColumnProperties.setNamespace(style.getNamespace());
- tableColumnProperties.setAttribute(style.getNamespace(), "column-width", columnWidth + getUnitsOfMeasure(null));
- style.addNode(tableColumnProperties);
-
- final AttributeList myAttrList = new AttributeList();
- myAttrList.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, style.getStyleName());
- xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMN, myAttrList, XmlWriterSupport.CLOSE);
- }
- xmlWriter.writeCloseTag();
- }
- catch (IOException e)
- {
- throw new ReportProcessingException("Failed", e);
- }
- }
-
- protected void endOther(final AttributeMap attrs) throws DataSourceException, ReportProcessingException
- {
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, OfficeToken.OBJECT_OLE, attrs) || oleHandled)
- {
- oleHandled = false;
- return;
- }
-
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_ROW, attrs) && isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE)
- {
- final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
- rowHeights.add(computeRowHeight(styleName));
- }
-
- if (isRepeatingSection() || isElementBoundaryCollectionPass())
- {
- return;
- }
-
- final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs);
- if (isFilteredNamespace(namespace))
- {
- return;
- }
- final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs);
- if (OfficeNamespaces.DRAWING_NS.equals(namespace) && OfficeToken.FRAME.equals(elementType))
- {
- return;
- }
-
- // if this is the report namespace, write out a table definition ..
- if (OfficeNamespaces.TABLE_NS.equals(namespace) && (OfficeToken.TABLE.equals(elementType) ||
- OfficeToken.COVERED_TABLE_CELL.equals(elementType) ||
- OfficeToken.TABLE_COLUMN.equals(elementType) ||
- OfficeToken.TABLE_COLUMNS.equals(elementType)))
- {
- return;
- }
-
- if ( !paragraphHandled && OfficeNamespaces.TEXT_NS.equals(namespace) && OfficeToken.P.equals(elementType))
- {
- if (!paragraphHandled)
- {
- return;
- }
-
- paragraphHandled = false;
- }
- try
- {
- final XmlWriter xmlWriter = getXmlWriter();
- xmlWriter.writeCloseTag();
- // table-cell elements may have a number-columns-spanned attribute which indicates how many
- // 'covered-table-cell' elements we need to generate
- generateCoveredTableCells(attrs);
- }
- catch (IOException e)
- {
- throw new ReportProcessingException("Failed", e);
- }
- }
-
- private void generateCoveredTableCells(final AttributeMap attrs) throws IOException
- {
- if (!ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_CELL, attrs))
- {
- return;
- }
-
- // do this after we close the tag
- final XmlWriter xmlWriter = getXmlWriter();
- final Object attribute = attrs.getAttribute(OfficeNamespaces.TABLE_NS, "number-columns-spanned");
- final int span = TextUtilities.parseInt((String) attribute, 0);
- for (int i = 1; i < span; i++)
- {
- xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, OfficeToken.COVERED_TABLE_CELL, null, XmlWriter.CLOSE);
- }
- }
-
- public String getExportDescriptor()
- {
- return "raw/" + PentahoReportEngineMetaData.OPENDOCUMENT_SPREADSHEET;
- }
-
- // /////////////////////////////////////////////////////////////////////////
- public void processText(final String text) throws DataSourceException, ReportProcessingException
- {
- if (!(isRepeatingSection() || isElementBoundaryCollectionPass()))
- {
- handleParagraph();
- super.processText(text);
- }
- }
-
- public void processContent(final DataFlags value) throws DataSourceException, ReportProcessingException
- {
- if (!(isRepeatingSection() || isElementBoundaryCollectionPass()))
- {
- handleParagraph();
- super.processContent(value);
- }
- }
-
- protected String getStartContent()
- {
- return "spreadsheet";
- }
-
- protected void startContent(final AttributeMap attrs) throws IOException, DataSourceException,
- ReportProcessingException
- {
- if (!isElementBoundaryCollectionPass())
- {
- final XmlWriter xmlWriter = getXmlWriter();
- xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, getStartContent(), null, XmlWriterSupport.OPEN);
-
- final AttributeMap tableAttributes = new AttributeMap();
- tableAttributes.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TABLE_NS);
- tableAttributes.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, OfficeToken.TABLE);
- tableAttributes.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, generateInitialTableStyle());
- tableAttributes.setAttribute(OfficeNamespaces.TABLE_NS, "name", "Report");
-
- performStyleProcessing(tableAttributes);
-
- xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE, buildAttributeList(tableAttributes), XmlWriterSupport.OPEN);
- createTableShapes();
- createTableColumns();
- }
- }
-
- private String generateInitialTableStyle() throws ReportProcessingException
- {
- final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
- final OfficeStyles commonStyles = predefStyles.getAutomaticStyles();
- if (!commonStyles.containsStyle(OfficeToken.TABLE, "Initial_Table"))
- {
- final String masterPageName = createMasterPage();
-
- final OfficeStyle tableStyle = new OfficeStyle();
- tableStyle.setStyleFamily(OfficeToken.TABLE);
- tableStyle.setStyleName("Initial_Table");
- tableStyle.setAttribute(OfficeNamespaces.STYLE_NS, "master-page-name", masterPageName);
- final Element tableProperties = produceFirstChild(tableStyle, OfficeNamespaces.STYLE_NS, "table-properties");
- tableProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, "transparent");
- commonStyles.addStyle(tableStyle);
- }
- return "Initial_Table";
- }
-
- private String createMasterPage() throws ReportProcessingException
- {
- final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
- final MasterPageFactory masterPageFactory = new MasterPageFactory(predefStyles.getMasterStyles());
- final OfficeMasterPage masterPage;
- if (!masterPageFactory.containsMasterPage("Standard", null, null))
- {
- masterPage = masterPageFactory.createMasterPage("Standard", null, null);
-
- final CSSNumericValue zeroLength = CSSNumericValue.createValue(CSSNumericType.CM, 0);
- final String pageLayoutTemplate = masterPage.getPageLayout();
- if (pageLayoutTemplate == null)
- {
- // there is no pagelayout. Create one ..
- final String derivedLayout = masterPageFactory.createPageStyle(getGlobalStylesCollection().getAutomaticStyles(), zeroLength, zeroLength);
- masterPage.setPageLayout(derivedLayout);
- }
- else
- {
- final String derivedLayout = masterPageFactory.derivePageStyle(pageLayoutTemplate,
- getPredefinedStylesCollection().getAutomaticStyles(),
- getGlobalStylesCollection().getAutomaticStyles(), zeroLength, zeroLength);
- masterPage.setPageLayout(derivedLayout);
- }
-
- final OfficeStylesCollection officeStylesCollection = getGlobalStylesCollection();
- final OfficeMasterStyles officeMasterStyles = officeStylesCollection.getMasterStyles();
- officeMasterStyles.addMasterPage(masterPage);
- }
- else
- {
- masterPage = masterPageFactory.getMasterPage("Standard", null, null);
- }
- return masterPage.getStyleName();
- }
-
- protected void endContent(final AttributeMap attrs) throws IOException, DataSourceException,
- ReportProcessingException
- {
- // todo
- if (!isElementBoundaryCollectionPass())
- {
- final XmlWriter xmlWriter = getXmlWriter();
- xmlWriter.writeCloseTag();
- xmlWriter.writeCloseTag();
- }
- }
-
- public void endReport(final ReportStructureRoot report) throws DataSourceException, ReportProcessingException
- {
- super.endReport(report);
- setElementBoundaryCollectionPass(false);
- resetTableCounter();
- columnCounter = 0;
- }
-
- private boolean isElementBoundaryCollectionPass()
- {
- return elementBoundaryCollectionPass;
- }
-
- private void setElementBoundaryCollectionPass(final boolean elementBoundaryCollectionPass)
- {
- this.elementBoundaryCollectionPass = elementBoundaryCollectionPass;
- }
-
- private ColumnBoundary[] getSortedColumnBoundaryArray()
- {
- if (sortedBoundaryArray == null)
- {
- getColumnBoundaryList().add(new ColumnBoundary(0));
- sortedBoundaryArray = (ColumnBoundary[]) getColumnBoundaryList().toArray(EMPTY_COLBOUNDS);
- Arrays.sort(sortedBoundaryArray);
- }
- return sortedBoundaryArray;
- }
-
- private List getColumnBoundaryList()
- {
- return columnBoundaryList;
- }
-
- private void addColumnWidthToRowBoundaryMarker(final float width)
- {
- currentRowBoundaryMarker += width;
- }
-
- private float getCurrentRowBoundaryMarker()
- {
- return currentRowBoundaryMarker;
- }
-
- private void resetTableCounter()
- {
- tableCounter = 0;
- }
-
- private void resetCurrentRowBoundaryMarker()
- {
- currentRowBoundaryMarker = 0;
- }
-
- private ColumnBoundary[] getBoundariesForTable(final int table)
- {
- if (boundariesForTableArray == null)
- {
- final List boundariesForTable = new ArrayList();
- final List boundaryList = getColumnBoundaryList();
- for (int i = 0; i < boundaryList.size(); i++)
- {
- final ColumnBoundary b = (ColumnBoundary) boundaryList.get(i);
- if (b.isContainedByTable(table))
- {
- boundariesForTable.add(b);
- }
- }
- boundariesForTableArray = (ColumnBoundary[]) boundariesForTable.toArray(EMPTY_COLBOUNDS);
- Arrays.sort(boundariesForTableArray);
- }
- return boundariesForTableArray;
- }
-
- private int getColumnSpanForCell(final int table, final int col, final int initialColumnSpan)
- {
- final ColumnBoundary[] globalBoundaries = getSortedColumnBoundaryArray();
- final ColumnBoundary[] tableBoundaries = getBoundariesForTable(table);
- // how many column boundaries in the globalBoundaries list fall between the currentRowWidth and the next boundary
- // for the current row
-
- float cellBoundary = tableBoundaries[col - 1].getBoundary();
- float cellWidth = tableBoundaries[col - 1].getBoundary();
-
- if (col > 1)
- {
- cellWidth = cellWidth - tableBoundaries[col - 2].getBoundary();
- }
-
- if (initialColumnSpan > 1)
- {
- // ok we've got some additional spanning specified on the input
- final int index = (col - 1) + (initialColumnSpan - 1);
- cellWidth += tableBoundaries[index].getBoundary() - tableBoundaries[col - 1].getBoundary();
- cellBoundary = tableBoundaries[index].getBoundary();
- }
-
- int beginBoundaryIndex = 0;
- int endBoundaryIndex = globalBoundaries.length - 1;
- for (int i = 0; i < globalBoundaries.length; i++)
- {
- // find beginning boundary
- if (globalBoundaries[i].getBoundary() <= cellBoundary - cellWidth)
- {
- beginBoundaryIndex = i;
- }
- if (globalBoundaries[i].getBoundary() <= cellBoundary)
- {
- endBoundaryIndex = i;
- }
- }
- final int span = endBoundaryIndex - beginBoundaryIndex;
- // span will be zero for the first column, so we adjust it to 1
- if (span == 0)
- {
- return 1;
- }
- // System.out.println("table = " + table + " col = " + col + " rowBoundaries.length = " + tableBoundaries.length + "
- // cellWidth = " + cellWidth + " span = " + span);
- return span;
- }
-
- protected String getTargetMimeType()
- {
- return "application/vnd.oasis.opendocument.spreadsheet";
- }
-}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java b/reportdesign/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java deleted file mode 100644 index c2ecac889..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java +++ /dev/null @@ -1,423 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: MasterPageFactory.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.output.text; - -import java.util.HashMap; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.pentaho.model.OfficeMasterPage; -import com.sun.star.report.pentaho.model.OfficeMasterStyles; -import com.sun.star.report.pentaho.model.RawText; -import com.sun.star.report.pentaho.model.OfficeStyles; -import com.sun.star.report.pentaho.model.PageLayout; -import java.util.Map; -import org.jfree.report.structure.Section; -import org.jfree.report.structure.Element; -import org.jfree.report.util.AttributeNameGenerator; -import org.jfree.report.ReportProcessingException; -import org.jfree.layouting.input.style.values.CSSNumericValue; - -/** - * Todo: Document me! - * - * @author Thomas Morgner - * @since 14.03.2007 - */ -public class MasterPageFactory -{ - - private static class MasterPageFactoryKey - { - - private final String template; - private final String pageHeader; - private final String pageFooter; - - public MasterPageFactoryKey(final String template, - final String pageHeader, - final String pageFooter) - { - this.template = template; - this.pageHeader = pageHeader; - this.pageFooter = pageFooter; - } - - public boolean equals(final Object o) - { - if (this != o) - { - if (o == null || getClass() != o.getClass()) - { - return false; - } - - final MasterPageFactoryKey that = (MasterPageFactoryKey) o; - - if (pageFooter != null ? !pageFooter.equals( - that.pageFooter) : that.pageFooter != null) - { - return false; - } - if (pageHeader != null ? !pageHeader.equals( - that.pageHeader) : that.pageHeader != null) - { - return false; - } - if (template != null ? !template.equals( - that.template) : that.template != null) - { - return false; - } - } - - return true; - } - - public int hashCode() - { - int result = (template != null ? template.hashCode() : 0); - result = 31 * result + (pageHeader != null ? pageHeader.hashCode() : 0); - result = 31 * result + (pageFooter != null ? pageFooter.hashCode() : 0); - return result; - } - - public String getTemplate() - { - return template; - } - - public String getPageHeader() - { - return pageHeader; - } - - public String getPageFooter() - { - return pageFooter; - } - } - - private static class PageLayoutKey - { - - private final String templateName; - private final CSSNumericValue headerHeight; - private final CSSNumericValue footerHeight; - - public PageLayoutKey(final String templateName, - final CSSNumericValue headerHeight, - final CSSNumericValue footerHeight) - { - this.templateName = templateName; - this.headerHeight = headerHeight; - this.footerHeight = footerHeight; - } - - public String getTemplateName() - { - return templateName; - } - - public CSSNumericValue getHeaderHeight() - { - return headerHeight; - } - - public CSSNumericValue getFooterHeight() - { - return footerHeight; - } - - public boolean equals(final Object o) - { - if (this == o) - { - return true; - } - if (o == null || getClass() != o.getClass()) - { - return false; - } - - final PageLayoutKey key = (PageLayoutKey) o; - - if (footerHeight != null ? !footerHeight.equals( - key.footerHeight) : key.footerHeight != null) - { - return false; - } - if (headerHeight != null ? !headerHeight.equals( - key.headerHeight) : key.headerHeight != null) - { - return false; - } - if (templateName != null ? !templateName.equals( - key.templateName) : key.templateName != null) - { - return false; - } - - return true; - } - - public int hashCode() - { - int result; - result = (templateName != null ? templateName.hashCode() : 0); - result = 31 * result + (headerHeight != null ? headerHeight.hashCode() : 0); - result = 31 * result + (footerHeight != null ? footerHeight.hashCode() : 0); - return result; - } - } - - // todo: Patch the page-layout ... - private static final String DEFAULT_PAGE_NAME = "Default"; - private final OfficeMasterStyles predefinedStyles; - private final AttributeNameGenerator masterPageNameGenerator; - private final Map masterPages; - private final AttributeNameGenerator pageLayoutNameGenerator; - private final Map pageLayouts; - - public MasterPageFactory(final OfficeMasterStyles predefinedStyles) - { - this.predefinedStyles = predefinedStyles; - this.masterPages = new HashMap(); - this.masterPageNameGenerator = new AttributeNameGenerator(); - this.pageLayouts = new HashMap(); - this.pageLayoutNameGenerator = new AttributeNameGenerator(); - } - - public OfficeMasterPage getMasterPage(final String template, - final String pageHeader, - final String pageFooter) - { - final MasterPageFactoryKey key = - new MasterPageFactoryKey(template, pageHeader, pageFooter); - return (OfficeMasterPage) masterPages.get(key); - } - - public boolean containsMasterPage(final String template, - final String pageHeader, - final String pageFooter) - { - final MasterPageFactoryKey key = - new MasterPageFactoryKey(template, pageHeader, pageFooter); - return masterPages.containsKey(key); - } - - public OfficeMasterPage createMasterPage(final String template, - final String pageHeader, - final String pageFooter) - { - final MasterPageFactoryKey key = - new MasterPageFactoryKey(template, pageHeader, pageFooter); - final OfficeMasterPage cached = (OfficeMasterPage) masterPages.get(key); - if (cached != null) - { - return cached; - } - - final String targetName = (masterPages.isEmpty()) ? "Standard" : template; - - OfficeMasterPage predef = predefinedStyles.getMasterPage(template); - if (predef == null) - { - // This is a 'magic' name .. - // todo: It could be that this should be called 'Standard' instead - predef = predefinedStyles.getMasterPage(MasterPageFactory.DEFAULT_PAGE_NAME); - } - - if (predef != null) - { - try - { - // derive - final OfficeMasterPage derived = (OfficeMasterPage) predef.clone(); - return setupMasterPage(derived, targetName, pageHeader, pageFooter, - key); - } - catch (CloneNotSupportedException cne) - { - throw new IllegalStateException("Implementation error: Unable to derive page"); - } - } - - final OfficeMasterPage masterPage = new OfficeMasterPage(); - masterPage.setNamespace(OfficeNamespaces.STYLE_NS); - masterPage.setType("master-page"); - return setupMasterPage(masterPage, targetName, pageHeader, pageFooter, key); - } - - private OfficeMasterPage setupMasterPage(final OfficeMasterPage derived, - final String targetName, - final String pageHeader, - final String pageFooter, - final MasterPageFactoryKey key) - { - derived.setStyleName(masterPageNameGenerator.generateName(targetName)); - masterPages.put(key, derived); - - if (pageHeader != null) - { - final Section header = new Section(); - header.setNamespace(OfficeNamespaces.STYLE_NS); - header.setType("header"); - header.addNode(new RawText(pageHeader)); - derived.addNode(header); - } - - if (pageFooter != null) - { - final Section footer = new Section(); - footer.setNamespace(OfficeNamespaces.STYLE_NS); - footer.setType("footer"); - footer.addNode(new RawText(pageFooter)); - derived.addNode(footer); - } - - return derived; - } - - public String createPageStyle(final OfficeStyles commonStyles, - final CSSNumericValue headerHeight, - final CSSNumericValue footerHeight) - { - final PageLayoutKey key = - new PageLayoutKey(null, headerHeight, footerHeight); - final PageLayout derived = new PageLayout(); - final String name = pageLayoutNameGenerator.generateName("autogenerated"); - derived.setStyleName(name); - commonStyles.addPageStyle(derived); - - if (headerHeight != null) - { - final Section headerStyle = new Section(); - headerStyle.setNamespace(OfficeNamespaces.STYLE_NS); - headerStyle.setType("header-style"); - derived.addNode(headerStyle); - MasterPageFactory.applyHeaderFooterHeight(headerStyle, headerHeight); - } - - if (footerHeight != null) - { - final Section footerStyle = new Section(); - footerStyle.setNamespace(OfficeNamespaces.STYLE_NS); - footerStyle.setType("footer-style"); - derived.addNode(footerStyle); - MasterPageFactory.applyHeaderFooterHeight(footerStyle, footerHeight); - } - pageLayouts.put(key, name); - return name; - } - - public String derivePageStyle(final String pageStyleTemplate, - final OfficeStyles predefined, - final OfficeStyles commonStyles, - final CSSNumericValue headerHeight, - final CSSNumericValue footerHeight) - throws ReportProcessingException - { - if (pageStyleTemplate == null) - { - throw new NullPointerException("A style-name must be given"); - } - - final PageLayoutKey key = - new PageLayoutKey(pageStyleTemplate, headerHeight, footerHeight); - final String pageLayoutName = (String) pageLayouts.get(key); - if (pageLayoutName != null) - { - // there's already a suitable version included. - return pageLayoutName; - } - - final PageLayout original = predefined.getPageStyle(pageStyleTemplate); - if (original == null) - { - throw new ReportProcessingException("Invalid page-layout '" + pageStyleTemplate + "', will not continue."); - } - - try - { - final PageLayout derived = (PageLayout) original.clone(); - final String name = pageLayoutNameGenerator.generateName( - pageStyleTemplate); - derived.setStyleName(name); - commonStyles.addPageStyle(derived); - - if (headerHeight != null) - { - Section headerStyle = derived.getHeaderStyle(); - if (headerStyle == null) - { - headerStyle = new Section(); - headerStyle.setNamespace(OfficeNamespaces.STYLE_NS); - headerStyle.setType("header-style"); - derived.addNode(headerStyle); - } - MasterPageFactory.applyHeaderFooterHeight(headerStyle, headerHeight); - } - - if (footerHeight != null) - { - Section footerStyle = derived.getFooterStyle(); - if (footerStyle == null) - { - footerStyle = new Section(); - footerStyle.setNamespace(OfficeNamespaces.STYLE_NS); - footerStyle.setType("footer-style"); - derived.addNode(footerStyle); - } - - MasterPageFactory.applyHeaderFooterHeight(footerStyle, footerHeight); - } - pageLayouts.put(key, name); - return name; - } - catch (CloneNotSupportedException e) - { - throw new IllegalStateException("Clone failed."); - } - } - - private static void applyHeaderFooterHeight(final Section headerFooterStyle, - final CSSNumericValue style) - { - Element headerFooterProps = headerFooterStyle.findFirstChild(OfficeNamespaces.STYLE_NS, "header-footer-properties"); - if (headerFooterProps == null) - { - headerFooterProps = new Section(); - headerFooterProps.setNamespace(OfficeNamespaces.STYLE_NS); - headerFooterProps.setType("header-footer-properties"); - headerFooterStyle.addNode(headerFooterProps); - } - headerFooterProps.setAttribute(OfficeNamespaces.SVG_NS, "height", style.getValue() + style.getType().getType()); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/text/PageBreakDefinition.java b/reportdesign/java/com/sun/star/report/pentaho/output/text/PageBreakDefinition.java deleted file mode 100644 index 5316e6d3b..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/text/PageBreakDefinition.java +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: PageBreakDefinition.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.output.text; - -/** - * Todo: Document me! - * - * @author Thomas Morgner - * @since 24.03.2007 - */ -public class PageBreakDefinition -{ - - private final boolean resetPageNumber; - - public PageBreakDefinition(final boolean resetPageNumber) - { - this.resetPageNumber = resetPageNumber; - } - - public boolean isResetPageNumber() - { - return resetPageNumber; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/text/PageContext.java b/reportdesign/java/com/sun/star/report/pentaho/output/text/PageContext.java deleted file mode 100644 index 8d4a0dc2c..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/text/PageContext.java +++ /dev/null @@ -1,239 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: PageContext.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.output.text; - -import org.jfree.layouting.input.style.values.CSSNumericValue; -import com.sun.star.report.pentaho.styles.LengthCalculator; - -/** - * Todo: Document me! - * - * @author Thomas Morgner - * @since 24.03.2007 - */ -public class PageContext -{ - - public static final int KEEP_TOGETHER_OFF = 0; - public static final int KEEP_TOGETHER_GROUP = 1; - public static final int KEEP_TOGETHER_FIRST_DETAIL = 2; - private PageContext parent; - private String header; - private CSSNumericValue headerHeight; - private String footer; - private CSSNumericValue footerHeight; - private int keepTogether; - private Integer columnCount = null; - private boolean sectionOpen; - - public PageContext() - { - this(null); - } - - public PageContext(final PageContext parent) - { - this.parent = parent; - if (parent != null) - { - this.keepTogether = parent.getKeepTogether(); - } - } - - public int getActiveColumns() - { - PageContext pc = this; - while (pc != null) - { - // TODO: IS this code correct? Why not columnCount = pc.getColumnCount(); ? - if (columnCount != null) - { - return columnCount.intValue(); - } - pc = pc.getParent(); - } - return 1; - } - - public void setColumnCount(final Integer columnCount) - { - this.columnCount = columnCount; - } - - public Integer getColumnCount() - { - return columnCount; - } - - public String getHeader() - { - return header; - } - - public void setHeader(final String header, final CSSNumericValue height) - { - this.header = header; - this.headerHeight = height; - } - - public String getFooter() - { - return footer; - } - - public CSSNumericValue getHeaderHeight() - { - return headerHeight; - } - - public CSSNumericValue getFooterHeight() - { - return footerHeight; - } - - public void setFooter(final String footer, final CSSNumericValue height) - { - this.footer = footer; - this.footerHeight = height; - } - - public int getKeepTogether() - { - return keepTogether; - } - - public void setKeepTogether(final int keepTogether) - { - this.keepTogether = keepTogether; - } - - public PageContext getParent() - { - return parent; - } - - public CSSNumericValue getAllFooterSize() - { - if (parent == null) - { - return footerHeight; - } - - final LengthCalculator lnc = new LengthCalculator(); - PageContext pc = this; - while (pc != null) - { - lnc.add(pc.getFooterHeight()); - pc = pc.getParent(); - } - return lnc.getResult(); - } - - public CSSNumericValue getAllHeaderSize() - { - if (parent == null) - { - return headerHeight; - } - - final LengthCalculator lnc = new LengthCalculator(); - PageContext pc = this; - while (pc != null) - { - lnc.add(pc.getHeaderHeight()); - pc = pc.getParent(); - } - return lnc.getResult(); - } - - public String getPageFooterContent() - { - if (parent == null) - { - return getFooter(); - } - - final StringBuffer b = new StringBuffer(); - - PageContext pc = this; - while (pc != null) - { - final String footer_ = pc.getFooter(); - if (footer_ != null) - { - b.append(footer_); - } - pc = pc.getParent(); - } - - if (b.length() != 0) - { - return b.toString(); - } - return null; - } - - public String getPageHeaderContent() - { - if (parent == null) - { - return getHeader(); - } - - final StringBuffer b = new StringBuffer(); - - PageContext pc = this; - while (pc != null) - { - final String header_ = pc.getHeader(); - if (header_ != null) - { - b.append(header_); - } - pc = pc.getParent(); - } - - if (b.length() != 0) - { - return b.toString(); - } - return null; - } - - public boolean isSectionOpen() - { - return sectionOpen; - } - - public void setSectionOpen(final boolean sectionOpen) - { - this.sectionOpen = sectionOpen; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportProcessor.java b/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportProcessor.java deleted file mode 100644 index 00eb7b9b5..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportProcessor.java +++ /dev/null @@ -1,117 +0,0 @@ -/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: TextRawReportProcessor.java,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package com.sun.star.report.pentaho.output.text;
-
-import com.sun.star.report.DataSourceFactory;
-import com.sun.star.report.OutputRepository;
-import com.sun.star.report.InputRepository;
-import com.sun.star.report.ImageService;
-import com.sun.star.report.pentaho.PentahoFormulaContext;
-import com.sun.star.report.pentaho.PentahoReportJob;
-import org.jfree.report.ReportProcessingException;
-import org.jfree.report.data.ReportContextImpl;
-import org.jfree.report.flow.ReportContext;
-import org.jfree.report.flow.ReportJob;
-import org.jfree.report.flow.ReportStructureRoot;
-import org.jfree.report.flow.ReportTarget;
-import org.jfree.report.flow.SinglePassReportProcessor;
-import org.jfree.resourceloader.ResourceManager;
-
-/**
- * Creation-Date: 03.07.2006, 17:08:25
- *
- * @author Thomas Morgner
- */
-public class TextRawReportProcessor extends SinglePassReportProcessor
-{
-
- private final OutputRepository outputRepository;
- private final String targetName;
- private final InputRepository inputRepository;
- private final ImageService imageService;
- private final DataSourceFactory dataSourceFactory;
-
- public TextRawReportProcessor(final InputRepository inputRepository,
- final OutputRepository outputRepository,
- final String targetName,
- final ImageService imageService,
- final DataSourceFactory dataSourceFactory)
- {
- if (inputRepository == null)
- {
- throw new NullPointerException();
- }
- if (outputRepository == null)
- {
- throw new NullPointerException();
- }
- if (targetName == null)
- {
- throw new NullPointerException();
- }
- if (imageService == null)
- {
- throw new NullPointerException();
- }
- if (dataSourceFactory == null)
- {
- throw new NullPointerException();
- }
-
- this.targetName = targetName;
- this.inputRepository = inputRepository;
- this.outputRepository = outputRepository;
- this.imageService = imageService;
- this.dataSourceFactory = dataSourceFactory;
- }
-
- protected ReportTarget createReportTarget(final ReportJob job)
- throws ReportProcessingException
- {
- final ReportStructureRoot report = job.getReportStructureRoot();
- final ResourceManager resourceManager = report.getResourceManager();
-
- return new TextRawReportTarget(job, resourceManager, report.getBaseResource(),
- inputRepository, outputRepository, targetName, imageService, dataSourceFactory);
- }
-
- protected ReportContext createReportContext(final ReportJob job,
- final ReportTarget target)
- {
- final ReportContext context = super.createReportContext(job, target);
- if (context instanceof ReportContextImpl)
- {
- final ReportContextImpl impl = (ReportContextImpl) context;
- impl.setFormulaContext(new PentahoFormulaContext(impl.getFormulaContext(),job.getConfiguration()));
- }
- return context;
- }
-}
-
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java b/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java deleted file mode 100644 index 7ef944bae..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java +++ /dev/null @@ -1,1518 +0,0 @@ -/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: TextRawReportTarget.java,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-package com.sun.star.report.pentaho.output.text;
-
-import com.sun.star.report.DataSourceFactory;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.InputStream;
-import org.jfree.io.IOUtils;
-import java.io.OutputStreamWriter;
-import java.util.Iterator;
-import java.util.Map;
-
-import com.sun.star.report.ImageService;
-import com.sun.star.report.InputRepository;
-import com.sun.star.report.OutputRepository;
-import com.sun.star.report.pentaho.OfficeNamespaces;
-import com.sun.star.report.OfficeToken;
-import com.sun.star.report.pentaho.PentahoReportEngineMetaData;
-import com.sun.star.report.pentaho.layoutprocessor.FormatValueUtility;
-import com.sun.star.report.pentaho.model.OfficeMasterPage;
-import com.sun.star.report.pentaho.model.OfficeMasterStyles;
-import com.sun.star.report.pentaho.model.OfficeStyle;
-import com.sun.star.report.pentaho.model.OfficeStyles;
-import com.sun.star.report.pentaho.model.OfficeStylesCollection;
-import com.sun.star.report.pentaho.model.PageSection;
-import com.sun.star.report.pentaho.output.OfficeDocumentReportTarget;
-import com.sun.star.report.pentaho.output.StyleUtilities;
-import com.sun.star.report.pentaho.styles.LengthCalculator;
-import java.util.ArrayList;
-import org.jfree.layouting.input.style.values.CSSNumericValue;
-import org.jfree.layouting.util.AttributeMap;
-import org.jfree.report.DataSourceException;
-import org.jfree.report.ReportProcessingException;
-import org.jfree.report.flow.ReportJob;
-import org.jfree.report.flow.ReportStructureRoot;
-import org.jfree.report.flow.ReportTargetUtil;
-import org.jfree.report.structure.Element;
-import org.jfree.report.structure.Node;
-import org.jfree.report.structure.Section;
-import org.jfree.report.util.AttributeNameGenerator;
-import org.jfree.report.util.IntegerCache;
-import org.jfree.resourceloader.ResourceKey;
-import org.jfree.resourceloader.ResourceManager;
-import org.jfree.util.FastStack;
-import org.jfree.util.ObjectUtilities;
-//import org.jfree.util.Log;
-import org.jfree.xmlns.common.AttributeList;
-import org.jfree.xmlns.writer.XmlWriter;
-import org.jfree.xmlns.writer.XmlWriterSupport;
-
-/**
- * Creation-Date: 03.07.2006, 16:28:00
- *
- * @author Thomas Morgner
- */
-public class TextRawReportTarget extends OfficeDocumentReportTarget
-{
-
- private static final String ALWAYS = "always";
- private static final String KEEP_TOGETHER = "keep-together";
- private static final String KEEP_WITH_NEXT = "keep-with-next";
- private static final String MAY_BREAK_BETWEEN_ROWS = "may-break-between-rows";
- private static final String NAME = "name";
- private static final String NONE = "none";
- private static final String NORMAL = "normal";
- private static final String PARAGRAPH_PROPERTIES = "paragraph-properties";
- private static final String STANDARD = "Standard";
- private static final String TABLE_PROPERTIES = "table-properties";
- private static final String VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT = "variables_paragraph_with_next";
- private static final String VARIABLES_HIDDEN_STYLE_WITHOUT_KEEPWNEXT = "variables_paragraph_without_next";
- private static final int TABLE_LAYOUT_VARIABLES_PARAGRAPH = 0;
- private static final int TABLE_LAYOUT_VARIABLES_IN_FIRST_CELL = 1;
- private static final int TABLE_LAYOUT_SINGLE_DETAIL_TABLE = 2;
- private static final int CP_SETUP = 0;
- private static final int CP_FIRST_TABLE = 1;
- private static final int CP_NEXT_TABLE = 2;
-
- // This is the initial state of the detail-band processing. It states, that we are now waiting for a
- // detail-band to be printed.
- private static final int DETAIL_SECTION_WAIT = 0;
- // The first detail section has started.
- private static final int DETAIL_SECTION_FIRST_STARTED = 1;
- // The first detail section has been printed.
- private static final int DETAIL_SECTION_FIRST_PRINTED = 2;
- // An other detail section has started
- private static final int DETAIL_SECTION_OTHER_STARTED = 3;
- // The other detail section has been printed.
- private static final int DETAIL_SECTION_OTHER_PRINTED = 4;
- private boolean pageFooterOnReportFooter;
- private boolean pageFooterOnReportHeader;
- private boolean pageHeaderOnReportFooter;
- private boolean pageHeaderOnReportHeader;
- private int contentProcessingState;
- private OfficeMasterPage currentMasterPage;
- private final FastStack activePageContext;
- private MasterPageFactory masterPageFactory;
- private LengthCalculator sectionHeight;
- private String variables;
- private PageBreakDefinition pageBreakDefinition;
- private VariablesDeclarations variablesDeclarations;
- private boolean columnBreakPending;
- private boolean sectionKeepTogether;
- private final AttributeNameGenerator sectionNames;
- private int detailBandProcessingState;
- private final int tableLayoutConfig;
- private int expectedTableRowCount;
- private boolean firstCellSeen;
- private boolean cellEmpty;
-
- public TextRawReportTarget(final ReportJob reportJob,
- final ResourceManager resourceManager,
- final ResourceKey baseResource,
- final InputRepository inputRepository,
- final OutputRepository outputRepository,
- final String target,
- final ImageService imageService,
- final DataSourceFactory datasourcefactory)
- throws ReportProcessingException
- {
- super(reportJob, resourceManager, baseResource, inputRepository, outputRepository, target, imageService, datasourcefactory);
- activePageContext = new FastStack();
- this.sectionNames = new AttributeNameGenerator();
-
- this.tableLayoutConfig = TABLE_LAYOUT_SINGLE_DETAIL_TABLE;
- }
-
- protected String getTargetMimeType()
- {
- return "application/vnd.oasis.opendocument.text";
- }
-
- /**
- * Checks, whether a manual page break should be inserted at the next possible location.
- *
- * @return true, if a pagebreak is pending, false otherwise.
- */
- private boolean isPagebreakPending()
- {
- return pageBreakDefinition != null;
- }
-
- private boolean isResetPageNumber()
- {
- if (pageBreakDefinition == null)
- {
- return false;
- }
- return pageBreakDefinition.isResetPageNumber();
- }
-
- /**
- * Defines, whether a manual pagebreak should be inserted at the next possible location.
- *
- * @param pageBreakDefinition the new flag value.
- */
- private void setPagebreakDefinition(final PageBreakDefinition pageBreakDefinition)
- {
- this.pageBreakDefinition = pageBreakDefinition;
- }
-
- private PageBreakDefinition getPagebreakDefinition()
- {
- return pageBreakDefinition;
- }
-
- // todo
- private boolean isKeepTableWithNext()
- {
- final int keepTogetherState = getCurrentContext().getKeepTogether();
- if (keepTogetherState == PageContext.KEEP_TOGETHER_GROUP)
- {
- return true;
- }
-
- final boolean keepWithNext;
- if (keepTogetherState == PageContext.KEEP_TOGETHER_FIRST_DETAIL)
- {
- keepWithNext = (detailBandProcessingState == DETAIL_SECTION_WAIT);
- }
- else
- {
- keepWithNext = false;
- }
- return keepWithNext;
- }
-
- private boolean isSectionPagebreakAfter(final AttributeMap attrs)
- {
- final Object forceNewPage =
- attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "force-new-page");
- if ("after-section".equals(forceNewPage))
- {
- return true;
- }
- if ("before-after-section".equals(forceNewPage))
- {
- return true;
- }
- return false;
- }
-
- private boolean isSectionPagebreakBefore(final AttributeMap attrs)
- {
- final Object forceNewPage =
- attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "force-new-page");
- return "before-section".equals(forceNewPage) || "before-after-section".equals(forceNewPage);
- }
-
- private PageContext getCurrentContext()
- {
- return (PageContext) activePageContext.peek();
- }
-
- private String createMasterPage(final boolean printHeader,
- final boolean printFooter)
- throws ReportProcessingException
- {
- // create the master page for the report-header.
- // If there is a page-header or footer in the report that gets
- // surpressed on the report-header, we have to insert a pagebreak
- // afterwards.
-
- final String activePageFooter;
- // Check, whether the report header can have a page-header
- final PageContext context = getCurrentContext();
- if (printFooter)
- {
- activePageFooter = context.getPageFooterContent();
- }
- else
- {
- activePageFooter = null;
- }
- final String activePageHeader;
- if (printHeader)
- {
- // we have to insert a manual pagebreak after the report header.
- activePageHeader = context.getPageHeaderContent();
- }
- else
- {
- activePageHeader = null;
- }
-
- final String masterPageName;
- if (currentMasterPage == null ||
- !masterPageFactory.containsMasterPage(STANDARD, activePageHeader, activePageFooter))
- {
-
- final CSSNumericValue headerSize = context.getAllHeaderSize();
- final CSSNumericValue footerSize = context.getAllFooterSize();
-
-
- currentMasterPage = masterPageFactory.createMasterPage(STANDARD, activePageHeader, activePageFooter);
-
-// Log.debug("Created a new master-page: " + currentMasterPage.getStyleName());
-
- // todo: Store the page-layouts as well.
- // The page layouts are derived from a common template, but as the
- // header-heights differ, we have to derive these beasts instead
- // of copying them
-
- final OfficeStylesCollection officeStylesCollection = getGlobalStylesCollection();
- final OfficeMasterStyles officeMasterStyles = officeStylesCollection.getMasterStyles();
- final String pageLayoutTemplate = currentMasterPage.getPageLayout();
- if (pageLayoutTemplate == null)
- {
- // there is no pagelayout. Create one ..
- final String derivedLayout = masterPageFactory.createPageStyle(getGlobalStylesCollection().getAutomaticStyles(), headerSize, footerSize);
- currentMasterPage.setPageLayout(derivedLayout);
- }
- else
- {
- final String derivedLayout = masterPageFactory.derivePageStyle(pageLayoutTemplate,
- getPredefinedStylesCollection().getAutomaticStyles(),
- getGlobalStylesCollection().getAutomaticStyles(), headerSize, footerSize);
- currentMasterPage.setPageLayout(derivedLayout);
- }
- officeMasterStyles.addMasterPage(currentMasterPage);
- masterPageName = currentMasterPage.getStyleName();
- }
- else
- {
- // retrieve the master-page.
- final OfficeMasterPage masterPage = masterPageFactory.getMasterPage(STANDARD, activePageHeader, activePageFooter);
- if (ObjectUtilities.equal(masterPage.getStyleName(), currentMasterPage.getStyleName()))
- {
- // They are the same,
- masterPageName = null;
- }
- else
- {
- // reuse the existing one ..
- currentMasterPage = masterPage;
- masterPageName = currentMasterPage.getStyleName();
- }
- }
-
- // if either the pageheader or footer are *not* printed with the
- // report header, then this implies that we have to insert a manual
- // pagebreak at the end of the section.
-
- if ((!printHeader && context.getHeader() != null) ||
- (!printFooter && context.getFooter() != null))
- {
- setPagebreakDefinition(new PageBreakDefinition(isResetPageNumber()));
- }
-
- return masterPageName;
- }
-
- private boolean isColumnBreakPending()
- {
- return columnBreakPending;
- }
-
- private void setColumnBreakPending(final boolean columnBreakPending)
- {
- this.columnBreakPending = columnBreakPending;
- }
-
- private Integer parseInt(final Object value)
- {
- if (value instanceof Number)
- {
- final Number n = (Number) value;
- return IntegerCache.getInteger(n.intValue());
- }
- if (value instanceof String)
- {
- try
- {
- return IntegerCache.getInteger(Integer.parseInt((String) value));
- }
- catch (NumberFormatException nfe)
- {
- //return null; // ignore
- }
- }
- return null;
- }
-
- private BufferState applyColumnsToPageBand(final BufferState contents,
- final int numberOfColumns)
- throws IOException, ReportProcessingException
- {
- if (numberOfColumns <= 1)
- {
- return contents;
- }
- startBuffering(getGlobalStylesCollection(), true);
- // derive section style ..
-
- // This is a rather cheap solution to the problem. In a sane world, we would have to feed the
- // footer multiple times. Right now, we simply rely on the balacing, which should make sure that
- // the column's content are evenly distributed.
- final XmlWriter writer = getXmlWriter();
- final AttributeList attrs = new AttributeList();
- attrs.setAttribute(OfficeNamespaces.TEXT_NS, OfficeToken.STYLE_NAME, generateSectionStyle(numberOfColumns));
- attrs.setAttribute(OfficeNamespaces.TEXT_NS, NAME, sectionNames.generateName("Section"));
- writer.writeTag(OfficeNamespaces.TEXT_NS, "section", attrs, XmlWriterSupport.OPEN);
- for (int i = 0; i < numberOfColumns; i++)
- {
- writer.writeStream(contents.getXmlAsReader());
- }
-
- writer.writeCloseTag();
- return finishBuffering();
- }
-
- private String generateSectionStyle(final int columnCount)
- {
- final OfficeStyles automaticStyles = getStylesCollection().getAutomaticStyles();
- final String styleName = getAutoStyleNameGenerator().generateName("auto_section_style");
-
- final Section sectionProperties = new Section();
- sectionProperties.setNamespace(OfficeNamespaces.STYLE_NS);
- sectionProperties.setType("section-properties");
- sectionProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, "transparent");
- sectionProperties.setAttribute(OfficeNamespaces.TEXT_NS, "dont-balance-text-columns", OfficeToken.FALSE);
- sectionProperties.setAttribute(OfficeNamespaces.STYLE_NS, "editable", OfficeToken.FALSE);
-
- if (columnCount > 1)
- {
- final Section columns = new Section();
- columns.setNamespace(OfficeNamespaces.STYLE_NS);
- columns.setType("columns");
- columns.setAttribute(OfficeNamespaces.FO_NS, "column-count", String.valueOf(columnCount));
- columns.setAttribute(OfficeNamespaces.STYLE_NS, "column-gap", "0cm");
- sectionProperties.addNode(columns);
-
-// final Section columnSep = new Section();
-// columnSep.setNamespace(OfficeNamespaces.STYLE_NS);
-// columnSep.setType("column-sep");
-// columnSep.setAttribute(OfficeNamespaces.STYLE_NS, "width", "0.035cm");
-// columnSep.setAttribute(OfficeNamespaces.STYLE_NS, "color", "#000000");
-// columnSep.setAttribute(OfficeNamespaces.STYLE_NS, "height", "100%");
-// columns.addNode(columnSep);
-
- for (int i = 0; i < columnCount; i++)
- {
- final Section column = new Section();
- column.setNamespace(OfficeNamespaces.STYLE_NS);
- column.setType("column");
- column.setAttribute(OfficeNamespaces.STYLE_NS, "rel-width", "1*");
- column.setAttribute(OfficeNamespaces.FO_NS, "start-indent", "0cm");
- column.setAttribute(OfficeNamespaces.FO_NS, "end-indent", "0cm");
- columns.addNode(column);
- }
- }
-
- final OfficeStyle style = new OfficeStyle();
- style.setNamespace(OfficeNamespaces.STYLE_NS);
- style.setType("style");
- style.setAttribute(OfficeNamespaces.STYLE_NS, NAME, styleName);
- style.setAttribute(OfficeNamespaces.STYLE_NS, "family", "section");
- style.addNode(sectionProperties);
-
- automaticStyles.addStyle(style);
- return styleName;
- }
-
- /**
- * Starts the output of a new office document. This method writes the generic 'office:document-content' tag along with
- * all known namespace declarations.
- *
- * @param report the report object.
- * @throws org.jfree.report.DataSourceException
- * if there was an error accessing the datasource
- * @throws org.jfree.report.ReportProcessingException
- * if some other error occured.
- */
- public void startReport(final ReportStructureRoot report)
- throws DataSourceException, ReportProcessingException
- {
- super.startReport(report);
- variablesDeclarations = new VariablesDeclarations();
- detailBandProcessingState = DETAIL_SECTION_WAIT;
- sectionNames.reset();
-
- pageFooterOnReportFooter = false;
- pageFooterOnReportHeader = false;
- pageHeaderOnReportFooter = false;
- pageHeaderOnReportHeader = false;
- contentProcessingState = TextRawReportTarget.CP_SETUP;
-
- activePageContext.clear();
- activePageContext.push(new PageContext());
-
- final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
- masterPageFactory = new MasterPageFactory(predefStyles.getMasterStyles());
-
- predefStyles.getAutomaticStyles().addStyle(createVariablesStyle(true));
- predefStyles.getAutomaticStyles().addStyle(createVariablesStyle(false));
- }
-
- private OfficeStyle createVariablesStyle(final boolean keepWithNext)
- {
- final OfficeStyle variablesSectionStyle = new OfficeStyle();
- variablesSectionStyle.setStyleFamily(OfficeToken.PARAGRAPH);
- if (keepWithNext)
- {
- variablesSectionStyle.setStyleName(TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT);
- }
- else
- {
- variablesSectionStyle.setStyleName(TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITHOUT_KEEPWNEXT);
- }
-
- final Section paragraphProps = new Section();
- paragraphProps.setNamespace(OfficeNamespaces.STYLE_NS);
- paragraphProps.setType(PARAGRAPH_PROPERTIES);
- paragraphProps.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, "transparent");
- paragraphProps.setAttribute(OfficeNamespaces.FO_NS, "text-align", "start");
- paragraphProps.setAttribute(OfficeNamespaces.FO_NS, KEEP_WITH_NEXT, ALWAYS);
- paragraphProps.setAttribute(OfficeNamespaces.FO_NS, KEEP_TOGETHER, ALWAYS);
- paragraphProps.setAttribute(OfficeNamespaces.STYLE_NS, "vertical-align", "top");
- variablesSectionStyle.addNode(paragraphProps);
-
- final Section textProps = new Section();
- textProps.setNamespace(OfficeNamespaces.STYLE_NS);
- textProps.setType("text-properties");
- textProps.setAttribute(OfficeNamespaces.FO_NS, "font-variant", NORMAL);
- textProps.setAttribute(OfficeNamespaces.FO_NS, "text-transform", NONE);
- textProps.setAttribute(OfficeNamespaces.FO_NS, "color", "#ffffff");
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-outline", OfficeToken.FALSE);
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-blinking", OfficeToken.FALSE);
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-line-through-style", NONE);
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-line-through-mode", "continuous");
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-position", "0% 100%");
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "font-name", "Tahoma");
- textProps.setAttribute(OfficeNamespaces.FO_NS, "font-size", "1pt");
- textProps.setAttribute(OfficeNamespaces.FO_NS, "letter-spacing", NORMAL);
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "letter-kerning", OfficeToken.FALSE);
- textProps.setAttribute(OfficeNamespaces.FO_NS, "font-style", NORMAL);
- textProps.setAttribute(OfficeNamespaces.FO_NS, "text-shadow", NONE);
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-underline-style", NONE);
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-underline-mode", "continuous");
- textProps.setAttribute(OfficeNamespaces.FO_NS, "font-weight", NORMAL);
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-rotation-angle", "0");
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-emphasize", NONE);
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-combine", NONE);
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-combine-start-char", "");
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-combine-end-char", "");
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-blinking", OfficeToken.FALSE);
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-scale", "100%");
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "font-relief", NONE);
- textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-display", NONE);
- variablesSectionStyle.addNode(textProps);
- return variablesSectionStyle;
- }
-
- protected void startContent(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- final XmlWriter xmlWriter = getXmlWriter();
- xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "text", null, XmlWriterSupport.OPEN);
-
- // now start the buffering. We have to insert the variables declaration
- // later ..
- startBuffering(getStylesCollection(), true);
-
- final Object columnCountRaw = attrs.getAttribute(OfficeNamespaces.FO_NS, "column-count");
- final Integer colCount = parseInt(columnCountRaw);
- if (colCount != null)
- {
- final PageContext pageContext = getCurrentContext();
- pageContext.setColumnCount(colCount);
- }
-
- }
-
- protected void startOther(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs);
- final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs);
-
- if (ObjectUtilities.equal(OfficeNamespaces.INTERNAL_NS, namespace))
- {
- if (ObjectUtilities.equal(OfficeToken.IMAGE, elementType))
- {
- startImageProcessing(attrs);
- }
- else if (ObjectUtilities.equal(OfficeToken.OBJECT_OLE, elementType) && getCurrentRole() != ROLE_TEMPLATE)
- {
- startChartProcessing(attrs);
- }
- return;
- }
- else if (isFilteredNamespace(namespace))
- {
- throw new IllegalStateException("This element should be hidden: " +
- namespace + ", " + elementType);
- }
-
- if (isTableMergeActive() && detailBandProcessingState == DETAIL_SECTION_OTHER_PRINTED && ObjectUtilities.equal(OfficeNamespaces.TABLE_NS, namespace) && ObjectUtilities.equal(OfficeToken.TABLE_COLUMNS, elementType))
- {
- // Skip the columns section if the tables get merged..
- startBuffering(getStylesCollection(), true);
- return;
- }
- else
- {
- openSection();
-
- final boolean isTableNS = ObjectUtilities.equal(OfficeNamespaces.TABLE_NS, namespace);
- if (isTableNS)
- {
- if (ObjectUtilities.equal(OfficeToken.TABLE, elementType))
- {
- startTable(attrs);
- return;
- }
-
- if (ObjectUtilities.equal(OfficeToken.TABLE_ROW, elementType))
- {
- startRow(attrs);
- return;
- }
- }
-
-
- if (ObjectUtilities.equal(OfficeNamespaces.TEXT_NS, namespace))
- {
- if (ObjectUtilities.equal("variable-set", elementType))
- {
- // update the variables-declaration thingie ..
- final String varName = (String) attrs.getAttribute(OfficeNamespaces.TEXT_NS, NAME);
- final String varType = (String) attrs.getAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE);
- final String newVarName = variablesDeclarations.produceVariable(varName, varType);
- attrs.setAttribute(OfficeNamespaces.TEXT_NS, NAME, newVarName);
- }
- else if (ObjectUtilities.equal("variable-get", elementType))
- {
- final String varName = (String) attrs.getAttribute(OfficeNamespaces.TEXT_NS, NAME);
- final String varType = (String) attrs.getAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE);
- final String newVarName = variablesDeclarations.produceVariable(varName, varType);
- attrs.setAttribute(OfficeNamespaces.TEXT_NS, NAME, newVarName);
- // this one must not be written, as the DTD does not declare it.
- // attrs.setAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE, null);
- }
- }
-
- if (tableLayoutConfig == TABLE_LAYOUT_VARIABLES_PARAGRAPH && variables != null)
- {
- // This cannot happen as long as the report sections only contain tables. But at some point in the
- // future they will be made of paragraphs, and then we are prepared ..
- // Log.debug("Variables-Section in own paragraph " + variables);
-
- StyleUtilities.copyStyle(OfficeToken.PARAGRAPH,
- TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, getStylesCollection(),
- getGlobalStylesCollection(), getPredefinedStylesCollection());
- final XmlWriter xmlWriter = getXmlWriter();
- xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, OfficeToken.P, OfficeToken.STYLE_NAME,
- TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, XmlWriterSupport.OPEN);
- xmlWriter.writeText(variables);
- xmlWriter.writeCloseTag();
- variables = null;
- }
-
- if (isTableNS && ObjectUtilities.equal(OfficeToken.TABLE_CELL, elementType))
- {
- cellEmpty = true;
- }
-
- final boolean keepTogetherOnParagraph = true;
-
- if (keepTogetherOnParagraph)
- {
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, OfficeToken.P, attrs))
- {
- final int keepTogetherState = getCurrentContext().getKeepTogether();
- cellEmpty = false;
- if (!firstCellSeen && (sectionKeepTogether || keepTogetherState == PageContext.KEEP_TOGETHER_GROUP))
- {
- OfficeStyle style = null;
- final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TEXT_NS, OfficeToken.STYLE_NAME);
- if (styleName == null)
- {
- final boolean keep = (keepTogetherState == PageContext.KEEP_TOGETHER_GROUP || expectedTableRowCount > 0) && isParentKeepTogether();
- final ArrayList propertyNameSpaces = new ArrayList();
- final ArrayList propertyNames = new ArrayList();
- final ArrayList propertyValues = new ArrayList();
-
- propertyNameSpaces.add(OfficeNamespaces.FO_NS);
- propertyNameSpaces.add(OfficeNamespaces.FO_NS);
- propertyNames.add(KEEP_TOGETHER);
- propertyValues.add(ALWAYS);
- if (keep)
- {
- propertyNames.add(KEEP_WITH_NEXT);
- propertyValues.add(ALWAYS);
- }
- else
- {
- propertyNames.add(KEEP_WITH_NEXT);
- propertyValues.add(null);
- }
- style = StyleUtilities.queryStyleByProperties(getStylesCollection(), OfficeToken.PARAGRAPH, PARAGRAPH_PROPERTIES, propertyNameSpaces, propertyNames, propertyValues);
- }
- if (style == null)
- {
- style = deriveStyle(OfficeToken.PARAGRAPH, styleName);
- // Lets set the 'keep-together' flag..
-
- Element paragraphProps = style.getParagraphProperties();
- if (paragraphProps == null)
- {
- paragraphProps = new Section();
- paragraphProps.setNamespace(OfficeNamespaces.STYLE_NS);
- paragraphProps.setType(PARAGRAPH_PROPERTIES);
- style.addNode(paragraphProps);
- }
- paragraphProps.setAttribute(OfficeNamespaces.FO_NS, KEEP_TOGETHER, ALWAYS);
-
- // We prevent pagebreaks within the two adjacent rows (this one and the next one) if
- // either a group-wide keep-together is defined or if we haven't reached the end of the
- // current section yet.
- if ((keepTogetherState == PageContext.KEEP_TOGETHER_GROUP || expectedTableRowCount > 0) && isParentKeepTogether())
- {
- paragraphProps.setAttribute(OfficeNamespaces.FO_NS, KEEP_WITH_NEXT, ALWAYS);
- }
- }
-
- attrs.setAttribute(OfficeNamespaces.TEXT_NS, OfficeToken.STYLE_NAME, style.getStyleName());
- }
- }
- }
-
- if (ObjectUtilities.equal(OfficeNamespaces.DRAWING_NS, namespace) && ObjectUtilities.equal(OfficeToken.FRAME, elementType))
- {
- final String styleName = (String) attrs.getAttribute(OfficeNamespaces.DRAWING_NS, OfficeToken.STYLE_NAME);
- final OfficeStyle predefAutoStyle = getPredefinedStylesCollection().getAutomaticStyles().getStyle(OfficeToken.GRAPHIC, styleName);
- if (predefAutoStyle != null)
- {
- // special ole handling
- final Element graphicProperties = predefAutoStyle.getGraphicProperties();
- graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, VERTICAL_POS, "from-top");
- graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, HORIZONTAL_POS, "from-left");
- graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "vertical-rel", "paragraph-content");
- graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "horizontal-rel", "paragraph");
- graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "flow-with-text", "false");
- graphicProperties.setAttribute(OfficeNamespaces.DRAWING_NS, "ole-draw-aspect", "1");
-
- // attrs.setAttribute(OfficeNamespaces.DRAWING_NS, OfficeToken.STYLE_NAME, predefAutoStyle.getStyleName());
- }
- }
-
- // process the styles as usual
- performStyleProcessing(attrs);
- final XmlWriter xmlWriter = getXmlWriter();
- final AttributeList attrList = buildAttributeList(attrs);
- xmlWriter.writeTag(namespace, elementType, attrList, XmlWriterSupport.OPEN);
-
- if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, OfficeToken.P, attrs))
- {
- cellEmpty = false;
- if (tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH && variables != null)
- {
- //Log.debug("Variables-Section in existing cell " + variables);
- xmlWriter.writeText(variables);
- variables = null;
- }
- }
- }
- }
-
- private void startRow(final AttributeMap attrs)
- throws IOException, ReportProcessingException
- {
- firstCellSeen = false;
- expectedTableRowCount -= 1;
- final String rowStyle = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
- final CSSNumericValue rowHeight = computeRowHeight(rowStyle);
- // Log.debug("Adding row-Style: " + rowStyle + " " + rowHeight);
- sectionHeight.add(rowHeight);
-
-// if (expectedTableRowCount > 0)
-// {
-// // Some other row. Create a keep-together
-//
-// }
-// else
-// {
-// // This is the last row before the section will end.
-// // or (in some weird cases) There is no information when the row will end.
-// // Anyway, if we are here, we do not create a keep-together style on the table-row ..
-// }
- // process the styles as usual
- performStyleProcessing(attrs);
-
- final AttributeList attrList = buildAttributeList(attrs);
- getXmlWriter().writeTag(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_ROW, attrList, XmlWriterSupport.OPEN);
- }
-
- private void startTable(final AttributeMap attrs)
- throws ReportProcessingException, IOException
- {
- final Integer trc = (Integer) attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "table-row-count");
- if (trc == null)
- {
- expectedTableRowCount = -1;
- }
- else
- {
- expectedTableRowCount = trc.intValue();
- }
-
- if (isSectionPagebreakBefore(attrs))
- {
- // force a pagebreak ..
- setPagebreakDefinition(new PageBreakDefinition(isResetPageNumber()));
- }
-
- // its a table. This means, it is a root-level element
- final PageBreakDefinition breakDefinition;
- String masterPageName = null;
- final int currentRole = getCurrentRole();
- if (contentProcessingState == TextRawReportTarget.CP_FIRST_TABLE)
- {
- contentProcessingState = TextRawReportTarget.CP_NEXT_TABLE;
-
- // Processing the report header now.
- if (currentRole == OfficeDocumentReportTarget.ROLE_REPORT_HEADER)
- {
- breakDefinition = new PageBreakDefinition(isResetPageNumber());
- masterPageName = createMasterPage(pageHeaderOnReportHeader, pageFooterOnReportHeader);
- if (masterPageName == null)
- {
- // we should always have a master-page ...
- masterPageName = currentMasterPage.getStyleName();
- }
- }
- else if (currentRole == OfficeDocumentReportTarget.ROLE_REPORT_FOOTER)
- {
- breakDefinition = new PageBreakDefinition(isResetPageNumber());
- masterPageName = createMasterPage(pageHeaderOnReportFooter, pageFooterOnReportFooter);
- if (masterPageName == null && isSectionPagebreakBefore(attrs))
- {
- // If we have a manual pagebreak, then activate the current master-page again.
- masterPageName = currentMasterPage.getStyleName();
- }
- // But we skip this (and therefore the resulting pagebreak) if there is no manual break
- // and no other condition that would force an break.
- }
- else if (currentRole == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER || currentRole == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER)
- {
- breakDefinition = null;
- // no pagebreaks ..
- }
- else if (currentMasterPage == null ||
- isPagebreakPending())
- {
- // Must be the first table, as we have no master-page yet.
- masterPageName = createMasterPage(true, true);
- setPagebreakDefinition(null);
- if (masterPageName == null)
- {
- // we should always have a master-page ...
- masterPageName = currentMasterPage.getStyleName();
- }
- breakDefinition = new PageBreakDefinition(isResetPageNumber());
- }
- else
- {
- breakDefinition = null;
- }
- }
- else if (isPagebreakPending() &&
- currentRole != OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER &&
- currentRole != OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER)
- {
- // Derive an automatic style for the pagebreak.
-// Log.debug("Manual pagebreak (within the section): " + getCurrentRole());
- breakDefinition = getPagebreakDefinition();
- setPagebreakDefinition(null);
- masterPageName = createMasterPage(true, true);
- if (masterPageName == null || isSectionPagebreakBefore(attrs))
- {
- // If we have a manual pagebreak, then activate the current master-page again.
- masterPageName = currentMasterPage.getStyleName();
- }
- }
- else
- {
- breakDefinition = null;
- }
-
- final XmlWriter xmlWriter = getXmlWriter();
- if (detailBandProcessingState == DETAIL_SECTION_OTHER_PRINTED &&
- masterPageName != null)
- {
- // close the last table-tag, we will open a new one
- xmlWriter.writeCloseTag();
- // Reset the detail-state to 'started' so that the table's columns get printed now.
- detailBandProcessingState = DETAIL_SECTION_OTHER_STARTED;
- }
-
- if (tableLayoutConfig == TABLE_LAYOUT_VARIABLES_PARAGRAPH && variables != null)
- {
- if (masterPageName != null)
- {
- // write a paragraph that uses the VARIABLES_HIDDEN_STYLE as
- // primary style. Derive that one and add the manual pagebreak.
- // The predefined style already has the 'keep-together' flags set.
-// Log.debug("Variables-Section with new Master-Page " + variables + " " + masterPageName);
-
- final OfficeStyle style = deriveStyle(OfficeToken.PARAGRAPH, TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT);
- style.setAttribute(OfficeNamespaces.STYLE_NS, "master-page-name", masterPageName);
- if (breakDefinition.isResetPageNumber())
- {
- final Element paragraphProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, PARAGRAPH_PROPERTIES);
- paragraphProps.setAttribute(OfficeNamespaces.STYLE_NS, "page-number", "1");
- }
- if (isColumnBreakPending())
- {
- final Element paragraphProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, PARAGRAPH_PROPERTIES);
- paragraphProps.setAttribute(OfficeNamespaces.FO_NS, "break-before", "column");
- setColumnBreakPending(false);
- }
- xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, OfficeToken.P, OfficeToken.STYLE_NAME, style.getStyleName(), XmlWriterSupport.OPEN);
-
- masterPageName = null;
- //breakDefinition = null;
- }
- else if (isColumnBreakPending())
- {
- setColumnBreakPending(false);
-
- final OfficeStyle style = deriveStyle(OfficeToken.PARAGRAPH, TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT);
- final Element paragraphProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, PARAGRAPH_PROPERTIES);
- paragraphProps.setAttribute(OfficeNamespaces.STYLE_NS, "page-number", "1");
-
- xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, OfficeToken.P, OfficeToken.STYLE_NAME, style.getStyleName(), XmlWriterSupport.OPEN);
- }
- else
- {
- // Write a paragraph without adding the pagebreak. We can reuse the global style, but we have to make
- // sure that the style is part of the current 'auto-style' collection.
-// Log.debug("Variables-Section " + variables);
-
- StyleUtilities.copyStyle(OfficeToken.PARAGRAPH,
- TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, getStylesCollection(),
- getGlobalStylesCollection(), getPredefinedStylesCollection());
- xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, OfficeToken.P, OfficeToken.STYLE_NAME,
- TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, XmlWriterSupport.OPEN);
- }
- xmlWriter.writeText(variables);
- xmlWriter.writeCloseTag();
- variables = null;
- }
-
- final boolean keepWithNext = isKeepTableWithNext();
- final boolean localKeepTogether = OfficeToken.TRUE.equals(attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, KEEP_TOGETHER));
- final boolean tableMergeActive = isTableMergeActive();
- if (tableMergeActive)
- {
- this.sectionKeepTogether = localKeepTogether;
- }
- else
- {
- this.sectionKeepTogether = false;
-
- }
-
- // Check, whether we have a reason to derive a style...
- if (masterPageName != null ||
- (!tableMergeActive && (localKeepTogether || keepWithNext)) || isColumnBreakPending())
- {
- final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
- final OfficeStyle style = deriveStyle("table", styleName);
-
- if (masterPageName != null)
- {
-// Log.debug("Starting a new MasterPage: " + masterPageName);
- // Patch the current styles.
- // This usually only happens on Table-Styles or Paragraph-Styles
- style.setAttribute(OfficeNamespaces.STYLE_NS, "master-page-name", masterPageName);
- if (breakDefinition.isResetPageNumber())
- {
- final Element paragraphProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, PARAGRAPH_PROPERTIES);
- paragraphProps.setAttribute(OfficeNamespaces.STYLE_NS, "page-number", "1");
- }
- }
- if (isColumnBreakPending())
- {
- final Element paragraphProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, PARAGRAPH_PROPERTIES);
- paragraphProps.setAttribute(OfficeNamespaces.FO_NS, "break-before", "column");
- setColumnBreakPending(false);
- }
-
- // Inhibit breaks inside the table only if it has been defined and if we do not create one single
- // big detail section. In that case, this flag would be invalid and would cause layout-errors.
- if (!tableMergeActive)
- {
- if (localKeepTogether)
- {
- final Element tableProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, TABLE_PROPERTIES);
- tableProps.setAttribute(OfficeNamespaces.STYLE_NS, MAY_BREAK_BETWEEN_ROWS, OfficeToken.FALSE);
- }
- }
- else
- {
- if (detailBandProcessingState == DETAIL_SECTION_WAIT)
- {
- detailBandProcessingState = DETAIL_SECTION_FIRST_STARTED;
- }
- else if (detailBandProcessingState == DETAIL_SECTION_FIRST_PRINTED)
- {
- detailBandProcessingState = DETAIL_SECTION_OTHER_STARTED;
- }
- }
- if (keepWithNext)
- {
- boolean addKeepWithNext = true;
- if (currentRole == ROLE_GROUP_FOOTER)
- {
- addKeepWithNext = isParentKeepTogether();
- }
-
- final Element tableProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, TABLE_PROPERTIES);
- tableProps.setAttribute(OfficeNamespaces.STYLE_NS, MAY_BREAK_BETWEEN_ROWS, OfficeToken.FALSE);
- if (addKeepWithNext)
- {
- tableProps.setAttribute(OfficeNamespaces.FO_NS, KEEP_WITH_NEXT, ALWAYS);
- // A keep-with-next does not work, if the may-break-betweek rows is not set to false ..
- }
- }
- attrs.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, style.getStyleName());
- // no need to copy the styles, this was done while deriving the
- // style ..
- }
- else
- {
- // Check, whether we may be able to skip the table.
- if (tableMergeActive)
- {
- if (detailBandProcessingState == DETAIL_SECTION_OTHER_PRINTED)
- {
- // Skip the whole thing ..
- return;
- }
- else if (detailBandProcessingState == DETAIL_SECTION_WAIT)
- {
- if (keepWithNext)
- {
- final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
-
- final OfficeStyle style = deriveStyle(OfficeToken.TABLE, styleName);
- final Element tableProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, TABLE_PROPERTIES);
- // A keep-with-next does not work, if the may-break-betweek rows is not set to false ..
- tableProps.setAttribute(OfficeNamespaces.STYLE_NS, MAY_BREAK_BETWEEN_ROWS, OfficeToken.FALSE);
- final String hasGroupFooter = (String) attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "has-group-footer");
- if (hasGroupFooter != null && hasGroupFooter.equals(OfficeToken.TRUE))
- {
- tableProps.setAttribute(OfficeNamespaces.FO_NS, KEEP_WITH_NEXT, ALWAYS);
- }
-
- attrs.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, style.getStyleName());
- }
- detailBandProcessingState = DETAIL_SECTION_FIRST_STARTED;
- }
- else if (detailBandProcessingState == DETAIL_SECTION_FIRST_PRINTED)
- {
- detailBandProcessingState = DETAIL_SECTION_OTHER_STARTED;
- }
- }
-
- // process the styles as usual
- performStyleProcessing(attrs);
- }
-
- final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs);
- final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs);
- final AttributeList attrList = buildAttributeList(attrs);
- xmlWriter.writeTag(namespace, elementType, attrList, XmlWriterSupport.OPEN);
- }
-
- private boolean isParentKeepTogether()
- {
- PageContext context = getCurrentContext();
- if (context != null)
- {
- context = context.getParent();
- if (context != null)
- {
- return context.getKeepTogether() == PageContext.KEEP_TOGETHER_GROUP;
- }
- }
- return false;
- }
-
- private boolean isTableMergeActive()
- {
- return getCurrentRole() == ROLE_DETAIL &&
- tableLayoutConfig == TABLE_LAYOUT_SINGLE_DETAIL_TABLE;
- }
-
- private void openSection()
- throws IOException
- {
- if (isRepeatingSection())
- {
- // repeating sections have other ways of defining columns ..
- return;
- }
- if (getCurrentRole() == ROLE_TEMPLATE ||
- getCurrentRole() == ROLE_SPREADSHEET_PAGE_HEADER ||
- getCurrentRole() == ROLE_SPREADSHEET_PAGE_FOOTER)
- {
- // the template section would break the multi-column stuff and we dont open up sections there
- // anyway ..
- return;
- }
-
- final PageContext pageContext = getCurrentContext();
- final Integer columnCount = pageContext.getColumnCount();
- if (columnCount != null && !pageContext.isSectionOpen())
- {
- final AttributeList attrs = new AttributeList();
- attrs.setAttribute(OfficeNamespaces.TEXT_NS, OfficeToken.STYLE_NAME, generateSectionStyle(columnCount.intValue()));
- attrs.setAttribute(OfficeNamespaces.TEXT_NS, NAME, sectionNames.generateName("Section"));
- getXmlWriter().writeTag(OfficeNamespaces.TEXT_NS, "section", attrs, XmlWriterSupport.OPEN);
-
- pageContext.setSectionOpen(true);
- }
-
- }
-
- protected void startReportSection(final AttributeMap attrs, final int role)
- throws IOException, DataSourceException, ReportProcessingException
- {
- sectionHeight = new LengthCalculator();
- if (role == OfficeDocumentReportTarget.ROLE_TEMPLATE ||
- role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER ||
- role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER)
- {
- // Start buffering with an dummy styles-collection, so that the global styles dont get polluted ..
- startBuffering(new OfficeStylesCollection(), true);
- }
- else if (role == OfficeDocumentReportTarget.ROLE_PAGE_HEADER)
- {
- startBuffering(getGlobalStylesCollection(), true);
- pageHeaderOnReportHeader = PageSection.isPrintWithReportHeader(attrs);
- pageHeaderOnReportFooter = PageSection.isPrintWithReportFooter(attrs);
- }
- else if (role == OfficeDocumentReportTarget.ROLE_PAGE_FOOTER)
- {
- startBuffering(getGlobalStylesCollection(), true);
- pageFooterOnReportHeader = PageSection.isPrintWithReportHeader(attrs);
- pageFooterOnReportFooter = PageSection.isPrintWithReportFooter(attrs);
- }
- else if (role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER || role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER)
- {
- startBuffering(getGlobalStylesCollection(), true);
- }
- else if (role == OfficeDocumentReportTarget.ROLE_VARIABLES)
- {
- startBuffering(getGlobalStylesCollection(), false);
- }
- else
- {
- contentProcessingState = TextRawReportTarget.CP_FIRST_TABLE;
- if (role == OfficeDocumentReportTarget.ROLE_GROUP_HEADER || role == OfficeDocumentReportTarget.ROLE_GROUP_FOOTER)
- {
- // if we have a repeating header, then skip the first one ..
- // if this is a repeating footer, skip the last one. This means,
- // we have to buffer all group footers and wait for the next section..
- startBuffering(getContentStylesCollection(), true);
- }
-
- if (role != OfficeDocumentReportTarget.ROLE_DETAIL)
- {
- // reset the detail-state. The flag will be updated on startTable and endOther(Table) if the
- // current role is ROLE_DETAIL
- detailBandProcessingState = DETAIL_SECTION_WAIT;
- }
- }
- }
-
- protected void startGroup(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- super.startGroup(attrs);
- final PageContext pageContext = new PageContext(getCurrentContext());
- activePageContext.push(pageContext);
-
- final Object resetPageNumber = attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "reset-page-number");
- if (OfficeToken.TRUE.equals(resetPageNumber))
- {
- setPagebreakDefinition(new PageBreakDefinition(true));
- }
-
- final Object keepTogether = attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, KEEP_TOGETHER);
- if ("whole-group".equals(keepTogether))
- {
- pageContext.setKeepTogether(PageContext.KEEP_TOGETHER_GROUP);
- }
- else if ("with-first-detail".equals(keepTogether) && pageContext.getKeepTogether() != PageContext.KEEP_TOGETHER_GROUP)
- {
- pageContext.setKeepTogether(PageContext.KEEP_TOGETHER_FIRST_DETAIL);
- }
-
- final Object columnCountRaw = attrs.getAttribute(OfficeNamespaces.FO_NS, "column-count");
- final Integer colCount = parseInt(columnCountRaw);
- if (colCount != null)
- {
- pageContext.setColumnCount(colCount);
- }
-
- final Object newColumn = attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "start-new-column");
- if (OfficeToken.TRUE.equals(newColumn))
- {
- setColumnBreakPending(true);
- }
- }
-
- protected void startGroupInstance(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- if (getGroupContext().isGroupWithRepeatingSection())
- {
- setPagebreakDefinition(new PageBreakDefinition(isResetPageNumber()));
- }
- }
-
- protected void endGroup(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- if (getGroupContext().isGroupWithRepeatingSection())
- {
- setPagebreakDefinition(new PageBreakDefinition(isResetPageNumber()));
- }
-
- super.endGroup(attrs);
- finishSection();
-
- activePageContext.pop();
- }
-
- private void finishSection()
- throws ReportProcessingException
- {
- final PageContext pageContext = getCurrentContext();
- if (pageContext.isSectionOpen())
- {
- pageContext.setSectionOpen(false);
- try
- {
- getXmlWriter().writeCloseTag();
- }
- catch (IOException e)
- {
- throw new ReportProcessingException("IOError", e);
- }
- }
- }
-
- protected void endReportSection(final AttributeMap attrs, final int role)
- throws IOException, DataSourceException, ReportProcessingException
- {
- if (role == ROLE_TEMPLATE ||
- role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER ||
- role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER)
- {
- finishBuffering();
- return;
- }
-
- final CSSNumericValue result = sectionHeight.getResult();
- if (role == OfficeDocumentReportTarget.ROLE_PAGE_HEADER)
- {
- final PageContext pageContext = getCurrentContext();
- pageContext.setHeader(applyColumnsToPageBand(finishBuffering(), pageContext.getActiveColumns()).getXmlBuffer(), result);
- }
- else if (role == OfficeDocumentReportTarget.ROLE_PAGE_FOOTER)
- {
- final PageContext pageContext = getCurrentContext();
- pageContext.setFooter(applyColumnsToPageBand(finishBuffering(), pageContext.getActiveColumns()).getXmlBuffer(), result);
- }
- else if (role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER)
- {
- final PageContext pageContext = getCurrentContext();
- pageContext.setHeader(applyColumnsToPageBand(finishBuffering(), pageContext.getActiveColumns()).getXmlBuffer(), result);
- }
- else if (role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER)
- {
- final PageContext pageContext = getCurrentContext();
- pageContext.setFooter(applyColumnsToPageBand(finishBuffering(), pageContext.getActiveColumns()).getXmlBuffer(), result);
- }
- else if (role == OfficeDocumentReportTarget.ROLE_VARIABLES)
- {
- if (variables == null)
- {
- variables = finishBuffering().getXmlBuffer();
- }
- else
- {
- variables += finishBuffering().getXmlBuffer();
- }
- }
- else if (role == OfficeDocumentReportTarget.ROLE_GROUP_HEADER)
- {
- final String headerText = finishBuffering().getXmlBuffer();
- final int iterationCount = getGroupContext().getParent().getIterationCount();
- final boolean repeat = OfficeToken.TRUE.equals(attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "repeat-section"));
- if (!repeat || iterationCount > 0)
- {
- getXmlWriter().writeText(headerText);
- }
- }
- else if (role == OfficeDocumentReportTarget.ROLE_GROUP_FOOTER)
- {
- final String footerText = finishBuffering().getXmlBuffer();
- // how do we detect whether this is the last group footer?
- getXmlWriter().writeText(footerText);
- }
-
- }
-
- public void endReport(final ReportStructureRoot report)
- throws DataSourceException, ReportProcessingException
- {
- super.endReport(report);
- variablesDeclarations = null;
-
- try
- {
- // Write the settings ..
- final AttributeList rootAttributes = new AttributeList();
- rootAttributes.addNamespaceDeclaration("office", OfficeNamespaces.OFFICE_NS);
- rootAttributes.addNamespaceDeclaration("config", OfficeNamespaces.CONFIG);
- rootAttributes.addNamespaceDeclaration("ooo", OfficeNamespaces.OO2004_NS);
- rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.0");
- final OutputStream outputStream = getOutputRepository().createOutputStream("settings.xml", "text/xml");
- final XmlWriter xmlWriter = new XmlWriter(new OutputStreamWriter(outputStream, "UTF-8"), createTagDescription());
- xmlWriter.setAlwaysAddNamespace(true);
- xmlWriter.writeXmlDeclaration("UTF-8");
- xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "document-settings", rootAttributes, XmlWriterSupport.OPEN);
- xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "settings", XmlWriterSupport.OPEN);
- xmlWriter.writeTag(OfficeNamespaces.CONFIG, "config-item-set", NAME, "ooo:configuration-settings", XmlWriterSupport.OPEN);
-
- final AttributeList configAttributes = new AttributeList();
- configAttributes.setAttribute(OfficeNamespaces.CONFIG, NAME, "TableRowKeep");
- configAttributes.setAttribute(OfficeNamespaces.CONFIG, "type", "boolean");
- xmlWriter.writeTag(OfficeNamespaces.CONFIG, "config-item", configAttributes, XmlWriterSupport.OPEN);
- xmlWriter.writeText(OfficeToken.TRUE);
- xmlWriter.writeCloseTag();
-
- xmlWriter.writeCloseTag();
- xmlWriter.writeCloseTag();
- xmlWriter.writeCloseTag();
- xmlWriter.close();
-
- // now copy the meta.xml
- if (getInputRepository().isReadable("meta.xml"))
- {
- final InputStream inputStream = getInputRepository().createInputStream("meta.xml");
- try
- {
- final OutputStream outputMetaStream = getOutputRepository().createOutputStream("meta.xml", "text/xml");
- IOUtils.getInstance().copyStreams(inputStream, outputMetaStream);
- outputMetaStream.close();
- } finally
- {
- inputStream.close();
- }
- }
- }
- catch (IOException ioe)
- {
- throw new ReportProcessingException("Failed to write settings document");
- }
- }
-
- protected void endOther(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs);
- final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs);
-
- final boolean isInternalNS = ObjectUtilities.equal(OfficeNamespaces.INTERNAL_NS, namespace);
- final boolean isTableNs = ObjectUtilities.equal(OfficeNamespaces.TABLE_NS, namespace);
- if (isTableMergeActive() && detailBandProcessingState == DETAIL_SECTION_OTHER_PRINTED && isTableNs && ObjectUtilities.equal(OfficeToken.TABLE_COLUMNS, elementType))
- {
- finishBuffering();
- return;
- }
-
- if (isInternalNS && (ObjectUtilities.equal(OfficeToken.IMAGE, elementType) ||
- ObjectUtilities.equal(OfficeToken.OBJECT_OLE, elementType)))
- {
- return;
- }
-
- final XmlWriter xmlWriter = getXmlWriter();
- if (tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH &&
- isTableNs && ObjectUtilities.equal(OfficeToken.TABLE_CELL, elementType))
- {
- if (variables != null)
- {
- // This cannot happen as long as the report sections only contain tables. But at some point in the
- // future they will be made of paragraphs, and then we are prepared ..
- //Log.debug("Variables-Section " + variables);
- final String tag;
- if (sectionKeepTogether && expectedTableRowCount > 0)
- {
- tag = TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT;
- }
- else
- {
- tag = TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITHOUT_KEEPWNEXT;
- }
- StyleUtilities.copyStyle(OfficeToken.PARAGRAPH,
- tag, getStylesCollection(),
- getGlobalStylesCollection(), getPredefinedStylesCollection());
- xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, OfficeToken.P, OfficeToken.STYLE_NAME,
- tag, XmlWriterSupport.OPEN);
- xmlWriter.writeText(variables);
- xmlWriter.writeCloseTag();
- variables = null;
- }
- /**
- // Only generate the empty paragraph, if we have to add the keep-together ..
- else if (cellEmpty && expectedTableRowCount > 0 &&
- sectionKeepTogether && !firstCellSeen)
- {
- // we have no variables ..
- StyleUtilities.copyStyle(OfficeToken.PARAGRAPH,
- TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, getStylesCollection(),
- getGlobalStylesCollection(), getPredefinedStylesCollection());
- xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, OfficeToken.P, OfficeToken.STYLE_NAME,
- TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, XmlWriterSupport.CLOSE);
- }
- */
- }
-
- if (isTableNs && (ObjectUtilities.equal(OfficeToken.TABLE_CELL, elementType) || ObjectUtilities.equal(OfficeToken.COVERED_TABLE_CELL, elementType)))
- {
- firstCellSeen = true;
- }
- if (isTableNs && ObjectUtilities.equal(OfficeToken.TABLE, elementType))
- {
- if (getCurrentRole() == ROLE_DETAIL)
- {
- if (!isTableMergeActive())
- {
- // We do not merge the detail bands, so an ordinary close will do.
- xmlWriter.writeCloseTag();
- }
- else if (detailBandProcessingState == DETAIL_SECTION_FIRST_STARTED)
- {
- final int keepTogetherState = getCurrentContext().getKeepTogether();
- if (keepTogetherState == PageContext.KEEP_TOGETHER_FIRST_DETAIL)
- {
- xmlWriter.writeCloseTag();
- detailBandProcessingState = DETAIL_SECTION_FIRST_PRINTED;
- }
- else
- {
- detailBandProcessingState = DETAIL_SECTION_OTHER_PRINTED;
- }
- }
- else if (detailBandProcessingState == DETAIL_SECTION_OTHER_STARTED)
- {
- detailBandProcessingState = DETAIL_SECTION_OTHER_PRINTED;
- }
- }
- else
- {
- xmlWriter.writeCloseTag();
- }
- if (isSectionPagebreakAfter(attrs))
- {
- setPagebreakDefinition(new PageBreakDefinition(false));
- }
- }
- else
- {
- xmlWriter.writeCloseTag();
- }
- }
-
- protected void endGroupBody(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- if (tableLayoutConfig == TABLE_LAYOUT_SINGLE_DETAIL_TABLE && detailBandProcessingState == DETAIL_SECTION_OTHER_PRINTED)
- {
- // closes the table ..
- final XmlWriter xmlWriter = getXmlWriter();
- xmlWriter.writeCloseTag();
- detailBandProcessingState = DETAIL_SECTION_WAIT;
- }
-
- }
-
- protected void endContent(final AttributeMap attrs)
- throws IOException, DataSourceException, ReportProcessingException
- {
- finishSection();
- final BufferState bodyText = finishBuffering();
- final XmlWriter writer = getXmlWriter();
-
- final Map definedMappings = variablesDeclarations.getDefinedMappings();
- if (!definedMappings.isEmpty())
- {
- writer.writeTag(OfficeNamespaces.TEXT_NS, "variable-decls", XmlWriterSupport.OPEN);
- final Iterator mappingsIt = definedMappings.entrySet().iterator();
- while (mappingsIt.hasNext())
- {
- final Map.Entry entry = (Map.Entry) mappingsIt.next();
- final AttributeList entryList = new AttributeList();
- entryList.setAttribute(OfficeNamespaces.TEXT_NS, NAME, (String) entry.getKey());
- entryList.setAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE, (String) entry.getValue());
- writer.writeTag(OfficeNamespaces.TEXT_NS, "variable-decl", entryList, XmlWriterSupport.CLOSE);
- }
- writer.writeCloseTag();
- }
-
- writer.writeStream(bodyText.getXmlAsReader());
- writer.setLineEmpty(true);
- writer.writeCloseTag();
- }
-
- public String getExportDescriptor()
- {
- return "raw/" + PentahoReportEngineMetaData.OPENDOCUMENT_TEXT;
- }
-}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/text/VariablesDeclarations.java b/reportdesign/java/com/sun/star/report/pentaho/output/text/VariablesDeclarations.java deleted file mode 100644 index c06cc71cc..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/output/text/VariablesDeclarations.java +++ /dev/null @@ -1,110 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: VariablesDeclarations.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.output.text; - -import java.util.HashMap; -import java.util.Map; -import java.util.Iterator; - -import org.jfree.report.util.AttributeNameGenerator; - -/** - * A collection that holds all used variables. A variable is primarily keyed by - * its original name. If a variable contains more than one type, it is also - * keyed by the type. - * - * @author Thomas Morgner - * @since 26.03.2007 - */ -public class VariablesDeclarations -{ - - private final AttributeNameGenerator nameGenerator; - private final Map variables; - - public VariablesDeclarations() - { - variables = new HashMap(); - nameGenerator = new AttributeNameGenerator(); - } - - public String produceVariable(final String name, - final String type) - { - HashMap holder = (HashMap) variables.get(name); - if (holder == null) - { - holder = new HashMap(); - variables.put(name, holder); - } - - final String mapping = (String) holder.get(type); - if (mapping != null) - { - return mapping; - } - final String result = nameGenerator.generateName(name); - if (holder.isEmpty()) - { - // create the default mapping as well.. - holder.put(null, name); - holder.put("time", name); - holder.put("date", name); - holder.put("datetime", name); - holder.put("float", name); - holder.put("string", name); - holder.put("boolean", name); - } - holder.put(type, name); - return result; - } - - public Map getDefinedMappings() - { - final HashMap mappings = new HashMap(); - final Iterator vars = variables.values().iterator(); - while (vars.hasNext()) - { - final HashMap types = (HashMap) vars.next(); - final Iterator varsByType = types.entrySet().iterator(); - while (varsByType.hasNext()) - { - final Map.Entry entry = (Map.Entry) varsByType.next(); - final String type = (String) entry.getKey(); - if (type != null) - { - final String varName = (String) entry.getValue(); - mappings.put(varName, type); - } - } - } - return mappings; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/AttributeSpecification.java b/reportdesign/java/com/sun/star/report/pentaho/parser/AttributeSpecification.java deleted file mode 100644 index 39b440c4b..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/AttributeSpecification.java +++ /dev/null @@ -1,61 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: AttributeSpecification.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser; - -public final class AttributeSpecification -{ - private final String namespaceUrl; - private final String attributName; - private final String mapperImplementation; - - public AttributeSpecification (String namespaceUrl, String attributName, String mapperImplementation) - { - this.namespaceUrl = namespaceUrl; - this.attributName = attributName; - this.mapperImplementation = mapperImplementation; - } - - public String getAttributName () - { - return attributName; - } - - public String getMapperImplementation () - { - return mapperImplementation; - } - - public String getNamespaceUrl () - { - return namespaceUrl; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/ElementReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/ElementReadHandler.java deleted file mode 100644 index addf270ce..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/ElementReadHandler.java +++ /dev/null @@ -1,92 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ElementReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser; - -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.AbstractXmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * Creation-Date: 03.07.2006, 14:22:34 - * - * @author Thomas Morgner - */ -public abstract class ElementReadHandler extends AbstractXmlReadHandler -{ - - public ElementReadHandler() - { - } - - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) throws SAXException - { - final Element element = getElement(); - copyElementType(element); - copyAttributes(attrs, element); - } - - protected void copyElementType(final Element element) - { - element.setType(getTagName()); - element.setNamespace(getUri()); - } - - protected void copyAttributes(final Attributes attrs, final Element element) - { - final int length = attrs.getLength(); - for (int i = 0; i < length; i++) - { - final String value = attrs.getValue(i); - final String namespace = attrs.getURI(i); - final String attr = attrs.getLocalName(i); - element.setAttribute(namespace, attr, value); - } - } - - /** - * Returns the object for this element or null, if this element does not - * create an object. - * - * @return the object. - */ - public Object getObject() throws SAXException - { - return getElement(); - } - - public abstract Element getElement(); -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeDocumentXmlResourceFactory.java b/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeDocumentXmlResourceFactory.java deleted file mode 100644 index 33a6e851a..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeDocumentXmlResourceFactory.java +++ /dev/null @@ -1,56 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeDocumentXmlResourceFactory.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser; - -import com.sun.star.report.pentaho.model.OfficeDocument; -import org.jfree.report.modules.factories.report.base.JFreeReportXmlResourceFactory; - -/** - * A LibLoader resource factory for OfficeDocument objects. OfficeDocuments are - * JFreeReport instances which have some additional properties. - * - * @author Thomas Morgner - * @since 09.03.2007 - */ -public class OfficeDocumentXmlResourceFactory extends JFreeReportXmlResourceFactory -{ - - public OfficeDocumentXmlResourceFactory() - { - } - - public Class getFactoryType() - { - return OfficeDocument.class; - } - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java b/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java deleted file mode 100644 index 674969d3f..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java +++ /dev/null @@ -1,189 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeParserUtil.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser; - -import java.util.Iterator; -import java.util.Properties; -import java.util.Map; -import java.util.HashMap; - -import org.jfree.resourceloader.Resource; -import org.jfree.resourceloader.ResourceException; -import org.jfree.resourceloader.ResourceManager; -import org.jfree.util.DefaultConfiguration; -import org.jfree.util.Log; -import org.jfree.report.JFreeReportBoot; -import org.jfree.layouting.namespace.NamespaceDefinition; -import org.jfree.layouting.namespace.Namespaces; - -public class OfficeParserUtil -{ - - private static OfficeParserUtil instance; - private static final String NAMESPACES_PREFIX = "namespaces."; - - public static synchronized OfficeParserUtil getInstance() - { - if (instance == null) - { - instance = new OfficeParserUtil(); - } - return instance; - } - private final DefaultConfiguration props; - private final NamespaceDefinition[] namespaces; - - private OfficeParserUtil() - { - props = new DefaultConfiguration(); - - final ResourceManager resourceManager = new ResourceManager(); - resourceManager.registerDefaults(); - try - { - final Resource res = resourceManager.createDirectly("res://com/sun/star/report/pentaho/parser/selectors.properties", Properties.class); - final Properties resProps = (Properties) res.getResource(); - props.putAll(resProps); - } - catch (ResourceException e) - { - Log.warn("Unable to load mapping rules. Parsing services may not be available.", e); - } - - namespaces = Namespaces.createFromConfig(JFreeReportBoot.getInstance().getGlobalConfig(), - "org.jfree.report.namespaces.", resourceManager); - } - - public NamespaceDefinition getNamespaceDeclaration(final String uri) - { - if (uri == null) - { - throw new NullPointerException("URI must not be null"); - } - - for (int i = 0; i < namespaces.length; i++) - { - final NamespaceDefinition definition = namespaces[i]; - if (uri.equals(definition.getURI())) - { - return definition; - } - } - return null; - } - - public String getGenericFont(final String officeFont) - { - return props.getProperty("font-family." + officeFont.toLowerCase(), officeFont); - } - - public String getNamespaceURI(final String namespacePrefix) - { - return props.getProperty(NAMESPACES_PREFIX + namespacePrefix); - } - - public String getNamespaceForStyleFamily(final String styleFamily) - { - return props.getProperty("style-family." + styleFamily); - } - - public Map getNamespaces() - { - final Map map = new HashMap(); - final Iterator keys = props.findPropertyKeys(NAMESPACES_PREFIX); - while (keys.hasNext()) - { - final String key = (String) keys.next(); - final String value = props.getConfigProperty(key); - map.put(key.substring(NAMESPACES_PREFIX.length()), value); - } - return map; - } - - public String getNamespacePrefix(final String namespaceURI) - { - final Iterator keys = props.findPropertyKeys(NAMESPACES_PREFIX); - while (keys.hasNext()) - { - final String key = (String) keys.next(); - final String value = props.getConfigProperty(key); - if (namespaceURI.equals(value)) - { - return key.substring(NAMESPACES_PREFIX.length()); - } - } - return null; - } - - public AttributeSpecification parseStyleAttrDefinition(final String key, final String prefix, final String tagname) - { - final String configPrefix = "attr." + prefix + "." + tagname + "."; - final String configSuffix = key.substring(configPrefix.length()); - final int dotPosition = configSuffix.indexOf('.'); - if (dotPosition == -1) - { - return null; - } - final String namespaceUri = getNamespaceURI(configSuffix.substring(0, dotPosition)); - final String attrName = configSuffix.substring(dotPosition + 1); - final String value = props.getProperty(key); - return new AttributeSpecification(namespaceUri, attrName, value); - } - - public Iterator findStylesForElement(final String prefix, - final String tagname) - { - final String configPrefix = "attr." + prefix + "." + tagname + "."; - return props.findPropertyKeys(configPrefix); - } - - public boolean isValidStyleElement(final String uri, final String tagName) - { - final String prefix = getNamespacePrefix(uri); - if (prefix == null) - { - return false; - } - - final Iterator stylesForElement = findStylesForElement(prefix, tagName); - return stylesForElement.hasNext(); - } - - public String getSelectorPattern() - { - return props.getConfigProperty("style-selector.pattern"); - } - - public static void main(final String[] args) - { - JFreeReportBoot.getInstance().start(); - System.out.print(OfficeParserUtil.getInstance().getNamespaces()); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeStylesXmlResourceFactory.java b/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeStylesXmlResourceFactory.java deleted file mode 100644 index cf159a1fc..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeStylesXmlResourceFactory.java +++ /dev/null @@ -1,64 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeStylesXmlResourceFactory.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser; - -import com.sun.star.report.pentaho.model.OfficeStylesCollection; -import org.jfree.report.JFreeReportBoot; -import org.jfree.util.Configuration; -import org.jfree.xmlns.parser.AbstractXmlResourceFactory; - -/** - * A LibLoader resource factory for loading an OfficeStyles-collection. This - * implementation is meant to parse the 'styles.xml' file. - * - * @author Thomas Morgner - * @since 09.03.2007 - */ -public class OfficeStylesXmlResourceFactory extends AbstractXmlResourceFactory -{ - - public OfficeStylesXmlResourceFactory() - { - } - - - protected Configuration getConfiguration() - { - return JFreeReportBoot.getInstance().getGlobalConfig(); - } - - public Class getFactoryType() - { - return OfficeStylesCollection.class; - } - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/StarStyleXmlFactoryModule.java b/reportdesign/java/com/sun/star/report/pentaho/parser/StarStyleXmlFactoryModule.java deleted file mode 100644 index 26e6f1e5a..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/StarStyleXmlFactoryModule.java +++ /dev/null @@ -1,65 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StarStyleXmlFactoryModule.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.pentaho.parser.office.DocumentStylesReadHandler; -import org.jfree.xmlns.parser.XmlDocumentInfo; -import org.jfree.xmlns.parser.XmlFactoryModule; -import org.jfree.xmlns.parser.XmlReadHandler; - -public class StarStyleXmlFactoryModule implements XmlFactoryModule -{ - public StarStyleXmlFactoryModule() - { - } - - public XmlReadHandler createReadHandler (final XmlDocumentInfo documentInfo) - { - return new DocumentStylesReadHandler(); - } - - public int getDocumentSupport (final XmlDocumentInfo documentInfo) - { - final String rootNamespace = documentInfo.getRootElementNameSpace(); - if (OfficeNamespaces.OFFICE_NS.equals(rootNamespace) && "document-styles".equals(documentInfo.getRootElement()) ) - { - return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE; - } - return XmlFactoryModule.NOT_RECOGNIZED; - } - - public String getDefaultNamespace(final XmlDocumentInfo documentInfo) - { - return null; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/StarXmlFactoryModule.java b/reportdesign/java/com/sun/star/report/pentaho/parser/StarXmlFactoryModule.java deleted file mode 100644 index d7b9abdbf..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/StarXmlFactoryModule.java +++ /dev/null @@ -1,65 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StarXmlFactoryModule.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser; - -import org.jfree.xmlns.parser.XmlDocumentInfo; -import org.jfree.xmlns.parser.XmlFactoryModule; -import org.jfree.xmlns.parser.XmlReadHandler; -import com.sun.star.report.pentaho.parser.office.DocumentContentReadHandler; -import com.sun.star.report.pentaho.OfficeNamespaces; - -public class StarXmlFactoryModule implements XmlFactoryModule -{ - - public StarXmlFactoryModule() - { - } - - public XmlReadHandler createReadHandler(final XmlDocumentInfo documentInfo) - { - return new DocumentContentReadHandler(); - } - - public int getDocumentSupport(final XmlDocumentInfo documentInfo) - { - final String rootNamespace = documentInfo.getRootElementNameSpace(); - if (OfficeNamespaces.OFFICE_NS.equals(rootNamespace) && - ("document-content".equals(documentInfo.getRootElement()) || "document".equals(documentInfo.getRootElement()))) - { - return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE; - } - return XmlFactoryModule.NOT_RECOGNIZED; - } - - public String getDefaultNamespace(final XmlDocumentInfo documentInfo) - { - return null; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/StyleMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/StyleMapper.java deleted file mode 100644 index 32ab1a2f8..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/StyleMapper.java +++ /dev/null @@ -1,42 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StyleMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser; - -import org.jfree.layouting.input.style.CSSDeclarationRule; - -public interface StyleMapper -{ - public void updateStyle (final String uri, - final String attrName, - final String attrValue, - final CSSDeclarationRule targetRule); -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/chart/ChartReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/chart/ChartReadHandler.java deleted file mode 100644 index 642733db3..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/chart/ChartReadHandler.java +++ /dev/null @@ -1,112 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ChartReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.chart; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import java.util.ArrayList; - -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.parser.rpt.DetailRootTableReadHandler; -import com.sun.star.report.pentaho.parser.rpt.ReportReadHandler; -import com.sun.star.report.pentaho.parser.text.TextContentReadHandler; -import java.util.List; -import org.jfree.report.structure.Element; -import org.jfree.report.structure.Section; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * - * @author Ocke Janssen - */ -public class ChartReadHandler extends ElementReadHandler -{ - - private final Section element; - private final List children; - private final ReportReadHandler reportHandler; - - public ChartReadHandler(ReportReadHandler reportHandler) - { - this.reportHandler = reportHandler; - children = new ArrayList(); - element = new Section(); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if ("detail".equals(tagName)) - { - final DetailRootTableReadHandler detail = new DetailRootTableReadHandler(); - reportHandler.setDetail(detail); - return detail; - } - else if ("p".equals(tagName) && OfficeNamespaces.TEXT_NS.equals(uri)) - { - final TextContentReadHandler readHandler = new TextContentReadHandler(); - children.add(readHandler); - return readHandler; - } - final ChartReadHandler erh = new ChartReadHandler(reportHandler); - children.add(erh); - return erh; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - for (int i = 0; i < children.size(); i++) - { - final ElementReadHandler handler = (ElementReadHandler) children.get(i); - element.addNode(handler.getElement()); - } - } - - public Element getElement() - { - return element; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/data/DataStyleReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/data/DataStyleReadHandler.java deleted file mode 100644 index 856c94f15..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/data/DataStyleReadHandler.java +++ /dev/null @@ -1,129 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DataStyleReadHandler.java,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.data; - -import java.util.ArrayList; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.pentaho.model.DataStyle; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import java.util.List; -import org.jfree.report.structure.Element; -import org.jfree.report.structure.StaticText; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -public class DataStyleReadHandler extends ElementReadHandler -{ - - private final DataStyle dataStyle; - private final List children; - private final boolean hasCData; - - public DataStyleReadHandler(final boolean hasCData) - { - this.hasCData = hasCData; - this.dataStyle = new DataStyle(); - this.children = new ArrayList(); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.DATASTYLE_NS.equals(uri) || OfficeNamespaces.STYLE_NS.equals(uri)) - { - final DataStyleReadHandler xrh = new DataStyleReadHandler("text".equals(tagName) || "currency-symbol".equals(tagName)); - children.add(xrh); - return xrh; - } - - return null; - } - - /** - * This method is called to process the character data between element tags. - * - * @param ch the character buffer. - * @param start the start index. - * @param length the length. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - public void characters(final char[] ch, final int start, final int length) - throws SAXException - { - if (hasCData) - { - children.add(new StaticText(new String(ch, start, length))); - } - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - for (int i = 0; i < children.size(); i++) - { - final Object o = children.get(i); - if (o instanceof ElementReadHandler) - { - final ElementReadHandler handler = (ElementReadHandler) o; - dataStyle.addNode(handler.getElement()); - } - else if (o instanceof StaticText) - { - dataStyle.addNode((StaticText) o); - } - } - } - - public DataStyle getDataStyle() - { - return dataStyle; - } - - public Element getElement() - { - return dataStyle; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/draw/ObjectOleReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/draw/ObjectOleReadHandler.java deleted file mode 100644 index d5a742eba..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/draw/ObjectOleReadHandler.java +++ /dev/null @@ -1,84 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ObjectOleReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.draw; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.pentaho.model.ObjectOleElement; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import org.jfree.report.structure.Element; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * - * @author Ocke Janssen - */ -public class ObjectOleReadHandler extends ElementReadHandler -{ - - private final static String RPT_CHART_CLASS_ID = "80243D39-6741-46C5-926E-069164FF87BB"; - private final static String OOO_CHART_CLASS_ID = "12DCAE26-281F-416F-A234-C3086127382E"; - private final ObjectOleElement element; - - public ObjectOleReadHandler(final ObjectOleElement element) - { - this.element = element; - } - - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) throws SAXException - { - super.startParsing(attrs); - - final String url = attrs.getValue(OfficeNamespaces.XLINK_NS, "href"); - if (url != null) - { - element.setUrl(url); - } - - String classid = attrs.getValue(OfficeNamespaces.DRAWING_NS, "class-id"); - if (classid != null) - { - if ( classid.equalsIgnoreCase(RPT_CHART_CLASS_ID)) - classid = OOO_CHART_CLASS_ID; - element.setClassId(classid); - } - } - - public Element getElement() - { - return element; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/office/BodyReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/office/BodyReadHandler.java deleted file mode 100644 index add74d3da..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/office/BodyReadHandler.java +++ /dev/null @@ -1,91 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: BodyReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.office; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.parser.rpt.ReportReadHandler; -import org.jfree.report.structure.Element; -import org.jfree.report.structure.Section; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -public class BodyReadHandler extends ElementReadHandler -{ - - private ElementReadHandler reportReadHandler; - private final Section body; - - public BodyReadHandler() - { - body = new Section(); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.OFFICE_NS.equals(uri) && "report".equals(tagName)) - { - reportReadHandler = new ReportReadHandler(); - return reportReadHandler; - } - - return null; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - if (reportReadHandler != null) - { - body.addNode(reportReadHandler.getElement()); - } - } - - public Element getElement() - { - return body; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentContentReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentContentReadHandler.java deleted file mode 100644 index db8b7b4ea..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentContentReadHandler.java +++ /dev/null @@ -1,233 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DocumentContentReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.office; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.pentaho.model.OfficeDocument; -import com.sun.star.report.pentaho.model.OfficeStylesCollection; -import com.sun.star.report.pentaho.parser.style.OfficeStylesReadHandler; -import org.jfree.report.JFreeReport; -import org.jfree.resourceloader.Resource; -import org.jfree.resourceloader.ResourceException; -import org.jfree.resourceloader.ResourceKey; -import org.jfree.resourceloader.ResourceKeyCreationException; -import org.jfree.resourceloader.ResourceManager; -import org.jfree.util.Log; -import org.jfree.xmlns.parser.AbstractXmlReadHandler; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * This is the root handler for the document context. The - * 'office:document-context' element is encountered, if the document is split - * into separate files. - * <p/> - * Alternativly, there is the option to keep everything in one file. The root - * element for that format is 'office:document'. - */ -public class DocumentContentReadHandler extends AbstractXmlReadHandler -{ - - private OfficeDocument report; - private FontFaceDeclsReadHandler fontFaceReadHandler; - private BodyReadHandler bodyReadHandler; - private OfficeStylesCollection officeStylesCollection; - - public DocumentContentReadHandler() - { - } - - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) - throws SAXException - { - super.startParsing(attrs); - // parse the external 'styles.xml' if it exists - // parse the external 'meta.xml' if it exists - // parse the external 'settings.xml' if it exists - this.report = parseContentXml(); - this.report.setVirtual(true); - this.report.setType("document-content"); - this.report.setNamespace(OfficeNamespaces.OFFICE_NS); - this.report.setVirtual(true); - this.officeStylesCollection = parseStylesXml(); - } - - private OfficeStylesCollection parseStylesXml() - { - final ResourceKey contextKey = getRootHandler().getContext(); - final ResourceManager resourceManager = getRootHandler().getResourceManager(); - - try - { - final ResourceKey key = - resourceManager.deriveKey(contextKey, "styles.xml"); - final Resource resource = - resourceManager.create(key, contextKey, OfficeStylesCollection.class); - final OfficeStylesCollection styles = - (OfficeStylesCollection) resource.getResource(); - if (styles != null) - { - return styles; - } - } - catch (ResourceKeyCreationException e) - { - // ignore .. - Log.debug("Failed to create resource-key for 'styles.xml'. Ignoring.", e); - } - catch (ResourceException e) - { - // ignore .. - Log.debug("Failed to parse resource for 'styles.xml'. Ignoring.", e); - } - - return new OfficeStylesCollection(); - } - - private OfficeDocument parseContentXml() - { - // Check whether this is a content.xml. - if (!OfficeNamespaces.OFFICE_NS.equals(getUri()) || "document-content".equals(getTagName())) - { - return new OfficeDocument(); - } - - // we may have to parse an existing content.xml. - final ResourceKey contextKey = getRootHandler().getContext(); - final ResourceManager resourceManager = getRootHandler().getResourceManager(); - try - { - final ResourceKey key = - resourceManager.deriveKey(contextKey, "content.xml"); - final Resource resource = - resourceManager.create(key, contextKey, JFreeReport.class); - final OfficeDocument doc = (OfficeDocument) resource.getResource(); - if (doc != null) - { - return doc; - } - } - catch (ResourceKeyCreationException e) - { - // ignore .. - Log.debug("Failed to create resource-key for 'content.xml'. Ignoring."); - } - catch (ResourceException e) - { - // ignore .. - Log.debug("Failed to parse resource for 'content.xml'. Ignoring."); - } - return new OfficeDocument(); - - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.OFFICE_NS.equals(uri)) - { - if ("font-face-decls".equals(tagName)) - { - if (fontFaceReadHandler == null) - { - fontFaceReadHandler = new FontFaceDeclsReadHandler(officeStylesCollection.getFontFaceDecls()); - } - return fontFaceReadHandler; - } - else if ("automatic-styles".equals(tagName)) - { - return new OfficeStylesReadHandler(officeStylesCollection.getAutomaticStyles()); - } - else if ("styles".equals(tagName)) - { - return new OfficeStylesReadHandler(officeStylesCollection.getCommonStyles()); - } - else if ("master-styles".equals(tagName)) - { - return new MasterStylesReadHandler(officeStylesCollection.getMasterStyles()); - } - else if ("body".equals(tagName)) - { - bodyReadHandler = new BodyReadHandler(); - return bodyReadHandler; - } - } - return null; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() - throws SAXException - { - // The office-document is the only node of the report. It allows us to - // switch the layout-processing implementation later on. - - report.setStylesCollection(officeStylesCollection); - - if (bodyReadHandler != null) - { - report.addNode(bodyReadHandler.getElement()); - } - } - - /** - * Returns the object for this element or null, if this element does not - * create an object. - * - * @return the object. - */ - public Object getObject() - throws SAXException - { - return report; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentStylesReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentStylesReadHandler.java deleted file mode 100644 index de9b56820..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentStylesReadHandler.java +++ /dev/null @@ -1,110 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DocumentStylesReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.office; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.pentaho.model.OfficeStylesCollection; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.parser.style.OfficeStylesReadHandler; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * The root parser for a 'styles.xml' document. This generates the global - * (or common) style collection. These styles contain the named common styles - * and the page layouts. - * - * @author Thomas Morgner - * @since 08.03.2007 - */ -public class DocumentStylesReadHandler extends ElementReadHandler -{ - private final OfficeStylesCollection officeStylesCollection; - private FontFaceDeclsReadHandler fontFaceReadHandler; - - public DocumentStylesReadHandler() - { - officeStylesCollection = new OfficeStylesCollection(); - } - - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (!OfficeNamespaces.OFFICE_NS.equals(uri)) - { - return null; - } - - if ("font-face-decls".equals(tagName)) - { - if (fontFaceReadHandler == null) - { - fontFaceReadHandler = new FontFaceDeclsReadHandler - (officeStylesCollection.getFontFaceDecls()); - } - return fontFaceReadHandler; - } - else if ("automatic-styles".equals(tagName)) - { - return new OfficeStylesReadHandler(officeStylesCollection.getAutomaticStyles()); - } - else if ("styles".equals(tagName)) - { - return new OfficeStylesReadHandler(officeStylesCollection.getCommonStyles()); - } - else if ("master-styles".equals(tagName)) - { - return new MasterStylesReadHandler(officeStylesCollection.getMasterStyles()); - } - return null; - } - - - public Element getElement() - { - return officeStylesCollection; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java deleted file mode 100644 index 45ac84a1c..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java +++ /dev/null @@ -1,119 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FontFaceDeclsReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.office; - -import java.util.ArrayList; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.pentaho.model.FontFaceDeclsSection; -import com.sun.star.report.pentaho.model.FontFaceElement; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.parser.style.FontFaceReadHandler; -import java.util.List; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * Reads the font-face declarations section. This one can only contain - * font-face elements. - * - * @author Thomas Morgner - * @since 13.03.2007 - */ -public class FontFaceDeclsReadHandler extends ElementReadHandler -{ - private final FontFaceDeclsSection fontFaceDecls; - private final List fontFaceReadHandlers; - - public FontFaceDeclsReadHandler(final FontFaceDeclsSection fontFaceDecls) - { - this.fontFaceDecls = fontFaceDecls; - this.fontFaceReadHandlers = new ArrayList(); - } - - public FontFaceDeclsSection getFontFaceDecls() - { - return fontFaceDecls; - } - - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (!OfficeNamespaces.STYLE_NS.equals(uri) ) - { - return null; - } - - if ("font-face".equals(tagName)) - { - final FontFaceReadHandler frh = new FontFaceReadHandler(); - fontFaceReadHandlers.add(frh); - return frh; - } - return null; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() - throws SAXException - { - for (int i = 0; i < fontFaceReadHandlers.size(); i++) - { - final FontFaceReadHandler handler = (FontFaceReadHandler) fontFaceReadHandlers.get(i); - fontFaceDecls.addFontFace((FontFaceElement) handler.getElement()); - } - } - - public Element getElement() - { - return fontFaceDecls; - } - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/office/MasterStylesReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/office/MasterStylesReadHandler.java deleted file mode 100644 index feb7fc143..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/office/MasterStylesReadHandler.java +++ /dev/null @@ -1,124 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: MasterStylesReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.office; - -import java.util.ArrayList; - -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.parser.style.StyleDefinitionReadHandler; -import com.sun.star.report.pentaho.parser.style.MasterPageReadHandler; -import com.sun.star.report.pentaho.model.OfficeMasterStyles; -import com.sun.star.report.pentaho.OfficeNamespaces; -import java.util.List; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * Todo: Document me! - * - * @author Thomas Morgner - * @since 13.03.2007 - */ -public class MasterStylesReadHandler extends ElementReadHandler -{ - - private final OfficeMasterStyles masterStyles; - private final List otherHandlers; - private final List masterPageHandlers; - - public MasterStylesReadHandler(final OfficeMasterStyles masterStyles) - { - this.masterStyles = masterStyles; - this.masterPageHandlers = new ArrayList(); - this.otherHandlers = new ArrayList(); - } - - public OfficeMasterStyles getMasterStyles() - { - return masterStyles; - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.STYLE_NS.equals(uri) && "master-page".equals(tagName)) - { - final MasterPageReadHandler mrh = new MasterPageReadHandler(); - masterPageHandlers.add(mrh); - return mrh; - } - - final StyleDefinitionReadHandler readHandler = - new StyleDefinitionReadHandler(); - otherHandlers.add(readHandler); - return readHandler; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() - throws SAXException - { - for (int i = 0; i < otherHandlers.size(); i++) - { - final ElementReadHandler handler = - (ElementReadHandler) otherHandlers.get(i); - masterStyles.getOtherNodes().addNode(handler.getElement()); - } - - for (int i = 0; i < masterPageHandlers.size(); i++) - { - final MasterPageReadHandler handler = - (MasterPageReadHandler) masterPageHandlers.get(i); - masterStyles.addMasterPage(handler.getMasterPage()); - } - } - - public Element getElement() - { - return masterStyles; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd deleted file mode 100644 index 88fcc020a..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd +++ /dev/null @@ -1,418 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - - Copyright 2008 by Sun Microsystems, Inc. - - OpenOffice.org - a multi-platform office productivity suite - - $RCSfile: rpt-schema-v1.0-os.xsd,v $ - - $Revision: 1.3 $ - - This file is part of OpenOffice.org. - - OpenOffice.org is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - OpenOffice.org 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 version 3 for more details - (a copy is included in the LICENSE file that accompanied this code). - - You should have received a copy of the GNU Lesser General Public License - version 3 along with OpenOffice.org. If not, see - <http://www.openoffice.org/license.html> - for a copy of the LGPLv3 License. - - --> - -<!----> -<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" - elementFormDefault="qualified" - targetNamespace="urn:oasis:names:tc:opendocument:xmlns:report:1.0" - xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" - xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" - xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" - xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" - xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" - xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" - xmlns:rpt="urn:oasis:names:tc:opendocument:xmlns:report:1.0" - xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" - xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" - xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" - xmlns:xforms="http://www.w3.org/2002/xforms" - xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" - xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" - xmlns:ns1="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" - xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" - xmlns:math="http://www.w3.org/1998/Math/MathML" - xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" - xmlns:dc="http://purl.org/dc/elements/1.1/"> - <xs:import namespace="http://purl.org/dc/elements/1.1/" schemaLocation="dc.xsd"/> - <xs:import namespace="http://www.w3.org/1998/Math/MathML" schemaLocation="math.xsd"/> - <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd"/> - <xs:import namespace="http://www.w3.org/2002/xforms" schemaLocation="xforms.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" schemaLocation="anim.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" schemaLocation="chart.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:config:1.0" schemaLocation="config.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" schemaLocation="ns1.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" schemaLocation="dr3d.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" schemaLocation="draw.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:form:1.0" schemaLocation="form.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" schemaLocation="meta.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:office:1.0" schemaLocation="office.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" schemaLocation="presentation.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:script:1.0" schemaLocation="script.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" schemaLocation="smil.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:style:1.0" schemaLocation="style.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" schemaLocation="svg.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0" schemaLocation="table.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" schemaLocation="OpenDocument-schema-v1.0-os.xsd"/> - <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" schemaLocation="fo.xsd"/> - <xs:attributeGroup name="office-report-attlist"> - <xs:attribute name="command-type" default="command" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="table"/> - <xs:enumeration value="query"/> - <xs:enumeration value="command"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="command" form="qualified" type="text:string"/> - <xs:attribute name="escape-processing" default="true" form="qualified" type="text:boolean"/> - <xs:attribute name="filter" form="qualified" type="text:string"/> - <xs:attribute name="caption" form="qualified" type="text:string"/> - </xs:attributeGroup> - <xs:element name="report-component"> - <xs:complexType> - <xs:attributeGroup ref="text:common-draw-name-attlist"/> - </xs:complexType> - </xs:element> - <xs:element name="group"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="0" maxOccurs="unbounded" ref="rpt:function"/> - <xs:element minOccurs="0" ref="rpt:group-header"/> - <xs:choice> - <xs:element ref="rpt:group"/> - <xs:element ref="rpt:detail"/> - </xs:choice> - <xs:element minOccurs="0" ref="rpt:group-footer"/> - </xs:sequence> - <xs:attributeGroup ref="rpt:rpt-group-attlist"/> - </xs:complexType> - </xs:element> - <xs:attributeGroup name="rpt-group-attlist"> - <xs:attribute name="sort-ascending" use="required" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="start-new-column" default="false" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="reset-page-number" default="false" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="print-header-on-each-page" default="false" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="group-expression" use="required" form="qualified" type="text:string"/> - <xs:attribute name="keep-together" default="no" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="no"/> - <xs:enumeration value="whole-group"/> - <xs:enumeration value="with-first-detail"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - </xs:attributeGroup> - <xs:element name="group-header"> - <xs:complexType> - <xs:sequence> - <xs:element ref="table:table"/> - </xs:sequence> - <xs:attributeGroup ref="rpt:rpt-group-section-attlist"/> - </xs:complexType> - </xs:element> - <xs:element name="group-footer"> - <xs:complexType> - <xs:sequence> - <xs:element ref="table:table"/> - </xs:sequence> - <xs:attributeGroup ref="rpt:rpt-group-section-attlist"/> - </xs:complexType> - </xs:element> - <xs:element name="report-header"> - <xs:complexType> - <xs:sequence> - <xs:element ref="table:table"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="page-header"> - <xs:complexType> - <xs:sequence> - <xs:element ref="table:table"/> - </xs:sequence> - <xs:attributeGroup ref="rpt:rpt-page-attlist"/> - </xs:complexType> - </xs:element> - <xs:element name="column-header"> - <xs:complexType> - <xs:sequence> - <xs:element ref="table:table"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="detail"> - <xs:complexType> - <xs:sequence> - <xs:element ref="table:table"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="column-footer"> - <xs:complexType> - <xs:sequence> - <xs:element ref="table:table"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="page-footer"> - <xs:complexType> - <xs:sequence> - <xs:element ref="table:table"/> - </xs:sequence> - <xs:attributeGroup ref="rpt:rpt-page-attlist"/> - </xs:complexType> - </xs:element> - <xs:element name="report-footer"> - <xs:complexType> - <xs:sequence> - <xs:element ref="table:table"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:attributeGroup name="rpt-page-attlist"> - <xs:attribute name="page-print-option" default="all-pages" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="all-pages"/> - <xs:enumeration value="not-with-report-header"/> - <xs:enumeration value="not-with-report-footer"/> - <xs:enumeration value="not-with-report-header-nor-footer"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - </xs:attributeGroup> - <xs:attributeGroup name="rpt-section-attlist"> - <xs:attribute name="visible" default="true" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="force-new-page" default="none" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="none"/> - <xs:enumeration value="before-section"/> - <xs:enumeration value="after-section"/> - <xs:enumeration value="before-after-section"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="new-row-or-column" default="none" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="none"/> - <xs:enumeration value="before-section"/> - <xs:enumeration value="after-section"/> - <xs:enumeration value="before-after-section"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="keep-together" default="false" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - </xs:attributeGroup> - <xs:attributeGroup name="rpt-group-section-attlist"> - <xs:attribute name="repeat-section" default="false" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - </xs:attributeGroup> - <xs:element name="sub-document"> - <xs:complexType> - <xs:sequence> - <xs:group ref="rpt:report-master-detail-fields"/> - <xs:element ref="rpt:report-element"/> - <xs:choice minOccurs="0"> - <xs:element ref="office:document"/> - <xs:element ref="math:math"/> - </xs:choice> - </xs:sequence> - <xs:attributeGroup ref="rpt:report-sub-document-attlist"/> - </xs:complexType> - </xs:element> - <xs:attributeGroup name="report-sub-document-attlist"> - <xs:attribute ref="xlink:href"/> - <xs:attribute ref="xlink:type"/> - <xs:attributeGroup ref="xlink:show"/> - <xs:attributeGroup ref="xlink:actuate"/> - </xs:attributeGroup> - <xs:group name="report-master-detail-fields"> - <xs:sequence> - <xs:element minOccurs="0" ref="rpt:master-detail-fields"/> - </xs:sequence> - </xs:group> - <xs:element name="master-detail-fields"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="0" maxOccurs="unbounded" ref="rpt:master-detail-field"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="master-detail-field"> - <xs:complexType> - <xs:attribute name="master" use="required" form="qualified" type="text:string"/> - <xs:attribute name="detail" form="qualified" type="text:string"/> - </xs:complexType> - </xs:element> - <xs:element name="function"> - <xs:complexType> - <xs:attribute name="formula" use="required" form="qualified" type="text:formula"/> - <xs:attribute name="name" use="required" form="qualified" type="text:string"/> - <xs:attribute name="pre-evaluated" use="required" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - </xs:complexType> - </xs:element> - <xs:element name="report-element"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="0" ref="rpt:conditional-print-expression"/> - <xs:element minOccurs="0" ref="rpt:report-component"/> - <xs:element minOccurs="0" maxOccurs="unbounded" ref="rpt:format-condition"/> - </xs:sequence> - <xs:attributeGroup ref="rpt:rpt-report-element-attlist"/> - </xs:complexType> - </xs:element> - <xs:attributeGroup name="rpt-report-element-attlist"> - <xs:attribute name="print-when-group-change" default="false" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="print-repeated-values" default="true" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - </xs:attributeGroup> - <xs:element name="conditional-print-expression" type="xs:string"/> - <xs:element name="format-condition"> - <xs:complexType> - <xs:attributeGroup ref="rpt:rpt-format-condition-attlist"/> - </xs:complexType> - </xs:element> - <xs:attributeGroup name="rpt-format-condition-attlist"> - <xs:attribute name="enabled" default="false" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - <xs:attribute name="formula" form="qualified" type="text:formula"/> - </xs:attributeGroup> - <xs:element name="fixed-content"> - <xs:complexType> - <xs:sequence> - <xs:element ref="rpt:report-element"/> - <xs:element ref="text:p"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="formatted-text"> - <xs:complexType> - <xs:sequence> - <xs:element ref="rpt:report-element"/> - <xs:group ref="text:common-form-control-content"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:attributeGroup name="rpt-formatted-text-attlist"> - <xs:attributeGroup ref="text:common-data-field-attlist"/> - </xs:attributeGroup> - <xs:element name="image"> - <xs:complexType> - <xs:sequence> - <xs:element ref="rpt:report-element"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:attributeGroup name="rpt-image-attlist"> - <xs:attributeGroup ref="text:common-data-field-attlist"/> - <xs:attributeGroup ref="text:image-data"/> - <xs:attribute name="scale" use="required" form="qualified"> - <xs:simpleType> - <xs:restriction base="xs:token"> - <xs:enumeration value="true"/> - <xs:enumeration value="false"/> - </xs:restriction> - </xs:simpleType> - </xs:attribute> - </xs:attributeGroup> -</xs:schema> diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ConditionalPrintExpressionReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ConditionalPrintExpressionReadHandler.java deleted file mode 100644 index 4cd40ace8..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ConditionalPrintExpressionReadHandler.java +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ConditionalPrintExpressionReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.rpt; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import org.jfree.report.expressions.FormulaFunction; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.AbstractXmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * Handles the 'report:conditional-print-expression' element that can appear - * in all report elements and all root-level sections. - * - * @author Thomas Morgner - * @since 02.03.2007 - */ -public class ConditionalPrintExpressionReadHandler - extends AbstractXmlReadHandler -{ - - private final Element element; - - public ConditionalPrintExpressionReadHandler(final Element element) - { - if (element == null) - { - throw new NullPointerException(); - } - this.element = element; - } - - protected void startParsing(final Attributes attrs) throws SAXException - { - super.startParsing(attrs); - final String formula = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "formula"); - if (formula != null) - { - final FormulaFunction valueExpression = new FormulaFunction(); - valueExpression.setFormula(formula); - element.setDisplayCondition(valueExpression); - } - - } - - /** - * Returns the object for this element or null, if this element does not - * create an object. - * - * @return the object. - */ - public Object getObject() - throws SAXException - { - return element; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/DetailRootTableReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/DetailRootTableReadHandler.java deleted file mode 100644 index 681a7168c..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/DetailRootTableReadHandler.java +++ /dev/null @@ -1,41 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DetailRootTableReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.rpt; - -import com.sun.star.report.pentaho.model.OfficeDetailSection; - -public class DetailRootTableReadHandler extends RootTableReadHandler -{ - - public DetailRootTableReadHandler() - { - super(new OfficeDetailSection()); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FixedContentReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FixedContentReadHandler.java deleted file mode 100644 index b745b52e2..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FixedContentReadHandler.java +++ /dev/null @@ -1,98 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FixedContentReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.rpt; - -import com.sun.star.report.pentaho.model.FixedTextElement; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.parser.text.TextContentReadHandler; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.IgnoreAnyChildReadHandler; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * Creation-Date: 01.10.2006, 18:48:11 - * - * @author Thomas Morgner - */ -public class FixedContentReadHandler extends ElementReadHandler -{ - - private final FixedTextElement element; - - public FixedContentReadHandler() - { - element = new FixedTextElement(); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.TEXT_NS.equals(uri) && OfficeToken.P.equals(tagName)) - { - // expect a paragraph (which will be ignored; it is a structural - // component that needs not to be printed at all. - return new TextContentReadHandler(element.getContent()); - } - - if (OfficeNamespaces.OOREPORT_NS.equals(uri)) - { - // expect a report control. The control will modifiy the current - // element (as we do not separate the elements that strictly ..) - if ("report-control".equals(tagName)) - { - return new IgnoreAnyChildReadHandler(); - } - if ("report-element".equals(tagName)) - { - return new ReportElementReadHandler(element); - } - } - return null; - } - - public Element getElement() - { - return element; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FormatConditionReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FormatConditionReadHandler.java deleted file mode 100644 index fe175cf1c..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FormatConditionReadHandler.java +++ /dev/null @@ -1,100 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FormatConditionReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.rpt; - -import com.sun.star.report.pentaho.model.FormatCondition; -import com.sun.star.report.pentaho.model.ReportElement; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import org.jfree.report.expressions.FormulaExpression; -import org.jfree.xmlns.parser.AbstractXmlReadHandler; -import org.jfree.xmlns.parser.ParseException; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * I'm quite sure I should parse something here. But what? - * - * @author Ocke Janssen - */ -public class FormatConditionReadHandler extends AbstractXmlReadHandler -{ - - private final ReportElement element; - - public FormatConditionReadHandler(final ReportElement element) - { - if (element == null) - { - throw new NullPointerException(); - } - this.element = element; - } - - protected void startParsing(final Attributes attrs) throws SAXException - { - super.startParsing(attrs); - - - final String formula = - attrs.getValue(OfficeNamespaces.OOREPORT_NS, "formula"); - if (formula == null) - { - throw new ParseException("Required attribute 'formula' is missing.", getLocator()); - } - final String stylename = - attrs.getValue(OfficeNamespaces.OOREPORT_NS, OfficeToken.STYLE_NAME); - if (stylename == null) - { - throw new ParseException("Required attribute 'style-name' is missing.", getLocator()); - } - final FormulaExpression valueExpression = new FormulaExpression(); - valueExpression.setFormula(formula); - - final String enabledText = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "enabled"); - final boolean enabled = (enabledText == null || OfficeToken.TRUE.equals(enabledText)); - final FormatCondition formatCondition = - new FormatCondition(valueExpression, stylename, enabled); - element.addFormatCondition(formatCondition); - - } - - /** - * Returns the object for this element or null, if this element does not - * create an object. - * - * @return the object. - */ - public Object getObject() - throws SAXException - { - return element; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java deleted file mode 100644 index 19ac46fb6..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java +++ /dev/null @@ -1,118 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FormattedTextReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.rpt; - -import com.sun.star.report.pentaho.model.FormattedTextElement; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.OfficeNamespaces; -import org.jfree.report.expressions.FormulaExpression; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.jfree.xmlns.parser.IgnoreAnyChildReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * Creation-Date: 01.10.2006, 19:06:45 - * - * @author Thomas Morgner - */ -public class FormattedTextReadHandler extends ElementReadHandler -{ - - private final FormattedTextElement element; - - public FormattedTextReadHandler() - { - element = new FormattedTextElement(); - } - - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) throws SAXException - { - super.startParsing(attrs); - - final String formula = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "formula"); - if (formula != null) - { - final FormulaExpression valueExpression = new FormulaExpression(); - valueExpression.setFormula(formula); - element.setValueExpression(valueExpression); - } - - // * Print-Repeated-Values - // * Print-In-First-New-Section - // * Print-When-Group-Changes - - // * Print-When-Section-Overflows - // That property cannot be evaluated yet, as this would require us to - // have a clue about pagebreaking. We dont have that - not yet and never - // in the future, as pagebreaks are computed by OpenOffice instead - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.OOREPORT_NS.equals(uri)) - { - // expect a report control. The control will modifiy the current - // element (as we do not separate the elements that strictly ..) - if ("report-control".equals(tagName)) - { - return new IgnoreAnyChildReadHandler(); - } - if ("report-element".equals(tagName)) - { - return new ReportElementReadHandler(element); - } - } - return null; - } - - public Element getElement() - { - return element; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FunctionReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FunctionReadHandler.java deleted file mode 100644 index 42c2df2ac..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FunctionReadHandler.java +++ /dev/null @@ -1,116 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FunctionReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.rpt; - -import org.jfree.xmlns.parser.AbstractXmlReadHandler; -import org.jfree.xmlns.parser.ParseException; -import org.jfree.report.expressions.Expression; -import org.jfree.report.expressions.FormulaFunction; -import org.jfree.report.expressions.FormulaExpression; -import org.xml.sax.SAXException; -import org.xml.sax.Attributes; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; - -/** - * Parses a named expression. These expressions are encountered on reports and - * groups and compute global values. Expressions must have an unique name. - * - * @author Thomas Morgner - */ -public class FunctionReadHandler extends AbstractXmlReadHandler -{ - - private Expression expression; - - public FunctionReadHandler() - { - } - - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) - throws SAXException - { - final String formula = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "formula"); - if (formula == null) - { - throw new ParseException("Required attribute 'formula' is missing", getLocator()); - } - - final String name = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "name"); - if (name == null) - { - throw new ParseException("Required attribute 'name' is missing", getLocator()); - } - final String initialFormula = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "initial-formula"); - final String deepTraversing = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "deep-traversing"); - - if (initialFormula != null) - { - final FormulaFunction function = new FormulaFunction(); - function.setInitial(initialFormula); - function.setFormula(formula); - this.expression = function; - } - else - { - final FormulaExpression expression = new FormulaExpression(); - expression.setFormula(formula); - this.expression = expression; - } - - expression.setName(name); - expression.setDeepTraversing(OfficeToken.TRUE.equals(deepTraversing)); - final String preEvaluated = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "pre-evaluated"); - expression.setPrecompute(OfficeToken.TRUE.equals(preEvaluated)); - } - - /** - * Returns the object for this element or null, if this element does not - * create an object. - * - * @return the object. - */ - public Object getObject() - throws SAXException - { - return getExpression(); - } - - public Expression getExpression() - { - return expression; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java deleted file mode 100644 index 8253fd009..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java +++ /dev/null @@ -1,180 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: GroupReadHandler.java,v $ - * $Revision: 1.7 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.rpt; - -import com.sun.star.report.OfficeToken; -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.OfficeGroupInstanceSection; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import java.util.List; -import org.jfree.report.expressions.FormulaExpression; -import org.jfree.report.structure.Element; -import org.jfree.report.structure.Section; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -public class GroupReadHandler extends ElementReadHandler -{ - - private GroupSectionReadHandler groupHeader; - private GroupSectionReadHandler groupFooter; - private GroupReadHandler childGroup; - private RootTableReadHandler detailSection; - private final OfficeGroup group; - private final OfficeGroupInstanceSection groupInstanceSection; - private final List functionHandlers; - private final ReportReadHandler rh; - - public GroupReadHandler(final ReportReadHandler _rh) - { - rh = _rh; - group = new OfficeGroup(); - groupInstanceSection = new OfficeGroupInstanceSection(); - groupInstanceSection.setNamespace(OfficeNamespaces.INTERNAL_NS); - groupInstanceSection.setType("group-instance"); - group.addNode(groupInstanceSection); - functionHandlers = new ArrayList(); - } - - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) throws SAXException - { - super.startParsing(attrs); - - final String groupExpr = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "group-expression"); - if (groupExpr != null) - { - final FormulaExpression function = new FormulaExpression(); - function.setFormula(groupExpr); - groupInstanceSection.setGroupingExpression(function); - } - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (!OfficeNamespaces.OOREPORT_NS.equals(uri)) - { - return null; - } - if ("function".equals(tagName)) - { - final FunctionReadHandler erh = new FunctionReadHandler(); - functionHandlers.add(erh); - return erh; - } - if ("group-header".equals(tagName)) - { - groupHeader = new GroupSectionReadHandler(); - return groupHeader; - } - if ("group".equals(tagName)) - { - childGroup = new GroupReadHandler(rh); - return childGroup; - } - if ("detail".equals(tagName)) - { - detailSection = new DetailRootTableReadHandler(); - rh.setDetail(detailSection); - return detailSection; - } - if ("group-footer".equals(tagName)) - { - ((Element)((Section)rh.getDetail().getElement()).getNode(0)).setAttribute(OfficeNamespaces.INTERNAL_NS,"has-group-footer", OfficeToken.TRUE); - groupFooter = new GroupSectionReadHandler(); - return groupFooter; - } - return null; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - for (int i = 0; i < functionHandlers.size(); i++) - { - final FunctionReadHandler handler = - (FunctionReadHandler) functionHandlers.get(i); - groupInstanceSection.addExpression(handler.getExpression()); - } - - if (groupHeader != null) - { - groupInstanceSection.addNode(groupHeader.getElement()); - } - - final Section groupBody = new Section(); - groupBody.setNamespace(OfficeNamespaces.INTERNAL_NS); - groupBody.setType("group-body"); - groupInstanceSection.addNode(groupBody); - // XOR: Either the detail or the group section can be set .. - if (detailSection != null) - { - groupBody.addNode(detailSection.getElement()); - } - else if (childGroup != null) - { - groupBody.addNode(childGroup.getElement()); - } - - if (groupFooter != null) - { - groupInstanceSection.addNode(groupFooter.getElement()); - } - } - - public Element getElement() - { - return group; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/GroupSectionReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/GroupSectionReadHandler.java deleted file mode 100644 index 7d92ed5aa..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/GroupSectionReadHandler.java +++ /dev/null @@ -1,41 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: GroupSectionReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.rpt; - -import com.sun.star.report.pentaho.model.OfficeGroupSection; - -public class GroupSectionReadHandler extends RootTableReadHandler -{ - - public GroupSectionReadHandler() - { - super(new OfficeGroupSection()); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ImageReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ImageReadHandler.java deleted file mode 100644 index 76446b04a..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ImageReadHandler.java +++ /dev/null @@ -1,141 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ImageReadHandler.java,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.rpt; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import com.sun.star.report.pentaho.model.ImageElement; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.parser.xlink.XLinkReadHandler; -import org.jfree.report.expressions.FormulaExpression; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.IgnoreAnyChildReadHandler; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * Deals with Image-content. There are two ways to specify the image; - * as formula or as static image data. - * - * @author Thomas Morgner - */ -public class ImageReadHandler extends ElementReadHandler -{ - - private final ImageElement contentElement; - private XLinkReadHandler xLinkReadHandler; - - public ImageReadHandler() - { - contentElement = new ImageElement(); - } - - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) throws SAXException - { - super.startParsing(attrs); - final String formula = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "formula"); -// final String preserveIRI = attrs.getValue(OfficeNamespaces.OOREPORT_NS, OfficeToken.PRESERVE_IRI); - if (formula != null && formula.length() != 0) - { - // now, the evaulated content ends up in the 'content' attribute of the - // element. - final FormulaExpression valueExpression = new FormulaExpression(); - valueExpression.setFormula(formula); - contentElement.setFormula(valueExpression); - } - - contentElement.setNamespace(OfficeNamespaces.FORM_NS); - contentElement.setType(OfficeToken.IMAGE); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.DRAWING_NS.equals(uri) && OfficeToken.IMAGE_DATA.equals(tagName)) - { - xLinkReadHandler = new XLinkReadHandler(); - return xLinkReadHandler; - } - - if (OfficeNamespaces.OOREPORT_NS.equals(uri)) - { - // expect a report control. The control will modifiy the current - // element (as we do not separate the elements that strictly ..) - if ("report-control".equals(tagName)) - { - return new IgnoreAnyChildReadHandler(); - } - if ("report-element".equals(tagName)) - { - return new ReportElementReadHandler(contentElement); - } - } - return null; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - // if we have static content (as well or only), that one goes into the - // alternate-content attribute right now. It is part of the output target - // and style rules to deal with them properly .. - if (xLinkReadHandler != null) - { - contentElement.setAttribute(OfficeNamespaces.OOREPORT_NS, - "alternate-content", xLinkReadHandler.getUri()); - } - } - - public Element getElement() - { - return contentElement; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/MasterDetailReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/MasterDetailReadHandler.java deleted file mode 100644 index 22b6d36f1..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/MasterDetailReadHandler.java +++ /dev/null @@ -1,109 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: MasterDetailReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.rpt; - -import com.sun.star.report.pentaho.model.ObjectOleElement; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.OfficeNamespaces; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * - * @author Ocke Janssen - */ -public class MasterDetailReadHandler extends ElementReadHandler -{ - - private final ObjectOleElement element; - private final boolean parseMasterDetail; - - public MasterDetailReadHandler(final ObjectOleElement element) - { - this.element = element; - parseMasterDetail = false; - } - - public MasterDetailReadHandler(final ObjectOleElement element, final boolean parseMasterDetail) - { - this.element = element; - this.parseMasterDetail = parseMasterDetail; - } - - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) throws SAXException - { - super.startParsing(attrs); - if (parseMasterDetail) - { - final String master = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "master"); - if (master != null && master.length() > 0 ) - { - final String detail = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "detail"); - element.addMasterDetailFields(master, detail); - } - } - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.OOREPORT_NS.equals(uri) && "master-detail-field".equals(tagName)) - { - // expect a report control. The control will modifiy the current - // element (as we do not separate the elements that strictly ..) - return new MasterDetailReadHandler(element, true); - } - - return null; - } - - public Element getElement() - { - return element; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ReportElementReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ReportElementReadHandler.java deleted file mode 100644 index aca2419e6..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ReportElementReadHandler.java +++ /dev/null @@ -1,109 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportElementReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.rpt; - -import com.sun.star.report.pentaho.model.ReportElement; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.jfree.xmlns.parser.IgnoreAnyChildReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -public class ReportElementReadHandler extends ElementReadHandler -{ - - private final ReportElement element; - - public ReportElementReadHandler(final ReportElement element) - { - if (element == null) - { - throw new NullPointerException(); - } - - this.element = element; - } - - public Element getElement() - { - return element; - } - - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) - throws SAXException - { - super.startParsing(attrs); - final String printWhenGroupChanges = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "print-when-group-changes"); - element.setPrintWhenGroupChanges(OfficeToken.TRUE.equals(printWhenGroupChanges)); - final String printRepeatingValues = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "print-repeated-values"); - element.setPrintRepeatedValues(printRepeatingValues == null || OfficeToken.TRUE.equals(printRepeatingValues)); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (!OfficeNamespaces.OOREPORT_NS.equals(uri)) - { - return null; - } - if ("conditional-print-expression".equals(tagName)) - { - return new ConditionalPrintExpressionReadHandler(element); - } - if ("format-condition".equals(tagName)) - { - return new FormatConditionReadHandler(element); - } - if ("report-component".equals(tagName)) - { - return new IgnoreAnyChildReadHandler(); - } - return null; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java deleted file mode 100644 index 3989cff53..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java +++ /dev/null @@ -1,237 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportReadHandler.java,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.rpt; - -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 com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.parser.chart.ChartReadHandler; -import java.util.List; -import org.jfree.report.structure.Element; -import org.jfree.report.structure.Section; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -public class ReportReadHandler extends ElementReadHandler -{ - - private RootTableReadHandler pageHeader; - private RootTableReadHandler pageFooter; - private RootTableReadHandler reportHeader; - private RootTableReadHandler reportFooter; - private RootTableReadHandler detail; - - public void setDetail(final RootTableReadHandler detail) - { - this.detail = detail; - } - public final RootTableReadHandler getDetail() - { - return detail; - } - private GroupReadHandler groups; - private final OfficeReport rootSection; - private final List functionHandlers; - private final List preBodyHandlers; - private final List postBodyHandlers; - private boolean pre = true; - - public ReportReadHandler() - { - rootSection = new OfficeReport(); - rootSection.setAttribute(OfficeNamespaces.INTERNAL_NS, "simple-report-structure", Boolean.TRUE); - functionHandlers = new ArrayList(); - preBodyHandlers = new ArrayList(); - postBodyHandlers = new ArrayList(); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - final XmlReadHandler erh; - if (OfficeNamespaces.CHART_NS.equals(uri)) - { - erh = new ChartReadHandler(this); - if (pre) - { - preBodyHandlers.add(erh); - } - else - { - postBodyHandlers.add(erh); - } - } - else if (OfficeNamespaces.OOREPORT_NS.equals(uri)) - { - if ("function".equals(tagName)) - { - erh = new FunctionReadHandler(); - functionHandlers.add(erh); - } - else if ("page-header".equals(tagName)) - { - pageHeader = new RootTableReadHandler(); - erh = pageHeader; - } - else if ("report-header".equals(tagName)) - { - reportHeader = new RootTableReadHandler(); - erh = reportHeader; - } - else if ("report-footer".equals(tagName)) - { - reportFooter = new RootTableReadHandler(); - erh = reportFooter; - } - else if ("page-footer".equals(tagName)) - { - pageFooter = new RootTableReadHandler(); - erh = pageFooter; - } - else if ("detail".equals(tagName)) - { - pre = false; - detail = new DetailRootTableReadHandler(); - erh = detail; - } - else if ("group".equals(tagName)) - { - groups = new GroupReadHandler(this); - erh = groups; - } - else - { - erh = null; - } - } - else - { - erh = null; - } - return erh; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - if (pageHeader != null) - { - rootSection.setPageHeader(pageHeader.getElement()); - } - if (pageFooter != null) - { - rootSection.setPageFooter(pageFooter.getElement()); - } - if (reportHeader != null) - { - rootSection.setReportHeader(reportHeader.getElement()); - } - - final Section preBody = createSection("report-pre-body", preBodyHandlers); - if (preBody != null) - { - rootSection.setPreBodySection(preBody); - } - - final Section groupBody = new Section(); - groupBody.setNamespace(OfficeNamespaces.INTERNAL_NS); - groupBody.setType("report-body"); - rootSection.setBodySection(groupBody); - - // XOR: Either the detail or the group section can be set .. - if (groups != null) - { - groupBody.addNode(groups.getElement()); - } - else if (detail != null) - { - groupBody.addNode(detail.getElement()); - } - - final Section postBody = createSection("report-post-body", postBodyHandlers); - if (postBody != null) - { - rootSection.setPostBodySection(postBody); - } - - if (reportFooter != null) - { - rootSection.setReportFooter(reportFooter.getElement()); - } - - for (int i = 0; i < functionHandlers.size(); i++) - { - final FunctionReadHandler handler = - (FunctionReadHandler) functionHandlers.get(i); - rootSection.addExpression(handler.getExpression()); - } - } - - public Element getElement() - { - return rootSection; - } - - private final Section createSection(final String name, final List handler) - { - if (!handler.isEmpty()) - { - final Section section = new Section(); - section.setNamespace(OfficeNamespaces.INTERNAL_NS); - section.setType(name); - - for (int i = 0; i < handler.size(); i++) - { - final ElementReadHandler erh = (ElementReadHandler) handler.get(i); - section.addNode(erh.getElement()); - } - return section; - } - return null; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/RootTableReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/RootTableReadHandler.java deleted file mode 100644 index f7add8cd3..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/RootTableReadHandler.java +++ /dev/null @@ -1,105 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: RootTableReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.rpt; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.parser.table.TableReadHandler; -import org.jfree.report.structure.Element; -import org.jfree.report.structure.Section; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -public class RootTableReadHandler extends ElementReadHandler -{ - - private TableReadHandler sectionTableReadHandler; - private final Section section; - - public RootTableReadHandler() - { - section = new Section(); - } - - protected RootTableReadHandler(final Section section) - { - if (section == null) - { - throw new NullPointerException(); - } - this.section = section; - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.TABLE_NS.equals(uri) && "table".equals(tagName)) - { - sectionTableReadHandler = new TableReadHandler(); - return sectionTableReadHandler; - } - if (OfficeNamespaces.OOREPORT_NS.equals(uri) && "conditional-print-expression".equals(tagName)) - { - return new ConditionalPrintExpressionReadHandler(section); - } - return null; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() - throws SAXException - { - if (sectionTableReadHandler != null) - { - section.addNode(sectionTableReadHandler.getElement()); - } - } - - public Element getElement() - { - return section; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/SubDocumentReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/SubDocumentReadHandler.java deleted file mode 100644 index d6a290324..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/SubDocumentReadHandler.java +++ /dev/null @@ -1,137 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: SubDocumentReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.rpt; - -import com.sun.star.report.pentaho.model.ObjectOleElement; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import com.sun.star.report.pentaho.parser.draw.ObjectOleReadHandler; -import com.sun.star.report.pentaho.parser.text.NoCDATATextContentReadHandler; -import org.jfree.report.structure.Section; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.jfree.xmlns.parser.IgnoreAnyChildReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * - * @author Ocke Janssen - */ -public class SubDocumentReadHandler extends NoCDATATextContentReadHandler -{ - - private final ObjectOleElement element; - private boolean ignore = false; - - public SubDocumentReadHandler(final ObjectOleElement element) - { - this.element = element; - } - - public SubDocumentReadHandler(final Section section, final ObjectOleElement element) - { - super(section); - this.element = element; - } - - public SubDocumentReadHandler(final Section section) - { - this(section, new ObjectOleElement()); - ignore = true; - } - - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) throws SAXException - { - if (!ignore) - { - super.startParsing(attrs); - } - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.OOREPORT_NS.equals(uri)) - { - // expect a report control. The control will modifiy the current - // element (as we do not separate the elements that strictly ..) - if ("report-control".equals(tagName)) - { - return new IgnoreAnyChildReadHandler(); - } - if ("report-element".equals(tagName)) - { - return new ReportElementReadHandler(element); - } - if ("master-detail-fields".equals(tagName)) - { - return new MasterDetailReadHandler(element); - } - } - if (OfficeNamespaces.DRAWING_NS.equals(uri)) - { - final XmlReadHandler readHandler; - if (OfficeToken.OBJECT_OLE.equals(tagName)) - { - readHandler = new ObjectOleReadHandler(element); - } - else if ("frame".equals(tagName)) - { - readHandler = new SubDocumentReadHandler(new Section(), element); - } - else - { - readHandler = null; - } - if (readHandler != null) - { - getChildren().add(readHandler); - return readHandler; - } - } - return super.getHandlerForChild(uri, tagName, atts); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/selectors.properties b/reportdesign/java/com/sun/star/report/pentaho/parser/selectors.properties deleted file mode 100644 index eca5a9072..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/selectors.properties +++ /dev/null @@ -1,116 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: selectors.properties,v $ -# -# $Revision: 1.3 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -# <style:style style:name="S1" style:family="graphics"> -# <style:section-properties fo:background-color="#ffffff"/> -# </style:style> -# -# gets translated into: -# -# *[draw|style-name~="S1"] - -namespaces.draw=urn:oasis:names:tc:opendocument:xmlns:drawing:1.0 -namespaces.fo=urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0 -namespaces.style=urn:oasis:names:tc:opendocument:xmlns:style:1.0 -namespaces.table=urn:oasis:names:tc:opendocument:xmlns:table:1.0 -namespaces.chart=urn:oasis:names:tc:opendocument:xmlns:chart:1.0 -namespaces.rpt=http://openoffice.org/2005/report - -# -# maps the style family type (graphics) into a style rule of the -# common form: *[<namespace>|<style-name>~="<classname>"] -# -style-family.graphic=draw -style-family.graphics=draw -style-family.control=control -style-family.report-element=rpt -style-family.table-column=table -style-family.table-row=table -style-family.table-cell=table -style-family.table=table - -# Builds the selector pattern for a star-office stylesheet -# -# 0: Namespace prefix -# 1: Style-class attribute name (from the global namespace definition) -# 2: Style-class value -style-selector.pattern=*[{0}|{1}~="{2}"] - -# -# The following properties map the OpenOffice-generic font names -# into their CSS counterparts. As I dont have a clue, whats the difference -# between modern and swiss typeface, I am ignorant for now and ignore -# them. Blame me for that :) -font-family.roman=serif -font-family.swiss=sans-serif -font-family.modern=sans-serif -font-family.decorative=fantasy -font-family.script=cursive -font-family.system=monospace - - -# -# Defines the style property mapping for the resolve process from the -# OpenOffice report format into the internal LibLayout format -# -# attr.style.<group>.<namespace>.<attr-name>=<class> -# -# Group is an selector, which corresponds to one of the sub-elements of -# the style element of the OpenDocument format. (It must match the element -# name for which the attributes are defined.) -# -# Namespace is a defined namespace prefix from this file as defined in the -# namespaces.<prefix> section above -# -# AttrName is the defined attribute name for this namespace as defined by the -# opendocument standard. -attr.style.graphic-properties.draw.textarea-vertical-align=com.sun.star.report.pentaho.parser.stylemapper.draw.TextAreaVerticalAlignMapper -attr.style.section-properties.fo.background-color=com.sun.star.report.pentaho.parser.stylemapper.fo.BackgroundColorMapper -attr.style.paragraph-properties.fo.text-align=com.sun.star.report.pentaho.parser.stylemapper.fo.TextAlignMapper -attr.style.paragraph-properties.style.vertical-align=com.sun.star.report.pentaho.parser.stylemapper.style.VerticalAlignMapper -attr.style.text-properties.fo.color=com.sun.star.report.pentaho.parser.stylemapper.fo.ColorMapper -attr.style.text-properties.style.font-name=com.sun.star.report.pentaho.parser.stylemapper.style.FontNameMapper -attr.style.text-properties.fo.font-family=com.sun.star.report.pentaho.parser.stylemapper.style.FontFamilyMapper -attr.style.table-properties.fo.background-color=com.sun.star.report.pentaho.parser.stylemapper.fo.BackgroundColorMapper -#attr.style.text-properties.style.font-style-name= -attr.style.text-properties.style.font-family-generic=com.sun.star.report.pentaho.parser.stylemapper.style.FontFamilyGenericMapper -attr.style.text-properties.style.font-pitch=com.sun.star.report.pentaho.parser.stylemapper.style.FontPitchMapper -attr.style.text-properties.fo.font-size=com.sun.star.report.pentaho.parser.stylemapper.fo.FontSizeMapper -attr.style.text-properties.fo.font-style=com.sun.star.report.pentaho.parser.stylemapper.fo.FontStyleMapper -attr.style.text-properties.style.text-underline-style=com.sun.star.report.pentaho.parser.stylemapper.style.TextUnderlineStyleMapper -attr.style.text-properties.style.text-underline-width=com.sun.star.report.pentaho.parser.stylemapper.style.TextUnderlineWidthMapper -attr.style.text-properties.style.text-underline-color=com.sun.star.report.pentaho.parser.stylemapper.style.TextUnderlineColorMapper -attr.style.text-properties.fo.font-weight=com.sun.star.report.pentaho.parser.stylemapper.fo.FontWeightMapper -attr.style.text-properties.style.text-emphasize=com.sun.star.report.pentaho.parser.stylemapper.style.TextEmphasizeMapper -attr.style.text-properties.style.font-relief=com.sun.star.report.pentaho.parser.stylemapper.style.FontReliefMapper -attr.style.table-column-properties.table.column-width=com.sun.star.report.pentaho.parser.stylemapper.table.ColumnWidthMapper -attr.style.table-row-properties.table.row-height=com.sun.star.report.pentaho.parser.stylemapper.table.RowHeightMapper -attr.style.table-cell-properties.fo.border-right=com.sun.star.report.pentaho.parser.stylemapper.fo.BorderRightMapper diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/style-mapping.txt b/reportdesign/java/com/sun/star/report/pentaho/parser/style-mapping.txt deleted file mode 100644 index 6b1ede5d9..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/style-mapping.txt +++ /dev/null @@ -1,8 +0,0 @@ - <style:style style:name="S1" style:family="graphics"> - <style:section-properties fo:background-color="#ffffff"/> - </style:style> - -gets translated into: - -*[draw|style-name~="S1"] - diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/style/FontFaceReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/style/FontFaceReadHandler.java deleted file mode 100644 index b91ffbaeb..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/style/FontFaceReadHandler.java +++ /dev/null @@ -1,59 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FontFaceReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.style; - -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.model.FontFaceElement; -import org.jfree.report.structure.Element; - -/** - * Reads a single font-face declaration. This is equal to the @font rule of - * the CSS standard. We do not interpret the attributes of the element in - * any way yet. - * - * @author Thomas Morgner - * @since 13.03.2007 - */ -public class FontFaceReadHandler extends ElementReadHandler -{ - private final FontFaceElement fontFaceElement; - - public FontFaceReadHandler() - { - this.fontFaceElement = new FontFaceElement(); - } - - public Element getElement() - { - return fontFaceElement; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java deleted file mode 100644 index 00fe1696d..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java +++ /dev/null @@ -1,107 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: MasterPageReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.style; - -import java.util.ArrayList; - -import com.sun.star.report.pentaho.model.OfficeMasterPage; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import java.util.List; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * Todo: Document me! - * - * @author Thomas Morgner - * @since 13.03.2007 - */ -public class MasterPageReadHandler extends ElementReadHandler -{ - private final OfficeMasterPage masterPage; - private final List otherHandlers; - - public MasterPageReadHandler() - { - masterPage = new OfficeMasterPage(); - this.otherHandlers = new ArrayList(); - } - - public OfficeMasterPage getMasterPage() - { - return masterPage; - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - final StyleDefinitionReadHandler readHandler = - new StyleDefinitionReadHandler(); - otherHandlers.add(readHandler); - return readHandler; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() - throws SAXException - { - for (int i = 0; i < otherHandlers.size(); i++) - { - final ElementReadHandler handler = - (ElementReadHandler) otherHandlers.get(i); - masterPage.addNode(handler.getElement()); - } - } - - - public Element getElement() - { - return masterPage; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java deleted file mode 100644 index 9f5efafd0..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java +++ /dev/null @@ -1,106 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeStyleReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.style; - -import java.util.ArrayList; - -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.model.OfficeStyle; -import java.util.List; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * This class reads a single style rule. The resulting 'office-style' element - * is added to an 'office-styles' set. - */ -public class OfficeStyleReadHandler extends ElementReadHandler -{ - private final OfficeStyle officeStyle; - private final List childs; - - public OfficeStyleReadHandler() - { - this.officeStyle = new OfficeStyle(); - this.childs = new ArrayList(); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild (final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { -// if (OfficeParserUtil.getInstance().isValidStyleElement(uri, tagName)) -// { -// } - final StyleDefinitionReadHandler readHandler = - new StyleDefinitionReadHandler(); - childs.add(readHandler); - return readHandler; - } - - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - for (int i = 0; i < childs.size(); i++) - { - final ElementReadHandler handler = (ElementReadHandler) childs.get(i); - officeStyle.addNode(handler.getElement()); - } - } - - public OfficeStyle getOfficeStyle() - { - return officeStyle; - } - - public Element getElement() - { - return officeStyle; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java deleted file mode 100644 index 8050575be..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java +++ /dev/null @@ -1,143 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OfficeStylesReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.style; - -import java.util.ArrayList; -import org.jfree.report.modules.factories.report.flow.SectionReadHandler; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.pentaho.model.OfficeStyles; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.parser.data.DataStyleReadHandler; -import java.util.List; - -public class OfficeStylesReadHandler extends ElementReadHandler -{ - private final List textStyleChilds; - private final List dataStyleChilds; - private final List otherStyleChilds; - private final List pageLayoutChilds; - private final OfficeStyles officeStyles; - - public OfficeStylesReadHandler(final OfficeStyles officeStyles) - { - this.officeStyles = officeStyles; - this.pageLayoutChilds = new ArrayList(); - this.dataStyleChilds = new ArrayList(); - this.textStyleChilds = new ArrayList(); - this.otherStyleChilds = new ArrayList(); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild (final String uri, final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.STYLE_NS.equals(uri)) - { - if ("style".equals(tagName)) - { - final OfficeStyleReadHandler xrh = new OfficeStyleReadHandler(); - textStyleChilds.add(xrh); - return xrh; - } - else if ("page-layout".equals(tagName)) - { - final PageLayoutReadHandler prh = new PageLayoutReadHandler(); - pageLayoutChilds.add(prh); - return prh; - } - } - else if (OfficeNamespaces.DATASTYLE_NS.equals(uri)) - { - final DataStyleReadHandler xrh = new DataStyleReadHandler(false); - dataStyleChilds.add(xrh); - return xrh; - } - - final SectionReadHandler genericReadHander = new SectionReadHandler(); - otherStyleChilds.add(genericReadHander); - return genericReadHander; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - for (int i = 0; i < textStyleChilds.size(); i++) - { - final OfficeStyleReadHandler handler = - (OfficeStyleReadHandler) textStyleChilds.get(i); - officeStyles.addStyle(handler.getOfficeStyle()); - } - - for (int i = 0; i < pageLayoutChilds.size(); i++) - { - final PageLayoutReadHandler handler = - (PageLayoutReadHandler) pageLayoutChilds.get(i); - officeStyles.addPageStyle(handler.getPageLayout()); - } - - for (int i = 0; i < dataStyleChilds.size(); i++) - { - final DataStyleReadHandler handler = - (DataStyleReadHandler) dataStyleChilds.get(i); - officeStyles.addDataStyle(handler.getDataStyle()); - } - - for (int i = 0; i < otherStyleChilds.size(); i++) - { - final SectionReadHandler handler = - (SectionReadHandler) otherStyleChilds.get(i); - officeStyles.addOtherNode((Element) handler.getNode()); - } - } - - public Element getElement() - { - return officeStyles; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java deleted file mode 100644 index e5da5f4cc..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java +++ /dev/null @@ -1,105 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: PageLayoutReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.style; - -import java.util.ArrayList; - -import com.sun.star.report.pentaho.model.PageLayout; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import java.util.List; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * Reads a page-layout element. - * - * @author Thomas Morgner - * @since 13.03.2007 - */ -public class PageLayoutReadHandler extends ElementReadHandler -{ - private final PageLayout pageLayout; - private final List childs; - - public PageLayoutReadHandler() - { - this.pageLayout = new PageLayout(); - this.childs = new ArrayList(); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild (final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - final StyleDefinitionReadHandler readHandler = - new StyleDefinitionReadHandler(); - childs.add(readHandler); - return readHandler; - } - - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - for (int i = 0; i < childs.size(); i++) - { - final ElementReadHandler handler = (ElementReadHandler) childs.get(i); - pageLayout.addNode(handler.getElement()); - } - } - - public PageLayout getPageLayout() - { - return pageLayout; - } - - public Element getElement() - { - return pageLayout; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java deleted file mode 100644 index 6ed54e220..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java +++ /dev/null @@ -1,101 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StyleDefinitionReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.style; - -import java.util.ArrayList; - -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import java.util.List; -import org.jfree.report.structure.Element; -import org.jfree.report.structure.Section; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * Reads all childs of a style-definition. This simply copies everything that - * is contained in the source-file into a generic structure that can be - * written out later. - */ -public class StyleDefinitionReadHandler extends ElementReadHandler -{ - private final Section rawSection; - private final List childs; - - public StyleDefinitionReadHandler() - { - this.rawSection = new Section(); - this.childs = new ArrayList(); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - final StyleDefinitionReadHandler readHandler = - new StyleDefinitionReadHandler(); - childs.add(readHandler); - return readHandler; - } - - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() - throws SAXException - { - for (int i = 0; i < childs.size(); i++) - { - final ElementReadHandler handler = (ElementReadHandler) childs.get(i); - rawSection.addNode(handler.getElement()); - } - } - - - public Element getElement() - { - return rawSection; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java deleted file mode 100644 index 98a4ce59f..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java +++ /dev/null @@ -1,78 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OneOfConstantsMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.stylemapper; - -import java.util.HashMap; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import java.util.Map; -import org.jfree.layouting.input.style.CSSDeclarationRule; -import org.jfree.layouting.input.style.StyleKey; -import org.jfree.layouting.input.style.values.CSSValue; - -public abstract class OneOfConstantsMapper implements StyleMapper -{ - - private final StyleKey styleKey; - private final Map mappings; - - protected OneOfConstantsMapper(final StyleKey styleKey) - { - this.styleKey = styleKey; - this.mappings = new HashMap(); - } - - public void addMapping (final String value, final CSSValue target) - { - mappings.put(value, target); - } - - public void updateStyle(final String uri, - final String attrName, - final String attrValue, - final CSSDeclarationRule targetRule) - { - final CSSValue value = lookupMapping(attrValue); - if (value != null) - { - targetRule.setPropertyValue(styleKey, value); - } - } - - public StyleKey getStyleKey() - { - return styleKey; - } - - protected CSSValue lookupMapping(final String attrValue) - { - return (CSSValue) mappings.get(attrValue); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/draw/TextAreaVerticalAlignMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/draw/TextAreaVerticalAlignMapper.java deleted file mode 100644 index 6240ff18d..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/draw/TextAreaVerticalAlignMapper.java +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TextAreaVerticalAlignMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.stylemapper.draw; - -import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; -import org.jfree.layouting.input.style.keys.box.BoxStyleKeys; -import org.jfree.layouting.input.style.values.CSSConstant; - -public class TextAreaVerticalAlignMapper extends OneOfConstantsMapper -{ - public TextAreaVerticalAlignMapper () - { - super (BoxStyleKeys.BOX_VERTICAL_ALIGN); - addMapping("top", new CSSConstant("top")); - addMapping("bottom", new CSSConstant("bottom")); - addMapping("middle", new CSSConstant("middle")); - addMapping("justify", new CSSConstant("justify")); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BackgroundColorMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BackgroundColorMapper.java deleted file mode 100644 index 251dcbe2c..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BackgroundColorMapper.java +++ /dev/null @@ -1,56 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: BackgroundColorMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.stylemapper.fo; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; -import org.jfree.layouting.input.style.keys.border.BorderStyleKeys; -import org.jfree.layouting.input.style.values.CSSColorValue; -import org.jfree.layouting.util.ColorUtil; - -public class BackgroundColorMapper implements StyleMapper -{ - - public BackgroundColorMapper() - { - } - - public void updateStyle(final String uri, - final String attrName, - final String attrValue, - final CSSDeclarationRule targetRule) - { - final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue); - if (cv != null) - { - targetRule.setPropertyValue(BorderStyleKeys.BACKGROUND_COLOR, cv); - } - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BorderRightMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BorderRightMapper.java deleted file mode 100644 index 8b7869641..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BorderRightMapper.java +++ /dev/null @@ -1,62 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: BorderRightMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * BorderRightMapper.java - * - * Created on 16. Februar 2007, 13:00 - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ -package com.sun.star.report.pentaho.parser.stylemapper.fo; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; - -/** - * - * @author oj93728 - */ -public class BorderRightMapper implements StyleMapper -{ - - /** Creates a new instance of BorderRightMapper */ - public BorderRightMapper() - { - } - - public void updateStyle(final String uri, - final String attrName, - final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValueAsString(attrName, attrValue); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/ColorMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/ColorMapper.java deleted file mode 100644 index 08ce9dc08..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/ColorMapper.java +++ /dev/null @@ -1,54 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ColorMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.stylemapper.fo; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; -import org.jfree.layouting.input.style.keys.color.ColorStyleKeys; -import org.jfree.layouting.input.style.values.CSSColorValue; -import org.jfree.layouting.util.ColorUtil; - -public class ColorMapper implements StyleMapper -{ - - public ColorMapper() - { - } - - public void updateStyle(final String uri, final String attrName, final String attrValue, - final CSSDeclarationRule targetRule) - { - final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue); - if (cv != null) - { - targetRule.setPropertyValue(ColorStyleKeys.COLOR, cv); - } - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontSizeMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontSizeMapper.java deleted file mode 100644 index e18b829df..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontSizeMapper.java +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FontSizeMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.stylemapper.fo; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; -import org.jfree.layouting.input.style.keys.font.FontStyleKeys; - -public class FontSizeMapper implements StyleMapper -{ - - public FontSizeMapper() - { - } - - public void updateStyle(final String uri, final String attrName, final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValueAsString(FontStyleKeys.FONT_SIZE, attrValue); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontStyleMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontStyleMapper.java deleted file mode 100644 index 28bb2f2f1..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontStyleMapper.java +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FontStyleMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.stylemapper.fo; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; -import org.jfree.layouting.input.style.keys.font.FontStyleKeys; - -public class FontStyleMapper implements StyleMapper -{ - public FontStyleMapper () - { - } - - public void updateStyle (final String uri, final String attrName, final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValueAsString(FontStyleKeys.FONT_STYLE, attrValue); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontWeightMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontWeightMapper.java deleted file mode 100644 index ffee86a47..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontWeightMapper.java +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FontWeightMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.stylemapper.fo; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; -import org.jfree.layouting.input.style.keys.font.FontStyleKeys; - -public class FontWeightMapper implements StyleMapper -{ - public FontWeightMapper () - { - } - - public void updateStyle (final String uri, final String attrName, final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValueAsString(FontStyleKeys.FONT_WEIGHT, attrValue); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/TextAlignMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/TextAlignMapper.java deleted file mode 100644 index 67fccc66a..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/TextAlignMapper.java +++ /dev/null @@ -1,51 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TextAlignMapper.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.stylemapper.fo; - -import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; -import org.jfree.layouting.input.style.keys.text.TextAlign; -import org.jfree.layouting.input.style.keys.text.TextStyleKeys; - -public class TextAlignMapper extends OneOfConstantsMapper -{ - public TextAlignMapper () - { - super(TextStyleKeys.TEXT_ALIGN); - addMapping("start", TextAlign.START); - addMapping("end", TextAlign.END); - addMapping("left", TextAlign.LEFT); - addMapping("center", TextAlign.CENTER); - addMapping("right", TextAlign.RIGHT); - addMapping("justify", TextAlign.JUSTIFY); - } - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java deleted file mode 100644 index 3001d7ef8..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java +++ /dev/null @@ -1,64 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FontFamilyGenericMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.stylemapper.style; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; -import org.jfree.layouting.input.style.keys.font.FontStyleKeys; -import org.jfree.layouting.input.style.values.CSSStringValue; -import org.jfree.layouting.input.style.values.CSSStringType; -import org.jfree.layouting.input.style.values.CSSValue; -import org.jfree.layouting.input.style.values.CSSValueList; - -public class FontFamilyGenericMapper implements StyleMapper -{ - - public FontFamilyGenericMapper() - { - } - - public void updateStyle(final String uri, final String attrName, final String attrValue, - final CSSDeclarationRule targetRule) - { - final CSSValue value = targetRule.getPropertyCSSValue(FontStyleKeys.FONT_FAMILY); - if (!(value instanceof CSSValueList)) - { - final CSSStringValue cssVal = new CSSStringValue(CSSStringType.STRING, attrValue); - targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY, - new CSSValueList(new CSSValue[]{cssVal})); - } - else - { - final CSSValueList list = (CSSValueList) value; - targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY, - CSSValueList.insertLast(list, value)); - } - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java deleted file mode 100644 index d5d7e5b7a..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java +++ /dev/null @@ -1,64 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FontFamilyMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.stylemapper.style; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; -import org.jfree.layouting.input.style.values.CSSStringValue; -import org.jfree.layouting.input.style.values.CSSStringType; -import org.jfree.layouting.input.style.values.CSSValue; -import org.jfree.layouting.input.style.values.CSSValueList; -import org.jfree.layouting.input.style.keys.font.FontStyleKeys; - -public class FontFamilyMapper implements StyleMapper -{ - - public FontFamilyMapper() - { - } - - public void updateStyle(final String uri, final String attrName, final String attrValue, - final CSSDeclarationRule targetRule) - { - final CSSValue value = targetRule.getPropertyCSSValue(FontStyleKeys.FONT_FAMILY); - if (!(value instanceof CSSValueList)) - { - final CSSStringValue cssVal = new CSSStringValue(CSSStringType.STRING, attrValue); - targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY, - new CSSValueList(new CSSValue[]{cssVal})); - } - else - { - final CSSValueList list = (CSSValueList) value; - targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY, - CSSValueList.insertFirst(list, value)); - } - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java deleted file mode 100644 index 8dc6ef36d..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FontNameMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.stylemapper.style; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; -import org.jfree.layouting.input.style.values.CSSStringValue; -import org.jfree.layouting.input.style.values.CSSStringType; -import org.jfree.layouting.input.style.keys.font.FontStyleKeys; - -public class FontNameMapper implements StyleMapper -{ - public FontNameMapper () - { - } - - public void updateStyle (final String uri, final String attrName, final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValue(FontStyleKeys.FONT_NAME, - new CSSStringValue(CSSStringType.STRING, attrValue)); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java deleted file mode 100644 index 1841e13bf..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java +++ /dev/null @@ -1,46 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FontPitchMapper.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.stylemapper.style; - -import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; -import org.jfree.layouting.input.style.keys.font.FontStyleKeys; -import org.jfree.layouting.input.style.values.CSSConstant; - -public class FontPitchMapper extends OneOfConstantsMapper -{ - public FontPitchMapper () - { - super (FontStyleKeys.FONT_PITCH); - addMapping("variable", new CSSConstant("variable")); - addMapping("fixed", new CSSConstant("fixed")); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java deleted file mode 100644 index f65df8f16..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java +++ /dev/null @@ -1,50 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FontReliefMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.stylemapper.style; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; -import org.jfree.layouting.input.style.keys.font.FontStyleKeys; - -public class FontReliefMapper implements StyleMapper -{ - public FontReliefMapper () - { - - } - - public void updateStyle (final String uri, final String attrName, final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValueAsString(FontStyleKeys.FONT_EFFECT, attrValue); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java deleted file mode 100644 index e3c955658..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TextEmphasizeMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.stylemapper.style; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; - -public class TextEmphasizeMapper implements StyleMapper -{ - public TextEmphasizeMapper () - { - - } - - public void updateStyle (final String uri, final String attrName, final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValueAsString("font-emphasize", attrValue); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java deleted file mode 100644 index a4a484e2d..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java +++ /dev/null @@ -1,57 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TextUnderlineColorMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.stylemapper.style; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; -import org.jfree.layouting.input.style.keys.text.TextStyleKeys; -import org.jfree.layouting.input.style.values.CSSColorValue; -import org.jfree.layouting.util.ColorUtil; - -public class TextUnderlineColorMapper implements StyleMapper -{ - public TextUnderlineColorMapper () - { - } - - public void updateStyle (final String uri, - final String attrName, - final String attrValue, - final CSSDeclarationRule targetRule) - { - final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue); - if (cv != null) - { - targetRule.setPropertyValue(TextStyleKeys.TEXT_UNDERLINE_COLOR, cv); - } - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java deleted file mode 100644 index ec9e33950..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TextUnderlineStyleMapper.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.stylemapper.style; - -import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; -import org.jfree.layouting.input.style.keys.text.TextStyleKeys; -import org.jfree.layouting.input.style.keys.text.TextDecorationStyle; - -public class TextUnderlineStyleMapper extends OneOfConstantsMapper -{ - public TextUnderlineStyleMapper () - { - super(TextStyleKeys.TEXT_UNDERLINE_STYLE); - addMapping("none", TextDecorationStyle.NONE); - addMapping("solid", TextDecorationStyle.SOLID); - addMapping("dotted", TextDecorationStyle.DOTTED); - addMapping("dash", TextDecorationStyle.DASHED); - addMapping("long-dash", TextDecorationStyle.LONG_DASH); - addMapping("dot-dash", TextDecorationStyle.DOT_DASH); - addMapping("dot-dot-dash", TextDecorationStyle.DOT_DOT_DASH); - addMapping("wave", TextDecorationStyle.WAVE); - } - - - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWidthMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWidthMapper.java deleted file mode 100644 index cb14bb898..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWidthMapper.java +++ /dev/null @@ -1,78 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TextUnderlineWidthMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.stylemapper.style; - -import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; -import org.jfree.layouting.input.style.keys.border.BorderWidth; -import org.jfree.layouting.input.style.keys.text.TextDecorationWidth; -import org.jfree.layouting.input.style.keys.text.TextStyleKeys; -import org.jfree.layouting.input.style.values.CSSAutoValue; -import org.jfree.layouting.input.style.values.CSSValue; - -public class TextUnderlineWidthMapper extends OneOfConstantsMapper -{ - - public TextUnderlineWidthMapper() - { - super(TextStyleKeys.TEXT_UNDERLINE_WIDTH); - addMapping("auto", CSSAutoValue.getInstance()); - addMapping("normal", BorderWidth.MEDIUM); - addMapping("bold", TextDecorationWidth.BOLD); - addMapping("thin", BorderWidth.THIN); - addMapping("dash", TextDecorationWidth.DASH); - addMapping("medium", BorderWidth.MEDIUM); - addMapping("thick", BorderWidth.THICK); - } - - public void updateStyle(final String uri, - final String attrName, - final String attrValue, - final CSSDeclarationRule targetRule) - { - if (attrName == null) - { - throw new NullPointerException(); - } - - final CSSValue value = lookupMapping(attrValue); - if (value != null) - { - targetRule.setPropertyValue(getStyleKey(), value); - } - else - // percent - // positive integer - // positive length - { - targetRule.setPropertyValueAsString(getStyleKey(), attrValue); - } - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java deleted file mode 100644 index 144fa366f..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TextUnderlineWordMode.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.stylemapper.style; - -import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; -import org.jfree.layouting.input.style.keys.text.TextDecorationMode; -import org.jfree.layouting.input.style.keys.text.TextStyleKeys; - -public class TextUnderlineWordMode extends OneOfConstantsMapper -{ - public TextUnderlineWordMode () - { - super(TextStyleKeys.TEXT_UNDERLINE_MODE); - addMapping("continuous", TextDecorationMode.CONTINUOUS); - addMapping("skip-white-space", TextDecorationMode.SKIP_WHITE_SPACE); - } - - -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java deleted file mode 100644 index 0da4cc99d..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java +++ /dev/null @@ -1,50 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: VerticalAlignMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.parser.stylemapper.style; - -import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; -import org.jfree.layouting.input.style.keys.line.LineStyleKeys; -import org.jfree.layouting.input.style.values.CSSConstant; -import org.jfree.layouting.input.style.values.CSSAutoValue; - -public class VerticalAlignMapper extends OneOfConstantsMapper -{ - public VerticalAlignMapper () - { - super (LineStyleKeys.VERTICAL_ALIGN); - addMapping("top", new CSSConstant("top")); - addMapping("bottom", new CSSConstant("bottom")); - addMapping("middle", new CSSConstant("middle")); - addMapping("baseline", new CSSConstant("baseline")); - addMapping("auto", CSSAutoValue.getInstance()); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/ColumnWidthMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/ColumnWidthMapper.java deleted file mode 100644 index 8f34c7de1..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/ColumnWidthMapper.java +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ColumnWidthMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package com.sun.star.report.pentaho.parser.stylemapper.table; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; -import org.jfree.layouting.input.style.keys.box.BoxStyleKeys; - -/** - * Creation-Date: 03.07.2006, 13:08:27 - * - * @author Thomas Morgner - */ -public class ColumnWidthMapper implements StyleMapper -{ - public ColumnWidthMapper() - { - } - - public void updateStyle(final String uri, - final String attrName, - final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValueAsString(BoxStyleKeys.WIDTH, attrValue); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/RowHeightMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/RowHeightMapper.java deleted file mode 100644 index 9327a8b7d..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/RowHeightMapper.java +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: RowHeightMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package com.sun.star.report.pentaho.parser.stylemapper.table; - -import com.sun.star.report.pentaho.parser.StyleMapper; -import org.jfree.layouting.input.style.CSSDeclarationRule; -import org.jfree.layouting.input.style.keys.box.BoxStyleKeys; - -/** - * Creation-Date: 03.07.2006, 13:08:27 - * - * @author Thomas Morgner - */ -public class RowHeightMapper implements StyleMapper -{ - public RowHeightMapper() - { - } - - public void updateStyle(final String uri, - final String attrName, - final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValueAsString(BoxStyleKeys.HEIGHT, attrValue); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/table/CoveredCellReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/table/CoveredCellReadHandler.java deleted file mode 100644 index e574ba02a..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/table/CoveredCellReadHandler.java +++ /dev/null @@ -1,56 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: CoveredCellReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.table; - -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import org.jfree.report.structure.Element; -import org.jfree.report.structure.Section; - -/** - * Todo: Document me! - * - * @author Thomas Morgner - * @since 14.03.2007 - */ -public class CoveredCellReadHandler extends ElementReadHandler -{ - - private final Element coveredCell; - - public CoveredCellReadHandler() - { - coveredCell = new Section(); - } - - public Element getElement() - { - return coveredCell; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableCellReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableCellReadHandler.java deleted file mode 100644 index aa54a7fd9..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableCellReadHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TableCellReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.table; - -import com.sun.star.report.pentaho.model.TableCellElement; -import com.sun.star.report.pentaho.parser.text.NoCDATATextContentReadHandler; - -/** - * A read handler for table-cell contents. This is basicly a text-content - * read handler; we may extend this implementation later. - * - * @author Thomas Morgner - * @since 05.03.2007 - */ -public class TableCellReadHandler extends NoCDATATextContentReadHandler -{ - - public TableCellReadHandler() - { - super(new TableCellElement(), true); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableColumnReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableColumnReadHandler.java deleted file mode 100644 index 438f1d2a5..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableColumnReadHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TableColumnReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.table; - -import org.jfree.report.structure.Section; -import org.jfree.report.structure.Element; -import com.sun.star.report.pentaho.parser.ElementReadHandler; - -/** - * Creation-Date: 03.07.2006, 14:26:55 - * - * @author Thomas Morgner - */ -public class TableColumnReadHandler extends ElementReadHandler -{ - - private final Section tableColumn; - public TableColumnReadHandler() - { - tableColumn = new Section(); - } - - public Element getElement() - { - return tableColumn; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java deleted file mode 100644 index 2cc75f75d..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java +++ /dev/null @@ -1,102 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TableColumnsReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.table; - -import java.util.ArrayList; - -import org.jfree.report.structure.Section; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import java.util.List; - -/** - * Creation-Date: 03.07.2006, 13:50:41 - * - * @author Thomas Morgner - */ -public class TableColumnsReadHandler extends ElementReadHandler -{ - - private final List columns; - private final Section tableColumns; - - public TableColumnsReadHandler() - { - columns = new ArrayList(); - tableColumns = new Section(); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.TABLE_NS.equals(uri) && OfficeToken.TABLE_COLUMN.equals(tagName) ) - { - final TableColumnReadHandler readHandler = new TableColumnReadHandler(); - columns.add(readHandler); - return readHandler; - } - - return null; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - for (int i = 0; i < columns.size(); i++) - { - final TableColumnReadHandler handler = (TableColumnReadHandler) columns.get(i); - tableColumns.addNode(handler.getElement()); - } - } - - public Element getElement() - { - return tableColumns; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableReadHandler.java deleted file mode 100644 index c2b5ad56a..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableReadHandler.java +++ /dev/null @@ -1,144 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TableReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.table; - -import java.util.ArrayList; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import com.sun.star.report.pentaho.model.OfficeTableSection; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.parser.rpt.ConditionalPrintExpressionReadHandler; -import java.util.List; -import org.jfree.report.structure.Element; -import org.jfree.report.structure.Section; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * Creation-Date: 03.07.2006, 13:47:47 - * - * @author Thomas Morgner - */ -public class TableReadHandler extends ElementReadHandler -{ - - private final List children; - private final Section table; - - public TableReadHandler() - { - children = new ArrayList(); - table = new OfficeTableSection(); - } - - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) - throws SAXException - { - super.startParsing(attrs); - final String enabled = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "visible"); - if (enabled == null || OfficeToken.TRUE.equals(enabled)) - { - table.setEnabled(true); - } - else - { - table.setEnabled(false); - } - - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.OOREPORT_NS.equals(uri) && "conditional-print-expression".equals(tagName)) - { - return new ConditionalPrintExpressionReadHandler(table); - } - else if (OfficeNamespaces.TABLE_NS.equals(uri)) - { - if (OfficeToken.TABLE_COLUMNS.equals(tagName) || OfficeToken.TABLE_HEADER_COLUMNS.equals(tagName)) - { - final TableColumnsReadHandler columns = new TableColumnsReadHandler(); - children.add(columns); - return columns; - } - else if (OfficeToken.TABLE_ROW.equals(tagName)) - { - final TableRowReadHandler rowHandler = new TableRowReadHandler(); - children.add(rowHandler); - return rowHandler; - } - else if (OfficeToken.TABLE_ROWS.equals(tagName) || OfficeToken.TABLE_HEADER_ROWS.equals(tagName)) - { - final TableRowsReadHandler rowsHandler = new TableRowsReadHandler(); - children.add(rowsHandler); - return rowsHandler; - } - } - return null; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - for (int i = 0; i < children.size(); i++) - { - final ElementReadHandler handler = (ElementReadHandler) children.get(i); - table.addNode(handler.getElement()); - } - } - - public Element getElement() - { - return table; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableRowReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableRowReadHandler.java deleted file mode 100644 index f3950f57b..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableRowReadHandler.java +++ /dev/null @@ -1,125 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TableRowReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.table; - -import java.util.ArrayList; - -import org.jfree.report.structure.Section; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import java.util.List; - -/** - * Creation-Date: 03.07.2006, 13:51:47 - * - * @author Thomas Morgner - */ -public class TableRowReadHandler extends ElementReadHandler -{ - - private final List tableCells; - private final Section tableRow; - - public TableRowReadHandler() - { - tableCells = new ArrayList(); - tableRow = new Section(); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - final XmlReadHandler rh; - if (OfficeNamespaces.TABLE_NS.equals(uri)) - { - if (OfficeToken.TABLE_CELL.equals(tagName)) - { - rh = new TableCellReadHandler(); - } - else if (OfficeToken.COVERED_TABLE_CELL.equals(tagName)) - { - rh = new CoveredCellReadHandler(); - } - else - { - rh = null; - } - if (rh != null) - { - tableCells.add(rh); - } - } - else - { - rh = null; - } - return rh; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - for (int i = 0; i < tableCells.size(); i++) - { - final ElementReadHandler handler = (ElementReadHandler) tableCells.get(i); - tableRow.addNode(handler.getElement()); - } - } - - /** - * Returns the object for this element or null, if this element does not - * create an object. - * - * @return the object. - */ - public Element getElement() - { - return tableRow; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableRowsReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableRowsReadHandler.java deleted file mode 100644 index 3f9e28653..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableRowsReadHandler.java +++ /dev/null @@ -1,101 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TableRowsReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.table; - -import java.util.ArrayList; - -import org.jfree.report.structure.Section; -import org.jfree.report.structure.Element; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import java.util.List; - -/** - * - * @author Ocke Janssen - */ -public class TableRowsReadHandler extends ElementReadHandler -{ - - private final List rows; - private final Section tableRows; - - public TableRowsReadHandler() - { - rows = new ArrayList(); - tableRows = new Section(); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.TABLE_NS.equals(uri) && OfficeToken.TABLE_ROW.equals(tagName)) - { - final TableRowReadHandler readHandler = new TableRowReadHandler(); - rows.add(readHandler); - return readHandler; - } - - return null; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - for (int i = 0; i < rows.size(); i++) - { - final TableRowReadHandler handler = (TableRowReadHandler) rows.get(i); - tableRows.addNode(handler.getElement()); - } - } - - public Element getElement() - { - return tableRows; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/text/NoCDATATextContentReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/text/NoCDATATextContentReadHandler.java deleted file mode 100644 index 156a2eb7b..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/text/NoCDATATextContentReadHandler.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2007, Your Corporation. All Rights Reserved. - */ -package com.sun.star.report.pentaho.parser.text; - -import java.util.ArrayList; - -import com.sun.star.report.pentaho.parser.ElementReadHandler; -import com.sun.star.report.pentaho.parser.rpt.FixedContentReadHandler; -import com.sun.star.report.pentaho.parser.rpt.FormattedTextReadHandler; -import com.sun.star.report.pentaho.parser.rpt.ImageReadHandler; -import com.sun.star.report.pentaho.OfficeNamespaces; -import com.sun.star.report.OfficeToken; -import com.sun.star.report.pentaho.parser.rpt.SubDocumentReadHandler; -import java.util.List; -import org.jfree.report.structure.Section; -import org.jfree.report.structure.Element; -import org.jfree.report.structure.StaticText; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * This is a generic implementation that accepts all input and adds special - * handlers for the report-elements. - * - * @author Thomas Morgner - */ -public class NoCDATATextContentReadHandler extends ElementReadHandler -{ - - private Section section; - private List children; - private boolean copyType; - - public NoCDATATextContentReadHandler(final Section section, - final boolean copyType) - { - this.children = new ArrayList(); - this.section = section; - this.copyType = copyType; - } - - public NoCDATATextContentReadHandler(final Section section) - { - this(section, false); - } - - public NoCDATATextContentReadHandler() - { - this(new Section(), true); - } - - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) throws SAXException - { - super.startParsing(attrs); - final Element element = getElement(); - if (copyType) - { - copyElementType(element); - } - copyAttributes(attrs, element); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.OOREPORT_NS.equals(uri)) - { - if ("fixed-content".equals(tagName)) - { - final FixedContentReadHandler fixedContentReadHandler = new FixedContentReadHandler(); - children.add(fixedContentReadHandler); - return fixedContentReadHandler; - } - if ("formatted-text".equals(tagName)) - { - final FormattedTextReadHandler formattedTextReadHandler = new FormattedTextReadHandler(); - children.add(formattedTextReadHandler); - return formattedTextReadHandler; - } - if (OfficeToken.IMAGE.equals(tagName)) - { - final ImageReadHandler imageReadHandler = new ImageReadHandler(); - children.add(imageReadHandler); - return imageReadHandler; - } - if ("sub-document".equals(tagName)) - { - final SubDocumentReadHandler subDocReadHandler = new SubDocumentReadHandler(section); - // children.add(subDocReadHandler); - return subDocReadHandler; - } - } - if (OfficeNamespaces.DRAWING_NS.equals(uri)) - { - final XmlReadHandler readHandler; - if (OfficeToken.IMAGE.equals(tagName)) - { - readHandler = new ImageReadHandler(); - } - else - { - readHandler = new NoCDATATextContentReadHandler(); - } - children.add(readHandler); - return readHandler; - } - else - { - final TextContentReadHandler readHandler = new TextContentReadHandler(); - children.add(readHandler); - return readHandler; - } - } - - public List getChildren() - { - return children; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - for (int i = 0; i < children.size(); i++) - { - final Object o = children.get(i); - if (o instanceof ElementReadHandler) - { - final ElementReadHandler handler = (ElementReadHandler) o; - section.addNode(handler.getElement()); - } - else if (o instanceof StaticText) - { - section.addNode((StaticText) o); - } - } - } - - public Element getElement() - { - return section; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/text/TextContentReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/text/TextContentReadHandler.java deleted file mode 100644 index 3e8c019f2..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/text/TextContentReadHandler.java +++ /dev/null @@ -1,72 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TextContentReadHandler.java,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.text; - -import org.jfree.report.structure.Section; -import org.jfree.report.structure.StaticText; -import org.xml.sax.SAXException; - -/** - * This is a generic implementation that accepts all input and adds special - * handlers for the report-elements. - * - * @author Thomas Morgner - */ -public class TextContentReadHandler extends NoCDATATextContentReadHandler -{ - - public TextContentReadHandler(final Section section, final boolean copyType) - { - super(section, copyType); - } - - public TextContentReadHandler(final Section section) - { - super(section); - } - - public TextContentReadHandler() - { - } - - /** - * This method is called to process the character data between element tags. - * - * @param ch the character buffer. - * @param start the start index. - * @param length the length. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - public void characters(final char[] ch, final int start, final int length) - throws SAXException - { - getChildren().add(new StaticText(new String(ch, start, length))); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/xlink/XLinkReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/xlink/XLinkReadHandler.java deleted file mode 100644 index ba6bdeb15..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/xlink/XLinkReadHandler.java +++ /dev/null @@ -1,98 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: XLinkReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.parser.xlink; - -import com.sun.star.report.pentaho.OfficeNamespaces; -import org.jfree.xmlns.parser.AbstractXmlReadHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * An image reference. - * - * @author Thomas Morgner - */ -public class XLinkReadHandler extends AbstractXmlReadHandler -{ - - private String uri; - private String type; - private String show; - private String actuate; - - public XLinkReadHandler() - { - } - - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) throws SAXException - { - uri = attrs.getValue(OfficeNamespaces.XLINK_NS, "uri"); - type = attrs.getValue(OfficeNamespaces.XLINK_NS, "type"); - show = attrs.getValue(OfficeNamespaces.XLINK_NS, "show"); - actuate = attrs.getValue(OfficeNamespaces.XLINK_NS, "actuate"); - } - - /** - * Returns the object for this element or null, if this element does not - * create an object. - * - * @return the object. - */ - public Object getObject() throws SAXException - { - return uri; - } - - public String getUri() - { - return uri; - } - - public String getType() - { - return type; - } - - public String getShow() - { - return show; - } - - public String getActuate() - { - return actuate; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/smil.css b/reportdesign/java/com/sun/star/report/pentaho/smil.css deleted file mode 100644 index b01076ff3..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/smil.css +++ /dev/null @@ -1,5 +0,0 @@ -@namespace url("urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0"); - -/** - * All default styles for formating-objects elements (if there are any). - */ diff --git a/reportdesign/java/com/sun/star/report/pentaho/star-office.css b/reportdesign/java/com/sun/star/report/pentaho/star-office.css deleted file mode 100644 index da515eb88..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/star-office.css +++ /dev/null @@ -1,5 +0,0 @@ -@namespace url("http://openoffice.org/2004/office"); - -/** - * All default styles for office elements. - */ diff --git a/reportdesign/java/com/sun/star/report/pentaho/star-report.css b/reportdesign/java/com/sun/star/report/pentaho/star-report.css deleted file mode 100644 index ef4e595d8..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/star-report.css +++ /dev/null @@ -1,73 +0,0 @@ -@namespace table url("urn:oasis:names:tc:opendocument:xmlns:table:1.0"); -@namespace text url("urn:oasis:names:tc:opendocument:xmlns:text:1.0"); -@namespace report url("http://openoffice.org/2005/report"); - -table|table { - display: table; -} - -table|table-columns { - display: table-column-group; -} - -table|table-column { - display: table-column; -} - -table|table-row { - display: table-row; -} - -table|table-cell { - display: table-cell; -} - -table|table-cell[number-columns-spanned], -table|table-cell[number-columns-spanned], -table|table-columns[number-columns-spanned], -table|table-column[number-columns-spanned] { - -x-liblayout-colspan: attr("table|number-columns-spanned"); -} - -table|table-cell[number-rows-spanned], -table|table-cell[number-rows-spanned] { - -x-liblayout-rowspan: attr("table|number-rows-spanned"); -} - - -/** - * Style definitions for star report. - */ -* { - vertical-align: baseline; -} - -/** - * A standard number format declaration. The number of decimal places - * and whether there is grouping is defined by the format string. - * - * The position and content of embedded text is also derived directly from - * the given format string text. - - number - scientific - text - boolean - date - currency - percentage - fraction - - */ -@format number myname { - -x-liblayout-decimal-replacement: "-"; - -x-liblayout-display-factor: 1000; - content: "'Prefix'#,##0.00'postfix'"; -} - -@format scientific anothername { - /* to be filled */ -} - - - diff --git a/reportdesign/java/com/sun/star/report/pentaho/star-rpt.css b/reportdesign/java/com/sun/star/report/pentaho/star-rpt.css deleted file mode 100644 index 6da26872b..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/star-rpt.css +++ /dev/null @@ -1,5 +0,0 @@ -@namespace url("http://openoffice.org/2005/report"); - -/** - * All default styles for report elements. - */ diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/LengthCalculator.java b/reportdesign/java/com/sun/star/report/pentaho/styles/LengthCalculator.java deleted file mode 100644 index cbc2eaee9..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/styles/LengthCalculator.java +++ /dev/null @@ -1,116 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: LengthCalculator.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.styles; - -import org.jfree.layouting.input.style.values.CSSNumericType; -import org.jfree.layouting.input.style.values.CSSNumericValue; - -/** - * A helper class that sums up various CSS-length. The various unit types are - * kept separate until the final result is computed to minimize the computation - * inaccuracy. - * - * @author Thomas Morgner - * @since 15.03.2007 - */ -public class LengthCalculator -{ - // and centimeter (x10) - private double millimeter; - - // and pica (x12) and inch(x72). Px is assumed to be in 96dpi. - private double point; - - private double pixel; - - public LengthCalculator() - { - } - - public void add (final CSSNumericValue value) - { - if (value == null) - { - return; - } - - final CSSNumericType numericType = value.getType(); - if (numericType == CSSNumericType.CM) - { - millimeter += value.getValue() * 10; - } - else if (numericType == CSSNumericType.MM) - { - millimeter += value.getValue(); - } - else if (numericType == CSSNumericType.PT) - { - point += value.getValue(); - } - else if (numericType == CSSNumericType.PC) - { - point += 12 * value.getValue(); - } - else if (numericType == CSSNumericType.INCH) - { - point += 72 * value.getValue(); - } - else if (numericType == CSSNumericType.PX) - { - pixel += value.getValue(); - } - // Log.debug ("Adding " + value + " [mm: " + millimeter + "] [pt: " + point + "] px: [" + pixel + "]"); - } - - public CSSNumericValue getResult () - { - if (pixel == 0 && point == 0) - { - return CSSNumericValue.createValue(CSSNumericType.MM, millimeter); - } - if (pixel == 0 && millimeter == 0) - { - return CSSNumericValue.createValue(CSSNumericType.PT, point); - } - if (point == 0 && millimeter == 0) - { - return CSSNumericValue.createValue(CSSNumericType.PX, pixel); - } - // else convert it. - - double result = point; - result += (millimeter * 10 * 72 / 254); - result += pixel * 72 / 96; - - return CSSNumericValue.createValue(CSSNumericType.PT, result); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapper.java b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapper.java deleted file mode 100644 index 549aec925..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapper.java +++ /dev/null @@ -1,106 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StyleMapper.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.styles; - -import java.util.HashMap; - -import java.util.Map; -import org.jfree.resourceloader.Resource; -import org.jfree.resourceloader.ResourceException; -import org.jfree.resourceloader.ResourceManager; - -/** - * The style-mapper holds all information about the OpenOffice style mapping - * mechanism. OpenOffice references styles by their name and context, a style - * has a style-family assigned. The style family is determined by the element - * referencing the style, and there is no easily accessible information - * available on that. - * <p/> - * Therefore this mapper acts as gatekeeper for this information. The style - * mapping information is read from an external definition file and can be - * maintained externally. - * - * @author Thomas Morgner - * @since 11.03.2007 - */ -public class StyleMapper -{ - private final Map backend; - - public StyleMapper() - { - this.backend = new HashMap(); - } - - public void addMapping(final StyleMappingRule rule) - { - backend.put(rule.getKey(), rule); - } - - public boolean isListOfStyles(final String elementNamespace, - final String elementTagName, - final String attributeNamespace, - final String attributeName) - { - final StyleMapperKey key = new StyleMapperKey - (elementNamespace, elementTagName, attributeNamespace, attributeName); - final StyleMappingRule rule = (StyleMappingRule) backend.get(key); - if (rule == null) - { - return false; - } - return rule.isListOfValues(); - } - - public String getStyleFamilyFor(final String elementNamespace, - final String elementTagName, - final String attributeNamespace, - final String attributeName) - { - final StyleMapperKey key = new StyleMapperKey - (elementNamespace, elementTagName, attributeNamespace, attributeName); - final StyleMappingRule rule = (StyleMappingRule) backend.get(key); - if (rule == null) - { - return null; - } - return rule.getFamily(); - } - - public static StyleMapper loadInstance (final ResourceManager resourceManager) - throws ResourceException - { - final Resource resource = resourceManager.createDirectly - ("res://com/sun/star/report/pentaho/styles/stylemapper.xml", StyleMapper.class); - return (StyleMapper) resource.getResource(); - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperKey.java b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperKey.java deleted file mode 100644 index b25a22e2f..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperKey.java +++ /dev/null @@ -1,123 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StyleMapperKey.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.styles; - -/** - * A hash key for the stylemapper. - * - * @author Thomas Morgner - * @since 12.03.2007 - */ -public final class StyleMapperKey -{ - - private final String elementNamespace; - private final String elementName; - private final String attributeNamespace; - private final String attributeName; - private final int hashCode; - - public StyleMapperKey(final String elementNamespace, - final String elementName, - final String attributeNamespace, - final String attributeName) - { - if (elementNamespace == null) - { - throw new NullPointerException(); - } - if (elementName == null) - { - throw new NullPointerException(); - } - - this.elementNamespace = elementNamespace; - this.elementName = elementName; - this.attributeNamespace = attributeNamespace; - this.attributeName = attributeName; - this.hashCode = computeHashCode(); - } - - public String getElementNamespace() - { - return elementNamespace; - } - - public String getElementName() - { - return elementName; - } - - public String getAttributeNamespace() - { - return attributeNamespace; - } - - public String getAttributeName() - { - return attributeName; - } - - public boolean equals(final Object o) - { - if (this != o) - { - if (o == null || getClass() != o.getClass()) - { - return false; - } - - final StyleMapperKey that = (StyleMapperKey) o; - - if ((attributeName != null ? !attributeName.equals(that.attributeName) : that.attributeName != null) || - (attributeNamespace != null ? !attributeNamespace.equals(that.attributeNamespace) : that.attributeNamespace != null) || - !elementName.equals(that.elementName) || !elementNamespace.equals(that.elementNamespace)) - { - return false; - } - } - - return true; - } - - private int computeHashCode() - { - int result = elementNamespace.hashCode(); - result = 31 * result + elementName.hashCode(); - result = 31 * result + (attributeNamespace != null ? attributeNamespace.hashCode() : 0); - result = 31 * result + (attributeName != null ? attributeName.hashCode() : 0); - return result; - } - - public int hashCode() - { - return hashCode; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperXmlFactoryModule.java b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperXmlFactoryModule.java deleted file mode 100644 index c1a26455c..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperXmlFactoryModule.java +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StyleMapperXmlFactoryModule.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.styles; - -import org.jfree.xmlns.parser.XmlDocumentInfo; -import org.jfree.xmlns.parser.XmlFactoryModule; -import org.jfree.xmlns.parser.XmlReadHandler; - -/** - * An XML-FactoryModule that load the style-mapper contents. - * - * @author Thomas Morgner - * @since 12.03.2007 - */ -public class StyleMapperXmlFactoryModule implements XmlFactoryModule -{ - - public static final String NAMESPACE = - "http://jfreereport.sourceforge.net/namespaces/engine/openoffice/stylemapper"; - - public StyleMapperXmlFactoryModule() - { - } - - public XmlReadHandler createReadHandler(final XmlDocumentInfo documentInfo) - { - return new StyleMappingDocumentReadHandler(); - } - - public int getDocumentSupport(final XmlDocumentInfo documentInfo) - { - final String rootNamespace = documentInfo.getRootElementNameSpace(); - if (StyleMapperXmlFactoryModule.NAMESPACE.equals(rootNamespace) && - "style-mapper-definition".equals(documentInfo.getRootElement())) - { - - return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE; - } - return XmlFactoryModule.NOT_RECOGNIZED; - } - - public String getDefaultNamespace(final XmlDocumentInfo documentInfo) - { - return null; - } -} - diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperXmlResourceFactory.java b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperXmlResourceFactory.java deleted file mode 100644 index d154d1a06..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperXmlResourceFactory.java +++ /dev/null @@ -1,59 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StyleMapperXmlResourceFactory.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.styles; - -import org.jfree.xmlns.parser.AbstractXmlResourceFactory; -import org.jfree.util.Configuration; -import org.jfree.report.JFreeReportBoot; - -/** - * Todo: Document me! - * - * @author Thomas Morgner - * @since 12.03.2007 - */ -public class StyleMapperXmlResourceFactory extends AbstractXmlResourceFactory -{ - public StyleMapperXmlResourceFactory() - { - } - - protected Configuration getConfiguration() - { - return JFreeReportBoot.getInstance().getGlobalConfig(); - } - - public Class getFactoryType() - { - return StyleMapper.class; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingDocumentReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingDocumentReadHandler.java deleted file mode 100644 index 891279637..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingDocumentReadHandler.java +++ /dev/null @@ -1,108 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StyleMappingDocumentReadHandler.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.report.pentaho.styles; - -import java.util.ArrayList; - -import java.util.List; -import org.jfree.xmlns.parser.AbstractXmlReadHandler; -import org.jfree.xmlns.parser.XmlReadHandler; -import org.xml.sax.SAXException; -import org.xml.sax.Attributes; - -/** - * Todo: Document me! - * - * @author Thomas Morgner - * @since 12.03.2007 - */ -public class StyleMappingDocumentReadHandler extends AbstractXmlReadHandler -{ - - private final StyleMapper styleMapper; - private final List mappings; - - public StyleMappingDocumentReadHandler() - { - this.mappings = new ArrayList(); - this.styleMapper = new StyleMapper(); - } - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (isSameNamespace(uri) && "mapping".equals(tagName)) - { - final StyleMappingReadHandler smr = new StyleMappingReadHandler(); - mappings.add(smr); - return smr; - } - return null; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() - throws SAXException - { - for (int i = 0; i < mappings.size(); i++) - { - final StyleMappingReadHandler handler = - (StyleMappingReadHandler) mappings.get(i); - styleMapper.addMapping(handler.getRule()); - } - } - - /** - * Returns the object for this element or null, if this element does not - * create an object. - * - * @return the object. - */ - public Object getObject() - throws SAXException - { - return styleMapper; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java deleted file mode 100644 index ff4e1ab3c..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java +++ /dev/null @@ -1,109 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StyleMappingReadHandler.java,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.styles; - -import org.jfree.xmlns.parser.AbstractXmlReadHandler; -import org.jfree.xmlns.parser.ParseException; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * Todo: Document me! - * - * @author Thomas Morgner - * @since 12.03.2007 - */ -public class StyleMappingReadHandler extends AbstractXmlReadHandler -{ - private StyleMappingRule rule; - - public StyleMappingReadHandler() - { - } - - - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) - throws SAXException - { - final String elementNamespace = attrs.getValue(getUri(), - "element-namespace"); - if (elementNamespace == null) - { - throw new ParseException - ("Required attribute 'element-namespace' is missing", getLocator()); - } - - final String elementName = attrs.getValue(getUri(), "element-name"); - - if (elementName == null) - { - throw new ParseException - ("Required attribute 'element-name' is missing", getLocator()); - } - - final String attributeNamespace = attrs.getValue(getUri(), - "attribute-namespace"); - final String attributeName = attrs.getValue(getUri(), "attribute-name"); - - final boolean listOfValues = - "styleNameRefs".equals(attrs.getValue(getUri(), "type")); - - final String family = attrs.getValue(getUri(), "style-family"); - final StyleMapperKey key = new StyleMapperKey - (elementNamespace, elementName, attributeNamespace, attributeName); - rule = new StyleMappingRule(key, family, listOfValues); - } - - - public StyleMappingRule getRule() - { - return rule; - } - - /** - * Returns the object for this element or null, if this element does not - * create an object. - * - * @return the object. - */ - public Object getObject() - throws SAXException - { - return rule; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingRule.java b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingRule.java deleted file mode 100644 index e15a910c0..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingRule.java +++ /dev/null @@ -1,70 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: StyleMappingRule.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.pentaho.styles; - -/** - * Todo: Document me! - * - * @author Thomas Morgner - * @since 12.03.2007 - */ -public class StyleMappingRule -{ - private final StyleMapperKey key; - private final String family; - private final boolean listOfValues; - - - public StyleMappingRule(final StyleMapperKey key, final String family, - final boolean listOfValues) - { - this.key = key; - this.family = family; - this.listOfValues = listOfValues; - } - - - public StyleMapperKey getKey() - { - return key; - } - - public String getFamily() - { - return family; - } - - public boolean isListOfValues() - { - return listOfValues; - } -} diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xml b/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xml deleted file mode 100644 index 129e86462..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xml +++ /dev/null @@ -1,172 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - - Copyright 2008 by Sun Microsystems, Inc. - - OpenOffice.org - a multi-platform office productivity suite - - $RCSfile: stylemapper.xml,v $ - - $Revision: 1.5 $ - - This file is part of OpenOffice.org. - - OpenOffice.org is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - OpenOffice.org 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 version 3 for more details - (a copy is included in the LICENSE file that accompanied this code). - - You should have received a copy of the GNU Lesser General Public License - version 3 along with OpenOffice.org. If not, see - <http://www.openoffice.org/license.html> - for a copy of the LGPLv3 License. - - --> -<style-mapper-definition - xmlns="http://jfreereport.sourceforge.net/namespaces/engine/openoffice/stylemapper"> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - element-name="p" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - attribute-name="style-name" - style-family="paragraph" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - element-name="p" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - attribute-name="class-names" - style-family="paragraph" - type="styleNameRefs"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - element-name="list" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - attribute-name="style-name" - style-family="paragraph" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - element-name="section" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - attribute-name="style-name" - style-family="section" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - element-name="span" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - attribute-name="style-name" - style-family="text" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - element-name="span" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - attribute-name="class-names" - style-family="text" - type="styleNameRefs"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - element-name="ruby" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - attribute-name="style-name" - style-family="ruby" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - element-name="ruby-text" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" - attribute-name="style-name" - style-family="paragraph" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0" - element-name="table" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0" - attribute-name="style-name" - style-family="table" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0" - element-name="table-column" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0" - attribute-name="style-name" - style-family="table-column" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0" - element-name="table-row" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0" - attribute-name="style-name" - style-family="table-row" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0" - element-name="table-cell" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0" - attribute-name="style-name" - style-family="table-cell" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" - element-name="custom-shape" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" - attribute-name="style-name" - style-family="graphic" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" - element-name="frame" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" - attribute-name="style-name" - style-family="graphic" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - element-name="chart" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - attribute-name="style-name" - style-family="chart" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - element-name="title" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - attribute-name="style-name" - style-family="chart" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - element-name="axis" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - attribute-name="style-name" - style-family="chart" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - element-name="series" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - attribute-name="style-name" - style-family="chart" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - element-name="wall" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - attribute-name="style-name" - style-family="chart" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - element-name="floor" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - attribute-name="style-name" - style-family="chart" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - element-name="legend" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - attribute-name="style-name" - style-family="chart" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - element-name="plot-area" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - attribute-name="style-name" - style-family="chart" - type="styleNameRef"/> - <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - element-name="grid" - attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" - attribute-name="style-name" - style-family="chart" - type="styleNameRef"/> -</style-mapper-definition> diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xsd b/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xsd deleted file mode 100644 index 905dbc846..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xsd +++ /dev/null @@ -1,95 +0,0 @@ -<!-- - - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - - Copyright 2008 by Sun Microsystems, Inc. - - OpenOffice.org - a multi-platform office productivity suite - - $RCSfile: stylemapper.xsd,v $ - - $Revision: 1.3 $ - - This file is part of OpenOffice.org. - - OpenOffice.org is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - OpenOffice.org 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 version 3 for more details - (a copy is included in the LICENSE file that accompanied this code). - - You should have received a copy of the GNU Lesser General Public License - version 3 along with OpenOffice.org. If not, see - <http://www.openoffice.org/license.html> - for a copy of the LGPLv3 License. - - --> - -<xsd:schema version="0.9" - xmlns:xsd="http://www.w3.org/2001/XMLSchema" - xmlns="http://jfreereport.sourceforge.net/namespaces/engine/openoffice/stylemapper" - targetNamespace="http://jfreereport.sourceforge.net/namespaces/engine/openoffice/stylemapper" - attributeFormDefault="unqualified"> - <xsd:annotation> - <xsd:documentation> - This schema describes the format of the stylemapper definition file. - The stylemapper declares what style-families are referenced by an element. - </xsd:documentation> - </xsd:annotation> - - <xsd:simpleType name="styleNameRefType"> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="styleNameRef"/> - <xsd:enumeration value="styleNameRefs"/> - </xsd:restriction> - </xsd:simpleType> - - <xsd:simpleType name="styleFamilyType"> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="paragraph"/> - <xsd:enumeration value="text"/> - <xsd:enumeration value="section"/> - <xsd:enumeration value="table"/> - <xsd:enumeration value="table-column"/> - <xsd:enumeration value="table-row"/> - <xsd:enumeration value="table-cell"/> - <xsd:enumeration value="table-page"/> - <xsd:enumeration value="chart"/> - <xsd:enumeration value="default"/> - <xsd:enumeration value="drawing-page"/> - <xsd:enumeration value="graphic"/> - <xsd:enumeration value="presentation"/> - <xsd:enumeration value="control"/> - <xsd:enumeration value="ruby"/> - <xsd:enumeration value="custom-shape"/> - </xsd:restriction> - </xsd:simpleType> - - <xsd:element name="mapping"> - <xsd:complexType> - <xsd:attribute name="element-namespace" use="required" type="xsd:anyURI"/> - <xsd:attribute name="element-name" use="required" type="xsd:NCName"/> - <xsd:attribute name="attribute-namespace" use="required" type="xsd:anyURI"/> - <xsd:attribute name="attribute-name" use="required" type="xsd:NCName"/> - <xsd:attribute name="type" use="required" type="styleNameRefType"/> - <xsd:attribute name="style-family" use="required" type="styleFamilyType"/> - </xsd:complexType> - </xsd:element> - - <xsd:element name="style-mapper-definition"> - <xsd:complexType> - <xsd:complexContent> - <xsd:restriction base="xsd:anyType"> - <xsd:sequence> - <xsd:element ref="mapping" minOccurs="0" maxOccurs="unbounded"/> - </xsd:sequence> - </xsd:restriction> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - -</xsd:schema> diff --git a/reportdesign/java/com/sun/star/report/pentaho/svg.css b/reportdesign/java/com/sun/star/report/pentaho/svg.css deleted file mode 100644 index f715210c7..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/svg.css +++ /dev/null @@ -1,5 +0,0 @@ -@namespace url("urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"); - -/** - * All default styles for formating-objects elements (if there are any). - */ diff --git a/reportdesign/java/com/sun/star/report/pentaho/xsl-fo.css b/reportdesign/java/com/sun/star/report/pentaho/xsl-fo.css deleted file mode 100644 index 494ee6693..000000000 --- a/reportdesign/java/com/sun/star/report/pentaho/xsl-fo.css +++ /dev/null @@ -1,5 +0,0 @@ -@namespace url("urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"); - -/** - * All default styles for formating-objects elements (if there are any). - */ diff --git a/reportdesign/java/com/sun/star/report/util/DefaultJobProperties.java b/reportdesign/java/com/sun/star/report/util/DefaultJobProperties.java deleted file mode 100644 index 2cb50b80e..000000000 --- a/reportdesign/java/com/sun/star/report/util/DefaultJobProperties.java +++ /dev/null @@ -1,83 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DefaultJobProperties.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.util; - -import java.util.HashMap; - -import com.sun.star.report.JobProperties; -import com.sun.star.report.ReportEngineMetaData; -import com.sun.star.report.JobDefinitionException; -import java.util.Map; - -public class DefaultJobProperties implements JobProperties -{ - private final ReportEngineMetaData metaData; - private final Map properties; - - public DefaultJobProperties (final ReportEngineMetaData metaData) - { - if (metaData == null) - { - throw new NullPointerException(); - } - this.properties = new HashMap(); - this.metaData = metaData; - } - - public Object getProperty (final String key) - { - return properties.get(key); - } - - public void setProperty (final String key, final Object value) - throws JobDefinitionException - { - final Class type = metaData.getParameterType(key); - if (type == null) - { - throw new JobDefinitionException("The parameter name is not known: " + key); - } - if (!type.isInstance(value)) - { - throw new JobDefinitionException("The parameter value is not understood"); - } - - this.properties.put(key, value); - } - - public JobProperties copy() - { - final DefaultJobProperties props = new DefaultJobProperties(metaData); - props.properties.putAll(properties); - return props; - } -} diff --git a/reportdesign/java/com/sun/star/report/util/DefaultParameterMap.java b/reportdesign/java/com/sun/star/report/util/DefaultParameterMap.java deleted file mode 100644 index 965db6588..000000000 --- a/reportdesign/java/com/sun/star/report/util/DefaultParameterMap.java +++ /dev/null @@ -1,129 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DefaultParameterMap.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.util; - -import java.util.HashMap; - -import com.sun.star.report.ParameterMap; -import java.util.Map; - -public class DefaultParameterMap implements ParameterMap -{ - private final Map backend; - - public DefaultParameterMap () - { - backend = new HashMap(); - } - - public void clear () - { - backend.clear(); - } - - /** - * 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) - { - if (key == null) - { - throw new NullPointerException - ("DefaultParameterMap.get (..): Parameter 'key' must not be null"); - } - return backend.get(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) - { - if (key == null) - { - throw new NullPointerException - ("DefaultParameterMap.get (..): Parameter 'key' must not be null"); - } - final Object o = this.backend.get(key); - if (o == null) - { - return defaultValue; - } - return o; - } - - public String[] keys () - { - return (String[]) this.backend.keySet().toArray(new String[backend.size()]); - } - - /** - * 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) - { - if (key == null) - { - throw new NullPointerException - ("ReportProperties.put (..): Parameter 'key' must not be null"); - } - if (value == null) - { - this.backend.remove(key); - } - else - { - this.backend.put(key, value); - } - } - - public int size () - { - return this.backend.size(); - } -} diff --git a/reportdesign/java/com/sun/star/report/util/DefaultReportJobDefinition.java b/reportdesign/java/com/sun/star/report/util/DefaultReportJobDefinition.java deleted file mode 100644 index 4ce835b66..000000000 --- a/reportdesign/java/com/sun/star/report/util/DefaultReportJobDefinition.java +++ /dev/null @@ -1,123 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DefaultReportJobDefinition.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -package com.sun.star.report.util; - -import com.sun.star.report.DataSourceFactory; -import com.sun.star.report.InputRepository; -import com.sun.star.report.JobDefinitionException; -import com.sun.star.report.JobProperties; -import com.sun.star.report.OutputRepository; -import com.sun.star.report.ParameterMap; -import com.sun.star.report.ReportEngineMetaData; -import com.sun.star.report.ReportEngineParameterNames; -import com.sun.star.report.ReportJobDefinition; - -public class DefaultReportJobDefinition implements ReportJobDefinition -{ - public static final String OUTPUT_TYPE = "output-type"; - - private final DefaultParameterMap parameters; - private final DefaultJobProperties properties; - - public DefaultReportJobDefinition (final ReportEngineMetaData metaData) - { - this.parameters = new DefaultParameterMap(); - this.properties = new DefaultJobProperties(metaData); - } - - public void setDataSourceFactory (final DataSourceFactory dataSourceFactory) - throws JobDefinitionException - { - this.properties.setProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY, dataSourceFactory); - } - - public DataSourceFactory getDataSourceFactory () - { - return (DataSourceFactory) this.properties.getProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY); - } - - public InputRepository getInputRepository () - { - return (InputRepository) - this.properties.getProperty(ReportEngineParameterNames.INPUT_REPOSITORY); - } - - public void setInputRepository (final InputRepository inputRepository) - throws JobDefinitionException - { - this.properties.setProperty(ReportEngineParameterNames.INPUT_REPOSITORY, inputRepository); - } - - public OutputRepository getOutputRepository () - { - return (OutputRepository) - this.properties.getProperty(ReportEngineParameterNames.OUTPUT_REPOSITORY); - } - - public void setOutputRepository (final OutputRepository outputRepository) - throws JobDefinitionException - { - this.properties.setProperty(ReportEngineParameterNames.OUTPUT_REPOSITORY, outputRepository); - } - - /** - * The parameters of the root report definition. The parameters for the subreports are - * defined using mappings, it would not make sense to define them here. - * - * @return a map container for query parameters. - */ - public ParameterMap getQueryParameters () - { - return parameters; - } - - public void setReportDefinitionName (final String reportDefinitionName) - throws JobDefinitionException - { - this.properties.setProperty(ReportEngineParameterNames.INPUT_NAME, reportDefinitionName); - } - - /** - * The name under which we can load the report definition. - * - * @return the report definition's name. - */ - public String getReportDefinitionName () - { - return (String) this.properties.getProperty(ReportEngineParameterNames.INPUT_NAME); - } - - public JobProperties getProcessingParameters () - { - return properties; - } -} diff --git a/reportdesign/java/com/sun/star/report/util/ManifestWriter.java b/reportdesign/java/com/sun/star/report/util/ManifestWriter.java deleted file mode 100644 index 6670fa5e6..000000000 --- a/reportdesign/java/com/sun/star/report/util/ManifestWriter.java +++ /dev/null @@ -1,122 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ManifestWriter.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package com.sun.star.report.util; - -import java.util.HashMap; -import java.util.Map; -import java.util.Iterator; -import java.io.OutputStreamWriter; -import java.io.IOException; -import java.io.OutputStream; - -import org.jfree.xmlns.writer.XmlWriterSupport; -import org.jfree.xmlns.writer.DefaultTagDescription; -import org.jfree.xmlns.writer.XmlWriter; -import org.jfree.xmlns.common.AttributeList; -import org.jfree.report.JFreeReportBoot; -import com.sun.star.report.OutputRepository; - -/** - * Creation-Date: 24.07.2007, 18:16:52 - * - * @author Thomas Morgner - */ -public class ManifestWriter -{ - // need this two strings other it breaks the ooo build :-( - public static final String MANIFEST_NS = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"; - public static final String TAG_DEF_PREFIX = "com.sun.star.report.pentaho.output."; - private final Map entries; - - public ManifestWriter() - { - entries = new HashMap(); - } - - public void addEntry(final String fullPath, final String mimeType) - { - if (fullPath == null) - { - throw new NullPointerException(); - } - if (mimeType == null) - { - throw new NullPointerException(); - } - if ("META-INF/manifest.xml".equals(fullPath)) - { - return; - } - entries.put(fullPath, mimeType); - } - - public boolean isEmpty() - { - return entries.isEmpty(); - } - - public void write(final OutputRepository outputRepository) throws IOException - { - if (isEmpty()) - { - return; - } - - final DefaultTagDescription tagDescription = new DefaultTagDescription(); - tagDescription.configure(JFreeReportBoot.getInstance().getGlobalConfig(), - TAG_DEF_PREFIX); - - final OutputStream manifestOutputStream = - outputRepository.createOutputStream("META-INF/manifest.xml", "text/xml"); - - final OutputStreamWriter writer = new OutputStreamWriter(manifestOutputStream, "UTF-8"); - final XmlWriter xmlWriter = new XmlWriter(writer, tagDescription); - xmlWriter.setAlwaysAddNamespace(true); - xmlWriter.writeXmlDeclaration("UTF-8"); - - final AttributeList rootAttributes = new AttributeList(); - rootAttributes.addNamespaceDeclaration("manifest", MANIFEST_NS); - xmlWriter.writeTag(MANIFEST_NS, "manifest", rootAttributes, XmlWriterSupport.OPEN); - - final Iterator iterator = entries.entrySet().iterator(); - while (iterator.hasNext()) - { - final Map.Entry entry = (Map.Entry) iterator.next(); - final AttributeList entryAttrs = new AttributeList(); - entryAttrs.setAttribute(MANIFEST_NS, "media-type", (String) entry.getValue()); - entryAttrs.setAttribute(MANIFEST_NS, "full-path", (String) entry.getKey()); - xmlWriter.writeTag(MANIFEST_NS, "file-entry", entryAttrs, XmlWriterSupport.CLOSE); - } - - xmlWriter.writeCloseTag(); - xmlWriter.close(); - } -} diff --git a/reportdesign/java/com/sun/star/report/util/ReportUtil.java b/reportdesign/java/com/sun/star/report/util/ReportUtil.java deleted file mode 100644 index 3fbfb060b..000000000 --- a/reportdesign/java/com/sun/star/report/util/ReportUtil.java +++ /dev/null @@ -1,45 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportUtil.java,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package com.sun.star.report.util; - -import org.jfree.util.ObjectUtilities; - -/** - * - * @author Ocke Janssen - */ -public class ReportUtil { - - public static boolean equalString(final String uri,final String uri2) - { - return ObjectUtilities.equal(uri, uri2); - } -} diff --git a/reportdesign/java/com/sun/star/report/util/makefile.mk b/reportdesign/java/com/sun/star/report/util/makefile.mk deleted file mode 100644 index cb2c735bd..000000000 --- a/reportdesign/java/com/sun/star/report/util/makefile.mk +++ /dev/null @@ -1,49 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.9 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = ..$/..$/..$/..$/..$/.. -PRJNAME = reportdesign -TARGET= rpt_java_css_util -PACKAGE = com$/sun$/star$/report$/util - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk -#----- compile .java files ----------------------------------------- - -.IF "$(SYSTEM_JFREEREPORT)" == "YES" -CLASSPATH!:=$(CLASSPATH)$(PATH_SEPERATOR)$(JCOMMON_JAR)$(PATH_SEPERATOR)$(LIBXML_JAR)$(PATH_SEPERATOR)$(JFREEREPORT_JAR) -.ELSE -JARFILES = jcommon-1.0.10.jar libxml-0.9.9.jar pentaho-reporting-flow-engine-0.9.2.jar -.ENDIF - -JAVAFILES = DefaultJobProperties.java DefaultParameterMap.java DefaultReportJobDefinition.java ManifestWriter.java -# --- Targets ------------------------------------------------------ -.INCLUDE : target.mk diff --git a/reportdesign/java/jfreereport.properties b/reportdesign/java/jfreereport.properties deleted file mode 100644 index cbf719656..000000000 --- a/reportdesign/java/jfreereport.properties +++ /dev/null @@ -1,35 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: jfreereport.properties,v $ -# -# $Revision: 1.4 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -org.jfree.report.modules.sun.report.Module=com.sun.star.report.pentaho.StarReportModule -org.jfree.base.LogTarget=*none* -org.jfree.base.LogLevel=true - diff --git a/reportdesign/java/libformula.properties b/reportdesign/java/libformula.properties deleted file mode 100644 index 0a69d6f0d..000000000 --- a/reportdesign/java/libformula.properties +++ /dev/null @@ -1,44 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: libformula.properties,v $ -# -# $Revision: 1.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -## -# Any configuration will happen here. - -# -# A list of all known functions. -# - -## -# Meta data functions -org.jfree.formula.functions.metadata.Author.class=com.sun.star.report.function.metadata.AuthorFunction -org.jfree.formula.functions.metadata.Author.description=com.sun.star.report.function.metadata.AuthorFunctionDescription -org.jfree.formula.functions.metadata.Title.class=com.sun.star.report.function.metadata.TitleFunction -org.jfree.formula.functions.metadata.Title.description=com.sun.star.report.function.metadata.TitleFunctionDescription diff --git a/reportdesign/java/loader.properties b/reportdesign/java/loader.properties deleted file mode 100644 index 5232ce0cf..000000000 --- a/reportdesign/java/loader.properties +++ /dev/null @@ -1,34 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: loader.properties,v $ -# -# $Revision: 1.3 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -org.jfree.resourceloader.factory.type.com.sun.star.report.pentaho.model.OfficeDocument=com.sun.star.report.pentaho.parser.OfficeDocumentXmlResourceFactory -org.jfree.resourceloader.factory.type.com.sun.star.report.pentaho.model.OfficeStylesCollection=com.sun.star.report.pentaho.parser.OfficeStylesXmlResourceFactory -org.jfree.resourceloader.factory.type.com.sun.star.report.pentaho.styles.StyleMapper=com.sun.star.report.pentaho.styles.StyleMapperXmlResourceFactory diff --git a/reportdesign/java/makefile.mk b/reportdesign/java/makefile.mk deleted file mode 100644 index 1e06c6531..000000000 --- a/reportdesign/java/makefile.mk +++ /dev/null @@ -1,49 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.6 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=.. -PRJNAME=reportdesign -TARGET=rpt_java -# --- Settings ---------------------------------- -.INCLUDE : settings.mk -# ------------------------------------------------------------------ - -COPYFILES = \ - $(CLASSDIR)$/jfreereport.properties \ - $(CLASSDIR)$/libformula.properties \ - $(CLASSDIR)$/loader.properties - -.INCLUDE : target.mk -# --- Targets ---------------------------------- -ALLTAR : $(COPYFILES) - -$(COPYFILES): $$(@:f) - +$(COPY) $< $@ diff --git a/reportdesign/license/THIRDPARTYREADMELICENSE.html b/reportdesign/license/THIRDPARTYREADMELICENSE.html deleted file mode 100644 index 39ab7d6e8..000000000 --- a/reportdesign/license/THIRDPARTYREADMELICENSE.html +++ /dev/null @@ -1,768 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> -</head> -<body> -DO NOT TRANSLATE OR LOCALIZE THIS DOCUMENT -<br> -<ul id="mozToc"> -<!--mozToc h2 1 h3 2--> - <li><a href="#mozTocId85416">Object Refinery Ltd, Pentaho Corporation - </a> - <ul> - <li><a href="#mozTocId993579">flute </a></li> - </ul> - </li> - <li><a href="#mozTocId716287">Object Refinery Ltd, Pentaho -Corporation </a> - <ul> - <li><a href="#mozTocId398477">JCommon-Serializer </a></li> - </ul> - </li> - <li><a href="#mozTocId401194">Object Refinery Ltd, Pentaho -Corporation </a> - <ul> - <li><a href="#mozTocId824702">JCommon </a></li> - </ul> - </li> - <li><a href="#mozTocId304569">Object Refinery Ltd, Pentaho -Corporation </a> - <ul> - <li><a href="#mozTocId90190">JFreeReport </a></li> - </ul> - </li> - <li><a href="#mozTocId732912">Object Refinery Ltd, Pentaho -Corporation </a> - <ul> - <li><a href="#mozTocId305365">JCommon </a></li> - </ul> - </li> - <li><a href="#mozTocId807378">Object Refinery Ltd, Pentaho -Corporation </a> - <ul> - <li><a href="#mozTocId266793">liblayout </a></li> - </ul> - </li> - <li><a href="#mozTocId239140">Object Refinery Ltd, Pentaho -Corporation </a> - <ul> - <li><a href="#mozTocId607093">libloader </a></li> - </ul> - </li> - <li><a href="#mozTocId133132">Object Refinery Ltd, Pentaho -Corporation </a> - <ul> - <li><a href="#mozTocId915718">libxml </a></li> - </ul> - </li> - <li><a href="#mozTocId249097">Object Refinery Ltd, Pentaho -Corporation </a> - <ul> - <li><a href="#mozTocId420278">pixie </a></li> - </ul> - </li> -</ul> -<hr style="width: 100%; height: 2px;">The following software may be -included in this product:Flute ; Use of any of this software -is governed -by the terms of the license below:<br> -<h2><a class="mozTocH2" name="mozTocId85416"></a>Object Refinery Ltd, -Pentaho Corporation<br> -</h2> -<h3><a class="mozTocH3" name="mozTocId993579"></a>flute<br> -</h3> -W3C® SOFTWARE NOTICE AND LICENSE -<br> -Copyright © 1994-2002 World Wide Web Consortium, (Massachusetts -Institute of -Technology, Institut National de Recherche en Informatique et en -Automatique, -Keio University). All Rights Reserved. -http://www.w3.org/Consortium/Legal/ -<br> -This W3C work (including software, documents, or other related items) -is being -provided by the copyright holders under the following license. By -obtaining, -using and/or copying this work, you (the licensee) agree that you have -read, -understood, and will comply with the following terms and conditions: -<br> -Permission to use, copy, modify, and distribute this software and its -documentation, with or without modification, for any purpose and -without fee or -royalty is hereby granted, provided that you include the following on -ALL copies -of the software and documentation or portions thereof, including -modifications, -that you make: -<br> -1. The full text of this NOTICE in a location viewable to users of the -redistributed or derivative work. -<br> -2. Any pre-existing intellectual property disclaimers, notices, or -terms and -conditions. If none exist, a short notice of the following form -(hypertext is -preferred, text is permitted) should be used within the body of any -redistributed or derivative code: "Copyright © [$date-of-software] -World Wide -Web Consortium, (Massachusetts Institute of Technology, Institut -National de -Recherche en Informatique et en Automatique, Keio University). All -Rights -Reserved. http://www.w3.org/Consortium/Legal/" -<br> -3. Notice of any changes or modifications to the W3C files, including -the -date changes were made. (We recommend you provide URIs to the location -from -which the code is derived.) -<br> -THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT -HOLDERS MAKE -NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT -LIMITED -TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE -OR THAT -THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD -PARTY -PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. -<br> -COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL -OR -CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR -DOCUMENTATION. -<br> -The name and trademarks of copyright holders may NOT be used in -advertising or -publicity pertaining to the software without specific, written prior -permission. -Title to copyright in this software and any associated documentation -will at all -times remain with copyright holders. -<br> -____________________________________ -<br> -This formulation of W3C's notice and license became active on August 14 -1998 so -as to improve compatibility with GPL. This version ensures that W3C -software -licensing terms are no more restrictive than GPL and consequently W3C -software -may be distributed in GPL packages. See the older formulation for the -policy -prior to this date. Please see our Copyright FAQ for common questions -about -using materials from our site, including specific terms and conditions -for -packages like libwww, Amaya, and Jigsaw. Other questions about this -notice can -be directed to site-policy@w3.org. <br> -<hr style="width: 100%; height: 2px;">The following software may be -included in this product: JCommon-Serializer; Use of any of this -software -is governed by the terms of the license below:<br> -<h2><a class="mozTocH2" name="mozTocId716287"></a>Object Refinery Ltd, -Pentaho Corporation <br> -</h2> -<h3><a class="mozTocH3" name="mozTocId398477"></a>JCommon-Serializer<br> -</h3> -<a href="#lgpl">jump to LGPL</a><br> -<hr style="width: 100%; height: 2px;">The following software may be -included in this product: JCommon; Use of any of this software -is governed by the terms of the license below:<br> -<h2><a class="mozTocH2" name="mozTocId401194"></a>Object Refinery Ltd, -Pentaho Corporation <br> -</h2> -<h3><a class="mozTocH3" name="mozTocId824702"></a>JCommon<br> -</h3> -<a href="#lgpl">jump to LGPL</a><br> -<hr style="width: 100%; height: 2px;">The following software may be -included in this product: JFreeReport; Use of any of this software -is governed by the terms of the license below:<br> -<h2><a class="mozTocH2" name="mozTocId304569"></a>Object Refinery Ltd, -Pentaho Corporation <br> -</h2> -<h3><a class="mozTocH3" name="mozTocId90190"></a>JFreeReport<br> -</h3> -<a href="#lgpl">jump to LGPL</a><br> -<hr style="width: 100%; height: 2px;">The following software may be -included in this product: JCommon; Use of any of this software -is governed by the terms of the license below:<br> -<h2><a class="mozTocH2" name="mozTocId732912"></a>Object Refinery Ltd, -Pentaho Corporation <br> -</h2> -<h3><a class="mozTocH3" name="mozTocId305365"></a>JCommon<br> -</h3> -<a href="#lgpl">jump to LGPL</a><br> -<hr style="width: 100%; height: 2px;">The following software may be -included in this product: liblayout; Use of any of this software -is governed by the terms of the license below:<br> -<h2><a class="mozTocH2" name="mozTocId807378"></a>Object Refinery Ltd, -Pentaho Corporation <br> -</h2> -<h3><a class="mozTocH3" name="mozTocId266793"></a>liblayout<br> -</h3> -<a href="#lgpl">jump to LGPL</a><br> -<hr style="width: 100%; height: 2px;">The following software may be -included in this product: libloader; Use of any of this software -is governed by the terms of the license below:<br> -<h2><a class="mozTocH2" name="mozTocId239140"></a>Object Refinery Ltd, -Pentaho Corporation <br> -</h2> -<h3><a class="mozTocH3" name="mozTocId607093"></a>libloader<br> -</h3> -<a href="#lgpl">jump to LGPL</a><br> -<hr style="width: 100%; height: 2px;">The following software may be -included in this product: libxml; Use of any of this software -is governed by the terms of the license below:<br> -<h2><a class="mozTocH2" name="mozTocId133132"></a>Object Refinery Ltd, -Pentaho Corporation <br> -</h2> -<h3><a class="mozTocH3" name="mozTocId915718"></a>libxml<br> -</h3> -<a href="#lgpl">jump to LGPL</a><br> -<hr style="width: 100%; height: 2px;">The following software may be -included in this product: pixie; Use of any of this software -is governed by the terms of the license below:<br> -<h2><a class="mozTocH2" name="mozTocId249097"></a>Object Refinery Ltd, -Pentaho Corporation <br> -</h2> -<h3><a class="mozTocH3" name="mozTocId420278"></a>pixie<br> -</h3> -<a href="#lgpl">jump to LGPL</a><br> -<hr style="width: 100%; height: 2px;"><br> -<h4><a name="lgpl" href="#lgpl">GNU LESSER GENERAL PUBLIC LICENSE</a></h4> -<p> -Version 2.1, February 1999 -</p> -<p> -</p> -<pre>Copyright (C) 1991, 1999 Free Software Foundation, Inc.<br>51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA<br>Everyone is permitted to copy and distribute verbatim copies<br>of this license document, but changing it is not allowed.<br><br>[This is the first released version of the Lesser GPL. It also counts<br> as the successor of the GNU Library Public License, version 2, hence<br> the version number 2.1.]<br></pre> -<h4>Preamble</h4> -<p> The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. -</p> -<p> This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations -below. -</p> -<p> When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. -</p> -<p> To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. -</p> -<p> For example, if you distribute copies of the library, whether -gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. -</p> -<p> We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. -</p> -<p> To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. -</p> -<p> Finally, software patents pose a constant threat to the existence -of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. -</p> -<p> Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. -</p> -<p> When a program is linked with a library, whether statically or -using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. -</p> -<p> We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. -</p> -<p> For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it -becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. -</p> -<p> In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. -</p> -<p> Although the Lesser General Public License is Less protective of -the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. -</p> -<p> The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. -</p> -<h4>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</h4> -<p> -<strong>0.</strong> -This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". -</p> -<p> A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. -</p> -<p> The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) -</p> -<p> "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control -compilation -and installation of the library. -</p> -<p> Activities other than copying, distribution and modification are -not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. -</p> -<p> -<strong>1.</strong> -You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. -</p> -<p> You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. -</p> -<p> -<strong>2.</strong> -You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: -</p> -<ul> - <li><strong>a)</strong> The modified work must itself be a software -library.</li> - <li><strong>b)</strong> You must cause the files modified to carry -prominent notices stating that you changed the files and the date of -any change.</li> - <li><strong>c)</strong> You must cause the whole of the work to be -licensed at no charge to all third parties under the terms of this -License.</li> - <li><strong>d)</strong> - <p> If a facility in the modified Library refers to a function or a -table of data to be supplied by an application program that uses the -facility, other than as an argument passed when the facility is -invoked, then you must make a good faith effort to ensure that, in the -event an application does not supply such function or table, the -facility still operates, and performs whatever part of its purpose -remains meaningful. </p> - <p> (For example, a function in a library to compute square roots -has a purpose that is entirely well-defined independent of the -application. Therefore, Subsection 2d requires that any -application-supplied function or table used by this function must be -optional: if the application does not supply it, the square root -function must still compute square roots.) </p> - <p> These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. </p> - <p> Thus, it is not the intent of this section to claim rights or -contest your rights to work written entirely by you; rather, the intent -is to exercise the right to control the distribution of derivative or -collective works based on the Library. </p> - <p> In addition, mere aggregation of another work not based on the -Library with the Library (or with a work based on the Library) on a -volume of a storage or distribution medium does not bring the other -work under -the scope of this License.</p> - </li> -</ul> -<p> -<strong>3.</strong> -You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. -</p> -<p> Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. -</p> -<p> This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. -</p> -<p> -<strong>4.</strong> -You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. -</p> -<p> If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. -</p> -<p> -<strong>5.</strong> -A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. -</p> -<p> However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. -</p> -<p> When a "work that uses the Library" uses material from a header -file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. -</p> -<p> If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) -</p> -<p> Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. -</p> -<p> -<strong>6.</strong> -As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. -</p> -<p> You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: -</p> -<ul> - <li><strong>a)</strong> Accompany the work with the complete -corresponding machine-readable source code for the Library including -whatever changes were used in the work (which must be distributed under -Sections 1 and 2 above); and, if the work is an executable linked with -the Library, with the complete machine-readable "work that uses the -Library", as object code and/or source code, so that the user can -modify the Library and then relink to produce a modified executable -containing the modified Library. (It is understood that the user who -changes the contents of definitions files in the Library will not -necessarily be able to recompile the application to use the modified -definitions.)</li> - <li><strong>b)</strong> Use a suitable shared library mechanism for -linking with the Library. A suitable mechanism is one that (1) uses at -run time a copy of the library already present on the user's computer -system, rather than copying library functions into the executable, and -(2) will operate properly with a modified version of the library, if -the user installs one, as long as the modified version is -interface-compatible with the version that the work was made with.</li> - <li><strong>c)</strong> Accompany the work with a written offer, -valid for at least three years, to give the same user the materials -specified in Subsection 6a, above, for a charge no more than the cost -of performing this distribution.</li> - <li><strong>d)</strong> If distribution of the work is made by -offering access to copy from a designated place, offer equivalent -access to copy the above specified materials from the same place.</li> - <li><strong>e)</strong> Verify that the user has already received a -copy of these materials or that you have already sent this user a copy.</li> -</ul> -<p> For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. -</p> -<p> It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. -</p> -<p> -<strong>7.</strong> You may place library facilities that are a work -based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: -</p> -<ul> - <li><strong>a)</strong> Accompany the combined library with a copy of -the same work based on the Library, uncombined with any other library -facilities. This must be distributed under the terms of the Sections -above.</li> - <li><strong>b)</strong> Give prominent notice with the combined -library of the fact that part of it is a work based on the Library, and -explaining where to find the accompanying uncombined form of the same -work.</li> -</ul> -<p> -<strong>8.</strong> You may not copy, modify, sublicense, link with, or -distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. -</p> -<p> -<strong>9.</strong> -You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. -</p> -<p> -<strong>10.</strong> -Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. -</p> -<p> -<strong>11.</strong> -If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. -</p> -<p> -If any portion of this section is held invalid or unenforceable under -any -particular circumstance, the balance of the section is intended to -apply, -and the section as a whole is intended to apply in other circumstances. -</p> -<p> -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. -</p> -<p> -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. -</p> -<p> -<strong>12.</strong> -If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may -add -an explicit geographical distribution limitation excluding those -countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. -</p> -<p> -<strong>13.</strong> -The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. -</p> -<p> -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. -</p> -<p> -<strong>14.</strong> -If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. -</p> -<p> -<strong>NO WARRANTY</strong> -</p> -<p> -<strong>15.</strong> -BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. -</p> -<p> -<strong>16.</strong> -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. -</p> -<h4>END OF TERMS AND CONDITIONS</h4> -<h4>How to Apply These Terms to Your New Libraries</h4> -<p> If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of -the -ordinary General Public License). -</p> -<p> To apply these terms, attach the following notices to the library. -It is -safest to attach them to the start of each source file to most -effectively -convey the exclusion of warranty; and each file should have at least -the -"copyright" line and a pointer to where the full notice is found. -</p> -<br> -<pre><var>one line to give the library's name and an idea of what it does.</var><br>Copyright (C) <var>year</var> <var>name of author</var><br><br>This library is free software; you can redistribute it and/or<br>modify it under the terms of the GNU Lesser General Public<br>License as published by the Free Software Foundation; either<br>version 2.1 of the License, or (at your option) any later version.<br><br>This library is distributed in the hope that it will be useful,<br>but WITHOUT ANY WARRANTY; without even the implied warranty of<br>MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU<br>Lesser General Public License for more details.<br><br>You should have received a copy of the GNU Lesser General Public<br>License along with this library; if not, write to the Free Software<br>Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA<br></pre> -<p> -Also add information on how to contact you by electronic and paper -mail. -</p> -<p> -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: -</p> -<pre>Yoyodyne, Inc., hereby disclaims all copyright interest in<br>the library `Frob' (a library for tweaking knobs) written<br>by James Random Hacker.<br><br><var>signature of Ty Coon</var>, 1 April 1990<br>Ty Coon, President of Vice<br><br></pre> -<p> -That's all there is to it! -</p> -</body> -</html> diff --git a/reportdesign/license/readme_en-US.html b/reportdesign/license/readme_en-US.html deleted file mode 100644 index c9fa84bf6..000000000 --- a/reportdesign/license/readme_en-US.html +++ /dev/null @@ -1,147 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<HTML> -<HEAD> - <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1"> - <TITLE>Sun™ Report Builder</TITLE> - <META NAME="GENERATOR" CONTENT="StarOffice 8 (Solaris Sparc)"> - <META NAME="CREATED" CONTENT="20070207;14293857"> - <META NAME="CHANGEDBY" CONTENT="ufi"> - <META NAME="CHANGED" CONTENT="20070814;14045700"> - <META NAME="CHANGEDBY" CONTENT="ufi"> - <META NAME="CHANGEDBY" CONTENT="ufi"> - <META NAME="CHANGEDBY" CONTENT="UFI"> - <STYLE TYPE="text/css"> - <!-- - H4 { margin-bottom: 0.07in; font-family: "Bitstream Vera Sans", "Arial", "Helvetica", "Lucida", "Geneva", "Helmet", sans-serif, "Andale Sans UI", "Arial Unicode MS", "Lucida Sans Unicode", "Tahoma"; font-size: 10pt } - --> - </STYLE> -</HEAD> -<BODY LANG="en-US" DIR="LTR"> -<H1>Sun™ Report Builder</H1> -<P>This file contains important information about the installation.</P> -<P>This software offered by Sun Microsystems, Inc. will enhance -StarOffice(TM) 8, StarSuite(TM) 8, and OpenOffice.org 2.3 software. -The following features will be added:</P> -<UL> - <LI><P>In a Base database document, in the Reports window, you now - have an additional choice to "Create Report in Design View".</P> - <LI><P>An interactive window allows you to create a database report - by drag-and-drop, with visual feedback.</P> - <LI><P>All reports created by Report Builder can also be edited in - the Report Builder window. - </P> -</UL> -<P>You find more information about installation and usage of the -plugin in the following paragraphs of this readme file. -</P> -<H2>Notes on Installation</H2> -<H3>System Requirements</H3> -<UL TYPE=CIRCLE> - <LI><P STYLE="margin-bottom: 0in">Microsoft Windows 98, ME, 2000 - (Service Pack 2 or higher), XP, Vista</P> - <LI><P STYLE="margin-bottom: 0in">A recent version of Java(TM) - Runtime Environment</P> - <LI><P STYLE="margin-bottom: 0in">A recent version of StarOffice(TM) - 8, StarSuite(TM) 8, or OpenOffice.org 2.3</P> - <LI><P STYLE="margin-bottom: 0in">256 MB RAM (512 MB RAM - recommended) - </P> - <LI><P STYLE="margin-bottom: 0in">5 MB available hard disk space - </P> -</UL> -<H3>Installing</H3> -<P>Installing Sun™ Report Builder adds additional functionality -to an installed version of StarOffice, StarSuite, or OpenOffice.org.</P> -<UL> - <LI><P>You need administrator rights to install a shared extension - for all users on your network. You do not need administrator rights - to install a user extension for your own use only.</P> -</UL> -<H3>To install a user extension</H3> -<UL> - <LI><P>Double-click the <FONT FACE="Bitstream Vera Sans Mono, Cumberland, Courier New, Courier, Lucida Sans Typewriter, Lucida Typewriter, Monaco, Monospaced">sun-report-builder.oxt</FONT> - file in your system's file browser</P> - <P>or</P> - <LI><P>Choose <B>Tools - Extension Manager</B>, select <B>My - Extensions</B> and click <B>Add</B>.</P> -</UL> -<H3>To install a shared extension with UI</H3> -<P>There are two ways of installing a shared extension with a -graphical user interface:</P> -<H4>From the Command Line</H4> -<OL> - <LI><P>Open a terminal or command shell.</P> - <LI><P STYLE="margin-top: 0.02in; margin-bottom: 0in">Change to the - StarOffice/program directory. (Replace StarOffice by StarSuite or - OpenOffice.org as applicable)</P> - <LI><P>Terminate <B>any running instances</B> of StarOffice and the - Quickstarter, if this happens to be running.</P> - <LI><P>Enter the following command:</P> - <P STYLE="margin-top: 0.01in; margin-bottom: 0.01in"><FONT FACE="Bitstream Vera Sans Mono, Cumberland, Courier New, Courier, Lucida Sans Typewriter, Lucida Typewriter, Monaco, Monospaced">unopkg - gui</FONT> - </P> - <P>The Extension Manager starts with a graphical user interface. - </P> - <LI><P>Click the <B>StarOffice Extensions</B> entry and click Add.</P> -</OL> -<H4>From Within StarOffice</H4> -<UL> - <LI><P>Choose <B>Tools - Extension Manager</B>, select <B>StarOffice - Extensions</B> and click <B>Add</B>.</P> -</UL> -<H3>To install a shared extension in text mode</H3> -<OL> - <LI><P>Open a terminal or command shell.</P> - <LI><P STYLE="margin-top: 0.02in; margin-bottom: 0in">Change to the - StarOffice/program directory.</P> - <LI><P>Enter the following command, using the path and file name of - your extension:</P> - <P STYLE="margin-top: 0.01in; margin-bottom: 0.01in"><FONT FACE="Bitstream Vera Sans Mono, Cumberland, Courier New, Courier, Lucida Sans Typewriter, Lucida Typewriter, Monaco, Monospaced">unopkg - add --shared (path/)sun-report-builder.oxt</FONT> - </P> -</OL> -<P STYLE="margin-top: 0.01in; margin-bottom: 0.01in">You need write -access to the StarOffice installation directory to be able to install -a <B>shared</B> extension. The extension manager will disable shared -extension installation if you have no write access to the directory.</P> -<P STYLE="margin-top: 0.01in; margin-bottom: 0.01in">All running -instances of StarOffice need to be terminated for a successful -installation of a <B>shared</B> extension.</P> -<H3>Uninstalling</H3> -<P>Open Extension Manager, click the Sun™ Report Builder entry, -then click Remove.</P> -<H2>Using the Plugin</H2> -<UL> - <LI><P>You find complete instructions on using the Sun Report - Builder in the application help that is installed with a recent - version of StarOffice, StarSuite, or OpenOffice.org. Press F1 to - open the Help Viewer, then enter the words Report Builder in the - Index text box.</P> -</UL> -<H2>Support and Feedback</H2> -<P>Product support for end users for the Sun™ Report Builder is -available by Sun Micosystems, Inc. -</P> -<P>We appreciate feedback or questions about the plugin but cannot -guarantee a response to every email.</P> -<P>We hope you enjoy using the new Sun™ Report Builder.</P> -<H2>Legal Disclaimers</H2> -<PRE>Copyright © 2007 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved. - -U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. - -Use is subject to license terms. - -This distribution may include materials developed by third parties. -Sun, Sun Microsystems and the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - -This product is covered and controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited. - - -Copyright © 2007 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, Etats-Unis. Tous droits réservés. -L'utilisation est soumise aux termes de la Licence. -Cette distribution peut comprendre des composants développés par des tierces parties. -Sun, Sun Microsystems et le logo Sun sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays. -Ce produit est soumis à la législation américaine en matière de contrôle des exportations et peut être soumis à la règlementation en vigueur dans d'autres pays dans le domaine des exportations et importations. Les utilisations, ou utilisateurs finaux, pour des armes nucléaires,des missiles, des armes biologiques et chimiques ou du nucléaire maritime, directement ou indirectement, sont strictement interdites. Les exportations ou réexportations vers les pays sous embargo américain, ou vers des entités figurant sur les listes d'exclusion d'exportation américaines, y compris, mais de manière non exhaustive, la liste de personnes qui font objet d'un ordre de ne pas participer, d'une façon directe ou indirecte, aux exportations des produits ou des services qui sont régis par la législation américaine en matière de contrôle des exportations et la liste de ressortissants spécifiquement désignés, sont rigoureusement interdites.</PRE> -</BODY> -</HTML>
\ No newline at end of file diff --git a/reportdesign/license/readme_en-US.txt b/reportdesign/license/readme_en-US.txt deleted file mode 100644 index 8c8d14397..000000000 --- a/reportdesign/license/readme_en-US.txt +++ /dev/null @@ -1,87 +0,0 @@ -Sun(TM) Report Builder - -This file contains important information about the installation. - -This software offered by Sun Microsystems, Inc. will enhance StarOffice(TM) 8, StarSuite(TM) 8, and OpenOffice.org 2.3 software. The following features will be added: - -- In a Base database document, in the Reports window, you now have an additional choice to "Create Report in Design View". -- An interactive window allows you to create a database report by drag-and-drop, with visual feedback. -- All reports created by Report Builder can also be edited in the Report Builder window. - -You find more information about installation and usage of the plugin in the following paragraphs of this readme file. - -Notes on Installation - -System Requirements - -Microsoft Windows 98, ME, 2000 (Service Pack 2 or higher), XP, Vista -- A recent version of Java(TM) Runtime Environment -- A recent version of StarOffice(TM) 8, StarSuite(TM) 8, or OpenOffice.org 2.3 -- 256 MB RAM (512 MB RAM recommended) -- 5 MB available hard disk space - -Installing - -Installing Sun(TM) Report Builder adds additional functionality to an installed version of StarOffice, StarSuite, or OpenOffice.org. -You need administrator rights to install a shared extension for all users on your network. You do not need administrator rights to install a user extension for your own use only. - -To install a user extension - -Double-click the sun-report-builder.oxt file in your system's file browser -or -Choose Tools - Extension Manager, select My Extensions and click Add. - -To install a shared extension with UI - -There are two ways of installing a shared extension with a graphical user interface: -From the Command Line -1. Open a terminal or command shell. -2. Change to the StarOffice/program directory. (Replace StarOffice by StarSuite or OpenOffice.org as applicable) -3. Terminate any running instances of StarOffice and the Quickstarter, if this happens to be running. -4. Enter the following command: -unopkg gui -The Extension Manager starts with a graphical user interface. -5. Click the StarOffice Extensions entry and click Add. -From Within StarOffice -Choose Tools - Extension Manager, select StarOffice Extensions and click Add. -To install a shared extension in text mode -1. Open a terminal or command shell. -2. Change to the StarOffice/program directory. -3. Enter the following command, using the path and file name of your extension: -unopkg add --shared (path/)sun-report-builder.oxt -You need write access to the StarOffice installation directory to be able to install a shared extension. The extension manager will disable shared extension installation if you have no write access to the directory. -All running instances of StarOffice need to be terminated for a successful installation of a shared extension. - -Uninstalling - -Open Extension Manager, click the Sun? Report Builder entry, then click Remove. - -Using the Plugin - -You find complete instructions on using the Sun Report Builder in the application help that is installed with a recent version of StarOffice, StarSuite, or OpenOffice.org. Press F1 to open the Help Viewer, then enter the words Report Builder in the Index text box. - -Support and Feedback - -Product support for end users for the Sun? Report Builder is available by Sun Micosystems, Inc. -We appreciate feedback or questions about the plugin but cannot guarantee a response to every email. -We hope you enjoy using the new Sun? Report Builder. - -Legal Disclaimers - -Copyright 2007 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved. - -U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. - -Use is subject to license terms. - -This distribution may include materials developed by third parties. -Sun, Sun Microsystems and the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - -This product is covered and controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited. - - -Copyright 2007 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, Etats-Unis. Tous droits rservs. -L'utilisation est soumise aux termes de la Licence. -Cette distribution peut comprendre des composants dvelopps par des tierces parties. -Sun, Sun Microsystems et le logo Sun sont des marques de fabrique ou des marques dposes de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays. -Ce produit est soumis la lgislation amricaine en matire de contrle des exportations et peut tre soumis la rglementation en vigueur dans d'autres pays dans le domaine des exportations et importations. Les utilisations, ou utilisateurs finaux, pour des armes nuclaires,des missiles, des armes biologiques et chimiques ou du nuclaire maritime, directement ou indirectement, sont strictement interdites. Les exportations ou rexportations vers les pays sous embargo amricain, ou vers des entits figurant sur les listes d'exclusion d'exportation amricaines, y compris, mais de manire non exhaustive, la liste de personnes qui font objet d'un ordre de ne pas participer, d'une faon directe ou indirecte, aux exportations des produits ou des services qui sont rgis par la lgislation amricaine en matire de contrle des exportations et la liste de ressortissants spcifiquement dsigns, sont rigoureusement interdites.
\ No newline at end of file diff --git a/reportdesign/prj/build.lst b/reportdesign/prj/build.lst index 00cb2ff8c..bf924b8fb 100644 --- a/reportdesign/prj/build.lst +++ b/reportdesign/prj/build.lst @@ -1,17 +1,6 @@ -rd reportdesign : BOOST:boost JFREEREPORT:jfreereport comphelper dbaccess readlicense_oo wizards formula NULL +rd reportdesign : BOOST:boost comphelper dbaccess formula NULL rd reportdesign usr1 - all rd_mkout NULL rd reportdesign\inc nmake - all rd_inc NULL -rd reportdesign\java nmake - all rd_java NULL -rd reportdesign\java\com\sun\star\report nmake - all rd_jreport rd_java NULL -rd reportdesign\java\com\sun\star\report\util nmake - all rd_jreport_util rd_jreport NULL -rd reportdesign\java\com\sun\star\report\pentaho nmake - all rd_jreport_pe rd_jreport_util rd_jreport_f_m NULL -rd reportdesign\java\com\sun\star\report\function\metadata nmake - all rd_jreport_f_m rd_jreport NULL -rd reportdesign\registry\schema\org\openoffice\Office nmake - all rd_reg_schema_ooo NULL -rd reportdesign\registry\schema\org\openoffice\Office\UI nmake - all rd_reg_schema_ooo_ui NULL -rd reportdesign\registry\data\org\openoffice nmake - all rd_data_ooOffice NULL -rd reportdesign\registry\data\org\openoffice\Office nmake - all rd_reg_data_ooo rd_reg_schema_ooo NULL -rd reportdesign\registry\data\org\openoffice\Office\UI nmake - all rd_reg_data_ooo_ui rd_reg_schema_ooo_ui NULL -rd reportdesign\registry\data\org\openoffice\TypeDetection nmake - all rd_reg_data_oot NULL rd reportdesign\source\core\api nmake - all rd_api rd_inc NULL rd reportdesign\source\core\resource nmake - all rd_res rd_inc NULL rd reportdesign\source\core\sdr nmake - all rd_sdr rd_inc NULL @@ -22,6 +11,5 @@ rd reportdesign\source\ui\dlg nmake rd reportdesign\source\ui\report nmake - all rd_uireport rd_inc NULL rd reportdesign\source\ui\inspection nmake - all rd_uiinspection rd_inc NULL rd reportdesign\source\filter\xml nmake - all rd_filter_xml rd_inc NULL -rd reportdesign\template\en-US\wizard\report nmake - all rd_template_en_us_wiz_rep NULL -rd reportdesign\util nmake - all rd_util rd_jreport_pe rd_api rd_res rd_shared rd_uimisc rd_uidlg rd_uireport rd_uiinspection rd_sdr rd_misc rd_filter_xml rd_reg_data_ooo rd_data_ooOffice rd_reg_data_oot rd_template_en_us_wiz_rep NULL +rd reportdesign\util nmake - all rd_util rd_api rd_res rd_shared rd_uimisc rd_uidlg rd_uireport rd_uiinspection rd_sdr rd_misc rd_filter_xml NULL diff --git a/reportdesign/prj/d.lst b/reportdesign/prj/d.lst index 813559020..88a7b28a4 100644 --- a/reportdesign/prj/d.lst +++ b/reportdesign/prj/d.lst @@ -26,15 +26,3 @@ dos: sh -c "if test %OS% = MACOSX; then create-bundle %_DEST%\lib%_EXT%\*.dylib; ..\uiconfig\dbreport\statusbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\statusbar\*.xml ..\uiconfig\dbreport\toolbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\toolbar\*.xml -# Extensions - -..\%__SRC%\bin\*.oxt %_DEST%\bin%_EXT%\*.oxt - -# License -mkdir: %_DEST%\bin%_EXT%\reportdesign - -..\license\license_en-US.txt %_DEST%\bin%_EXT%\reportdesign\license_en-US.txt -..\license\license_en-US.html %_DEST%\bin%_EXT%\reportdesign\license_en-US.html -..\license\readme_en-US.html %_DEST%\bin%_EXT%\reportdesign\readme_en-US.html -..\license\readme_en-US.txt %_DEST%\bin%_EXT%\reportdesign\readme_en-US.txt -..\license\THIRDPARTYREADMELICENSE.html %_DEST%\bin%_EXT%\reportdesign\THIRDPARTYREADMELICENSE.html diff --git a/reportdesign/registry/data/org/openoffice/Office/Accelerators.xcu b/reportdesign/registry/data/org/openoffice/Office/Accelerators.xcu deleted file mode 100644 index a11d7c3b9..000000000 --- a/reportdesign/registry/data/org/openoffice/Office/Accelerators.xcu +++ /dev/null @@ -1,138 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Common.xcu,v $ - * $Revision: 1.52 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> -<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:package="org.openoffice.Office" oor:name="Accelerators"> - - <node oor:name="PrimaryKeys"> - <node oor:name="Modules"> - <node oor:name="com.sun.star.report.ReportDefinition" oor:op="replace"> - - <node oor:name="R_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:SelectReport</value> - </prop> - </node> - - <node oor:name="RETURN_MOD2" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:ControlProperties</value> - </prop> - </node> - - <node oor:name="F4" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:ControlProperties</value> - </prop> - </node> - - <node oor:name="F5" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:ReportNavigator</value> - </prop> - </node> - - <node oor:name="ESCAPE" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:Escape</value> - </prop> - </node> - - <node oor:name="G_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:DbSortingAndGrouping</value> - </prop> - </node> - - <node oor:name="E_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:ExecuteReport</value> - </prop> - </node> - - <node oor:name="A_SHIFT_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:SelectAllInSection</value> - </prop> - </node> - - <node oor:name="T_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:SelectAllLabels</value> - </prop> - </node> - - <node oor:name="F_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:SelectAllEdits</value> - </prop> - </node> - - <node oor:name="Y_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:Redo</value> - </prop> - </node> - - <node oor:name="Z_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:Undo</value> - </prop> - </node> - - <node oor:name="TAB_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:NextMark</value> - </prop> - </node> - - <node oor:name="TAB_SHIFT_MOD1" oor:op="replace"> - <prop oor:name="Command"> - <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> - <value xml:lang="en-US">.uno:PrevMark</value> - </prop> - </node> - - </node> - </node> - </node> -</oor:component-data> diff --git a/reportdesign/registry/data/org/openoffice/Office/DataAccess.xcu b/reportdesign/registry/data/org/openoffice/Office/DataAccess.xcu deleted file mode 100644 index 5bad3a328..000000000 --- a/reportdesign/registry/data/org/openoffice/Office/DataAccess.xcu +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DataAccess.xcu,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> -<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="DataAccess" oor:package="org.openoffice.Office"> - <node oor:name="ReportEngines"> - <prop oor:name="DefaultReportEngine" oor:type="xs:string"> - <value>Pentaho Reporting Flow Engine</value> - </prop> - <node oor:name="ReportEngineNames"> - <node oor:name="Pentaho Reporting Flow Engine" oor:op="replace"> - <prop oor:name="UIName" oor:type="xs:string"> - <value>Pentaho Reporting Flow Engine</value> - </prop> - <prop oor:name="ServiceName" oor:type="xs:string"> - <value>com.sun.star.report.pentaho.SOReportJobFactory</value> - </prop> - </node> - </node> - </node> -</oor:component-data> diff --git a/reportdesign/registry/data/org/openoffice/Office/Embedding.xcu b/reportdesign/registry/data/org/openoffice/Office/Embedding.xcu deleted file mode 100644 index f7cbd03dd..000000000 --- a/reportdesign/registry/data/org/openoffice/Office/Embedding.xcu +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Embedding.xcu,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> -<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:install="http://openoffice.org/2004/installation" oor:package="org.openoffice.Office" oor:name="Embedding"> - <node oor:name="Objects"> - <node oor:name="D7896D52-B7AF-4820-9DFE-D404D015960F" oor:op="replace" > - <prop oor:name="ObjectFactory"> - <value>com.sun.star.embed.OOoEmbeddedObjectFactory</value> - </prop> - <prop oor:name="ObjectDocumentServiceName"> - <value>com.sun.star.report.ReportDefinition</value> - </prop> - <prop oor:name="ObjectMiscStatus"> - <value>1</value> - </prop> - <prop oor:name="ObjectVerbs"> - <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE</value> - </prop> - </node> - <node oor:name="80243D39-6741-46C5-926E-069164FF87BB" oor:op="replace" > - <prop oor:name="ObjectFactory"> - <value>com.sun.star.embed.OOoEmbeddedObjectFactory</value> - </prop> - <prop oor:name="ObjectDocumentServiceName"> - <value>com.sun.star.chart2.ChartDocument</value> - </prop> - <prop oor:name="ObjectDocumentFilterName"> - <value>StarOffice XML (Base) Report Chart</value> - </prop> - <prop oor:name="ObjectMiscStatus"> - <value>1</value> - </prop> - <prop oor:name="ObjectVerbs"> - <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE</value> - </prop> - </node> - </node> - <node oor:name="MimeTypeClassIDRelations"> - <prop oor:name="application/vnd.sun.xml.report.chart" oor:op="replace" oor:type="xs:string"> - <value>80243D39-6741-46C5-926E-069164FF87BB</value> - </prop> - <prop oor:name="application/vnd.sun.xml.report" oor:op="replace" oor:type="xs:string"> - <value>D7896D52-B7AF-4820-9DFE-D404D015960F</value> - </prop> - </node> -</oor:component-data> - diff --git a/reportdesign/registry/data/org/openoffice/Office/ExtendedColorScheme.xcu b/reportdesign/registry/data/org/openoffice/Office/ExtendedColorScheme.xcu deleted file mode 100644 index 69a60c10f..000000000 --- a/reportdesign/registry/data/org/openoffice/Office/ExtendedColorScheme.xcu +++ /dev/null @@ -1,196 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ExtendedColorScheme.xcu,v $ - * $Revision: 1.2 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> -<oor:component-data oor:name="ExtendedColorScheme" oor:package="org.openoffice.Office" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <node oor:name="ExtendedColorScheme"> - <prop oor:name="CurrentColorScheme"> - <value>default</value> - </prop> - <node oor:name="ColorSchemes"> - <node oor:name="default" oor:op="replace"> - <node oor:name="SunReportBuilder" oor:op="replace"> - <node oor:name="Entries"> - <node oor:name="ReportHeader" oor:op="replace"> - <prop oor:name="Color"> - <value>0x007Fa04C</value> - </prop> - <prop oor:name="DefaultColor"> - <value>0x007Fa04C</value> - </prop> - </node> - <node oor:name="ReportFooter" oor:op="replace"> - <prop oor:name="Color"> - <value>0x007Fa04C</value> - </prop> - <prop oor:name="DefaultColor"> - <value>0x007Fa04C</value> - </prop> - </node> - <node oor:name="PageHeader" oor:op="replace"> - <prop oor:name="Color"> - <value>0x00F0C158/</value> - </prop> - <prop oor:name="DefaultColor"> - <value>0x00F0C158/</value> - </prop> - </node> - <node oor:name="PageFooter" oor:op="replace"> - <prop oor:name="Color"> - <value>0x00F0C158</value> - </prop> - <prop oor:name="DefaultColor"> - <value>0x00F0C158</value> - </prop> - </node> - <node oor:name="GroupHeader" oor:op="replace"> - <prop oor:name="Color"> - <value>0x00AAC1D2</value> - </prop> - <prop oor:name="DefaultColor"> - <value>0x00AAC1D2</value> - </prop> - </node> - <node oor:name="GroupFooter" oor:op="replace"> - <prop oor:name="Color"> - <value>0x00AAC1D2</value> - </prop> - <prop oor:name="DefaultColor"> - <value>0x00AAC1D2</value> - </prop> - </node> - <node oor:name="ColumnHeader" oor:op="replace"> - <prop oor:name="Color"> - <value>0x00AAC1D2</value> - </prop> - <prop oor:name="DefaultColor"> - <value>0x00AAC1D2</value> - </prop> - </node> - <node oor:name="ColumnFooter" oor:op="replace"> - <prop oor:name="Color"> - <value>0x00AAC1D2</value> - </prop> - <prop oor:name="DefaultColor"> - <value>0x00AAC1D2</value> - </prop> - </node> - <node oor:name="Detail" oor:op="replace"> - <prop oor:name="Color"> - <value>0x00F1C4A2</value> - </prop> - <prop oor:name="DefaultColor"> - <value>0x00F1C4A2</value> - </prop> - </node> - <node oor:name="OverlappedControl" oor:op="replace"> - <prop oor:name="Color"> - <value>0x00FF3366</value> - </prop> - <prop oor:name="DefaultColor"> - <value>0x00FF3366</value> - </prop> - </node> - </node> - </node> - </node> - </node> - </node> - <node oor:name="EntryNames"> - <node oor:name="SunReportBuilder" oor:op="replace"> - <prop oor:name="DisplayName"> - <value xml:lang="de">Sun Report Builder</value> - <value xml:lang="en-US">Sun Report Builder</value> - </prop> - <node oor:name="Entries"> - <node oor:name="ReportHeader" oor:op="replace"> - <prop oor:name="DisplayName"> - <value xml:lang="de">Berichtskopf</value> - <value xml:lang="en-US">Report Header</value> - </prop> - </node> - <node oor:name="ReportFooter" oor:op="replace"> - <prop oor:name="DisplayName"> - <value xml:lang="de">Berichtsfuß</value> - <value xml:lang="en-US">Report Footer</value> - </prop> - </node> - <node oor:name="PageHeader" oor:op="replace"> - <prop oor:name="DisplayName"> - <value xml:lang="de">Seitenkopf</value> - <value xml:lang="en-US">Page Header</value> - </prop> - </node> - <node oor:name="PageFooter" oor:op="replace"> - <prop oor:name="DisplayName"> - <value xml:lang="de">Seitenfuß</value> - <value xml:lang="en-US">Page Footer</value> - </prop> - </node> - <node oor:name="GroupHeader" oor:op="replace"> - <prop oor:name="DisplayName"> - <value xml:lang="de">Gruppenkopf</value> - <value xml:lang="en-US">Group Header</value> - </prop> - </node> - <node oor:name="GroupFooter" oor:op="replace"> - <prop oor:name="DisplayName"> - <value xml:lang="de">Gruppenfuß</value> - <value xml:lang="en-US">Group Footer</value> - </prop> - </node> - <node oor:name="ColumnHeader" oor:op="replace"> - <prop oor:name="DisplayName"> - <value xml:lang="de">Spaltenkopf</value> - <value xml:lang="en-US">Column Header</value> - </prop> - </node> - <node oor:name="ColumnFooter" oor:op="replace"> - <prop oor:name="DisplayName"> - <value xml:lang="de">Spaltenfuß</value> - <value xml:lang="en-US">Column Footer</value> - </prop> - </node> - <node oor:name="Detail" oor:op="replace"> - <prop oor:name="DisplayName"> - <value xml:lang="de">Detail</value> - <value xml:lang="en-US">Detail</value> - </prop> - </node> - <node oor:name="OverlappedControl" oor:op="replace"> - <prop oor:name="DisplayName"> - <value xml:lang="de">Überlappende Steuerelemente</value> - <value xml:lang="en-US">Overlapped Control</value> - </prop> - </node> - </node> - </node> - </node> -</oor:component-data> - diff --git a/reportdesign/registry/data/org/openoffice/Office/Paths.xcu b/reportdesign/registry/data/org/openoffice/Office/Paths.xcu deleted file mode 100644 index b9d181768..000000000 --- a/reportdesign/registry/data/org/openoffice/Office/Paths.xcu +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Paths.xcu,v $ - * - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> - -<oor:component-data oor:package="org.openoffice.Office" oor:name="Paths" xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > <node oor:name="Paths"> - - <node oor:name="Template" oor:op="fuse"> - <node oor:name="InternalPaths"> - <node oor:name="%origin%/../../../../../template" oor:op="fuse"/> - </node> - </node> - - </node> -</oor:component-data> - diff --git a/reportdesign/registry/data/org/openoffice/Office/ReportDesign.xcu b/reportdesign/registry/data/org/openoffice/Office/ReportDesign.xcu deleted file mode 100644 index f077a190f..000000000 --- a/reportdesign/registry/data/org/openoffice/Office/ReportDesign.xcu +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportDesign.xcu,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> -<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="ReportDesign" oor:package="org.openoffice.Office"> - <node oor:name="UserData" oor:extensible="true"> - <prop oor:name="Chart" oor:op="replace" oor:type="xs:boolean"> - <value>true</value> - </prop> - </node> -</oor:component-data> diff --git a/reportdesign/registry/data/org/openoffice/Office/UI/Controller.xcu b/reportdesign/registry/data/org/openoffice/Office/UI/Controller.xcu deleted file mode 100644 index eeba54406..000000000 --- a/reportdesign/registry/data/org/openoffice/Office/UI/Controller.xcu +++ /dev/null @@ -1,170 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Controller.xcu,v $ - * $Revision: 1.2 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> -<oor:component-data oor:name="Controller" oor:package="org.openoffice.Office.UI" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <node oor:name="Registered"> - <node oor:name="ToolBar"> - <node oor:name="c4" oor:op="replace"> - <prop oor:name="Command"> - <value>.uno:FontColor</value> - </prop> - <prop oor:name="Module"> - <value>com.sun.star.report.ReportDefinition</value> - </prop> - <prop oor:name="Controller"> - <value>com.sun.star.report.ReportToolboxController</value> - </prop> - </node> - <node oor:name="c5" oor:op="replace"> - <prop oor:name="Command"> - <value>.uno:BackgroundColor</value> - </prop> - <prop oor:name="Module"> - <value>com.sun.star.report.ReportDefinition</value> - </prop> - <prop oor:name="Controller"> - <value>com.sun.star.report.ReportToolboxController</value> - </prop> - </node> - <node oor:name="c6" oor:op="replace"> - <prop oor:name="Command"> - <value>.uno:Color</value> - </prop> - <prop oor:name="Module"> - <value>com.sun.star.report.ReportDefinition</value> - </prop> - <prop oor:name="Controller"> - <value>com.sun.star.report.ReportToolboxController</value> - </prop> - </node> - <node oor:name="c7" oor:op="replace"> - <prop oor:name="Command"> - <value>.uno:BasicShapes</value> - </prop> - <prop oor:name="Module"> - <value>com.sun.star.report.ReportDefinition</value> - </prop> - <prop oor:name="Controller"> - <value>com.sun.star.report.ReportToolboxController</value> - </prop> - </node> - <node oor:name="c8" oor:op="replace"> - <prop oor:name="Command"> - <value>.uno:SymbolShapes</value> - </prop> - <prop oor:name="Module"> - <value>com.sun.star.report.ReportDefinition</value> - </prop> - <prop oor:name="Controller"> - <value>com.sun.star.report.ReportToolboxController</value> - </prop> - </node> - <node oor:name="c9" oor:op="replace"> - <prop oor:name="Command"> - <value>.uno:ArrowShapes</value> - </prop> - <prop oor:name="Module"> - <value>com.sun.star.report.ReportDefinition</value> - </prop> - <prop oor:name="Controller"> - <value>com.sun.star.report.ReportToolboxController</value> - </prop> - </node> - <node oor:name="c10" oor:op="replace"> - <prop oor:name="Command"> - <value>.uno:FlowChartShapes</value> - </prop> - <prop oor:name="Module"> - <value>com.sun.star.report.ReportDefinition</value> - </prop> - <prop oor:name="Controller"> - <value>com.sun.star.report.ReportToolboxController</value> - </prop> - </node> - <node oor:name="c11" oor:op="replace"> - <prop oor:name="Command"> - <value>.uno:CalloutShapes</value> - </prop> - <prop oor:name="Module"> - <value>com.sun.star.report.ReportDefinition</value> - </prop> - <prop oor:name="Controller"> - <value>com.sun.star.report.ReportToolboxController</value> - </prop> - </node> - <node oor:name="c12" oor:op="replace"> - <prop oor:name="Command"> - <value>.uno:StarShapes</value> - </prop> - <prop oor:name="Module"> - <value>com.sun.star.report.ReportDefinition</value> - </prop> - <prop oor:name="Controller"> - <value>com.sun.star.report.ReportToolboxController</value> - </prop> - </node> - <node oor:name="c14" oor:op="replace"> - <prop oor:name="Command"> - <value>.uno:CharFontName</value> - </prop> - <prop oor:name="Module"> - <value>com.sun.star.report.ReportDefinition</value> - </prop> - <prop oor:name="Controller"> - <value>com.sun.star.report.ReportToolboxController</value> - </prop> - </node> - </node> - <node oor:name="StatusBar"> - <node oor:name="c8" oor:op="replace"> - <prop oor:name="Command"> - <value>.uno:ZoomSlider</value> - </prop> - <prop oor:name="Module"> - <value>com.sun.star.report.ReportDefinition</value> - </prop> - <prop oor:name="Controller"> - <value>com.sun.star.report.comp.StatusbarController</value> - </prop> - </node> - <node oor:name="c9" oor:op="replace"> - <prop oor:name="Command"> - <value>.uno:Zoom</value> - </prop> - <prop oor:name="Module"> - <value>com.sun.star.report.ReportDefinition</value> - </prop> - <prop oor:name="Controller"> - <value>com.sun.star.report.comp.StatusbarController</value> - </prop> - </node> - </node> - </node> -</oor:component-data> diff --git a/reportdesign/registry/data/org/openoffice/Office/UI/DbReportWindowState.xcu b/reportdesign/registry/data/org/openoffice/Office/UI/DbReportWindowState.xcu deleted file mode 100644 index ffaa3b6cc..000000000 --- a/reportdesign/registry/data/org/openoffice/Office/UI/DbReportWindowState.xcu +++ /dev/null @@ -1,146 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DbReportWindowState.xcu,v $ - * $Revision: 1.2 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> -<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="DbReportWindowState" oor:package="org.openoffice.Office.UI"> - <node oor:name="UIElements"> - <node oor:name="States"> - <node oor:name="private:resource/toolbar/toolbar" oor:op="replace"> - <prop oor:name="DockPos" oor:type="xs:string"> - <value>0,1</value> - </prop> - <prop oor:name="Docked" oor:type="xs:boolean"> - <value>true</value> - </prop> - <prop oor:name="DockingArea" oor:type="xs:int"> - <value>0</value> - </prop> - <prop oor:name="Style" oor:type="xs:int"> - <value>0</value> - </prop> - <prop oor:name="UIName" oor:type="xs:string"> - <value xml:lang="en-US">Standard</value> - </prop> - <prop oor:name="Visible" oor:type="xs:boolean"> - <value>true</value> - </prop> - </node> - <node oor:name="private:resource/toolbar/Formatting" oor:op="replace"> - <prop oor:name="DockPos" oor:type="xs:string"> - <value>0,1</value> - </prop> - <prop oor:name="Docked" oor:type="xs:boolean"> - <value>true</value> - </prop> - <prop oor:name="DockingArea" oor:type="xs:int"> - <value>0</value> - </prop> - <prop oor:name="UIName" oor:type="xs:string"> - <value xml:lang="en-US">Formatting</value> - </prop> - <prop oor:name="Visible" oor:type="xs:boolean"> - <value>true</value> - </prop> - <prop oor:name="ContextSensitive" oor:type="xs:boolean"> - <value>true</value> - </prop> - </node> - <node oor:name="private:resource/toolbar/reportcontrols" oor:op="replace"> - <prop oor:name="UIName" oor:type="xs:string"> - <value xml:lang="en-US">Report Controls</value> - </prop> - <prop oor:name="DockPos" oor:type="xs:string"> - <value>0,2</value> - </prop> - <prop oor:name="Docked" oor:type="xs:boolean"> - <value>true</value> - </prop> - <prop oor:name="Visible" oor:type="xs:boolean"> - <value>true</value> - </prop> - </node> - <node oor:name="private:resource/toolbar/drawbar" oor:op="replace"> - <prop oor:name="UIName" oor:type="xs:string"> - <value xml:lang="en-US">Drawing objects</value> - </prop> - <prop oor:name="DockPos" oor:type="xs:string"> - <value>297,2</value> - </prop> - <prop oor:name="Docked" oor:type="xs:boolean"> - <value>true</value> - </prop> - <prop oor:name="Visible" oor:type="xs:boolean"> - <value>false</value> - </prop> - </node> - <node oor:name="private:resource/toolbar/alignmentbar" oor:op="replace"> - <prop oor:name="UIName" oor:type="xs:string"> - <value xml:lang="en-US">Align</value> - </prop> - <prop oor:name="DockPos" oor:type="xs:string"> - <value>489,2</value> - </prop> - <prop oor:name="Docked" oor:type="xs:boolean"> - <value>true</value> - </prop> - <prop oor:name="Visible" oor:type="xs:boolean"> - <value>true</value> - </prop> - </node> - <node oor:name="private:resource/toolbar/sectionalignmentbar" oor:op="replace"> - <prop oor:name="UIName" oor:type="xs:string"> - <value xml:lang="en-US">Align at Section</value> - </prop> - <prop oor:name="DockPos" oor:type="xs:string"> - <value>0,2</value> - </prop> - <prop oor:name="Docked" oor:type="xs:boolean"> - <value>true</value> - </prop> - <prop oor:name="Visible" oor:type="xs:boolean"> - <value>true</value> - </prop> - </node> - <node oor:name="private:resource/toolbar/resizebar" oor:op="replace"> - <prop oor:name="UIName" oor:type="xs:string"> - <value xml:lang="en-US">Object Resizing</value> - </prop> - <prop oor:name="DockPos" oor:type="xs:string"> - <value>670,2</value> - </prop> - <prop oor:name="Docked" oor:type="xs:boolean"> - <value>true</value> - </prop> - <prop oor:name="Visible" oor:type="xs:boolean"> - <value>true</value> - </prop> - </node> - </node> - </node> -</oor:component-data> diff --git a/reportdesign/registry/data/org/openoffice/Office/UI/ReportCommands.xcu b/reportdesign/registry/data/org/openoffice/Office/UI/ReportCommands.xcu deleted file mode 100644 index 93625cd0c..000000000 --- a/reportdesign/registry/data/org/openoffice/Office/UI/ReportCommands.xcu +++ /dev/null @@ -1,311 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportCommands.xcu,v $ - * $Revision: 1.2.2.1 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> -<oor:component-data oor:name="ReportCommands" oor:package="org.openoffice.Office.UI" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <node oor:name="UserInterface"> - <node oor:name="Commands"> - <node oor:name=".uno:ReportHeaderFooter" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Berichtskopf, -fuß</value> - <value xml:lang="en-US">Report Header/Footer</value> - </prop> - </node> - <node oor:name=".uno:PageHeaderFooter" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Kopf-, Fußzeile</value> - <value xml:lang="en-US">Page Header/Footer</value> - </prop> - </node> - <node oor:name=".uno:ShowRuler" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">~Lineal</value> - <value xml:lang="en-US">~Ruler</value> - </prop> - </node> - <node oor:name=".uno:DbSortingAndGrouping" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">~Sortierung and Grupierung</value> - <value xml:lang="en-US">~Sorting and Grouping</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:ConditionalFormatting" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">~Bedindungsabhängige Formatierung...</value> - <value xml:lang="en-US">~Conditional Formatting...</value> - </prop> - </node> - <node oor:name=".uno:PageDialog" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Seiteneinstellungen</value> - <value xml:lang="en-US">Page Settings</value> - </prop> - <prop oor:name="ContextLabel" oor:type="xs:string"> - <value xml:lang="de">Seiteneinstellungen...</value> - <value xml:lang="en-US">~Page...</value> - </prop> - </node> - <node oor:name=".uno:ResetAttributes" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Stan~dardformatierung</value> - <value xml:lang="en-US">~Default Formatting</value> - </prop> - </node> - <node oor:name=".uno:InsertPageNumberField" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">~Seitenzahlen...</value> - <value xml:lang="en-US">~Page Numbers...</value> - </prop> - </node> - <node oor:name=".uno:InsertDateTimeField" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">~Date and Time...</value> - </prop> - </node> - <node oor:name=".uno:SelectReport" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">~Select Report</value> - </prop> - </node> - <node oor:name=".uno:SubReportInNewWindow" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">~Unterbericht im neuen Fenster...</value> - <value xml:lang="en-US">~Subreport in New Window...</value> - </prop> - </node> - <node oor:name=".uno:FontColor" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Zeichenfarbe</value> - <value xml:lang="en-US">Font Color</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:GridMenu" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">~Raster</value> - <value xml:lang="en-US">Gr~id</value> - </prop> - </node> - <node oor:name=".uno:ColumnHeaderFooter" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">~Spalten Kopf-, Fußzeile</value> - <value xml:lang="en-US">~Column Header/Footer</value> - </prop> - </node> - <node oor:name=".uno:PasteSpecial" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">In~halte einfügen...</value> - <value xml:lang="en-US">Paste ~Special...</value> - </prop> - </node> - <node oor:name=".uno:ExecuteReport" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Bericht ausführen...</value> - <value xml:lang="en-US">Execute Report...</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:ImageControl" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Grafik</value> - <value xml:lang="en-US">Graphic...</value> - </prop> - </node> - <node oor:name=".uno:TextDocument" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Text Dokument</value> - <value xml:lang="en-US">ODF Text Document</value> - </prop> - </node> - <node oor:name=".uno:Spreadsheet" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Tabellen Dokument</value> - <value xml:lang="en-US">ODF Spreadsheet</value> - </prop> - </node> - <node oor:name=".uno:ReportNavigator" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Berichtsnavigator</value> - <value xml:lang="en-US">Report Navigator</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:SmallestWidth" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">HAS TO BE TARNSLATED: Fit to smallest width</value> - <value xml:lang="en-US">Fit to smallest width</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:SmallestHeight" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">HAS TO BE TARNSLATED: Fit to smallest height</value> - <value xml:lang="en-US">Fit to smallest height</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:GreatestWidth" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Fit to greatest width</value> - <value xml:lang="en-US">Fit to greatest width</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:GreatestHeight" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Fit to greatest height</value> - <value xml:lang="en-US">Fit to greatest height</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:ControlProperties" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Eigenschaften</value> - <value xml:lang="en-US">Properties</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:Distribution" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Verteilung...</value> - <value xml:lang="en-US">Distribution...</value> - </prop> - </node> - <node oor:name=".uno:SelectAllInSection" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">~Objekte im Bereich markieren</value> - <value xml:lang="en-US">~Select Objects in Section</value> - </prop> - </node> - <node oor:name=".uno:SectionAlignLeft" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Linksbündig am Bereich</value> - <value xml:lang="en-US">Left Align on Section</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:SectionAlignRight" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Rechtsbündig am Bereich</value> - <value xml:lang="en-US">Right Align on Section</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:SectionAlignTop" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Oben am Bereich</value> - <value xml:lang="en-US">Top Align on Section</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:SectionAlignBottom" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Bottom Align on Section</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:SectionAlignCenter" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Centered on Section</value> - </prop> - </node> - <node oor:name=".uno:SectionAlignMiddle" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Middle on Section</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:SelectAllLabels" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Select all Labels</value> - </prop> - </node> - <node oor:name=".uno:SelectAllEdits" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Select all Formatted Fields</value> - </prop> - </node> - </node> - <node oor:name="Popups"> - <node oor:name=".uno:ExportReportTo" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Berichtsausgabeformat</value> - <value xml:lang="en-US">Report Output Format</value> - </prop> - </node> - <node oor:name=".uno:SnapLinesMenu" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Führungslinien</value> - <value xml:lang="en-US">~Guides</value> - </prop> - </node> - <node oor:name=".uno:ObjectResize" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">Größenänderung</value> - <value xml:lang="en-US">Object Resizing</value> - </prop> - </node> - <node oor:name=".uno:ArrangeMenu" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="de">A~nordnung</value> - <value xml:lang="en-US">A~rrange</value> - </prop> - </node> - </node> - </node> -</oor:component-data> diff --git a/reportdesign/registry/data/org/openoffice/Office/UI/makefile.mk b/reportdesign/registry/data/org/openoffice/Office/UI/makefile.mk deleted file mode 100644 index af716d879..000000000 --- a/reportdesign/registry/data/org/openoffice/Office/UI/makefile.mk +++ /dev/null @@ -1,52 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=..$/..$/..$/..$/..$/.. - -PRJNAME=reportdesign -TARGET=data_ooOUI -PACKAGE=org.openoffice.Office.UI - -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Targets ------------------------------------------------------ -LOCALIZEDFILES= \ - ReportCommands.xcu \ - DbReportWindowState.xcu - -XCUFILES= \ - $(LOCALIZEDFILES) \ - Controller.xcu - -MODULEFILES= - -.INCLUDE : target.mk - -
\ No newline at end of file diff --git a/reportdesign/registry/data/org/openoffice/Office/makefile.mk b/reportdesign/registry/data/org/openoffice/Office/makefile.mk deleted file mode 100644 index 24919154e..000000000 --- a/reportdesign/registry/data/org/openoffice/Office/makefile.mk +++ /dev/null @@ -1,71 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.8.6.1 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/..$/..$/..$/.. - -PRJNAME=reportdesign -TARGET=data_ooOOffice -PACKAGE=org.openoffice.Office - -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Targets ------------------------------------------------------ - -LOCALIZEDFILES= \ - Embedding.xcu \ - ExtendedColorScheme.xcu \ - Accelerators.xcu \ - DataAccess.xcu - -XCUFILES= \ - $(LOCALIZEDFILES) \ - ReportDesign.xcu \ - Paths.xcu - -.INCLUDE : target.mk - -ALLTAR: "$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Embedding.xcs" "$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/ExtendedColorScheme.xcs" "$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Paths.xcs" - -"$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Embedding.xcs" : $(SOLARXMLDIR)$/registry$/schema$/$(PACKAGEDIR)$/Embedding.xcs - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -"$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/ExtendedColorScheme.xcs" : $(SOLARXMLDIR)$/registry$/schema$/$(PACKAGEDIR)$/ExtendedColorScheme.xcs - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -"$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Paths.xcs" : $(SOLARXMLDIR)$/registry$/schema$/$(PACKAGEDIR)$/Paths.xcs - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -"$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Accelerators.xcs": $(SOLARXMLDIR)$/registry$/schema$/$(PACKAGEDIR)$/Accelerators.xcs - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ diff --git a/reportdesign/registry/data/org/openoffice/Setup.xcu b/reportdesign/registry/data/org/openoffice/Setup.xcu deleted file mode 100644 index e8fee8e90..000000000 --- a/reportdesign/registry/data/org/openoffice/Setup.xcu +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Setup.xcu,v $ - * $Revision: 1.2.6.1 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> -<oor:component-data oor:name="Setup" oor:package="org.openoffice" xmlns:oor="http://openoffice.org/2001/registry" xmlns:install="http://openoffice.org/2004/installation" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <node oor:name="Office"> - <node oor:name="Factories"> - <node oor:name="com.sun.star.report.ReportDefinition" oor:op="replace" > - <prop oor:name="ooSetupFactoryCommandConfigRef"> - <value >ReportCommands</value> - </prop> - <prop oor:name="ooSetupFactoryShortName"> - <value >dbreport</value> - </prop> - <prop oor:name="ooSetupFactoryWindowStateConfigRef"> - <value >DbReportWindowState</value> - </prop> - <prop oor:name="ooSetupFactoryIcon"> - <value >14</value> - </prop> - <prop oor:name="ooSetupFactoryCmdCategoryConfigRef"> - <value >GenericCategories</value> - </prop> - <prop oor:name="ooSetupFactoryUIName"> - <value xml:lang="en-US">Base: Sun Report Builder</value> - </prop> - </node> - </node> - </node> -</oor:component-data> - diff --git a/reportdesign/registry/data/org/openoffice/TypeDetection/Filter.xcu b/reportdesign/registry/data/org/openoffice/TypeDetection/Filter.xcu deleted file mode 100644 index 0fcb6888f..000000000 --- a/reportdesign/registry/data/org/openoffice/TypeDetection/Filter.xcu +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Filter.xcu,v $ - * $Revision: 1.2 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> -<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:package="org.openoffice.TypeDetection" oor:name="Filter"> - <node oor:name="Filters"> - <node oor:name="StarOffice XML (Base) Report" oor:op="replace" oor:finalized="false" oor:mandatory="false"> - <prop oor:name="Flags"> - <value>IMPORT EXPORT OWN DEFAULT 3RDPARTYFILTER NOTINFILEDIALOG NOTINCHOOSER</value> - </prop> - <prop oor:name="UIComponent"/> - <prop oor:name="FilterService"/> - <prop oor:name="UserData"/> - <prop oor:name="FileFormatVersion"> - <value>6800</value> - </prop> - <prop oor:name="Type"> - <value>StarBaseReport</value> - </prop> - <prop oor:name="TemplateName"/> - <prop oor:name="DocumentService"> - <value>com.sun.star.report.ReportDefinition</value> - </prop> - <prop oor:name="UIName"> - <value xml:lang="en-US">ODF Database Report</value> - </prop> - </node> - - <node oor:name="StarOffice XML (Base) Report Chart" oor:op="replace" oor:finalized="false" oor:mandatory="false"> - <prop oor:name="Flags"> - <value>IMPORT EXPORT OWN DEFAULT NOTINFILEDIALOG NOTINCHOOSER</value> - </prop> - <prop oor:name="UIComponent"/> - <prop oor:name="FilterService"> - <value>com.sun.star.comp.chart2.report.XMLFilter</value> - </prop> - <prop oor:name="UserData"/> - <prop oor:name="FileFormatVersion"> - <value>6800</value> - </prop> - <prop oor:name="Type"> - <value>StarBaseReportChart</value> - </prop> - <prop oor:name="TemplateName"/> - <prop oor:name="DocumentService"> - <value>com.sun.star.chart2.ChartDocument</value> - </prop> - <prop oor:name="UIName"> - <value xml:lang="en-US">%productname% %formatversion% Report Chart</value> - </prop> - </node> - </node> -</oor:component-data> diff --git a/reportdesign/registry/data/org/openoffice/TypeDetection/Types.xcu b/reportdesign/registry/data/org/openoffice/TypeDetection/Types.xcu deleted file mode 100644 index 233c40cd0..000000000 --- a/reportdesign/registry/data/org/openoffice/TypeDetection/Types.xcu +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Types.xcu,v $ - * $Revision: 1.2 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> -<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:package="org.openoffice.TypeDetection" oor:name="Types"> - <node oor:name="Types"> - <node oor:name="StarBaseReport" oor:op="replace"> - <prop oor:name="DetectService"> - <value>com.sun.star.comp.report.ORptTypeDetection</value> - </prop> - <prop oor:name="URLPattern"> - <value>private:factory/sreport*</value> - </prop> - <prop oor:name="Extensions"> - <value>orp</value> - </prop> - <prop oor:name="MediaType"> - <value>application/vnd.sun.xml.report</value> - </prop> - <prop oor:name="Preferred"> - <value>false</value> - </prop> - <prop oor:name="PreferredFilter"> - <value>StarOffice XML (Base) Report</value> - </prop> - <prop oor:name="UIName"> - <value xml:lang="en-US">OpenDocument Database Report</value> - </prop> - <prop oor:name="ClipboardFormat"> - <value>StarBaseReport 9.0</value> - </prop> - </node> - <node oor:name="StarBaseReportChart" oor:op="replace"> - <prop oor:name="DetectService"/> - <prop oor:name="URLPattern"> - <value></value> - </prop> - <prop oor:name="Extensions"> - <value>odc</value> - </prop> - <prop oor:name="MediaType"> - <value>application/vnd.sun.xml.report.chart</value> - </prop> - <prop oor:name="Preferred"> - <value>false</value> - </prop> - <prop oor:name="PreferredFilter"> - <value>StarOffice XML (Base) Report Chart</value> - </prop> - <prop oor:name="UIName"> - <value xml:lang="en-US">StarOffice XML (Base) Report Chart 9</value> - </prop> - <prop oor:name="ClipboardFormat"> - <value>StarOffice XML (Base) Report Chart 9</value> - </prop> - </node> - </node> -</oor:component-data> diff --git a/reportdesign/registry/data/org/openoffice/TypeDetection/makefile.mk b/reportdesign/registry/data/org/openoffice/TypeDetection/makefile.mk deleted file mode 100644 index 21292aa5a..000000000 --- a/reportdesign/registry/data/org/openoffice/TypeDetection/makefile.mk +++ /dev/null @@ -1,59 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/..$/..$/..$/.. - -PRJNAME=reportdesign -TARGET=data_ooType -PACKAGE=org.openoffice.TypeDetection - -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Targets ------------------------------------------------------ - -LOCALIZEDFILES= \ - Filter.xcu \ - Types.xcu - -XCUFILES= \ - $(LOCALIZEDFILES) - -.INCLUDE : target.mk - -ALLTAR: "$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Filter.xcs" "$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Types.xcs" - -"$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Filter.xcs" : $(SOLARXMLDIR)$/registry$/schema$/$(PACKAGEDIR)$/Filter.xcs - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -"$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Types.xcs" : $(SOLARXMLDIR)$/registry$/schema$/$(PACKAGEDIR)$/Types.xcs - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ diff --git a/reportdesign/registry/data/org/openoffice/makefile.mk b/reportdesign/registry/data/org/openoffice/makefile.mk deleted file mode 100644 index 7ce66b9a6..000000000 --- a/reportdesign/registry/data/org/openoffice/makefile.mk +++ /dev/null @@ -1,54 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.2.6.1 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/..$/..$/.. - -PRJNAME=reportdesign -TARGET=data_ooOffice -PACKAGE=org.openoffice - -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Targets ------------------------------------------------------ - -LOCALIZEDFILES= \ - Setup.xcu - -XCUFILES= \ - $(LOCALIZEDFILES) - -.INCLUDE : target.mk - -ALLTAR: "$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Setup.xcs" - -"$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Setup.xcs": $(SOLARXMLDIR)$/registry$/schema$/$(PACKAGEDIR)$/Setup.xcs - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ diff --git a/reportdesign/registry/schema/org/openoffice/Office/ReportDesign.xcs b/reportdesign/registry/schema/org/openoffice/Office/ReportDesign.xcs deleted file mode 100644 index 24dc3f747..000000000 --- a/reportdesign/registry/schema/org/openoffice/Office/ReportDesign.xcs +++ /dev/null @@ -1,74 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportDesign.xcs,v $ - * $Revision: 1.2 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> -<oor:component-schema oor:name="ReportDesign" oor:package="org.openoffice.Office" xml:lang="en-US" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <info> - <author>OJ</author> - <desc>Contains informatation of report design.</desc> - </info> - <component> - <group oor:name="PropertyBrowser"> - <info> - <desc>specifies settings for the property browser used for reports and report controls.</desc> - </info> - <prop oor:name="DirectHelp" oor:type="xs:boolean"> - <info> - <author>OJ</author> - <desc>Enables or disables a help section at the bottom of the property browser, which shows the help of the currently active property.</desc> - </info> - <value>false</value> - </prop> - </group> - <group oor:name="Extension"> - <info> - <desc>specifies extension settings for the report designer.</desc> - </info> - <prop oor:name="DownloadURL" oor:type="xs:string"> - <info> - <author>LLA</author> - <desc>Direct download URL to the Sun(tm) Report Builder extension.</desc> - </info> - <value>http://extensions.services.openoffice.org</value> - </prop> - <prop oor:name="Name" oor:type="xs:string"> - <info> - <author>LLA</author> - <desc>Name of the extension.</desc> - </info> - <value>Sun(tm) Report Builder</value> - </prop> - </group> - <group oor:name="UserData" oor:extensible="true"> - <info> - <desc>Denotes an additional field for arbitrary data.</desc> - </info> - </group> - </component> -</oor:component-schema> diff --git a/reportdesign/registry/schema/org/openoffice/Office/UI/DbReportWindowState.xcs b/reportdesign/registry/schema/org/openoffice/Office/UI/DbReportWindowState.xcs deleted file mode 100644 index e3773dffb..000000000 --- a/reportdesign/registry/schema/org/openoffice/Office/UI/DbReportWindowState.xcs +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DbReportWindowState.xcs,v $ - * $Revision: 1.2 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> -<oor:component-schema oor:name="DbReportWindowState" oor:package="org.openoffice.Office.UI" xml:lang="en-US" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <info> - <author>OJ</author> - <desc>Contains state information of all dockable user interface elements based on a Window class which belongs to the database report module.</desc> - </info> - <import oor:component="org.openoffice.Office.UI.WindowState"/> - <uses oor:component="org.openoffice.Office.UI.WindowState"/> - <templates/> - <component> - <group oor:name="UIElements"> - <info> - <desc>Contains user interface element state data specific for the database report module."</desc> - </info> - <set oor:name="States" oor:node-type="WindowStateType" oor:component="org.openoffice.Office.UI.WindowState"> - <info> - <desc>Contains states of all known dockable user interface elements of the report module."</desc> - </info> - </set> - </group> - </component> -</oor:component-schema> diff --git a/reportdesign/registry/schema/org/openoffice/Office/UI/ReportCommands.xcs b/reportdesign/registry/schema/org/openoffice/Office/UI/ReportCommands.xcs deleted file mode 100644 index 833ca974f..000000000 --- a/reportdesign/registry/schema/org/openoffice/Office/UI/ReportCommands.xcs +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ReportCommands.xcs,v $ - * $Revision: 1.2 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> -<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="ReportCommands" oor:package="org.openoffice.Office.UI" xml:lang="en-US"> - <info> - <author>OJ</author> - <desc>Contains general information and about actions based on office commands.</desc> - </info> - <import oor:component="org.openoffice.Office.UI.Commands"/> - <uses oor:component="org.openoffice.Office.UI.Commands"/> - <templates/> - <component> - <group oor:name="UserInterface"> - <info> - <desc>Contains user interface data for Office commands and identifiers that are used by the user interface."</desc> - </info> - <set oor:name="Commands" oor:node-type="LabelType" oor:component="org.openoffice.Office.UI.Commands"> - <info> - <desc>Contains label text for Office commands and identifiers that are used by the user interface."</desc> - </info> - </set> - <set oor:name="Popups" oor:node-type="LabelType" oor:component="org.openoffice.Office.UI.Commands"> - <info> - <desc>Contains label text for popup menus identifiers that are used by the user interface."</desc> - </info> - </set> - </group> - </component> -</oor:component-schema> diff --git a/reportdesign/registry/schema/org/openoffice/Office/UI/makefile.mk b/reportdesign/registry/schema/org/openoffice/Office/UI/makefile.mk deleted file mode 100644 index 0ebe89126..000000000 --- a/reportdesign/registry/schema/org/openoffice/Office/UI/makefile.mk +++ /dev/null @@ -1,62 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=..$/..$/..$/..$/..$/.. - -PRJNAME=reportdesign -TARGET=schema_ooOfficeUI -PACKAGE=org.openoffice.Office.UI - -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Targets ------------------------------------------------------ - -XCSFILES= \ - ReportCommands.xcs \ - DbReportWindowState.xcs - -MODULEFILES= - -.INCLUDE : target.mk - -ALLTAR: "$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Commands.xcs" "$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/WindowState.xcs" "$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Controller.xcs" - -"$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Commands.xcs": $(SOLARXMLDIR)$/registry$/schema$/$(PACKAGEDIR)$/Commands.xcs - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -"$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/WindowState.xcs" : $(SOLARXMLDIR)$/registry$/schema$/$(PACKAGEDIR)$/WindowState.xcs - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -"$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/Controller.xcs" : $(SOLARXMLDIR)$/registry$/schema$/$(PACKAGEDIR)$/Controller.xcs - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - diff --git a/reportdesign/registry/schema/org/openoffice/Office/makefile.mk b/reportdesign/registry/schema/org/openoffice/Office/makefile.mk deleted file mode 100644 index 8c3eca916..000000000 --- a/reportdesign/registry/schema/org/openoffice/Office/makefile.mk +++ /dev/null @@ -1,50 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=..$/..$/..$/..$/.. - -PRJNAME=reportdesign -TARGET=schema_ooOffice -PACKAGE=org.openoffice.Office - -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Targets ------------------------------------------------------ - -XCSFILES= \ - ReportDesign.xcs - -.INCLUDE : target.mk - -ALLTAR: "$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/DataAccess.xcs" - -"$(PWD)$/$(MISC)$/$(EXTNAME)$/registry$/schema$/$(PACKAGEDIR)$/DataAccess.xcs" : $(SOLARXMLDIR)$/registry$/schema$/$(PACKAGEDIR)$/DataAccess.xcs - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ diff --git a/reportdesign/template/delzip b/reportdesign/template/delzip deleted file mode 100644 index e69de29bb..000000000 --- a/reportdesign/template/delzip +++ /dev/null diff --git a/reportdesign/template/en-US/wizard/report/default.otr b/reportdesign/template/en-US/wizard/report/default.otr Binary files differdeleted file mode 100644 index a822c6727..000000000 --- a/reportdesign/template/en-US/wizard/report/default.otr +++ /dev/null diff --git a/reportdesign/template/en-US/wizard/report/makefile.mk b/reportdesign/template/en-US/wizard/report/makefile.mk deleted file mode 100644 index 201c75cfe..000000000 --- a/reportdesign/template/en-US/wizard/report/makefile.mk +++ /dev/null @@ -1,73 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.3 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/..$/..$/.. - -PRJNAME=reportdesign -TARGET=template_en_us -PACKAGE= - -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Targets ------------------------------------------------------ - -XCUFILES= - -MODULEFILES= - -OTR_FILES_IN_REPORT_BUILDER_EXT=\ - default.otr - -# OTR_FILES_IN_TEMPLATE_EXT=\ -# finance.odr \ -# finance_2.odr \ -# yellow.odr - -ALLTAR: COPYFILES # COPYFILES2 - -.INCLUDE : target.mk - -#------------------------------------------------------------------------------- - -TARGETDIR=$(MISC)$/sun-report-builder$/template$/en-US$/wizard$/report - -COPYFILES: $(OTR_FILES_IN_REPORT_BUILDER_EXT) $(XCU_FILES) - @@-$(MKDIRHIER) $(TARGETDIR) - $(COPY) $(OTR_FILES_IN_REPORT_BUILDER_EXT) $(TARGETDIR) - -#------------------------------------------------------------------------------- - -# TARGETDIR2=$(MISC)$/templates$/template$/wizard$/report -# -# COPYFILES2: $(OTR_FILES_IN_TEMPLATE_EXT) $(XCU_FILES) -# @@-$(MKDIRHIER) $(TARGETDIR2) -# $(COPY) $(OTR_FILES_IN_TEMPLATE_EXT) $(TARGETDIR2) - diff --git a/reportdesign/template/makefile.mk b/reportdesign/template/makefile.mk deleted file mode 100644 index bf995b6ef..000000000 --- a/reportdesign/template/makefile.mk +++ /dev/null @@ -1,126 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=.. -PRJNAME=reportdesign -TARGET=rpt_templates - -# ??? -no_common_build_zip=true - -EXTENSION_VERSION_BASE=1.0.0 -.IF "$(PRODUCT)" != "" - EXTENSION_VERSION=$(EXTENSION_VERSION_BASE) -.ELSE - EXTENSION_VERSION=$(EXTENSION_VERSION_BASE).$(BUILD) -.ENDIF - -# --- Settings ---------------------------------- -.INCLUDE : settings.mk -# ------------------------------------------------------------------ - -# create Extension ----------------------------- - -.IF "$(SOLAR_JAVA)"!="" - -ZIP1TARGET=sun-report-builder-templates -ZIP1FLAGS=-r -ZIP1DIR=$(MISC)$/templates -ZIP1LIST=* -ZIP1EXT=.oxt - -XMLFILES := $(ZIP1DIR)$/description.xml \ - $(ZIP1DIR)$/META-INF$/manifest.xml - -XCU_FILES := $(ZIP1DIR)$/registry$/data$/org$/openoffice$/Office$/Paths.xcu - -ODR_FILES := \ - $(ZIP1DIR)$/template$/wizard$/report$/finance.odr \ - $(ZIP1DIR)$/template$/wizard$/report$/finance_2.odr \ - $(ZIP1DIR)$/template$/wizard$/report$/yellow.odr - -HTMLFILES := $(ZIP1DIR)$/THIRDPARTYREADMELICENSE.html \ - $(ZIP1DIR)$/readme_en-US.html \ - $(ZIP1DIR)$/readme_en-US.txt - -.IF "$(GUI)"!="WNT" -TXTFILES:=$(foreach,i,$(alllangiso) $(ZIP1DIR)$/registration$/LICENSE_$i) -LICLINES:=$(foreach,i,$(TXTFILES) <license-text xlink:href="registration/$(i:f)" lang="$(subst,LICENSE_, $(i:f))" license-id="$(subst,LICENSE_, $(i:f))" />) -.ELSE # "$(GUI)"!="WNT" -TXTFILES:=$(foreach,i,$(alllangiso) $(ZIP1DIR)$/registration$/license_$i.txt) -LICLINES:=$(foreach,i,$(TXTFILES) <license-text xlink:href="registration/$(i:f)" lang="$(subst,.txt, $(subst,license_, $(i:f)))" license-id="$(subst,.txt, $(subst,license_, $(i:f)))" />) -.ENDIF # "$(GUI)"!="WNT" - -# --- Targets ---------------------------------- -.INCLUDE : target.mk - -.IF "$(ZIP1TARGETN)"!="" -$(ZIP1TARGETN) : $(TXTFILES) $(XMLFILES) $(HTMLFILES) $(ODR_FILES) -.ENDIF # "$(ZIP1TARGETN)"!=" - -$(MISC)$/template_update_report.flag : $(XCU_FILES) - $(TOUCH) $@ - -$(ZIP1DIR)$/description.xml : pre.xml post.xml - @@-$(MKDIRHIER) $(@:d) - @@-$(RM) $(ZIP1DIR)$/description.xml - $(TYPE) pre.xml > $@ - $(TYPE) $(mktmp $(LICLINES)) >> $@ - $(TYPE) post.xml | $(SED) s/#VERSION#/$(EXTENSION_VERSION)/ >> $@ - -$(ZIP1DIR)$/registration$/license_%.txt : $(SOLARBINDIR)$/osl$/license_%.txt - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -$(ZIP1DIR)$/registration$/LICENSE_% : $(SOLARBINDIR)$/osl$/LICENSE_% - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -$(ZIP1DIR)$/registry$/data$/org$/openoffice$/Office$/%.xcu : $(MISC)$/template$/registry$/data$/org$/openoffice$/Office$/%.xcu - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -$(ZIP1DIR)$/META-INF$/manifest.xml : manifest.xml $(MISC)$/template_update_report.flag - @@-$(MKDIRHIER) $(@:d) - $(PERL) $(SOLARENV)$/bin$/makemani.pl $(PRJ)$/template$/manifest.xml $(ZIP1DIR) registry $(@:d:d) - -$(ZIP1DIR)$/readme_en-US.% : $(PRJ)$/license$/readme_en-US.% - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -$(ZIP1DIR)$/THIRDPARTYREADMELICENSE.html : $(PRJ)$/license$/THIRDPARTYREADMELICENSE.html - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -.ELSE # "$(SOLAR_JAVA)"!="" -.INCLUDE : target.mk -.ENDIF # "$(SOLAR_JAVA)"!="" -# diff --git a/reportdesign/template/manifest.xml b/reportdesign/template/manifest.xml deleted file mode 100644 index fc78c8c88..000000000 --- a/reportdesign/template/manifest.xml +++ /dev/null @@ -1,3 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd"> -<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest"> diff --git a/reportdesign/template/post.xml b/reportdesign/template/post.xml deleted file mode 100644 index 889fdd631..000000000 --- a/reportdesign/template/post.xml +++ /dev/null @@ -1,8 +0,0 @@ - </simple-license> - </registration> - <version value="#VERSION#"/> - <identifier value="com.sun.reportdesignertemplates"/> - <dependencies> - <OpenOffice.org-minimal-version value="3.0" d:name="OpenOffice.org 3.0"/> - </dependencies> -</description> diff --git a/reportdesign/template/pre.xml b/reportdesign/template/pre.xml deleted file mode 100644 index e36e2ecc7..000000000 --- a/reportdesign/template/pre.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<description xmlns="http://openoffice.org/extensions/description/2006" - xmlns:d="http://openoffice.org/extensions/description/2006" - xmlns:xlink="http://www.w3.org/1999/xlink"> - <registration> - <simple-license accept-by="admin" default-license-id="en-US" > diff --git a/reportdesign/template/registry/data/org/openoffice/Office/Paths.xcu b/reportdesign/template/registry/data/org/openoffice/Office/Paths.xcu deleted file mode 100644 index d35bb7f88..000000000 --- a/reportdesign/template/registry/data/org/openoffice/Office/Paths.xcu +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!--*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Paths.xcu,v $ - * - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************ --> - -<oor:component-data oor:package="org.openoffice.Office" oor:name="Paths" xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <node oor:name="Paths"> - - <node oor:name="Template" oor:op="fuse"> - <node oor:name="InternalPaths"> - <node oor:name="%origin%/../../../../../template" oor:op="fuse"/> - </node> - </node> - - </node> -</oor:component-data> - diff --git a/reportdesign/template/registry/data/org/openoffice/Office/makefile.mk b/reportdesign/template/registry/data/org/openoffice/Office/makefile.mk deleted file mode 100644 index 5d5765733..000000000 --- a/reportdesign/template/registry/data/org/openoffice/Office/makefile.mk +++ /dev/null @@ -1,53 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/..$/..$/..$/..$/.. - -PRJNAME=reportdesign -TARGET=template_data_ooOffice -PACKAGE=org.openoffice.Office - -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# -# we overwrite the PROCESSOUT directory, which comes from util/makefile.pmk -# and set it to the templates directory -# -PROCESSOUT=$(MISC)$/templates - -# --- Targets ------------------------------------------------------ - -XCUFILES= \ - Paths.xcu - -MODULEFILES= - -.INCLUDE : target.mk diff --git a/reportdesign/template/wizard/report/default.odr b/reportdesign/template/wizard/report/default.odr deleted file mode 100644 index 091de8494..000000000 --- a/reportdesign/template/wizard/report/default.odr +++ /dev/null @@ -1 +0,0 @@ -PKɧ!|j~Q_IroRF
\ No newline at end of file diff --git a/reportdesign/template/wizard/report/finance.odr b/reportdesign/template/wizard/report/finance.odr deleted file mode 100644 index 091de8494..000000000 --- a/reportdesign/template/wizard/report/finance.odr +++ /dev/null @@ -1 +0,0 @@ -PKɧ!|j~Q_IroRF
\ No newline at end of file diff --git a/reportdesign/template/wizard/report/finance_2.odr b/reportdesign/template/wizard/report/finance_2.odr deleted file mode 100644 index 091de8494..000000000 --- a/reportdesign/template/wizard/report/finance_2.odr +++ /dev/null @@ -1 +0,0 @@ -PKɧ!|j~Q_IroRF
\ No newline at end of file diff --git a/reportdesign/template/wizard/report/makefile.mk b/reportdesign/template/wizard/report/makefile.mk deleted file mode 100644 index 59b0bd105..000000000 --- a/reportdesign/template/wizard/report/makefile.mk +++ /dev/null @@ -1,73 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.2 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/..$/.. - -PRJNAME=reportdesign -TARGET=template -PACKAGE= - -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Targets ------------------------------------------------------ - -XCUFILES= - -MODULEFILES= - -ODR_FILES_IN_REPORT_BUILDER_EXT=\ - default.odr - -ODR_FILES_IN_TEMPLATE_EXT=\ - finance.odr \ - finance_2.odr \ - yellow.odr - -ALLTAR: COPYFILES COPYFILES2 - -.INCLUDE : target.mk - -#------------------------------------------------------------------------------- - -TARGETDIR=$(MISC)$/template$/wizard$/report - -COPYFILES: $(ODR_FILES_IN_REPORT_BUILDER_EXT) $(XCU_FILES) - @@-$(MKDIRHIER) $(TARGETDIR) - $(COPY) $(ODR_FILES_IN_REPORT_BUILDER_EXT) $(TARGETDIR) - -#------------------------------------------------------------------------------- - -TARGETDIR2=$(MISC)$/templates$/template$/wizard$/report - -COPYFILES2: $(ODR_FILES_IN_TEMPLATE_EXT) $(XCU_FILES) - @@-$(MKDIRHIER) $(TARGETDIR2) - $(COPY) $(ODR_FILES_IN_TEMPLATE_EXT) $(TARGETDIR2) - diff --git a/reportdesign/template/wizard/report/yellow.odr b/reportdesign/template/wizard/report/yellow.odr deleted file mode 100644 index 091de8494..000000000 --- a/reportdesign/template/wizard/report/yellow.odr +++ /dev/null @@ -1 +0,0 @@ -PKɧ!|j~Q_IroRF
\ No newline at end of file diff --git a/reportdesign/util/component.txt b/reportdesign/util/component.txt deleted file mode 100644 index 17f312c8e..000000000 --- a/reportdesign/util/component.txt +++ /dev/null @@ -1 +0,0 @@ -Create with the Sun Report Builder stylish, smart-looking database reports. The flexible report editor can define group and page headers as well as group and page footers and even calculation fields are available to accomplish complex database reports. diff --git a/reportdesign/util/delzip b/reportdesign/util/delzip deleted file mode 100644 index 8b1378917..000000000 --- a/reportdesign/util/delzip +++ /dev/null @@ -1 +0,0 @@ - diff --git a/reportdesign/util/description.xml b/reportdesign/util/description.xml deleted file mode 100644 index 6a375facc..000000000 --- a/reportdesign/util/description.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<description xmlns="http://openoffice.org/extensions/description/2006" - xmlns:d="http://openoffice.org/extensions/description/2006" - xmlns:xlink="http://www.w3.org/1999/xlink"> - <display-name> - <name lang="en-US">Sun™ Report Builder</name> - <!-- <name lang="en-US">Sun(TM) Report Builder</name> --> - </display-name> - <registration> - <simple-license accept-by="admin" default-license-id="lic-en-US" > - <license-text xlink:href="licensefile" lang="isocode" license-id="lic-isocode"/> - </simple-license> - </registration> - <version value="1.0.9"/> - <identifier value="com.sun.reportdesigner"/> - <dependencies> - <OpenOffice.org-minimal-version value="3.0" d:name="OpenOffice.org 3.0"/> - </dependencies> - <publisher> - <name xlink:href="http://www.sun.com/staroffice" lang="en">Sun Microsystems, Inc.</name> - </publisher> -</description> diff --git a/reportdesign/util/makefile.mk b/reportdesign/util/makefile.mk index ffdb93c2e..6faf7b460 100644 --- a/reportdesign/util/makefile.mk +++ b/reportdesign/util/makefile.mk @@ -37,21 +37,10 @@ TARGET2=$(TARGET)ui GEN_HID=TRUE GEN_HID_OTHER=TRUE -EXTENSION_VERSION_BASE=1.0.9 -.IF "$(PRODUCT)" != "" - EXTENSION_VERSION=$(EXTENSION_VERSION_BASE) -.ELSE - EXTENSION_VERSION=$(EXTENSION_VERSION_BASE).$(BUILD) -.ENDIF - # --- Settings ---------------------------------- -.INCLUDE : makefile.pmk +.INCLUDE : settings.mk # ------------------------------------------------------------------ -# calready set in util$/makefile.pmk -# EXTENSIONNAME:=sun-report-builder -EXTENSION_ZIPNAME:=sun-report-builder - # --- reportdesign core (rpt) ----------------------------------- LIB1TARGET=$(SLB)$/$(TARGET).lib @@ -217,107 +206,7 @@ SHL3DEF= $(MISC)$/$(SHL3TARGET).def DEF3NAME=$(SHL3TARGET) -# create Extension ----------------------------- - -.IF "$(SOLAR_JAVA)"!="" - -XMLFILES = $(EXTENSIONDIR)$/META-INF$/manifest.xml - -# DESCRIPTION_SRC is the source file which is copied into the extension -# It is defaulted to "description.xml", but we want to pre-process it, so we use an intermediate -# file -DESCRIPTION_SRC = $(MISC)$/description.xml - -COMPONENT_MERGED_XCU= \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Setup.xcu \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/DataAccess.xcu \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/ReportDesign.xcu \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/ExtendedColorScheme.xcu \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/Embedding.xcu \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/Paths.xcu \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/Accelerators.xcu \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/TypeDetection$/Filter.xcu \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/TypeDetection$/Types.xcu \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/UI$/ReportCommands.xcu \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/UI$/Controller.xcu \ - $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/UI$/DbReportWindowState.xcu \ - $(EXTENSIONDIR)$/registry$/schema$/org$/openoffice$/Office$/UI$/DbReportWindowState.xcs \ - $(EXTENSIONDIR)$/registry$/schema$/org$/openoffice$/Office$/UI$/ReportCommands.xcs \ - $(EXTENSIONDIR)$/registry$/schema$/org$/openoffice$/Office$/ReportDesign.xcs - -COMPONENT_OTR_FILES= \ - $(EXTENSIONDIR)$/template$/en-US$/wizard$/report$/default.otr - -COMPONENT_IMAGES= \ - $(EXTENSIONDIR)$/images$/em42.png \ - $(EXTENSIONDIR)$/images$/em42_hc.png - -COMPONENT_HTMLFILES = $(EXTENSIONDIR)$/THIRDPARTYREADMELICENSE.html \ - $(EXTENSIONDIR)$/readme_en-US.html \ - $(EXTENSIONDIR)$/readme_en-US.txt - -COMPONENT_JARFILES = \ - $(EXTENSIONDIR)$/sun-report-builder.jar - -COMPONENT_HELP= \ - $(EXTENSIONDIR)$/help$/component.txt - -# .jar files from solver -COMPONENT_EXTJARFILES = \ - $(EXTENSIONDIR)$/sun-report-builder.jar \ - $(EXTENSIONDIR)$/reportbuilderwizard.jar -.IF "$(SYSTEM_JFREEREPORT)" != "YES" -COMPONENT_EXTJARFILES += \ - $(EXTENSIONDIR)$/flute-1.3-jfree-20061107.jar \ - $(EXTENSIONDIR)$/jcommon-1.0.10.jar \ - $(EXTENSIONDIR)$/jcommon-serializer-0.2.0.jar \ - $(EXTENSIONDIR)$/libfonts-0.3.3.jar \ - $(EXTENSIONDIR)$/libformula-0.1.14.jar \ - $(EXTENSIONDIR)$/liblayout-0.2.8.jar \ - $(EXTENSIONDIR)$/libloader-0.3.6.jar \ - $(EXTENSIONDIR)$/librepository-0.1.4.jar \ - $(EXTENSIONDIR)$/libxml-0.9.9.jar \ - $(EXTENSIONDIR)$/pentaho-reporting-flow-engine-0.9.2.jar \ - $(EXTENSIONDIR)$/sac.jar -.ENDIF - -COMPONENT_MANIFEST_GENERIC:=TRUE -COMPONENT_MANIFEST_SEARCHDIR:=registry - -# make sure to add your custom files here -EXTENSION_PACKDEPS=$(COMPONENT_EXTJARFILES) $(COMPONENT_HTMLFILES) $(COMPONENT_OTR_FILES) $(COMPONENT_HELP) $(COMPONENT_IMAGES) - # --- Targets ---------------------------------- -.INCLUDE : extension_pre.mk -.INCLUDE : target.mk -.INCLUDE : extension_post.mk - -$(EXTENSIONDIR)$/%.jar : $(SOLARBINDIR)$/%.jar - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -$(EXTENSIONDIR)$/readme_en-US.% : $(PRJ)$/license$/readme_en-US.% - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -$(EXTENSIONDIR)$/images$/%.png : $(PRJ)$/images$/%.png - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -$(EXTENSIONDIR)$/THIRDPARTYREADMELICENSE.html : $(PRJ)$/license$/THIRDPARTYREADMELICENSE.html - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -$(COMPONENT_HELP) : $$(@:f) - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - -$(DESCRIPTION_SRC): description.xml - +-$(RM) $@ - $(TYPE) description.xml | $(SED) "s/#VERSION#/$(EXTENSION_VERSION)/" > $@ - -.ELSE # "$(SOLAR_JAVA)"!="" .INCLUDE : target.mk -.ENDIF # "$(SOLAR_JAVA)"!="" diff --git a/reportdesign/util/makefile.pmk b/reportdesign/util/makefile.pmk deleted file mode 100644 index 87409c959..000000000 --- a/reportdesign/util/makefile.pmk +++ /dev/null @@ -1,70 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.pmk,v $ -# -# $Revision: 1.6 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -XSLDIR=$(SOLARXMLDIR)$/processing -ABSXCSROOT=$(PWD)$/$(MISC)$/$(EXTNAME) -# ABSXCSROOT=$(MISC)$/$(EXTNAME) -XCSROOT=.. -# XCSROOT=$(SOLARXMLDIR) -# ABSXCSROOT=$(SOLARXMLDIR) -DTDDIR=$(SOLARXMLDIR) -PROCESSOUT=$(MISC)$/$(EXTNAME) -PROCESSORDIR=$(SOLARBINDIR) - - -# no validation by inspector class -NO_INSPECTION=TRUE - -JAVAPREPRO= -.IF "$(JDK_VERSION)" == "110" -JAVAPREPRO=-jdk11 -.ENDIF -.IF "$(PRODUCT)" != "" -JAVAPREPRO=$(JAVAPREPRO) + " -product" -.ENDIF - -# --- Settings ----------------------------------------------------- - -EXTENSIONNAME:=sun-report-builder - -.INCLUDE : settings.mk - -NOUNODOC= -BUILD_URD_ONLY=TRUE -LOCALIDLFILES=TRUE -URDDOC=TRUE - -.IF "$(OS)"=="SOLARIS" || "$(OS)"=="FREEBSD" -.IF "$(CPU)"=="I" -UNOIDL=unoidl -.ENDIF -.ENDIF - diff --git a/reportdesign/util/manifest.xml b/reportdesign/util/manifest.xml deleted file mode 100644 index 8ea30b6ad..000000000 --- a/reportdesign/util/manifest.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd"> -<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest"> - <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=Java" - manifest:full-path="sun-report-builder.jar"/> - <manifest:file-entry manifest:media-type="application/vnd.sun.star.package-bundle-description" - manifest:full-path="help/component.txt"/> diff --git a/reportdesign/util/target.pmk b/reportdesign/util/target.pmk deleted file mode 100644 index 42cc9e453..000000000 --- a/reportdesign/util/target.pmk +++ /dev/null @@ -1,38 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: target.pmk,v $ -# -# $Revision: 1.3 $ -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org 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 version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -REGISTRYCHECKFLAG=$(MISC)$/registrycheck.flag -$(OUT)$/misc$/$(TARGET).idls: makefile.mk - +-$(RM) $@ - +-$(RM) $(REGISTRYCHECKFLAG) - +$(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@ - -ALLTAR: $(OUT)$/misc$/$(TARGET).idls - |