Skip to content

[DSpace-CRIS] Configuration options for explore pages and homepage - #5983

Open
FrancescoMolinaro wants to merge 8 commits into
DSpace:mainfrom
4Science:task/main/DURACOM-508
Open

[DSpace-CRIS] Configuration options for explore pages and homepage#5983
FrancescoMolinaro wants to merge 8 commits into
DSpace:mainfrom
4Science:task/main/DURACOM-508

Conversation

@FrancescoMolinaro

@FrancescoMolinaro FrancescoMolinaro commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

References

Description

This PR introduces two new features/concepts that allow customization of some pages via rest configuration:

Explore Pages

An explore page is a graphical representation for a set of data, and it is made by several configurable section components (browse, search, facet, top, …) that typically require a browse index or a discovery configuration.

The explore page is available at /explore/{{SECTION_ID}}

Which page is visible and how is structured is determined via the dynamic-sections.xml file on the REST repository.

Example of explore section config:

<bean class="org.dspace.layout.DynamicLayoutSection" id="sectionresearchoutputs">
    <constructor-arg name="id" value="researchoutputs"/>
    <constructor-arg name="visible" value="true"/>
    <constructor-arg name="sectionComponents">
        <list>
            <list>
                <bean class="org.dspace.layout.DynamicLayoutBrowseComponent">
                    <property name="browseNames">
                        <list>
                            <value>rodept</value>
                            <value>author</value>
                            <value>rsoTitle</value>
                            <value>type</value>
                            <value>dateissued</value>
                            <value>subject</value>
                        </list>
                    </property>
                    <property name="style" value="col-md-4"/>
                </bean>
                <bean class="org.dspace.layout.DynamicLayoutSearchComponent">
                    <property name="discoveryConfigurationName" value="researchoutputs"/>
                    <property name="style" value="col-md-8"/>
                </bean>
            </list>
            <list>
                <bean class="org.dspace.layout.DynamicLayoutTopComponent">
                    <property name="discoveryConfigurationName" value="researchoutputs"/>
                    <property name="sortField" value="dc.date.accessioned"/>
                    <property name="order" value="desc"/>
                    <property name="style" value="col-md-6"/>
                    <property name="numberOfItems" value="5"/>
                </bean>
                <bean class="org.dspace.layout.DynamicLayoutTopComponent">
                    <property name="discoveryConfigurationName" value="researchoutputs"/>
                    <property name="sortField" value="metric.view"/>
                    <property name="order" value="desc"/>
                    <property name="style" value="col-md-6"/>
                    <property name="numberOfItems" value="5"/>
                </bean>
            </list>
            <list>
                <bean class="org.dspace.layout.DynamicLayoutFacetComponent">
                    <property name="discoveryConfigurationName" value="researchoutputs"/>
                    <property name="style" value="col-md-12"/>
                </bean>
            </list>
        </list>
    </constructor-arg>
</bean>

The sections configured for the explore pages will also impact the navbar layout, introducing new entries for each section.

image

It is also possible to create nested sections that will be shown in the top navigation bar as a hierarchical menu:

<bean class="org.dspace.layout.CrisLayoutSection" id="sectionfundings_and_projects">
    <constructor-arg name="id" value="fundings_and_projects"/>
    <constructor-arg name="visible" value="true"/>
    <!-- List of nested sections -->
    <property name="nestedSections">
        <list>
            <ref bean="sectionfundings"/>
            <ref bean="sectionprojects"/>
        </list>
    </property>
    <!-- sectionComponents cannot be used alongside nestedSections -->
    <!-- <constructor-arg name="sectionComponents" /> -->
</bean>

Home Page

As for the explore pages the home page is customizable via the dynamic-sections.xml where multiple type of sections can be defined for the home page under the bean "sectionsite", e.g.:

