はい、唯一のオプションは、Expando AKA カスタム プロパティ/フィールドを使用することです。fileEntry の場合、テーブルと列をプログラムで作成する必要はありませんが、[コントロール パネル] > [カスタム フィールド] で設定できます。
その後、expando 値を入力する方法がいくつかあります。
fileEntry.getExpandoBridge().setAttribute("propName", "propValue")
またはビューレイヤーからプロパティを取得する場合
<liferay-ui:custom-attributes-available className="<%= DLFileEntry.class.getName() %>">
<liferay-ui:custom-attribute-list
className="<%= DLFileEntry.class.getName() %>"
classPK="<%= (fileVersion != null) ? fileVersion.getFileVersionId() : 0 %>"
editable="<%= true %>"
label="<%= true %>"
/>
</liferay-ui:custom-attributes-available>
その後
ServiceContext serviceContext = ServiceContextFactory.getInstance(
DLFileEntry.class.getName(), actionRequest);
serviceContext は actionRequest のパラメーターによって設定され、呼び出します
fileEntry.getExpandoBridge().setAttributes(serviceContext)
最後に、特定のプロパティを持つ fileEntries を照会する必要がある場合があります
public Hits search() {
Map<String, Serializable> attributes = new HashMap<String, Serializable>();
attributes.put("propertyName", "propertyValue");
SearchContext searchContext = new SearchContext();
searchContext.setAttributes(attributes);
Indexer indexer = IndexerRegistryUtil.getIndexer(FileEntry.class);
return indexer.search(searchContext);
}
もちろん、Liferay ドキュメント ライブラリは JCR コンテンツ リポジトリではないため、このソリューションは少し複雑に見えるかもしれませんが、文字通り、JCRHook (ファイルが jackrabbit リポジトリに格納される場所) などのフックを介して具体的なリポジトリ実装の抽象化レイヤーを提供するドキュメント ライブラリです。 )、CMIS サポート、移行サポートなど。また、permissionChecking、fileVersioning、ドキュメント ワークフロー、アセット管理も処理します。
したがって、より複雑なことを行うつもりで、プロパティ/メタデータを照会し、それらを変更して展開する必要がある場合。JCRリポジトリを直接使用することを検討する必要があります...