2

したがって、Liferay には、ROOT/html/jsすべてのコア JavaScript を含むフォルダーがあります。連結されたjsファイルを作成する正確なメカニズムを誰かが説明してくれますか? barebone.jsp と everything.jsp の違いは何ですか? ファイルが 1 つのファイルに連結される順序は、コードのどこで確認できますか?

ファイルを見ることができtop_js.jspfますが、それにもかかわらず、私には不明なままでした。

前もって感謝します。

4

2 に答える 2

5

Liferay の portal.properties は、最もよく文書化されたファイルの 1 つです。Liferay Wiki または portal-impl.jar で見つけることができます。

そこで「barebone」、「everything」、または単に「Javascript」を検索します。そこから、次のドキュメントをコピーしました。

#
# Set a list of JavaScript files that will be loaded automatically in
# /html/common/themes/top_js.jsp.
#
# There are two lists of files specified in the properties
# "javascript.barebone.files" and "javascript.everything.files".
#
# As the name suggests, the barebone list is the minimum list of JavaScript
# files required for most cases. The everything list includes everything
# else not listed in the barebone list.
#
# The two lists of files exist for performance reasons because
# unauthenticated users usually do not utilize all the JavaScript that is
# available. See the property "javascript.barebone.enabled" for more
# information on the logic of when the barebone list is used and when the
# everything list is used and how to customize that logic.
#
# The list of files are also merged and packed for further performance
# improvements. See the property "javascript.fast.load" for more details.
#

#
# Specify the list of barebone files.
#
# The ordering of the JavaScript files is important.
#
# The Liferay scripts are grouped in such a way, that the first grouping
# denotes utility scripts that are used by the second and third groups. The
# second grouping denotes utility classes that rely on the first group, but
# does not rely on the second or third group. The third grouping denotes
# modules that rely on the first and second group.

javascript.barebone.files= ... (omitted here, multiline)

次のセクション (ここにすべてをコピーしないようにするため) には、ケースに関する興味深い情報も含まれている可能性があります。しかし、あなたの質問は上記の部分で答えられていると思います - portal.properties で残りを読んでください。

編集:コメントに答えるには:順序は上に記載されています。後のファイルは前のファイルに依存するため、上から下です。さらに、次のプロパティは、推論に関するヒントを与える可能性があります。

#
# Set this property to false to always load JavaScript files listed in the
# property "javascript.everything.files". Set this to true to sometimes
# load "javascript.barebone.files" and sometimes load
# "javascript.everything.files".
#
# The default logic is coded in com.liferay.portal.events.ServicePreAction
# in such a way that unauthenticated users get the list of barebone
# JavaScript files whereas authenticated users get both the list of barebone
# JavaScript files and the list of everything JavaScript files.
#
javascript.barebone.enabled=true

このすべての背後にある理由は、多くのインストールでは、お客様が転送されるデータと実行される JavaScript の量を最小限に抑えたいと考えているためです。すべてが完全に動的である場合、大量のファイルが転送されることになり、http 経由で多くの時間がかかります。「barebones」と「everything」は、すべてのファイルを連結および縮小し、1 つとして転送します。通常、1 つのファイルのみを転送する方が、複数のファイルを転送するよりもはるかに高速です。

一般的に、Liferay のドキュメントの量について議論することはできますが、portal.properties が Liferay で最もドキュメント化されたファイルの 1 つであることについて議論することはできません。それを見てみましょう - そうするだけで、Liferay で何ができるかについて多くの洞察が得られます。

于 2011-09-02T18:43:14.047 に答える
0

ベアボーンのリストは、ログアウトした状態でリストされた JavaScript ファイルであることを覚えておいてください。すべてのリストは、すべてのリストと最低限のリストを組み合わせたものです。

于 2015-02-06T10:26:27.010 に答える