我有一个 SharePoint Web 部件页面,页面查询字符串(在 URL 中)中有一个参数,我还有一个页面查看器 Web 部件(它实际上是 IFRAME 的指定网页),它显示了一个 Java 小程序。
有什么方法可以让 Java Applet 接收 SharePoint 查询字符串中的参数吗?
在 Web 部件中执行 Java 小程序的原因是允许将文件拖放到 Java 小程序上,并且参数显示文件在 SharePoint 文档中心中的保存位置。
我将不胜感激任何和所有的建议。
干杯
Nick
注释:
- 由于页面查看器 Web 部件周围的“墙”设置,Java Applet 无法直接读取共享点页面中的查询字符串。
- 我尝试在加载SharePoint页面时创建一个cookie,然后在加载Java小程序时读取cookie(在收到文件后,所以这不是一个计时问题),但它无法访问cookie(不同的域? )
I have a SharePoint webpart page, with a parameter in the page Querystring (in the URL), and I also have a Page Viewer webpart (which effectively IFRAME's the specified webpage), which shows a Java applet.
Is there any way I can get the parameter in the SharePoint Querystring to be recieved by the Java Applet ?
The reason for doing a Java applet in a webpart is to allow a file to be dragged and dropped onto the Java applet, and the parameter shows where the file would be saved in the SharePoint Document Centre.
I'd appreciate any and all suggestions.
Cheers
Nick
Notes:
- The Querystring in the sharepoint page cannot be read by the Java Applet directly, due to the 'walls' setup around the Page Viewer webpart.
- I've tried creating a cookie when the SharePoint page is loaded, then reading the cookie when the Java applet is loaded (upon recieving the file, so it's not a timing thing), but it can't access the cookie (different domains ?)
发布评论
评论(4)
找到此博客的链接其中介绍了如何将参数传递到内容编辑器 Web 部件,从而解决了问题。
Found a link to this blog which covers how to pass parameters to a content editor webpart, which then resolved the issue.
听起来您的两个网页从不同的域运行。在这种情况下,您需要使用跨域通信技巧之一来打破墙壁。
阅读这篇文章,
http://msdn.microsoft.com/en-us/ Library/bb735305.aspx
这是我最喜欢的方法。总而言之,
xd_helper Javascript 可以非常简单。看看 Google Friend Connect 使用的版本,
Facebook 使用更详细的版本,
http://static.ak.facebook.com/js/api_lib/v0.4/XdCommReceiver.js?2
Sounds like your two webpages run from different domains. In that case, you need to use one of the Cross-Domain Communication tricks to break the walls.
Read this article,
http://msdn.microsoft.com/en-us/library/bb735305.aspx
This is my favorite approach. To summarize it,
The xd_helper Javascript can be very simple. Look at the one used by Google Friend Connect,
Facebook uses a more verbose version,
http://static.ak.facebook.com/js/api_lib/v0.4/XdCommReceiver.js?2
SharePoint 和页面查看器 Web 部件可能不是这里直接的问题。正如您所说,您描述的“墙”是 HTML IFrame 标记。您可以将搜索重点放在小程序位于 IFrame 内时查询字符串是否可访问。
或者,为什么不使用内容编辑器 Web 部件?这允许您将任意 HTML 直接包含到页面中。不要通过查询字符串传递参数,而是通过 对象标记 传递参数:
您应该能够检索:
SharePoint and the Page Viewer Web Part probably aren't the issue here directly. As you state, the 'walls' that you describe are an HTML IFrame tag. You could focus your search on if the query string is accessible when the applet is within an IFrame.
Alternatively, why don't you use the Content Editor Web Part? That allows you to include any arbitrary HTML directly onto the page. Instead of passing parameters by query string, pass them through on the object tag:
You should be able to retrieve with:
您是否尝试过使用 JS 读取查询字符串,然后使用 document.writing 小程序的嵌入代码?
Have you tried reading the querystring using JS then document.writing the embed code for the applet?