Hide custom property from detail

cancel
Showing results for 
Search instead for 
Did you mean: 
wity
Active Member II

Hide custom property from detail

Jump to solution

Hello, 

I have custom document type and property in alfresco (repo) content-model.xml.

 

        <type name="digi:document">
            <title>Digi dokument</title>
            <parent>cm:content</parent>
            <properties>
                <property name="digi:IdDokumentu">
                    <title>Identifikační číslo</title>
                    <type>d:text</type>
                </property>
            </properties>
        </type>

How can I hide this property from detail of document in Alfresco Content Application ? Smiley HappySnímek obrazovky 2020-07-08 v 14.03.42.png

 

 

2 Solutions

Accepted Solutions
fcorti
Alfresco Employee

Re: Hide custom property from detail

Jump to solution

Hi @wity ,

As documented here, I'm not sure the syntax for the JSON configuration is correct.

It should be something like:

 "content-metadata": {
    "presets": {
      "my-preset": [
        {
            "title": "This is my preset",
            "items": [
                {
                    "type": "FIELD",
                    "properties": "*"
                },
{
"aspect": "st:siteContainer",
"properties": "*"
}
] } ],

Not sure if this is the root cause, but for sure it can affect the result.

I hope this will help you.

View solution in original post

oviwonkenovi
Active Member

Re: Hide custom property from detail

Jump to solution

I have facet similar problem. create a custom preset on app.config.json dit not worked for. The solution was to create it on app.extension.json as a new object on array

 
 
"content-metadata-presets":
{
"id": "app.content.metadata.custom",
"custom": ...
},
{ "id": "my.content.metadata.custom", "my-preset": [{ "id": "est.content.metadata.document", "title": "Some title", "items": [{ "editable": false, "id": "app.content.metadata.effectivityAspect", "aspect": "cm:versionable", "properties": ["cm:versionLabel"] } ] }] }

View solution in original post

4 Replies
sanjaybandhniya
Intermediate

Re: Hide custom property from detail

Jump to solution

Hi,

Check content-metadata-card-component .

Here you can set which property you want to display.

wity
Active Member II

Re: Hide custom property from detail

Jump to solution

Hello,

  thank you very much for your help. Can you please give some other help ? 

 

In my app.config.json a add my new "preset".

 

 "content-metadata": {
    "presets": {
      "my-preset": [
        {
            "title": "This is my preset",
            "items": [
                {
                    "type": "FIELD",
                    "aspect": "st:siteContainer",
                    "properties": ["*"]
                }
            ]
        }
    ],
      "custom": [
        {
          "includeAll": false,
          "exclude": [
            "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",
                "exif:exposureTime",
                "exif:fNumber",
                "exif:flash",
                "exif:focalLength",
                "exif:isoSpeedRatings",
                "exif:orientation",
                "exif:manufacturer",
                "exif:model",
                "exif:software"
              ]
            }
          ]
        },
        {
          "title": "APP.CONTENT_METADATA.EFFECTIVITY_GROUP_TITLE",
          "items": [
            {
              "aspect": "cm:effectivity",
              "properties": [
                "cm:from",
                "cm:to"
              ]
            }
          ]
        }
      ]
    }
  },

 

In metadata-tab.components.ts I use this my preset like this:

 

import {
  Component,
  Input,
  ViewEncapsulation,
  OnInit,
  OnDestroy
} from '@angular/core';
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
import {
  NodePermissionService,
  isLocked,
  AppExtensionService
} from '@alfresco/aca-shared';
import { AppStore, infoDrawerMetadataAspect } from '@alfresco/aca-shared/store';
import { AppConfigService, NotificationService } from '@alfresco/adf-core';
import { Observable, Subject } from 'rxjs';
import { Store } from '@ngrx/store';
import { ContentMetadataService } from '@alfresco/adf-content-services';
import { takeUntil } from 'rxjs/operators';

@Component({
  selector: 'app-metadata-tab',
  template: `
    <adf-content-metadata-card
      [preset]="'my-preset'"
      [node]="node"
      >
    </adf-content-metadata-card>
  `,
  encapsulation: ViewEncapsulation.None,
  host: { class: 'app-metadata-tab' }
})
export class MetadataTabComponent implements OnInit, OnDestroy {
  protected onDestroy$ = new Subject<boolean>();

  @Input()
  node: MinimalNodeEntryEntity;

  displayAspect$: Observable<string>;

  constructor(
    private permission: NodePermissionService,
    protected extensions: AppExtensionService,
    private appConfig: AppConfigService,
    private store: Store<AppStore>,
    private notificationService: NotificationService,
    private contentMetadataService: ContentMetadataService
  ) {
    if (this.extensions.contentMetadata) {
      this.appConfig.config[
        'content-metadata'
      ] = this.extensions.contentMetadata;
    }
    this.displayAspect$ = this.store.select(infoDrawerMetadataAspect);
  }

  get canUpdateNode(): boolean {
    if (this.node && !isLocked({ entry: this.node })) {
      return this.permission.check(this.node, ['update']);
    }

    return false;
  }

  ngOnInit() {
    this.contentMetadataService.error
      .pipe(takeUntil(this.onDestroy$))
      .subscribe((err: { message: string }) => {
        this.notificationService.showError(err.message);
      });
  }

  ngOnDestroy() {
    this.onDestroy$.next(true);
    this.onDestroy$.complete();
  }
}

 

But there is no changes Snímek obrazovky 2020-07-28 v 16.36.02.png

 

 

 

 

fcorti
Alfresco Employee

Re: Hide custom property from detail

Jump to solution

Hi @wity ,

As documented here, I'm not sure the syntax for the JSON configuration is correct.

It should be something like:

 "content-metadata": {
    "presets": {
      "my-preset": [
        {
            "title": "This is my preset",
            "items": [
                {
                    "type": "FIELD",
                    "properties": "*"
                },
{
"aspect": "st:siteContainer",
"properties": "*"
}
] } ],

Not sure if this is the root cause, but for sure it can affect the result.

I hope this will help you.

oviwonkenovi
Active Member

Re: Hide custom property from detail

Jump to solution

I have facet similar problem. create a custom preset on app.config.json dit not worked for. The solution was to create it on app.extension.json as a new object on array

 
 
"content-metadata-presets":
{
"id": "app.content.metadata.custom",
"custom": ...
},
{ "id": "my.content.metadata.custom", "my-preset": [{ "id": "est.content.metadata.document", "title": "Some title", "items": [{ "editable": false, "id": "app.content.metadata.effectivityAspect", "aspect": "cm:versionable", "properties": ["cm:versionLabel"] } ] }] }