General Actions:
Wiki: Google Summer of Code
▼:
Document Index
»
Space: XMPPIntegration
▼:
Document Index
»
Page: WebHome
<!-- Shidig Guice modules --> <context-param> <param-name>guice-modules</param-name> <param-value> org.apache.shindig.common.PropertiesModule: org.apache.shindig.gadgets.DefaultGuiceModule: org.apache.shindig.gadgets.oauth.OAuthModule: org.apache.shindig.common.cache.ehcache.EhCacheModule: org.xwiki.opensocial.social.XWSocialModule </param-value> </context-param>
<!-- Shindig filters --> <filter> <filter-name>authFilter</filter-name> <filter-class>org.apache.shindig.auth.AuthenticationServletFilter</filter-class> </filter>
<!-- Shindig filter mappings --> <filter-mapping> <filter-name>authFilter</filter-name> <url-pattern>/social/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>authFilter</filter-name> <url-pattern>/gadgets/ifr</url-pattern> </filter-mapping> <filter-mapping> <filter-name>authFilter</filter-name> <url-pattern>/gadgets/makeRequest</url-pattern> </filter-mapping> <filter-mapping> <filter-name>authFilter</filter-name> <url-pattern>/gadgets/api/rpc/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>authFilter</filter-name> <url-pattern>/gadgets/api/rest/*</url-pattern> </filter-mapping>
<!-- Shindig Guice listener --> <listener> <listener-class>org.apache.shindig.common.servlet.GuiceServletContextListener</listener-class> </listener>
<!-- Render a Gadget --> <servlet> <servlet-name>xml-to-html</servlet-name> <servlet-class> org.apache.shindig.gadgets.servlet.GadgetRenderingServlet </servlet-class> </servlet> <!-- Proxy --> <servlet> <servlet-name>proxy</servlet-name> <servlet-class> org.apache.shindig.gadgets.servlet.ProxyServlet </servlet-class> </servlet> <!-- makeRequest --> <servlet> <servlet-name>makeRequest</servlet-name> <servlet-class> org.apache.shindig.gadgets.servlet.MakeRequestServlet </servlet-class> </servlet> <servlet> <servlet-name>concat</servlet-name> <servlet-class> org.apache.shindig.gadgets.servlet.ConcatProxyServlet </servlet-class> </servlet> <!-- OAuth callback --> <servlet> <servlet-name>oauthCallback</servlet-name> <servlet-class> org.apache.shindig.gadgets.servlet.OAuthCallbackServlet </servlet-class> </servlet> <!-- Metadata RPC --> <servlet> <servlet-name>metadata</servlet-name> <servlet-class> org.apache.shindig.gadgets.servlet.RpcServlet </servlet-class> </servlet> <!-- javascript serving --> <servlet> <servlet-name>js</servlet-name> <servlet-class>org.apache.shindig.gadgets.servlet.JsServlet</servlet-class> </servlet> <!-- Serve social REST api --> <servlet> <servlet-name>socialRestapiServlet</servlet-name> <servlet-class> org.apache.shindig.protocol.DataServiceServlet </servlet-class> <init-param> <param-name>handlers</param-name> <param-value>org.apache.shindig.social.handlers</param-value> </init-param> </servlet> <!-- Serve social RPC api --> <servlet> <servlet-name>socialJsonRpcServlet</servlet-name> <servlet-class> org.xwiki.opensocial.social.XWikiShindigServlet </servlet-class> <init-param> <param-name>handlers</param-name> <param-value>org.apache.shindig.social.handlers</param-value> </init-param> </servlet> <!-- Serve gadgets RPC api --> <servlet> <servlet-name>gadgetsJsonRpcServlet</servlet-name> <servlet-class> org.apache.shindig.protocol.JsonRpcServlet </servlet-class> <init-param> <param-name>handlers</param-name> <param-value>org.apache.shindig.gadgets.handlers</param-value> </init-param> </servlet> <!-- Serve gadgets REST api --> <servlet> <servlet-name>gadgetsRestapiServlet</servlet-name> <servlet-class> org.apache.shindig.protocol.DataServiceServlet </servlet-class> <init-param> <param-name>handlers</param-name> <param-value>org.apache.shindig.gadgets.handlers</param-value> </init-param> </servlet>
<!-- Shindig servlet mappings --> <servlet-mapping> <servlet-name>js</servlet-name> <url-pattern>/gadgets/js/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>proxy</servlet-name> <url-pattern>/gadgets/proxy/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>makeRequest</servlet-name> <url-pattern>/gadgets/makeRequest</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>gadgetsJsonRpcServlet</servlet-name> <url-pattern>/gadgets/api/rpc/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>gadgetsRestapiServlet</servlet-name> <url-pattern>/gadgets/api/rest/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>concat</servlet-name> <url-pattern>/gadgets/concat</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>oauthCallback</servlet-name> <url-pattern>/gadgets/oauthcallback</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>xml-to-html</servlet-name> <url-pattern>/gadgets/ifr</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>metadata</servlet-name> <url-pattern>/gadgets/metadata</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>socialRestapiServlet</servlet-name> <url-pattern>/social/rest/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>socialJsonRpcServlet</servlet-name> <url-pattern>/social/rpc/*</url-pattern> </servlet-mapping>
<!-- The OpenSocial module --> <dependency> <groupId>org.xwiki.platform</groupId> <artifactId>xwiki-social-opensocial</artifactId> <version>1.0-SNAPSHOT</version> </dependency>
$xwiki.jsfx.use("js/xwiki/opensocial/json.js") $xwiki.jsfx.use("js/xwiki/opensocial/rpc.js") $xwiki.jsfx.use("js/xwiki/opensocial/cookies.js") $xwiki.jsfx.use("js/xwiki/opensocial/util.js") $xwiki.jsfx.use("js/xwiki/opensocial/gadgets.js") $xwiki.ssfx.use("js/xwiki/opensocial/gadgets.css") $xwiki.jsx.use("OpenSocial.Dashboard") ... ## Get all viewer apps #set($sql = ", BaseObject obj, StringProperty prop where doc.fullName=obj.name and obj.className='OpenSocialApplication.ApplicationClass' and prop.id.id=obj.id and prop.name='userId' and prop.value='$context.user' order by doc.date desc") ... <div id="layout-root" class="gadgets-layout-root"></div> ... <script> ... document.observe('xwiki:dom:loaded', function() { init(myapps); renderGadgets(); }); </script>
/** XWiki Ifr Dashboard Gadget **/
XWikiDashboardGadget = function(opt_params) {
gadgets.IfrGadget.call(this, opt_params);
};
XWikiDashboardGadget.inherits(gadgets.IfrGadget);
XWikiDashboardGadget.prototype.handleMaximize = function() {
window.location = this.fullAppUrl;
};
XWikiDashboardGadget.prototype.getTitleBarContent = function(continuation) {
continuation('<div id="' + this.cssClassTitleBar + '-' + this.id +
'" class="' + this.cssClassTitleBar + '"><span id="' +
this.getIframeId() + '_title" class="' +
this.cssClassTitle + '">' + (this.title ? this.title : 'Title') + '</span> | <span class="' +
this.cssClassTitleButtonBar +
'"><a href="#" onclick="gadgets.container.getGadget(' + this.id +
').handleOpenUserPrefsDialog();return false;" class="' + this.cssClassTitleButton +
'">settings</a> <a href="#" onclick="gadgets.container.getGadget(' +
this.id + ').handleToggle();return false;" class="' + this.cssClassTitleButton +
'">toggle</a> <a href="#" onclick="gadgets.container.getGadget(' +
this.id + ').handleMaximize();return false;" class="' + this.cssClassTitleButton +
'">see full app</a></span></div>');
};
gadgets.container.gadgetClass = XWikiDashboardGadget;
/** XWiki persistent UserPrefStore **/
gadgets.XWikiUserPrefStore = function() {
gadgets.UserPrefStore.call(this);
};
gadgets.XWikiUserPrefStore.inherits(gadgets.UserPrefStore);
gadgets.XWikiUserPrefStore.prototype.savePrefs = function(gadget) {
var pairs = [];
for (var name in gadget.getUserPrefs()) {
var value = gadget.getUserPref(name);
var pair = encodeURIComponent(name) + '=' + encodeURIComponent(value);
pairs.push(pair);
}
var params = pairs.join('&');
// store user prefs parameters
var url = gadget.fullAppUrl + "?xpage=saveuserprefs" + "&" + "params=" + encodeURIComponent(params);
new Ajax.Request(url,
{
method: 'get',
onSuccess: savePrefsAjaxSuccess
});
};
gadgets.XWikiUserPrefStore.prototype.getPrefs = function(gadget) {
var userPrefs = {};
var url = gadget.fullAppUrl + "?xpage=getuserprefs";
new Ajax.Request(url,
{
method: 'get',
onSuccess: getPrefsAjaxSuccess
});
return userPrefs;
};
gadgets.Container.prototype.userPrefStore = new gadgets.XWikiUserPrefStore();
/** Initialize XWiki Dashboard Container **/
function init(apps) {
gadgets.container.layoutManager = new gadgets.FloatLeftLayoutManager('layout-root');
for (var specUrl in apps) {
gadgets.container.addGadget(gadgets.container.createGadget({specUrl: specUrl, title: apps[specUrl].title, fullAppUrl: apps[specUrl].fullAppUrl}));
}
};
/** Render all gadgets on Dashboard **/
function renderGadgets() {
gadgets.container.renderGadgets();
};#set($appId = $doc.fullName)
#set($sql = "select fnp.value from XWikiDocument adoc, XWikiDocument udoc, BaseObject fo, BaseObject ao, StringProperty fnp, StringProperty uidp, StringProperty aidp where adoc.fullName=ao.name and udoc.fullName=fo.name and udoc.fullName='$context.user' and ao.className='OpenSocialApplication.ApplicationClass' and fo.className='XWiki.FriendClass' and uidp.id.id=ao.id and aidp.id.id=ao.id and fnp.id.id=fo.id and uidp.name='userId' and aidp.name='appId' and aidp.value='$appId' and fnp.name='friendName' and fnp.value=uidp.value")
#set($results = $xwiki.search($sql))XWikiCanvasGadget = function(opt_params) {
gadgets.IfrGadget.call(this, opt_params);
};
XWikiCanvasGadget.inherits(gadgets.IfrGadget);
XWikiCanvasGadget.prototype.getTitleBarContent = function(continuation) { continuation('');};
XWikiCanvasGadget.prototype.getUserPrefsDialogContent = function(continuation) { continuation('');};
gadgets.container.gadgetClass = XWikiCanvasGadget;
function canvasRenderGadget(specUrlVal) {
var app = gadgets.container.createGadget({specUrl: specUrlVal, width: "100%", height: "600"});
gadgets.container.setView("canvas");
gadgets.container.addGadget(app);
gadgets.container.layoutManager.setGadgetChromeIds(['gadget-chrome']);
gadgets.container.renderGadget(app);
}
If the user has customized the XE installation, he/she has to specify the wiki relative path to the server and the XML-RPC relative path. The default values are "/xwiki" and "/xmlrpc"
The XWiki Syntax is transformed in XHTML. If the page contains images that are attached to the current page or to another page, the images are downloaded locally and the user sees them when he edits the page.
When the user edits a page, can include also other images from the local machine.
These images will become attachments for the current page, if the page will be publish to the server.
Any other HTML created or opened with OpenOffice can be published. In this case, the user is requested to specify the name of the page and the space. where the current page will be published.
If the page contains pictures, these one become attachment for the page. Currently this operation is not optimal. All the pictures are sent to the server not only the modified ones.
Add a new space to the XWiki Server
Attach the current document to an XWiki page
The user can attached an opened OO Writer file, to an existing XWiki page, after he/she selects in the navigation panel the page that will be the parent.
Download attachments
The attachments can be downloaded to the local machine.
The user has to specify the location where the attachment will be downloaded.
"Hi Christina,
Sorry for the late answer but I have tried to look for a solution. Unfortunately I wasn't able to find anything what can help you here. The object you get via the DialogProvider service just implements XDialog and XTopWindow neither implements anything that you need. I fear that your workaround is currently the best available solution. Please write a request for enhancement and the owner to cd@openoffice.org. I hope that we can extend the implementation to support your use case."

