Setting property to read-only

cancel
Showing results for 
Search instead for 
Did you mean: 
Jannik
Customer

Setting property to read-only

Hello,

 

I'm having trouble setting one of my custom properties to read-only in the content app.

Based on this: https://www.alfresco.com/abn/adf/docs/content-services/components/content-metadata-card.component/#m...

I added the property to the config file:

 

"content-metadata": {
    "presets": {
      "custom": [
        {
          "includeAll": true,
          "readOnlyProperties": ["uiVMb:orgaUnit"],
          "exclude": [
            "rn:renditioned",
            "cm:versionable",
            "cm:auditable",
            "cm:thumbnailModification",
            "cm:content",
            "cm:author",
            "cm:titled",
            "cm:generalclassifiable",
            "cm:taggable",
            "dp:restrictable",
            "fm:commentsRollup",
            "qshare:shared",

            "exif:exif",
            "cm:effectivity",

            "cm:emailed",
            "cm:likesRatingSchemeRollups",
            "cm:lockable",
            "cm:ownable"
          ]
        },
        {
          "title": "APP.CONTENT_METADATA.EXIF_GROUP_TITLE",
          "items": [
            {
              "aspect": "exif:exif",
              "properties": [
                "exif:pixelXDimension",
                "exif:pixelYDimension",
                "exif:dateTimeOriginal",

I didn’t change anything in the metadata-tab component:

template: `
    <adf-content-metadata-card
      [readOnly]="!canUpdateNode"
      [preset]="'custom'"
      [node]="node"
      [displayAspect]="displayAspect$ | async"
    >
    </adf-content-metadata-card>

And yet, this property can be edited. What am I doing wrong?

Kind regards,

 

Jannik

3 Replies
dvuika
Alfresco Employee

Re: Setting property to read-only

Please note that the content app stores the metadata settings in the "content-metadata-presets" section of the "app.extensions.json", not "app.config.json" file. 

Jannik
Customer

Re: Setting property to read-only

Hi dvuika,

Thanks for your quick reply. I tried the app.extensions.json file

"content-metadata-presets": [
      {
        "id": "app.content.metadata.custom",
        "custom": [
          {
            "id": "app.content.metadata.customSetting",
            "includeAll": true,
            "readOnlyProperties": ["uiVMb:orgaUnit"],
            "exclude": [
              "rn:renditioned",
              "cm:versionable",
              "cm:auditable",
              "cm:thumbnailModification",
              "cm:content",
              "cm:author",
              "cm:titled",
              "cm:generalclassifiable",
              "cm:taggable",

and it didn’t work as well. I’m using ADF 3.9.0, ACS 6.1.0.5. Any further suggestions?

Cheers

fedorow
Senior Member II

Re: Setting property to read-only

I have the same problem with ACA latest version. 

Please help with an advice.

Serge