<bean class="org.dspace.layout.DynamicLayoutSection" id="sectionsite">
    <constructor-arg name="id" value="site"/>
    <constructor-arg name="visible" value="false"/>
    <constructor-arg name="sectionComponents">
        <list>
            <list>
                <bean class="org.dspace.layout.DynamicLayoutSearchComponent">
                    <property name="style" value="col-md-12"/>
                    <property name="searchType" value="basic"/>
                    <property name="displayTitle" value="false"/>
                </bean>
            </list>
            <list>
                <bean class="org.dspace.layout.DynamicLayoutCountersComponent">
                    <property name="style" value="col-md-12 py-4"/>
                    <property name="counterSettingsList">
                        <list>
                            <bean class="org.dspace.layout.DynamicLayoutCountersComponent.CounterSettings">
                                <property name="discoveryConfigurationName" value="researchoutputs"/>
                                <property name="label" value="publications"/>
                                <property name="icon" value="fas fa-file-alt fa-3x"/>
                                <property name="link" value="/explore/researchoutputs"/>
                            </bean>
                            <bean class="org.dspace.layout.DynamicLayoutCountersComponent.CounterSettings">
                                <property name="discoveryConfigurationName" value="project_funding"/>
                                <property name="label" value="project_funding"/>
                                <property name="icon" value="fas fa-cogs fa-3x"/>
                                <property name="link" value="/explore/fundings_and_projects"/>
                            </bean>
                            <bean class="org.dspace.layout.DynamicLayoutCountersComponent.CounterSettings">
                                <property name="discoveryConfigurationName" value="person"/>
                                <property name="label" value="rprofiles"/>
                                <property name="icon" value="fas fa-users fa-3x"/>
                                <property name="link" value="/explore/researcherprofiles"/>
                            </bean>
                        </list>
                    </property>
                </bean>
            </list>
            <list>
                <bean class="org.dspace.layout.DynamicLayoutTopComponent">
                    <property name="discoveryConfigurationName" value="homePageTopItems"/>
                    <property name="sortField" value="dc.date.accessioned"/>
                    <property name="order" value="desc"/>
                    <property name="style" value="col-md-6"/>
                    <property name="numberOfItems" value="5"/>
                </bean>
            </list>
        </list>
    </constructor-arg>
</bean>

Available sections

Browse component

Component consisting of a list of links that allow an entities browsing according to a specific configurable strategy (such as browse publications by author, or browse projects by title).

Search component

Component with which it is possible to search for entities of the given type by filtering for additional fields. The filters applicable to the search can be linked with AND, OR, and NOT, and are configurable.

image

It can also be of simple type

image

Top component

Component that shows the first n items in the system, ordered according to a certain criterion (such as sorting publications according to the last access date). The sort field, the order (ascending or descending), and the number of items to be displayed are configurable.

image

Facet component

Component composed of a series of configurable views that allow to highlight the occurrences of a certain field within the entities present in the system. For example, considering the publications, it is possible to configure facets to show the cardinalities of the authors, highlighting those with a higher count.

image

In addition to being able to configure the components themselves, it is also possible to configure which ones to show, how to arrange them on the page, and how many facet box per row to display.

Infographic (counters) component

Component composed by counters decorated with a custom icon, each one displaying the number of results returned by a query.

image

Text/Html component

Component containing a simple text, or its I18n key, or a link to an image, to be displayed as static content within explore section.

Instructions for Reviewers

Configure dynamic-sections.xml or use the one present in the REST repository to customize and test the new pages and components.

If no section is defined the default behavior should be observed.

List of changes in this PR:

Ported explore pages and related customizable components.
Ported home page enhancement to support configuration via dynamic-sections.xml.
Extended navbar menu logic to support entries for explore pages.

Include guidance for how to test or review your PR. This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@lgeggleston lgeggleston added high priority new feature DSpace-CRIS merger This ticket/PR relates to the merger of DSpace-CRIS into DSpace. labels Jul 22, 2026
@lgeggleston lgeggleston moved this to 🙋 Needs Reviewers Assigned in DSpace 11.0 Release Jul 22, 2026
@FrancescoMolinaro FrancescoMolinaro changed the title [DSpace-CRIS] Configuration options for homepage [DSpace-CRIS] Configuration options for explore pages and homepage Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Hi @FrancescoMolinaro,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

