07-08-2020 08:12 AM
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 ?
)
07-30-2020 04:29 AM
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.
08-31-2020 10:02 AM
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"] } ] }] }
07-21-2020 02:00 AM
07-28-2020 10:37 AM
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
07-30-2020 04:29 AM
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.
08-31-2020 10:02 AM
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"] } ] }] }
Explore our Alfresco products with the links below. Use labels to filter content by product module.