cancel
Showing results for 
Search instead for 
Did you mean: 

Hide custom property from detail

wity
Confirmed Champ
Confirmed Champ

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 Happyimage

2 ACCEPTED ANSWERS

fcorti
Elite Collaborator
Elite Collaborator

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 answer in original post

oviwonkenovi
Champ on-the-rise
Champ on-the-rise

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 answer in original post

4 REPLIES 4

sanjaybandhaniya
Elite Collaborator
Elite Collaborator

Hi,

Check content-metadata-card-component .

Here you can set which property you want to display.

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 image

fcorti
Elite Collaborator
Elite Collaborator

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
Champ on-the-rise
Champ on-the-rise

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"] } ] }] }