2012-06-20 41 views
1

我試圖從OrbeonForms版本3.8升級到3.9。我使用PriorityResourceManagerFactory如下:如何處理OrbeonForms中的靜態內容3.9

<context-param> 
    <param-name>oxf.resources.factory</param-name> 
    <param-value>org.orbeon.oxf.resources.PriorityResourceManagerFactory</param-value> 
</context-param> 
<!-- Uncomment this for the filesystem resource manager --> 
<context-param> 
    <param-name>oxf.resources.priority.1</param-name> 
    <param-value>org.orbeon.oxf.resources.FilesystemResourceManagerFactory</param-value> 
</context-param> 
<context-param> 
    <param-name>oxf.resources.priority.1.oxf.resources.filesystem.sandbox-directory</param-name> 
    <param-value>d:/Sources/esb-repository/user-interface</param-value> 
</context-param> 
<context-param> 
    <param-name>oxf.resources.priority.2</param-name> 
    <param-value>org.orbeon.oxf.resources.WebAppResourceManagerFactory</param-value> 
</context-param> 
<context-param> 
    <param-name>oxf.resources.priority.2.oxf.resources.webapp.rootdir</param-name> 
    <param-value>/WEB-INF/resources</param-value> 
</context-param> 
<context-param> 
    <param-name>oxf.resources.priority.3</param-name> 
    <param-value>org.orbeon.oxf.resources.FilesystemResourceManagerFactory</param-value> 
</context-param> 
<context-param> 
    <param-name>oxf.resources.priority.3</param-name> 
    <param-value>org.orbeon.oxf.resources.ClassLoaderResourceManagerFactory</param-value> 
</context-param> 

我在頁面flow.xml條目:在我的目錄

<files path-info=".+\.(gif|css|pdf|json|js|png|jpg|xsd|ico)" 
    matcher="oxf:perl5-matcher"/> 

我把整個應用程序的代碼,我有文件主題/風格/佈局.css。在Orbeon 3.8服務器路徑/orbeon/theme/styles/layout.css完美工作,但不在3.9。

如何配置它以保持向後兼容性?

回答

0

我假設/orbeon是您部署Orbeon Forms Web應用程序的上下文。

  1. 如果您使用Orbeon窗體PE,3.9版本開始的資源是enabled by default,瀏覽器請求的路徑需要/orbeon/3.14/theme/styles/layout.css,其中3.14是應用程序的版本。如果您在代碼中編寫/theme/styles/layout.css,則Orbeon Forms會自動爲您重寫,並在發送給瀏覽器的HTML中添加版本號。

  2. 由於3.9,default app path is prepended when looking up resources。因此,使用版本化資源的/orbeon/3.14/theme/styles/layout.css/orbeon/theme/styles/layout.css對版本資源的請求將在您的資源目錄中查找文件app/theme/styles/layout.css。所以,你需要:

    • 移動你的CSS到不同的地方在磁盤(app目錄下的移動theme)。
    • theme作爲平臺路徑,將其添加到oxf.url-rewriting.platform-paths property。很可能這是對你最有意義的選擇。