diff options
author | David Ostrovsky <david@ostrovsky.org> | 2013-03-07 08:17:56 +0100 |
---|---|---|
committer | David Ostrovsky <David.Ostrovsky@gmx.de> | 2013-03-11 08:56:40 +0000 |
commit | 6f28efc2a8a559cc8c37aa883f4de0b59d4fc79c (patch) | |
tree | c99e9f01d5f52daad04aa1f51e3bc53e78c073fb /reportbuilder/java/org/libreoffice/report/function | |
parent | ab8f432b3382967f87967495b0b0e4c17f082da5 (diff) |
fdo#61726: rename report-builder package to org.libreoffice.report
To prevent future clashes with uno name space rename the
com.sun.star.report package to org.libreoffice.report.
Bump the version to 1.2.4.
Change-Id: Ia06cb7ad8c1528c1d5b5eeb70f1e4b2aa854b70f
Reviewed-on: https://gerrit.libreoffice.org/2578
Reviewed-by: David Ostrovsky <David.Ostrovsky@gmx.de>
Tested-by: David Ostrovsky <David.Ostrovsky@gmx.de>
Diffstat (limited to 'reportbuilder/java/org/libreoffice/report/function')
11 files changed, 373 insertions, 0 deletions
diff --git a/reportbuilder/java/org/libreoffice/report/function/metadata/Author-Function.properties b/reportbuilder/java/org/libreoffice/report/function/metadata/Author-Function.properties new file mode 100644 index 000000000000..a05ce8dad886 --- /dev/null +++ b/reportbuilder/java/org/libreoffice/report/function/metadata/Author-Function.properties @@ -0,0 +1,21 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# +# x-no-translate + +display-name=AUTHOR +description=Returns the author of the report. diff --git a/reportbuilder/java/org/libreoffice/report/function/metadata/Author-Function_en_US.properties b/reportbuilder/java/org/libreoffice/report/function/metadata/Author-Function_en_US.properties new file mode 100644 index 000000000000..a05ce8dad886 --- /dev/null +++ b/reportbuilder/java/org/libreoffice/report/function/metadata/Author-Function_en_US.properties @@ -0,0 +1,21 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# +# x-no-translate + +display-name=AUTHOR +description=Returns the author of the report. diff --git a/reportbuilder/java/org/libreoffice/report/function/metadata/AuthorFunction.java b/reportbuilder/java/org/libreoffice/report/function/metadata/AuthorFunction.java new file mode 100644 index 000000000000..dcd30e5f056b --- /dev/null +++ b/reportbuilder/java/org/libreoffice/report/function/metadata/AuthorFunction.java @@ -0,0 +1,48 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package org.libreoffice.report.function.metadata; + +import org.libreoffice.report.ReportEngineParameterNames; + +import org.pentaho.reporting.libraries.formula.EvaluationException; +import org.pentaho.reporting.libraries.formula.FormulaContext; +import org.pentaho.reporting.libraries.formula.LibFormulaErrorValue; +import org.pentaho.reporting.libraries.formula.function.Function; +import org.pentaho.reporting.libraries.formula.function.ParameterCallback; +import org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair; +import org.pentaho.reporting.libraries.formula.typing.coretypes.TextType; + +public class AuthorFunction implements Function +{ + + 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/reportbuilder/java/org/libreoffice/report/function/metadata/AuthorFunctionDescription.java b/reportbuilder/java/org/libreoffice/report/function/metadata/AuthorFunctionDescription.java new file mode 100644 index 000000000000..b4cf6e22fce7 --- /dev/null +++ b/reportbuilder/java/org/libreoffice/report/function/metadata/AuthorFunctionDescription.java @@ -0,0 +1,57 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package org.libreoffice.report.function.metadata; + +import org.pentaho.reporting.libraries.formula.function.AbstractFunctionDescription; +import org.pentaho.reporting.libraries.formula.function.FunctionCategory; +import org.pentaho.reporting.libraries.formula.typing.Type; +import org.pentaho.reporting.libraries.formula.typing.coretypes.TextType; + +public class AuthorFunctionDescription extends AbstractFunctionDescription +{ + + public AuthorFunctionDescription() + { + super("AUTHOR", "org.libreoffice.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/reportbuilder/java/org/libreoffice/report/function/metadata/MetaDataFunctionCategory.java b/reportbuilder/java/org/libreoffice/report/function/metadata/MetaDataFunctionCategory.java new file mode 100644 index 000000000000..3b6ac8a29413 --- /dev/null +++ b/reportbuilder/java/org/libreoffice/report/function/metadata/MetaDataFunctionCategory.java @@ -0,0 +1,33 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package org.libreoffice.report.function.metadata; + +import org.pentaho.reporting.libraries.formula.function.AbstractFunctionCategory; +import org.pentaho.reporting.libraries.formula.function.FunctionCategory; + +public class MetaDataFunctionCategory extends AbstractFunctionCategory +{ + + public static final FunctionCategory CATEGORY = new MetaDataFunctionCategory(); + + private MetaDataFunctionCategory() + { + super("org.libreoffice.report.function.metadata.category"); + } +} + diff --git a/reportbuilder/java/org/libreoffice/report/function/metadata/Title-Function.properties b/reportbuilder/java/org/libreoffice/report/function/metadata/Title-Function.properties new file mode 100644 index 000000000000..3c0039f6c105 --- /dev/null +++ b/reportbuilder/java/org/libreoffice/report/function/metadata/Title-Function.properties @@ -0,0 +1,21 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# +# x-no-translate + +display-name=TITLE +description=Returns the title of the report. diff --git a/reportbuilder/java/org/libreoffice/report/function/metadata/Title-Function_en_US.properties b/reportbuilder/java/org/libreoffice/report/function/metadata/Title-Function_en_US.properties new file mode 100644 index 000000000000..3c0039f6c105 --- /dev/null +++ b/reportbuilder/java/org/libreoffice/report/function/metadata/Title-Function_en_US.properties @@ -0,0 +1,21 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# +# x-no-translate + +display-name=TITLE +description=Returns the title of the report. diff --git a/reportbuilder/java/org/libreoffice/report/function/metadata/TitleFunction.java b/reportbuilder/java/org/libreoffice/report/function/metadata/TitleFunction.java new file mode 100644 index 000000000000..fdc7ed0ebc30 --- /dev/null +++ b/reportbuilder/java/org/libreoffice/report/function/metadata/TitleFunction.java @@ -0,0 +1,52 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package org.libreoffice.report.function.metadata; + +import org.libreoffice.report.ReportEngineParameterNames; + +import org.pentaho.reporting.libraries.formula.EvaluationException; +import org.pentaho.reporting.libraries.formula.FormulaContext; +import org.pentaho.reporting.libraries.formula.LibFormulaErrorValue; +import org.pentaho.reporting.libraries.formula.function.Function; +import org.pentaho.reporting.libraries.formula.function.ParameterCallback; +import org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair; +import org.pentaho.reporting.libraries.formula.typing.coretypes.TextType; + +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/reportbuilder/java/org/libreoffice/report/function/metadata/TitleFunctionDescription.java b/reportbuilder/java/org/libreoffice/report/function/metadata/TitleFunctionDescription.java new file mode 100644 index 000000000000..30d3d337b510 --- /dev/null +++ b/reportbuilder/java/org/libreoffice/report/function/metadata/TitleFunctionDescription.java @@ -0,0 +1,57 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package org.libreoffice.report.function.metadata; + +import org.pentaho.reporting.libraries.formula.function.AbstractFunctionDescription; +import org.pentaho.reporting.libraries.formula.function.FunctionCategory; +import org.pentaho.reporting.libraries.formula.typing.Type; +import org.pentaho.reporting.libraries.formula.typing.coretypes.TextType; + +public class TitleFunctionDescription extends AbstractFunctionDescription +{ + + public TitleFunctionDescription() + { + super("TITLE", "org.libreoffice.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/reportbuilder/java/org/libreoffice/report/function/metadata/category.properties b/reportbuilder/java/org/libreoffice/report/function/metadata/category.properties new file mode 100644 index 000000000000..39f24f271d1e --- /dev/null +++ b/reportbuilder/java/org/libreoffice/report/function/metadata/category.properties @@ -0,0 +1,21 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# +# x-no-translate + +display-name=Document Information +description=Contains functions to access document information. diff --git a/reportbuilder/java/org/libreoffice/report/function/metadata/category_en_US.properties b/reportbuilder/java/org/libreoffice/report/function/metadata/category_en_US.properties new file mode 100644 index 000000000000..76ea0bb4d77f --- /dev/null +++ b/reportbuilder/java/org/libreoffice/report/function/metadata/category_en_US.properties @@ -0,0 +1,21 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# +# x-no-translate + +display-name=MetaData +description=Contains functions about meta data |