如何使用HTML 5使XPage应用程序脱机工作

时间:2023-01-18 08:54:29

I am trying to make an xPages desktop application work offline, the challenge is how to make all the require resource available offline.

我试图使xPages桌面应用程序脱机工作,挑战是如何使所有需要的资源脱机使用。

i have created the following manifest file and specified the same in pageManifest .

我创建了以下清单文件,并在pageManifest中指定了相同的文件。

CACHE MANIFEST
#version: 0.0.15.7
jquery-1.10.2.min.js
angular.min.js
/DbPath/Angular.nsf/trashicon.gif
/DbPath/Angular.nsf/editicon.gif
/xsp/.ibmxspres/.mini/css/@Da&@Ib&2Tfxsp.css&2TfxspLTR.css&2TfxspSF.css.css
/xsp/.ibmxspres/dojoroot-1.6.1/dojo/dojo.js
/xsp/.ibmxspres/.mini/dojo/.en-us/@Iq.js
/DbPath/Angular.nsf/xsp/.ibmmodres/.css/bootstrap.min.css&custom.css
/DbPath/Angular.nsf/xsp/.ibmmodres/.js/jquery-1.10.2.min.js&bootstrap.min.js&angular.min.js&angularMisc.js

NETWORK:
/xsp/.ibmxspres/
/domjs/dojo-1.4.1/
/domjava/xsp/

I am not sure it is correct, it cache following image / Lib

我不确定它是否正确,它缓存在image / Lib之后

/DBPath/Angular.nsf/trashicon.gif

/DBPath/Angular.nsf/editicon.gif 

/xsp/.ibmxspres/dojoroot-1.6.1/dojo/dojo.js

/xsp/.ibmxspres/.mini/dojo/.en-us/@Iq.js

and the main page...

和主页......

but it does not cache the

但它没有缓存

/DBPath/Angular.nsf/xsp/.ibmmodres/.js/jquery-1.10.2.min.js&bootstrap.min.js&angular.min.js&angularMisc.js

which is important, may b i am doing it wrong. Also how can we cache the oneui theme . i am using Angular JS/JQuery which works fine when not cached, but it do not work with the manifest

这很重要,可能我做错了。另外我们如何缓存oneui主题。我正在使用Angular JS / JQuery,它在没有缓存时工作正常,但它不能与清单一起使用

if their is any simple example please share the link.

如果他们是任何简单的例子请分享链接。

4 个解决方案

#1


2  

What part of the app do you want to make available offline? If you're using full or partial updates, Server Side JavaScript and other server based stuff it cannot work offline.

您希望离线提供应用程序的哪个部分?如果您使用完整或部分更新,服务器端JavaScript和其他基于服务器的东西,它无法脱机工作。

#2


1  

Although this refers to Mobile apps it does have a sample showing you how to use HTML5 offline mode in XPages.

虽然这是指移动应用程序,但它确实有一个示例,向您展示如何在XPage中使用HTML5离线模式。

http://mobilecontrols.openntf.org

Offline.nsf contains basic HTML5 samples for how to do offline with XPages. MobileControlsOffline.nsf shows how to take a Dojo based mobile app offline.

Offline.nsf包含有关如何使用XPage脱机的基本HTML5示例。 MobileControlsOffline.nsf显示了如何使基于Dojo的移动应用程序脱机。

#3


0  

The definition of a manifest makes an interesting read, as well as the URL document with the section about valid URLS.

清单的定义进行了有趣的阅读,以及带有关于有效URLS的部分的URL文档。

As far as I know & is not a valid URL character if is isn't part of a parameter string that starts with ?.

据我所知,如果不是以?开头的参数字符串的一部分,则不是有效的URL字符。

So there are a set of actions you can try:

因此,您可以尝试一系列操作:

  • Switch off js/css combination. Since the files get cached locally anyway you don't benefit from it
  • 关闭js / css组合。由于文件无论如何都会在本地缓存,因此您无法从中受益

  • Try (it might work) to replace & in the manifest with &
  • 尝试(可能有效)用&替换清单中的&

Let us know how it goes.

让我们知道怎么回事。

#4


0  

I did some tests (using Domino Designer) with Firefox and Chrome and it seems that everything can be cached in these browsers. My sugestion:

我使用Firefox和Chrome进行了一些测试(使用Domino Designer),似乎所有内容都可以在这些浏览器中缓存。我的消化:

Instead of

/DBPath/Angular.nsf/xsp/.ibmmodres/.js/jquery-1.10.2.min.js&bootstrap.min.js&angular.min.js&angularMisc.js

Try a relative path without /

尝试没有/的相对路径

xsp/.ibmmodres/.js/jquery-1.10.2.min.js&bootstrap.min.js&angular.min.js&angularMisc.js

I used relative paths everytime. This is the cache manifest file used in my tests (all files were cached successfully):

