cancel
Showing results for 
Search instead for 
Did you mean: 

Possible error in documentation

qwertz
Confirmed Champ
Confirmed Champ

Hello,

Alfresco Angular 2 Components Catalog describes how you can set the default folder for the document-list dynamically. This is the snippet from the website:

import { ChangeDetectorRef } from '@angular/core';
import { AlfrescoApiService } from 'ng2-alfresco-core';

export class FilesComponent implements OnInit {

    currentFolderId: string = '-my-';

    constructor(private apiService: AlfrescoApiService,
                private changeDetector: ChangeDetectorRef) {
        // ...
    }

    ngOnInit() {
        let nodes: any = this.apiService.getInstance().nodes;
        nodes.getNodeInfo('-root-', {
            includeSource: true,
            include: ['path', 'properties'],
            relativePath: '/Sites/swsdp/documentLibrary'
        })
        .then(node => {
            console.log(node);
            this.currentFolderId = node.id;
            this.changeDetector.detectChanges();
        });
    }
}

I've tested it on 1.7.0 and it only works when running the angular app on my local machine. As soon as I deploy it on a remote testserver (still intranet) it sometimes, but not always, doesn't show the desired folder specified by relativePath, but navigates to the path currentFolderId initially was set to. In this case -my-.

Changing

currentFolderId: string = '-my-';

to

currentFolderId: string;

solves the problem for me but I don't know if this is really the right technique or if I was just lucky.

7 REPLIES 7

eugenio_romano
Elite Collaborator
Elite Collaborator

Hi , 

can you check if there are failing calls in your browser network console?

Here are the requests for currentFolderId: string = '-root-';

And here the requests for currentFolderId: string;

No request fails.

The problem appears a lot in Internet Explorer, but I've also seen it in Firefox a few times.

As this only occurs when the application runs on the remote server I was thinking that the longer time the requests take plays a role. So I've simulated a network delay on the server with "tc qdisc add dev eth0 root netem delay 500ms". I've tried a few different ms values but everytime I delay the traffic the problem doesn't even occur.

Do you have errors in the console log?

No, I only get these messages since I've updated to ADF 1.7.0:

ContentColumnComponent is deprecated starting with 1.7.0 and may be removed in future versions. Use DataColumnComponent instead.

qwertz
Confirmed Champ
Confirmed Champ

For testing on my local machine I am using the Alfresco SDK with the community edition and on the remote testing server the enterprise edition is installed. Is it possible that this has something to do with the problem?

Honestly, I don't think but which version do you have for the community and the enterprise? 

Community - 5.2.0 (r135134-b14)
Enterprise - 5.2.0 (r134899-b26)