cogProvides APIs to integrate OpenGraph in XWiki
Developed by

slauriere, Manuel Leduc

Active Installs0
0 Votes
LicenseGNU Lesser General Public License 2.1

Installable with the Extension Manager


Script Service

Currently the API provides a single Script Service with a single method metas that return a Map of metadata derived from the content of the page as well as the XWiki.OpenGraph.Code.OpenGraphMetaClass XObjects from the page.



public class OpenGraphScriptService implements ScriptService
     * Retrieve the properties from the {@link OpenGraphMetaClassInitializer#XCLASS_DOCUMENT_REFERENCE} XObjects of the
     * current document. Some missing properties are automatically completed when missing: {@link #OG_URL_PROPERTY},
     * {@link #OG_IMAGE_PROPERTY}.
     * @return a map of open graph properties associated to one or many contents

   public Map<String, List<String>> metas()
       // ...

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).

You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.


Dependencies for this extension (org.xwiki.contrib:application-opengraph-api 1.2.1):

  • org.xwiki.platform:xwiki-platform-oldcore 10.11

Get Connected