mvn install
Open Office 3.0 -> Tools -> Extension Manager -> add (the zip output); Restart OpenOffice
The navigational panel is not in the right place,for now. I will do more research about another way to implement this control. If the dialog remains the only choice then some coordinates should be calculated.obj = xMCF.createInstanceWithContext("com.sun.star.awt.DialogProvider2", m_xContext); XDialogProvider2 xDialogProvider = (XDialogProvider2) UnoRuntime.queryInterface(XDialogProvider2.class, obj); XDialog xDialog = xDialogProvider.createDialogWithHandler(DialogURL, this); XControl dialogControl = (XControl) UnoRuntime.queryInterface(XControl.class, xDialog); XControlModel xBasicDialogModel = dialogControl.getModel(); Object dialog = xMCF.createInstanceWithContext("com.sun.star.awt.UnoControlDialog", m_xContext); XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, dialog); xControl.setModel(xBasicDialogModel); XToolkit xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class, xMCF.createInstanceWithContext( "com.sun.star.awt.Toolkit", m_xContext)); WindowDescriptor aDescriptor = new WindowDescriptor(); aDescriptor.Type = WindowClass.TOP; aDescriptor.WindowServiceName = ""; aDescriptor.ParentIndex = -1; aDescriptor.Parent = xToolkit.getDesktopWindow(); aDescriptor.WindowAttributes = WindowAttribute.BORDER | WindowAttribute.MOVEABLE | WindowAttribute.SIZEABLE | WindowAttribute.CLOSEABLE; XWindowPeer xPeer = xToolkit.createWindow(aDescriptor); XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xPeer); xWindow.setVisible(false); xControl.createPeer(xToolkit, xPeer); m_xDialog = (XDialog) UnoRuntime.queryInterface(XDialog.class, dialog); m_xControlContainer = (XControlContainer) UnoRuntime.queryInterface(XControlContainer.class, m_xDialog);