Comment thread src/config/default-app-config.ts Outdated
pageSize: 5,
},
showDiscoverFilters: false,
enableDynamicLayout: true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would personally suggest disabling the feature by default, keeping an existing DSpace setup as easy / similar as possible for the regular user.

<ds-markdown-viewer [value]="homeHeaderMetadataValue"></ds-markdown-viewer>
</div>
}
@if (!isDynamicHomePageEnabled) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@if (!isDynamicHomePageEnabled) vs @else is the only switch. There is no "no sections configured → static homepage” path. Please implement that (pr description notes this is in place)

map(({ site, language }) => site?.firstMetadataValue('dspace.cms.home-header', { language })),
);

this.sectionComponents = this.sectionDataService.findById('site').pipe(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will always obtain these components, even if the feature is disabled, probably best to set this behind the enableDynamicLayout flag


/** Default text-row section configuration for the home header CMS metadata. */
homeHeaderSection: TextRowSection = {
content: 'cris.cms.home-header',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These keys are inconsistent and still refer to the CRIS system, IIRC we don't want that, a regular version of it exists in dspace.cms-home-header, I'd just use these regular dspace keys

Comment thread src/config/default-app-config.ts Outdated
// These styles are used in components like MetadataLinkViewComponent to display entity type indicators
// alongside metadata values, providing visual cues about the type of referenced entity.
layout: LayoutConfig = {
enableExplorePages: true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, I'd opt for a default-off

export class SectionDataService extends IdentifiableDataService<Section> {

protected linkPath = 'sections';
private findAllData: FindAllData<Section>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is never constructed, findAll will throw if used, seems unused though so can probably get rid of it.

Comment on lines +11 to +18
<select name="filter" id="filter" formControlName="filter" class="form-control me-2">
@for (filter of (filters | async); track filter) {
<option [value]="filter">{{'explore.index.' + filter | translate}}</option>
}
</select>
</div>
<div class="col-md-5 col-xl-6 pb-3">
<input type="text" name="query" id="query" formControlName="query" class="form-control me-2"/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These id's filter and query should be unique in a way since thy are in a @for to avoid duplicate IDs (accessiblity)

<ds-search-form
[inPlaceSearch]="false"
[configuration]="searchSection.discoveryConfigurationName"
[searchPlaceholder]="'search.search-form.placeholder' | translate"> ></ds-search-form>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo, remove the stray '>'

const order = this.topSection.order;
const sortDirection = order && order.toUpperCase() === 'ASC' ? SortDirection.ASC : SortDirection.DESC;
const pagination: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
id: 'search-object-pagination',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple top sections will share this pagination, which could not be intented

Comment on lines +146 to +159

this.notifyInfoService.isCoarConfigEnabled().pipe(
switchMap((coarLdnEnabled: boolean) => {
if (coarLdnEnabled) {
return this.notifyInfoService.getCoarLdnLocalInboxUrls();
} else {
return of([]);
}
}),
).subscribe((coarRestApiUrls: string[]) => {
if (coarRestApiUrls.length > 0) {
this.initPageLinks(coarRestApiUrls);
}
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are initializing the COAR links here and also in ds-home-coar, so it's duplicate work which also means duplicate tags and duplicate SSR ink headers. This one specifically is also never unsubscribed so can probably be removed

@FrancescoMolinaro

Copy link
Copy Markdown
Contributor Author

Hi @jensvannerum , many thanks for the review, much appreciated.
I have tried to address all your feedback and the code should be now in a cleaner state.
The only thing I didn't tackle is the "text-box" section as it has been dropped also on CRIS since the same result can be achieved with multiple text rows, @AdamF42 since this is not used anymore we should drop it also from the backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DSpace-CRIS merger This ticket/PR relates to the merger of DSpace-CRIS into DSpace. high priority new feature

Projects

Status: 🙋 Needs Reviewers Assigned

Development

Successfully merging this pull request may close these issues.

[DSpace-CRIS] Configuration options for homepage

3 participants