ACA Making properties read only

cancel
Showing results for 
Search instead for 
Did you mean: 
fedorow
Senior Member II

ACA Making properties read only

Jump to solution

Project Alfresco Content Application

I'm trying to extend Content Metadata Card with custom groups and can't make property readonly.

The changers of app.config.json file by documentation do not work,

and changers of app.extensions.json file by forum thread do not works too. 

 

app.extensions.json:

    "content-metadata-presets": [
      {
        "id": "app.content.metadata.custom",
        "custom": [
          {
            "id": "app.content.metadata.customSetting",
            "includeAll": true,
            "readOnlyProperties": [
              "myprefix:category",
              "myprefix:family",
              "myprefix:natura"
            ],
            "exclude": [
              "rn:renditioned",
              "cm:versionable",
              ...

app.config.json

  "content-metadata": {
    "presets": {
      "custom": [
        {
          "includeAll": true,
          "readOnlyProperties": [
            "myprefix:family",
            "myprefix:natura"
          ],
          "exclude": [
            "rn:renditioned",
            ...

 

To be honest, I tried place readOnlyProperties in every thread of custom preset in both files and separately.

 

What can I do?

1 Solution

Accepted Solutions
fedorow
Senior Member II

Re: ACA Making properties read only

Jump to solution

The "readOnlyProperties" did not work for me.

So I did workaround by using "editable": false parameter. Now group contains two items with same aspect. First item is editable, second item isn't.

...
"content-metadata-presets": [
  {
    "id": "app.content.metadata.custom",
    "custom": [
      {
        "title": "TRANSLATABLE_TITLE_FOR_GROUP_1",
        "items": [
          { 
            "id": "",
            "aspect": "myprefix:aspect", 
            "properties": [
              "myprefix:myEditableProperty1",
              "myprefix:myEditableProperty2"
            ]
          },
          { 
            "aspect": "myprefix:aspect", 
            "properties": [
              "myprefix:category",
              "myprefix:family",
              "myprefix:natura"
            ],
            "editable": false
          }
        ]
      }
    ]
  }
]
...

 

View solution in original post

3 Replies
angelborroy
Alfresco Employee

Re: ACA Making properties read only

Jump to solution

Did you follow these steps?

https://alfresco-content-app.netlify.app/#/tutorials/content-metadata

Hyland Developer Evangelist
fedorow
Senior Member II

Re: ACA Making properties read only

Jump to solution

Angel thanks for respond!

Yes I did it. Everything from tutorial works fine: creating group, includeAll, exclude, create list of properties from several asspects.

But there is nothing about readonly in the tutorial. Now I hide properties. But I want to show their values in read only mode.

fedorow
Senior Member II

Re: ACA Making properties read only

Jump to solution

The "readOnlyProperties" did not work for me.

So I did workaround by using "editable": false parameter. Now group contains two items with same aspect. First item is editable, second item isn't.

...
"content-metadata-presets": [
  {
    "id": "app.content.metadata.custom",
    "custom": [
      {
        "title": "TRANSLATABLE_TITLE_FOR_GROUP_1",
        "items": [
          { 
            "id": "",
            "aspect": "myprefix:aspect", 
            "properties": [
              "myprefix:myEditableProperty1",
              "myprefix:myEditableProperty2"
            ]
          },
          { 
            "aspect": "myprefix:aspect", 
            "properties": [
              "myprefix:category",
              "myprefix:family",
              "myprefix:natura"
            ],
            "editable": false
          }
        ]
      }
    ]
  }
]
...