NestTable、仮想プロパティを指定可能にする#1762
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enables virtual properties (手動入力された仮想プロパティ) to be registered as metadata for NestTable property settings in the AdminConsole and subsequently used in the GEM UI. Key changes include refactoring property definition retrieval to use a common getNestTablePropertyDefinition method, updating multiple JSP pages to use this method, and modifying EntityViewUtil to support conversion for virtual properties.
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| SearchConditionSection_Nest.jsp | Adds a helper method to retrieve NestTable property definitions with exception handling for missing properties. |
| SearchConditionSection.jsp | Replaces direct calls to ed.getProperty(...) with the new getNestTablePropertyDefinition method. |
| ReferencePropertyEditor_Table.jsp | Updates multiple references to property retrieval with the new method and ensures consistency in error messages. |
| ReferencePropertyEditor_Condition_Nest.jsp | Uses the new method for virtual property conversion in condition handling. |
| EntityViewUtil.java | Introduces getNestTablePropertyDefinition to return either an existing property definition or convert a virtual property; adds a private getVirtualPropertyDefinition for conversion. |
| MetaNestProperty.java | Adjusts null handling for property identifiers to allow virtual properties. |
| ReferencePropertySearchCondition.java & NormalSearchContext.java | Updates property retrieval to leverage the new utility method for NestTable properties. |
Files not reviewed (1)
- iplass-gem/src/main/resources/mtp-gem-messages_ja.properties: Language not supported
Comments suppressed due to low confidence (2)
iplass-gem/src/main/resources/jsp/gem/generic/element/section/SearchConditionSection.jsp:261
- [nitpick] The implementation of getNestTablePropertyDefinition is duplicated across several JSP files. Consider refactoring this method into a shared include or tag library to improve maintainability and reduce code duplication.
PropertyDefinition getNestTablePropertyDefinition(NestProperty np, EntityDefinition ed) {
iplass-gem/src/main/java/org/iplass/mtp/impl/view/generic/editor/MetaNestProperty.java:492
- [nitpick] Consider renaming the variable 'propertyId' to a more descriptive name such as 'defaultPropertyName' to improve clarity and ensure consistency in identifying properties when ph is null.
String propertyName = (ph != null) ? ph.getName() : propertyId;
| definition.setUpdatable(true); | ||
| return definition; | ||
| // なければ仮想プロパティなのでプロパティ定義に変換する | ||
| return getVirtualPropertyDefinition(nestProperty); |
There was a problem hiding this comment.
Ensure that 'nestProperty' is compatible with the expected 'FileItem' type for getVirtualPropertyDefinition or apply an explicit cast if NestProperty extends FileItem. This will prevent potential type mismatch issues at compile time.
| return getVirtualPropertyDefinition(nestProperty); | |
| return getVirtualPropertyDefinition((FileItem) nestProperty); |
There was a problem hiding this comment.
org.iplass.mtp.view.generic.editor.NestPropertyクラスはorg.iplass.mtp.view.generic.element.FileItemインターフェースを実装しているためキャストは不要
…-nesttable-virtual
対応内容
fixes #679
AdminConsoleにてView定義のNestTableプロパティ設定にて手動入力したプロパティ(仮想プロパティ)をメタデータ登録して、GEMの画面で利用できるようにする(修正前はプロパティ名を手動入力できるがメタデータ登録はできていなかった)。
動作確認・スクリーンショット(任意)
レビュー観点・補足情報(任意)