1

テーマの単一のCSSを共有する複数のアプリケーションがあります。そのため、この共通のCSSとリソースを共通のデータベースに移動し、テーマで動的に参照したいと考えています。

次のハードコードされたパスを使用して、これらのcssを参照できます。

<resource>
    <content-type>text/css</content-type>
    <href>/.ibmxspres/domino/common/designstore.nsf/custom_layout.css</href>
</resource>

このようにそれはうまく働いています。ただし、構成からデータベースパスを取得する必要があります。そのため、「/ common/designstore.nsf」パスをテーマにハードコーディングする必要はありません。

XpageのRenderResponseの前にdesignstoredbパスをsessionScope変数に入れてみました。そして、テーマでスコープ変数を参照しました。

<resource>
    <content-type>text/css</content-type>
    <href>#{sessionScope.commonCSSPath}</href>
</resource>

ここで、sessionScope.commonCSSPath = "/.ibmxspres/domino/common/designstore.nsf/custom_layout.css"

リソース内のdbパスを計算できるかどうか、または計算されたパスを使用して他のデータベースからCSSファイルを参照する他の方法を教えてください。

前もって感謝します。

4

1 に答える 1

1

Try calculating the href value using Javascript instead of EL:

<resource>
    <content-type>text/css</content-type>
    <href>#{javascript:sessionScope.commonCSSPath}</href>
</resource>

I am not sure if the timing of beforeRenderResponse and when a theme kicks in, makes it possible to reference a sessionScope variable. Let us know how it goes.

--

Update:

I use the following in a theme to determine the rendered property of a field and it works:

<control>
    ...
    <property>
        <name>rendered</name>
        <value>#{javascript:document.isEditable()}</value> 
    </property>
</control>

I also use a function to determine the value property where the function is a SSJS function that looks up a value in a profile document:

<control>
    ...
    <property>
        <name>value</name>
        <value>#{javascript:getNecessaryValue("SetupProfile", "fieldWithValue")}</value> 
    </property>
</control>

Hopefully this can inspire you to achieve what you want.

于 2012-08-16T04:25:30.767 に答える