cancel
Showing results for 
Search instead for 
Did you mean: 

ACS 23.4 (Share) – Can’t hide default Data List fields/columns for a custom list type (want only two

slcunha
Champ on-the-rise
Champ on-the-rise

Environment

Alfresco Content Services (Community): 23.4.1

Share UI (bundled with 23.4)

Tomcat 10, Java 17

DB: PostgreSQL 15

Deployment: Docker Compose (official images)

What I’m trying to do

Create a custom Data List item type with only two properties:

Old Street Name (first column / shown first on forms)

Current Street Name (second column / shown second on forms)

I can create the list and the two custom columns do appear, but Share still shows the default columns (created, creator, name, locale, modified, last accessed, etc.) and those also show up in the create/edit forms – some even come through as required. I want the grid to show only the two custom columns, and the forms to display only those two fields.

Repository side – files and paths

Container: alfresco-alfresco-1
Path: /usr/local/tomcat/shared/classes/alfresco/extension

1) Model: /usr/local/tomcat/shared/classes/alfresco/extension/models/customStreetNamesModel.xml
<?xml version="1.0" encoding="UTF-8"?>
<model name="sn:customStreetNamesModel"
xmlns="http://www.alfresco.org/model/dictionary/1.0">
<description>Street names data list</description>
<author>me</author>
<version>1.0</version>

<imports>
<import uri="http://www.alfresco.org/model/datalist/1.0" prefix="dl"/>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
</imports>

<namespaces>
<namespace uri="http://example.com/model/streetnames/1.0" prefix="sn"/>
</namespaces>

<types>
<type name="sn:streetNameItem">
<title>Item de Nome de Rua</title>
<parent>dl:dataListItem</parent>
<properties>
<property name="sn:oldStreetName">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="sn:currentStreetName">
<type>d:text</type>
<mandatory>false</mandatory>
</property>
</properties>
</type>
</types>
</model>

2) Bootstrap: /usr/local/tomcat/shared/classes/alfresco/extension/custom-street-names-context.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="customStreetNamesModel"
class="org.alfresco.repo.dictionary.DictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/models/customStreetNamesModel.xml</value>
</list>
</property>
</bean>
</beans>


(I previously hit parse errors while building the model, fixed those, and ACS now starts cleanly. The custom type appears as a new Data List type and I can create items.)

Share side – files and paths

Container: alfresco-share-1
Path: /usr/local/tomcat/webapps/share/WEB-INF/classes/alfresco/web-extension/share-config-custom.xml

Below is the current config I’m using. I put one single <alfresco-config> root in the file (no nesting).

a) Data List columns
<alfresco-config>
<!-- Data Lists grid -->
<config evaluator="string-compare" condition="datalists">
<types>
<type name="sn:streetNameItem">
<!-- I want ONLY the two columns below.
I also tried include-defaults="false" and replace="true" on this config. -->
<columns ignoreDefaults="true">
<column name="sn:oldStreetName"/>
<column name="sn:currentStreetName"/>
</columns>
</type>
</types>
</config>

b) Forms (create / edit / view)
<!-- Forms for my custom list item -->
<config evaluator="model-type" condition="sn:streetNameItem" replace="true">
<forms>
<form id="create">
<field-visibility>
<show id="sn:oldStreetName"/>
<show id="sn:currentStreetName"/>
<!-- Hide everything else -->
<hide id="cm:name"/>
<hide id="cm:title"/>
<hide id="cm:description"/>
<hide id="cm:created"/>
<hide id="cm:creator"/>
<hide id="cm:modified"/>
<hide id="cm:modifier"/>
<hide id="cm:lastAccessed"/>
<hide id="cm:locale"/>
</field-visibility>
<appearance>
<!-- Hidden cm:name so repo mandatory name is satisfied -->
<field id="cm:name">
<control template="/org/alfresco/components/form/controls/hidden.ftl">
<control-param name="copy-from">prop_sn_oldStreetName</control-param>
<control-param name="forceUnique">true</control-param>
</control>
</field>
</appearance>
</form>

<form id="edit">
<field-visibility>
<show id="sn:oldStreetName"/>
<show id="sn:currentStreetName"/>
<hide id="cm:name"/>
<hide id="cm:title"/>
<hide id="cm:description"/>
<hide id="cm:created"/>
<hide id="cm:creator"/>
<hide id="cm:modified"/>
<hide id="cm:modifier"/>
<hide id="cm:lastAccessed"/>
<hide id="cm:locale"/>
</field-visibility>
</form>

<form id="view">
<field-visibility>
<show id="sn:oldStreetName"/>
<show id="sn:currentStreetName"/>
</field-visibility>
</form>
</forms>
</config>
</alfresco-config>

What I see

In the grid, my two columns appear first (good), but all the default columns still appear after them (Created date, Creator, Name, Locale, Modifier, Modified date, Last accessed, etc.).

In the create/edit forms, those default fields are still rendered and some are required, even though I try to hide them and I provide a hidden cm:name.

Screenshots attached (list grid and create form).

0 REPLIES 0