Hi devs,
I propose to remove the following templates from
web/standard/src/main/webapp/templates/:
* direct.vm
* hiddenobject.vm
* plaincode.vm
* printheader.vm
* rights.vm
* viewobject.vm
These templates have been last modified in 2005-2008 and don't seem to
be used anywhere (any more) - please let me know if I'm wrong. Some of
them also have security issues that are hard to fix.
I'm +1 for removing them in 2.5M2
WDYT?
Thanks,
Alex
Hi,
I'd like to add interwiki support in XWiki Syntax 2.0 and 2.1.
I'm proposing to add the interwiki definitions to xwiki.properties using the format:
rendering.interWikiDefinitions = alias1=http://url1/
rendering.interWikiDefinitions = aliasN=http://urlN/
Then it's used like this for XWiki Syntax 2.1:
[[interwiki:alias1:path]]
For XWiki Syntax 2.0:
[[path@alias1]]
This generates in HTML:
http://url1/path
I have this already implemented, waiting to commit.
Thanks
-Vincent
Hi!
I'm trying to understand the Query Guide available at
http://xpescaderias.environmentalchange.net/xwiki/bin/view/Species/SpeciesC…
but still failing to get an answer to a problem.
I navigate to a document with this query...
#set($query = ", BaseObject as obj, LargeStringProperty as prop where
doc.fullName = obj.name and obj.className='Users.PdrUserClass' and
obj.id=prop.id.id and prop.id.name='Species' and prop.value like '" +
$species + "' order by doc.fullName asc")
I would like to set the value of $species to the value of the property
GalicianName of the class Species.SpeciesClass instantiated in this
document.
Please, could anybody help me to solve this doubt? Thanks!
Ricardo
--
Ricardo Rodríguez
CTO
eBioTIC.
Life Sciences, Data Modeling and Information Management Systems
On Sep 29, 2010, at 11:36 PM, lucaa (SVN) wrote:
> Author: lucaa
> Date: 2010-09-29 23:36:42 +0200 (Wed, 29 Sep 2010)
> New Revision: 31474
>
> Added:
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/pom.xml
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/src/main/java/org/xwiki/rendering/internal/macro/container/ColumnStyle.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/src/main/java/org/xwiki/rendering/internal/macro/container/ColumnsLayoutManager.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/src/main/java/org/xwiki/rendering/internal/macro/container/ContainerMacro.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/src/main/java/org/xwiki/rendering/macro/container/ContainerMacroParameters.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/src/main/java/org/xwiki/rendering/macro/container/LayoutManager.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/src/test/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/src/test/java/org/xwiki/rendering/RenderingTests.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/src/test/resources/macrocontainer4.test
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-dashboard/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-dashboard/pom.xml
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-dashboard/src/main/java/org/xwiki/rendering/internal/macro/dashboard/DashboardMacro.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-dashboard/src/main/java/org/xwiki/rendering/macro/dashboard/DashboardMacroParameters.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-dashboard/src/test/
> Removed:
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/pom.xml
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/src/main/java/org/xwiki/rendering/internal/macro/container/ColumnStyle.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/src/main/java/org/xwiki/rendering/internal/macro/container/ColumnsLayoutManager.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/src/main/java/org/xwiki/rendering/internal/macro/container/ContainerMacro.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/src/main/java/org/xwiki/rendering/macro/container/ContainerMacroParameters.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/src/main/java/org/xwiki/rendering/macro/container/LayoutManager.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-container/src/test/java/org/xwiki/rendering/RenderingTests.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-dashboard/pom.xml
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-dashboard/src/main/java/org/xwiki/rendering/internal/macro/dashboard/DashboardMacro.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-dashboard/src/main/java/org/xwiki/rendering/macro/dashboard/DashboardMacroParameters.java
> Modified:
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/pom.xml
> Log:
> XWIKI-5544: Create container macro that allows various layouts and decoration for contained objects
> XWIKI-5545: Commit initial version of the dashboard macro, that displays the contents on a columns dashboard
> * Moved the container and dashboard implementations from contrib/sandbox to the platform.
Note for the future: Maybe we'll have a platform/core/xwiki-gadget/ top level module in which we could put these macros.
Thanks
-Vincent
Could be interesting for our gadget impl.
Thanks
-Vincent
Begin forwarded message:
> From: Paul Lindner <lindner(a)apache.org>
> Date: September 29, 2010 8:38:56 PM GMT+02:00
> To: announce(a)apache.org
> Cc: dev(a)shindig.apache.org
> Subject: [ANN] Apache Shindig 2.0.0 released
>
> The Apache Shindig team is proud to announce the release of Apache
> Shindig, version 2.0.0
>
> Apache Shindig is an OpenSocial reference implementation in wide use
> by both social networks and enterprise software.
>
> Version 2.0.0 marks a major upgrade over the last previous stable
> release - 1.0.1. This release supports most of the OpenSocial 1.0
> specification. To accomplish this most of the interfaces have been
> extensively refactored and all of the subsystems have been cleaned up
> and revamped.
>
> Major new features include:
> * Support for Opensocial 0.9 and 1.0 features
> * New javascript osapi
> * OpenSocial Templates
> * Data Pipelining
> * Experimental Support in the shindig-extras module for:
> * Activity Streams Support
> * PubSub-2 support
> * Google Wave gadgets support
> * Opensocial Virtual Currency and Payments
> * Opensocial Groups Support
> * and much more.
>
> Developer Improvements include:
> * Much improved Guice extensibility. It's now much easier to layer
> new functionality
> into Shindig.
> * New shindig-extras module that includes features that are not yet
> standardized
> * All dependencies synced to the latest revisions.
>
> The release is available here:
>
> http://www.apache.org/dyn/closer.cgi/shindig/2.0.0
>
> You can find out more information about Apache Shindig including how
> to contribute at the project website at http://shindig.apache.org/
Hi all,
speaking of module reorganization, I would like to commit the following
layout (which is more consistent wrt the current one where everything is
in the toplevel directory)
xwiki-rest-api (toplevel module)
|
+- xwiki-rest-api-server (was xwiki-rest)
|
+- xwiki-rest-api-model (was xwiki-rest-module)
Let me know if you have any concern about this layout
Thanks,
-Fabio
hmmm IMO this macro should be in the xwiki-office/ directory along with the other 2 projects.
WDYT?
Thanks
-Vincent
On Sep 28, 2010, at 5:52 PM, mflorea (SVN) wrote:
> Author: mflorea
> Date: 2010-09-28 17:52:58 +0200 (Tue, 28 Sep 2010)
> New Revision: 31441
>
> Added:
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/pom.xml
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/macro/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/macro/office/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/macro/office/OfficeMacro.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/macro/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/macro/office/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/macro/office/OfficeMacroParameters.java
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/resources/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/resources/META-INF/
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/resources/META-INF/components.txt
> Modified:
> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/pom.xml
> Log:
> XWIKI-5538: Create a macro to view office attachments
>
>
> Modified: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/pom.xml
> ===================================================================
> --- platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/pom.xml 2010-09-28 14:59:38 UTC (rev 31440)
> +++ platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/pom.xml 2010-09-28 15:52:58 UTC (rev 31441)
> @@ -116,5 +116,6 @@
> <module>xwiki-rendering-macro-ruby</module>
> <module>xwiki-rendering-macro-python</module>
> <module>xwiki-rendering-macro-php</module>
> + <module>xwiki-rendering-macro-office</module>
> </modules>
> </project>
>
> Added: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/pom.xml
> ===================================================================
> --- platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/pom.xml (rev 0)
> +++ platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/pom.xml 2010-09-28 15:52:58 UTC (rev 31441)
> @@ -0,0 +1,58 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +
> +<!--
> + *
> + * See the NOTICE file distributed with this work for additional
> + * information regarding copyright ownership.
> + *
> + * This is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU Lesser General Public License as
> + * published by the Free Software Foundation; either version 2.1 of
> + * the License, or (at your option) any later version.
> + *
> + * This software is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this software; if not, write to the Free
> + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
> + * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
> + *
> +-->
> +
> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd">
> + <parent>
> + <artifactId>xwiki-core-rendering-macros-parent</artifactId>
> + <groupId>org.xwiki.platform</groupId>
> + <version>2.5-SNAPSHOT</version>
> + </parent>
> + <modelVersion>4.0.0</modelVersion>
> + <artifactId>xwiki-core-rendering-macro-office</artifactId>
> + <name>XWiki Platform - Core - Rendering - Macro - Office</name>
> + <version>2.5-SNAPSHOT</version>
> + <description>View office attachments (doc, ppt, xls, odt, odp, ods etc.) inside wiki pages without downloading or
> + importing them.</description>
> + <dependencies>
> + <dependency>
> + <groupId>org.xwiki.platform</groupId>
> + <artifactId>xwiki-core-office-viewer</artifactId>
> + <version>${project.version}</version>
> + </dependency>
> + </dependencies>
> + <build>
> + <plugins>
> + <plugin>
> + <!-- Apply the Checkstyle configurations defined in the top level pom.xml file -->
> + <groupId>org.apache.maven.plugins</groupId>
> + <artifactId>maven-checkstyle-plugin</artifactId>
> + </plugin>
> + </plugins>
> + </build>
> + <properties>
> + <!-- Skip Clirr execution since this is the first release of this module. Remove once XE 2.5M2 is released. -->
> + <xwiki.clirr.skip>true</xwiki.clirr.skip>
> + </properties>
> +</project>
>
>
> Property changes on: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/pom.xml
> ___________________________________________________________________
> Added: svn:keywords
> + Author Id Revision HeadURL
> Added: svn:eol-style
> + native
>
> Added: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/macro/office/OfficeMacro.java
> ===================================================================
> --- platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/macro/office/OfficeMacro.java (rev 0)
> +++ platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/macro/office/OfficeMacro.java 2010-09-28 15:52:58 UTC (rev 31441)
> @@ -0,0 +1,108 @@
> +/*
> + * See the NOTICE file distributed with this work for additional
> + * information regarding copyright ownership.
> + *
> + * This is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU Lesser General Public License as
> + * published by the Free Software Foundation; either version 2.1 of
> + * the License, or (at your option) any later version.
> + *
> + * This software is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this software; if not, write to the Free
> + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
> + * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
> + */
> +package org.xwiki.rendering.internal.macro.office;
> +
> +import java.util.Collections;
> +import java.util.List;
> +import java.util.Map;
> +
> +import org.xwiki.bridge.DocumentAccessBridge;
> +import org.xwiki.component.annotation.Component;
> +import org.xwiki.component.annotation.Requirement;
> +import org.xwiki.model.EntityType;
> +import org.xwiki.model.reference.AttachmentReference;
> +import org.xwiki.model.reference.DocumentReference;
> +import org.xwiki.model.reference.EntityReferenceResolver;
> +import org.xwiki.office.viewer.OfficeViewer;
> +import org.xwiki.rendering.block.Block;
> +import org.xwiki.rendering.macro.AbstractMacro;
> +import org.xwiki.rendering.macro.MacroExecutionException;
> +import org.xwiki.rendering.macro.office.OfficeMacroParameters;
> +import org.xwiki.rendering.transformation.MacroTransformationContext;
> +
> +/**
> + * View office attachments (doc, ppt, xls, odt, odp, ods etc.) inside wiki pages without downloading or importing them.
> + *
> + * @version $Id$
> + * @since 2.5M2
> + */
> +@Component("office")
> +public class OfficeMacro extends AbstractMacro<OfficeMacroParameters>
> +{
> + /**
> + * The component used to resolve the attachment string reference relative to the current document reference.
> + */
> + @Requirement("explicit")
> + private EntityReferenceResolver<String> explicitStringEntityReferenceResolver;
> +
> + /**
> + * The component used to get the current document reference.
> + */
> + @Requirement
> + private DocumentAccessBridge documentAccessBridge;
> +
> + /**
> + * The component used to view the office attachments.
> + */
> + @Requirement
> + private OfficeViewer officeViewer;
> +
> + /**
> + * Default constructor.
> + */
> + public OfficeMacro()
> + {
> + super("Office Document Viewer", "View office attachments (doc, ppt, xls, odt, odp, ods etc.) inside "
> + + "wiki pages without downloading or importing them.", OfficeMacroParameters.class);
> +
> + setDefaultCategory(DEFAULT_CATEGORY_CONTENT);
> + }
> +
> + /**
> + * {@inheritDoc}
> + *
> + * @see AbstractMacro#execute(Object, String, MacroTransformationContext)
> + */
> + public List<Block> execute(OfficeMacroParameters parameters, String content, MacroTransformationContext context)
> + throws MacroExecutionException
> + {
> + DocumentReference currentDocumentReference = documentAccessBridge.getCurrentDocumentReference();
> + AttachmentReference attachmentReference =
> + new AttachmentReference(explicitStringEntityReferenceResolver.resolve(parameters.getAttachment(),
> + EntityType.ATTACHMENT, currentDocumentReference));
> + Map<String, String> viewParameters =
> + Collections.singletonMap("filterStyles", String.valueOf(parameters.isFilterStyles()));
> + try {
> + return officeViewer.createView(attachmentReference, viewParameters).getChildren();
> + } catch (Exception e) {
> + throw new MacroExecutionException("Failed to view office attachment.", e);
> + }
> + }
> +
> + /**
> + * {@inheritDoc}
> + *
> + * @see AbstractMacro#supportsInlineMode()
> + */
> + public boolean supportsInlineMode()
> + {
> + return false;
> + }
> +}
>
>
> Property changes on: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/macro/office/OfficeMacro.java
> ___________________________________________________________________
> Added: svn:keywords
> + Author Id Revision HeadURL
> Added: svn:eol-style
> + native
>
> Added: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/macro/office/OfficeMacroParameters.java
> ===================================================================
> --- platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/macro/office/OfficeMacroParameters.java (rev 0)
> +++ platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/macro/office/OfficeMacroParameters.java 2010-09-28 15:52:58 UTC (rev 31441)
> @@ -0,0 +1,89 @@
> +/*
> + * See the NOTICE file distributed with this work for additional
> + * information regarding copyright ownership.
> + *
> + * This is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU Lesser General Public License as
> + * published by the Free Software Foundation; either version 2.1 of
> + * the License, or (at your option) any later version.
> + *
> + * This software is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this software; if not, write to the Free
> + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
> + * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
> + */
> +package org.xwiki.rendering.macro.office;
> +
> +import org.xwiki.properties.annotation.PropertyDescription;
> +import org.xwiki.properties.annotation.PropertyMandatory;
> +
> +/**
> + * Parameters for the {@link org.xwiki.rendering.internal.macro.office.OfficeMacro}.
> + *
> + * @version $Id$
> + * @since 2.5M2
> + */
> +public class OfficeMacroParameters
> +{
> + /**
> + * The office attachment to be viewed. Use an attachment string reference to specify which office file should be
> + * viewed: {@code file.ppt}, {@code Page(a)file.doc}, {@code Space.Page(a)file.xls} or {@code wiki:Space.Page@file.odt}.
> + */
> + private String attachment;
> +
> + /**
> + * Whether to filter in-line CSS styles present in the HTML content produced by the OpenOffice server. Office
> + * content is usually better integrated in the host wiki page when styles are filtered.
> + * <p>
> + * Styles are filtered by default.
> + */
> + private boolean filterStyles = true;
> +
> + /**
> + * @return a string reference to the office attachment to be viewed
> + */
> + public String getAttachment()
> + {
> + return attachment;
> + }
> +
> + /**
> + * Sets the office attachment to be viewed.
> + *
> + * @param attachment an attachment string reference
> + */
> + @PropertyDescription("The office attachment to be viewed. Use an attachment string reference to specify which "
> + + "office file should be viewed: file.ppt, Page(a)file.doc, Space.Page(a)file.xls or wiki:Space.Page@file.odt.")
> + @PropertyMandatory
> + public void setAttachment(String attachment)
> + {
> + this.attachment = attachment;
> + }
> +
> + /**
> + * @return {@code true} if the CSS styles present in the HTML content produces by the OpenOffice server are
> + * filtered, {@code false} otherwise
> + */
> + public boolean isFilterStyles()
> + {
> + return filterStyles;
> + }
> +
> + /**
> + * Sets whether to filter in-line CSS styles present in the HTML content produced by the OpenOffice server.
> + *
> + * @param filterStyles {@code true} to filter the CSS style present in the HTML content produces by the OpenOffice
> + * server, {@code false} otherwise
> + */
> + @PropertyDescription("Whether to filter in-line CSS styles present in the HTML content produced by the OpenOffice "
> + + "server. Office content is usually better integrated in the host wiki page when styles are filtered.")
> + public void setFilterStyles(boolean filterStyles)
> + {
> + this.filterStyles = filterStyles;
> + }
> +}
>
>
> Property changes on: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/macro/office/OfficeMacroParameters.java
> ___________________________________________________________________
> Added: svn:keywords
> + Author Id Revision HeadURL
> Added: svn:eol-style
> + native
>
> Added: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/resources/META-INF/components.txt
> ===================================================================
> --- platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/resources/META-INF/components.txt (rev 0)
> +++ platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/resources/META-INF/components.txt 2010-09-28 15:52:58 UTC (rev 31441)
> @@ -0,0 +1 @@
> +org.xwiki.rendering.internal.macro.office.OfficeMacro
> \ No newline at end of file
>
>
> Property changes on: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/resources/META-INF/components.txt
> ___________________________________________________________________
> Added: svn:eol-style
> + native
On Tue, Sep 28, 2010 at 18:00, Vincent Massol <vincent(a)massol.net> wrote:
> hmmm IMO this macro should be in the xwiki-office/ directory along with the other 2 projects.
>
> WDYT?
+1 it's not really a standard standalone macro but more one of the
office module interfaces
>
> Thanks
> -Vincent
>
> On Sep 28, 2010, at 5:52 PM, mflorea (SVN) wrote:
>
>> Author: mflorea
>> Date: 2010-09-28 17:52:58 +0200 (Tue, 28 Sep 2010)
>> New Revision: 31441
>>
>> Added:
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/pom.xml
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/macro/
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/macro/office/
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/macro/office/OfficeMacro.java
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/macro/
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/macro/office/
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/macro/office/OfficeMacroParameters.java
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/resources/
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/resources/META-INF/
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/resources/META-INF/components.txt
>> Modified:
>> platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/pom.xml
>> Log:
>> XWIKI-5538: Create a macro to view office attachments
>>
>>
>> Modified: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/pom.xml
>> ===================================================================
>> --- platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/pom.xml 2010-09-28 14:59:38 UTC (rev 31440)
>> +++ platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/pom.xml 2010-09-28 15:52:58 UTC (rev 31441)
>> @@ -116,5 +116,6 @@
>> <module>xwiki-rendering-macro-ruby</module>
>> <module>xwiki-rendering-macro-python</module>
>> <module>xwiki-rendering-macro-php</module>
>> + <module>xwiki-rendering-macro-office</module>
>> </modules>
>> </project>
>>
>> Added: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/pom.xml
>> ===================================================================
>> --- platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/pom.xml (rev 0)
>> +++ platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/pom.xml 2010-09-28 15:52:58 UTC (rev 31441)
>> @@ -0,0 +1,58 @@
>> +<?xml version="1.0" encoding="UTF-8"?>
>> +
>> +<!--
>> + *
>> + * See the NOTICE file distributed with this work for additional
>> + * information regarding copyright ownership.
>> + *
>> + * This is free software; you can redistribute it and/or modify it
>> + * under the terms of the GNU Lesser General Public License as
>> + * published by the Free Software Foundation; either version 2.1 of
>> + * the License, or (at your option) any later version.
>> + *
>> + * This software is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>> + * Lesser General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU Lesser General Public
>> + * License along with this software; if not, write to the Free
>> + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
>> + * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
>> + *
>> +-->
>> +
>> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd">
>> + <parent>
>> + <artifactId>xwiki-core-rendering-macros-parent</artifactId>
>> + <groupId>org.xwiki.platform</groupId>
>> + <version>2.5-SNAPSHOT</version>
>> + </parent>
>> + <modelVersion>4.0.0</modelVersion>
>> + <artifactId>xwiki-core-rendering-macro-office</artifactId>
>> + <name>XWiki Platform - Core - Rendering - Macro - Office</name>
>> + <version>2.5-SNAPSHOT</version>
>> + <description>View office attachments (doc, ppt, xls, odt, odp, ods etc.) inside wiki pages without downloading or
>> + importing them.</description>
>> + <dependencies>
>> + <dependency>
>> + <groupId>org.xwiki.platform</groupId>
>> + <artifactId>xwiki-core-office-viewer</artifactId>
>> + <version>${project.version}</version>
>> + </dependency>
>> + </dependencies>
>> + <build>
>> + <plugins>
>> + <plugin>
>> + <!-- Apply the Checkstyle configurations defined in the top level pom.xml file -->
>> + <groupId>org.apache.maven.plugins</groupId>
>> + <artifactId>maven-checkstyle-plugin</artifactId>
>> + </plugin>
>> + </plugins>
>> + </build>
>> + <properties>
>> + <!-- Skip Clirr execution since this is the first release of this module. Remove once XE 2.5M2 is released. -->
>> + <xwiki.clirr.skip>true</xwiki.clirr.skip>
>> + </properties>
>> +</project>
>>
>>
>> Property changes on: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/pom.xml
>> ___________________________________________________________________
>> Added: svn:keywords
>> + Author Id Revision HeadURL
>> Added: svn:eol-style
>> + native
>>
>> Added: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/macro/office/OfficeMacro.java
>> ===================================================================
>> --- platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/macro/office/OfficeMacro.java (rev 0)
>> +++ platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/macro/office/OfficeMacro.java 2010-09-28 15:52:58 UTC (rev 31441)
>> @@ -0,0 +1,108 @@
>> +/*
>> + * See the NOTICE file distributed with this work for additional
>> + * information regarding copyright ownership.
>> + *
>> + * This is free software; you can redistribute it and/or modify it
>> + * under the terms of the GNU Lesser General Public License as
>> + * published by the Free Software Foundation; either version 2.1 of
>> + * the License, or (at your option) any later version.
>> + *
>> + * This software is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>> + * Lesser General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU Lesser General Public
>> + * License along with this software; if not, write to the Free
>> + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
>> + * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
>> + */
>> +package org.xwiki.rendering.internal.macro.office;
>> +
>> +import java.util.Collections;
>> +import java.util.List;
>> +import java.util.Map;
>> +
>> +import org.xwiki.bridge.DocumentAccessBridge;
>> +import org.xwiki.component.annotation.Component;
>> +import org.xwiki.component.annotation.Requirement;
>> +import org.xwiki.model.EntityType;
>> +import org.xwiki.model.reference.AttachmentReference;
>> +import org.xwiki.model.reference.DocumentReference;
>> +import org.xwiki.model.reference.EntityReferenceResolver;
>> +import org.xwiki.office.viewer.OfficeViewer;
>> +import org.xwiki.rendering.block.Block;
>> +import org.xwiki.rendering.macro.AbstractMacro;
>> +import org.xwiki.rendering.macro.MacroExecutionException;
>> +import org.xwiki.rendering.macro.office.OfficeMacroParameters;
>> +import org.xwiki.rendering.transformation.MacroTransformationContext;
>> +
>> +/**
>> + * View office attachments (doc, ppt, xls, odt, odp, ods etc.) inside wiki pages without downloading or importing them.
>> + *
>> + * @version $Id$
>> + * @since 2.5M2
>> + */
>> +@Component("office")
>> +public class OfficeMacro extends AbstractMacro<OfficeMacroParameters>
>> +{
>> + /**
>> + * The component used to resolve the attachment string reference relative to the current document reference.
>> + */
>> + @Requirement("explicit")
>> + private EntityReferenceResolver<String> explicitStringEntityReferenceResolver;
>> +
>> + /**
>> + * The component used to get the current document reference.
>> + */
>> + @Requirement
>> + private DocumentAccessBridge documentAccessBridge;
>> +
>> + /**
>> + * The component used to view the office attachments.
>> + */
>> + @Requirement
>> + private OfficeViewer officeViewer;
>> +
>> + /**
>> + * Default constructor.
>> + */
>> + public OfficeMacro()
>> + {
>> + super("Office Document Viewer", "View office attachments (doc, ppt, xls, odt, odp, ods etc.) inside "
>> + + "wiki pages without downloading or importing them.", OfficeMacroParameters.class);
>> +
>> + setDefaultCategory(DEFAULT_CATEGORY_CONTENT);
>> + }
>> +
>> + /**
>> + * {@inheritDoc}
>> + *
>> + * @see AbstractMacro#execute(Object, String, MacroTransformationContext)
>> + */
>> + public List<Block> execute(OfficeMacroParameters parameters, String content, MacroTransformationContext context)
>> + throws MacroExecutionException
>> + {
>> + DocumentReference currentDocumentReference = documentAccessBridge.getCurrentDocumentReference();
>> + AttachmentReference attachmentReference =
>> + new AttachmentReference(explicitStringEntityReferenceResolver.resolve(parameters.getAttachment(),
>> + EntityType.ATTACHMENT, currentDocumentReference));
>> + Map<String, String> viewParameters =
>> + Collections.singletonMap("filterStyles", String.valueOf(parameters.isFilterStyles()));
>> + try {
>> + return officeViewer.createView(attachmentReference, viewParameters).getChildren();
>> + } catch (Exception e) {
>> + throw new MacroExecutionException("Failed to view office attachment.", e);
>> + }
>> + }
>> +
>> + /**
>> + * {@inheritDoc}
>> + *
>> + * @see AbstractMacro#supportsInlineMode()
>> + */
>> + public boolean supportsInlineMode()
>> + {
>> + return false;
>> + }
>> +}
>>
>>
>> Property changes on: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/internal/macro/office/OfficeMacro.java
>> ___________________________________________________________________
>> Added: svn:keywords
>> + Author Id Revision HeadURL
>> Added: svn:eol-style
>> + native
>>
>> Added: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/macro/office/OfficeMacroParameters.java
>> ===================================================================
>> --- platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/macro/office/OfficeMacroParameters.java (rev 0)
>> +++ platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/macro/office/OfficeMacroParameters.java 2010-09-28 15:52:58 UTC (rev 31441)
>> @@ -0,0 +1,89 @@
>> +/*
>> + * See the NOTICE file distributed with this work for additional
>> + * information regarding copyright ownership.
>> + *
>> + * This is free software; you can redistribute it and/or modify it
>> + * under the terms of the GNU Lesser General Public License as
>> + * published by the Free Software Foundation; either version 2.1 of
>> + * the License, or (at your option) any later version.
>> + *
>> + * This software is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>> + * Lesser General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU Lesser General Public
>> + * License along with this software; if not, write to the Free
>> + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
>> + * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
>> + */
>> +package org.xwiki.rendering.macro.office;
>> +
>> +import org.xwiki.properties.annotation.PropertyDescription;
>> +import org.xwiki.properties.annotation.PropertyMandatory;
>> +
>> +/**
>> + * Parameters for the {@link org.xwiki.rendering.internal.macro.office.OfficeMacro}.
>> + *
>> + * @version $Id$
>> + * @since 2.5M2
>> + */
>> +public class OfficeMacroParameters
>> +{
>> + /**
>> + * The office attachment to be viewed. Use an attachment string reference to specify which office file should be
>> + * viewed: {@code file.ppt}, {@code Page(a)file.doc}, {@code Space.Page(a)file.xls} or {@code wiki:Space.Page@file.odt}.
>> + */
>> + private String attachment;
>> +
>> + /**
>> + * Whether to filter in-line CSS styles present in the HTML content produced by the OpenOffice server. Office
>> + * content is usually better integrated in the host wiki page when styles are filtered.
>> + * <p>
>> + * Styles are filtered by default.
>> + */
>> + private boolean filterStyles = true;
>> +
>> + /**
>> + * @return a string reference to the office attachment to be viewed
>> + */
>> + public String getAttachment()
>> + {
>> + return attachment;
>> + }
>> +
>> + /**
>> + * Sets the office attachment to be viewed.
>> + *
>> + * @param attachment an attachment string reference
>> + */
>> + @PropertyDescription("The office attachment to be viewed. Use an attachment string reference to specify which "
>> + + "office file should be viewed: file.ppt, Page(a)file.doc, Space.Page(a)file.xls or wiki:Space.Page@file.odt.")
>> + @PropertyMandatory
>> + public void setAttachment(String attachment)
>> + {
>> + this.attachment = attachment;
>> + }
>> +
>> + /**
>> + * @return {@code true} if the CSS styles present in the HTML content produces by the OpenOffice server are
>> + * filtered, {@code false} otherwise
>> + */
>> + public boolean isFilterStyles()
>> + {
>> + return filterStyles;
>> + }
>> +
>> + /**
>> + * Sets whether to filter in-line CSS styles present in the HTML content produced by the OpenOffice server.
>> + *
>> + * @param filterStyles {@code true} to filter the CSS style present in the HTML content produces by the OpenOffice
>> + * server, {@code false} otherwise
>> + */
>> + @PropertyDescription("Whether to filter in-line CSS styles present in the HTML content produced by the OpenOffice "
>> + + "server. Office content is usually better integrated in the host wiki page when styles are filtered.")
>> + public void setFilterStyles(boolean filterStyles)
>> + {
>> + this.filterStyles = filterStyles;
>> + }
>> +}
>>
>>
>> Property changes on: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/java/org/xwiki/rendering/macro/office/OfficeMacroParameters.java
>> ___________________________________________________________________
>> Added: svn:keywords
>> + Author Id Revision HeadURL
>> Added: svn:eol-style
>> + native
>>
>> Added: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/resources/META-INF/components.txt
>> ===================================================================
>> --- platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/resources/META-INF/components.txt (rev 0)
>> +++ platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/resources/META-INF/components.txt 2010-09-28 15:52:58 UTC (rev 31441)
>> @@ -0,0 +1 @@
>> +org.xwiki.rendering.internal.macro.office.OfficeMacro
>> \ No newline at end of file
>>
>>
>> Property changes on: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-office/src/main/resources/META-INF/components.txt
>> ___________________________________________________________________
>> Added: svn:eol-style
>> + native
>
> _______________________________________________
> devs mailing list
> devs(a)xwiki.org
> http://lists.xwiki.org/mailman/listinfo/devs
>
--
Thomas Mortagne
Hi devs,
Vincent suggested that I should rename xwiki-officeimporter and
xwiki-officepreview to xwiki-office-importer and xwiki-office-preview
respectively. The rules are:
* module name starts with "xwiki"
* separate words with - (dash) (e.g. xwiki-shared-tests)
* prefer short names (fewer words) (xwiki-csrf instead of xwiki-csrftoken)
* avoid generic words like "service", "manger" (e.g. xwiki-patch instead
of xwiki-patch-service)
I'm +1 for these rules. If you agree I'll rename the office modules.
Thanks,
Marius
Hi devs,
I'm going to create a macro for previewing office attachments. It's main
usage will be:
{{officepreview attachment="presentation.ppt" filterStyles="true"/}}
"officepreview" is a bit long for a macro name. "preview" is shorter but
is too generic and thus can be confusing. "preview" could be the name of
a more generic macro that previews any type of attachment, based on its
mime type (so not just office documents).
"attachment" is the only required parameter. It is also a bit long, but
"file", which is shorter, is confusing. Some users might try to preview
office documents from their file system or from the web.
"filterStyles" is optional, and defaults to false.
The office preview macro will be just a wrapper for the office preview
script service. This means no decorations (e.g. borders, headings, etc.)
will be added around the output of the script service:
{{velocity}}
{{html}}
$services.officepreview.preview($attachmentReference, $filterStyles)
{{/html}}
{{/velocity}}
I'm not sure if the office preview macro should be a wiki macro or a
Java macro. One disadvantage for wiki macros is
http://jira.xwiki.org/jira/browse/XWIKI-4262 . This means that the
attachment string reference must be resolve before calling the office
preview script service. Currently there's no clean way to resolve a
reference relative to a given document in velocity so I would have to
use groovy which raises programming rights issue. Alternative we can
extend the
http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-model/src/main…
.
There's nothing to customize so the power of wiki macros wouldn't be
used. You can create a wiki macro that wraps the office preview macro
and add decorations specific to your needs.
One the other hand, the advantages of a Java macro are not significant
either because the macro is just a simple wrapper for the office preview
script service.
WDYT?
Thanks,
Marius