minor
#24407
Layout refactoring: restructure (admin) layouts so that .layout.xml and component XML are adjacent
The new form of layout definition (see #23037, LayoutStructure) means that (at least for migrated layouts) there are two layout files per content view (the generated top-level layout file (*.layout.xml) and the previous component XML file *.xml). The layout XML file incorporates the component XML file via the indirection of a layout template. Due to the generation heuristics, the two files are generally not adjacent but are located in completely different subtrees.
The (administrative) layout definitions provided by the base system should be adapted to comply with the conventions for the layout structure in LayoutStructure.
Code Migration
Replace the administration structure defined independently for each application with the administration inherited from the base components (admin/index.layout.xml) and, if necessary, customize it using your own layout overlay files:
- Delete the WEB-INF/layouts/my.project.name folder created during the migration in #23037, along with its entire contents.
- Remove all administrative components inherited from the base from your own layout.csv (the Admin tab may only contain layouts defined by the application itself). If the application has no custom admin layouts, the Admin tab remains empty.
- Regenerate the layout (Ant layout_setup).
- In the application’s masterFrame.layout.xml, remove the line
<layout-reference resource="my.project.name/tl/admin/adminView.layout.xml"/>
with
<layout-reference resource="admin/index.layout.xml"/>
.
- Remove the layout.csv file (any further generation will destroy the new structure).
- Integrate your own administrative components into the admin structure predefined by the base project.
- To do this, create a *.layout.overlay.xml file for the admin tab in the application where the application’s administrative component is to be inserted. See the following example.
To insert a component into the base administration, create a file named admin/base/index.layout.overlay.xml in the application and populate it with the following content:
admin/base/index.layout.overlay.xml:
#!xml
<component>
<component name="adminBaseView">
<components>
<layout-reference resource="my.module.name/admin/my/component.layout.xml"/>
</components>
</component>
</component>
The application’s masterFrame.layout.xml should then have the following structure:
#!xml
<include name="templates/masterFrame.xml" ...>
<components>
<layout-reference resource="com.my.app/myFirstView.layout.xml"/>
...
<layout-reference resource="com.my.app/myLastView.layout.xml"/>
<layout-reference resource="admin/index.layout.xml"/>
</components>
</include>
Test
Refactoring, no additional test.