我每次都使用相对路径。这是我的测试中使用的缓存清单文件(所有文件都已成功缓存):

CACHE MANIFEST
# 2013-01-07 v1.0.0
xsp/.ibmmodres/.js/js%2Fvendor%2Fmodernizr-2.6.2-respond-1.1.0.min.js&js%2Fvendor%2Fjquery-1.10.2.min.js&js%2Fvendor%2Fbootstrap.min.js&js%2Fvendor%2Fhandlebars.runtime-v1.1.2.js&js%2Fplugins.js&js%2Fmain.js
xsp/.ibmmodres/.css/css%2Fbootstrap.min.css&css%2Fbootstrap-theme.min.css&css%2Fmain.css
xsp/.ibmmodres/.js/jquery-1.10.2.min.map
/xsp/.ibmxspres/.mini/css/@Da&@Ib&2Tfxsp.css&2TfxspLTR.css&2TfxspSF.css.css
/xsp/.ibmxspres/dojoroot-1.6.1/dojo/dojo.js
/xsp/.ibmxspres/.mini/dojo/.es-es/@Iq.js
/xsp/.ibmxspres/.mini/dojo/.es/@Iq.js
NETWORK:
*

#1


2  

What part of the app do you want to make available offline? If you're using full or partial updates, Server Side JavaScript and other server based stuff it cannot work offline.

您希望离线提供应用程序的哪个部分?如果您使用完整或部分更新,服务器端JavaScript和其他基于服务器的东西,它无法脱机工作。

#2


1  

Although this refers to Mobile apps it does have a sample showing you how to use HTML5 offline mode in XPages.

虽然这是指移动应用程序,但它确实有一个示例,向您展示如何在XPage中使用HTML5离线模式。

http://mobilecontrols.openntf.org

Offline.nsf contains basic HTML5 samples for how to do offline with XPages. MobileControlsOffline.nsf shows how to take a Dojo based mobile app offline.

Offline.nsf包含有关如何使用XPage脱机的基本HTML5示例。 MobileControlsOffline.nsf显示了如何使基于Dojo的移动应用程序脱机。

#3


0  

The definition of a manifest makes an interesting read, as well as the URL document with the section about valid URLS.

清单的定义进行了有趣的阅读,以及带有关于有效URLS的部分的URL文档。

As far as I know & is not a valid URL character if is isn't part of a parameter string that starts with ?.

据我所知,如果不是以?开头的参数字符串的一部分,则不是有效的URL字符。

So there are a set of actions you can try:

因此,您可以尝试一系列操作:

  • Switch off js/css combination. Since the files get cached locally anyway you don't benefit from it
  • 关闭js / css组合。由于文件无论如何都会在本地缓存,因此您无法从中受益

  • Try (it might work) to replace & in the manifest with &
  • 尝试(可能有效)用&替换清单中的&

Let us know how it goes.

让我们知道怎么回事。

#4


0  

I did some tests (using Domino Designer) with Firefox and Chrome and it seems that everything can be cached in these browsers. My sugestion:

我使用Firefox和Chrome进行了一些测试(使用Domino Designer),似乎所有内容都可以在这些浏览器中缓存。我的消化:

Instead of

/DBPath/Angular.nsf/xsp/.ibmmodres/.js/jquery-1.10.2.min.js&bootstrap.min.js&angular.min.js&angularMisc.js

Try a relative path without /

尝试没有/的相对路径

xsp/.ibmmodres/.js/jquery-1.10.2.min.js&bootstrap.min.js&angular.min.js&angularMisc.js

I used relative paths everytime. This is the cache manifest file used in my tests (all files were cached successfully):

我每次都使用相对路径。这是我的测试中使用的缓存清单文件(所有文件都已成功缓存):

CACHE MANIFEST
# 2013-01-07 v1.0.0
xsp/.ibmmodres/.js/js%2Fvendor%2Fmodernizr-2.6.2-respond-1.1.0.min.js&js%2Fvendor%2Fjquery-1.10.2.min.js&js%2Fvendor%2Fbootstrap.min.js&js%2Fvendor%2Fhandlebars.runtime-v1.1.2.js&js%2Fplugins.js&js%2Fmain.js
xsp/.ibmmodres/.css/css%2Fbootstrap.min.css&css%2Fbootstrap-theme.min.css&css%2Fmain.css
xsp/.ibmmodres/.js/jquery-1.10.2.min.map
/xsp/.ibmxspres/.mini/css/@Da&@Ib&2Tfxsp.css&2TfxspLTR.css&2TfxspSF.css.css
/xsp/.ibmxspres/dojoroot-1.6.1/dojo/dojo.js
/xsp/.ibmxspres/.mini/dojo/.es-es/@Iq.js
/xsp/.ibmxspres/.mini/dojo/.es/@Iq.js
NETWORK:
*