<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to populate the ObjectDataTableAdapter with Alfresco api in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-populate-the-objectdatatableadapter-with-alfresco-api/m-p/11777#M5210</link>
    <description>&lt;P&gt;The tutorial may be out of date. I think the webscript has been deprecated from newer versions of the ADF and it is no longer available. I used EcmUserService and it worked.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Feb 2022 08:25:44 GMT</pubDate>
    <dc:creator>KarekMedAM</dc:creator>
    <dc:date>2022-02-17T08:25:44Z</dc:date>
    <item>
      <title>How to populate the ObjectDataTableAdapter with Alfresco api</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-populate-the-objectdatatableadapter-with-alfresco-api/m-p/11776#M5209</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;I'm following this tutorial:&amp;nbsp;&lt;A href="https://www.alfresco.com/abn/adf/docs/tutorials/working-with-data-table/" target="_blank" rel="noopener nofollow noreferrer"&gt;https://www.alfresco.com/abn/adf/docs/tutorials/working-with-data-table/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;here is my&amp;nbsp;mydatatable.component.ts&lt;/P&gt;&lt;PRE&gt;import { Component, OnInit } from '@angular/core';
import { AlfrescoApiService } from '@alfresco/adf-core';
import { ObjectDataTableAdapter, ObjectDataRow } from '@alfresco/adf-core';

@Component({
  selector: 'app-mydatatable',
  templateUrl: './mydatatable.component.html',
  styleUrls: ['./mydatatable.component.scss']
})
export class MydatatableComponent implements OnInit {

  data = new ObjectDataTableAdapter([],[]);

  
  constructor(private apiService: AlfrescoApiService) {

    let api: any = this.apiService.getInstance();
  //   let api2: any = this.apiService;

  api.webScript.executeWebScript(
    'GET',
    'people',
    [],
    null,
    '/alfresco/api/-default-/public/alfresco/versions/1',
    null
 ).then(
    (response: any) =&amp;gt; {
       let results = [];
       for (var entry of response.list.entries) {
          results.push({
             id: entry.entry.id,
             firstName: entry.entry.firstName,
             lastName: entry.entry.lastName,
             status: 'green',
             icon: 'material-icons://accessibility'
          });
       }
       this.data.setRows(results.map(item =&amp;gt; {
          return new ObjectDataRow(item);
       }));
    }
 );

}

  ngOnInit(): void {
    
  }

  onRowClick(event: any) {
    alert('We just clicked row id: ' + event.value.obj.status);
  }

}&lt;/PRE&gt;&lt;P&gt;and&amp;nbsp;mydatatable.component.html&lt;/P&gt;&lt;PRE&gt;&amp;lt;adf-datatable 


(rowClick)="onRowClick($event)"
  [data]="data"&amp;gt;
  &amp;lt;data-columns&amp;gt;
    &amp;lt;data-column 
      key="icon" 
      type="image" 
        [sortable]="false"&amp;gt;
      &amp;lt;/data-column&amp;gt;
    &amp;lt;data-column 
      key="firstName" 
      title="First Name"&amp;gt;
    &amp;lt;/data-column&amp;gt;
    &amp;lt;data-column 
      key="lastName" 
      title="Last Name" 
      class="full-width name-column"&amp;gt;
    &amp;lt;/data-column&amp;gt;
    &amp;lt;data-column key="status" title="Status"&amp;gt;
        &amp;lt;ng-template let-entry="$implicit"&amp;gt;
          &amp;lt;span *ngIf="entry.data.getValue(entry.row, entry.col) == 'red'" style="background-color: red; width: 20px; height: 20px"&amp;gt;&amp;lt;/span&amp;gt;
          &amp;lt;span *ngIf="entry.data.getValue(entry.row, entry.col) == 'green'" style="background-color: green; width: 20px; height: 20px"&amp;gt;&amp;lt;/span&amp;gt;
        &amp;lt;/ng-template&amp;gt;
      &amp;lt;/data-column&amp;gt;

  &amp;lt;/data-columns&amp;gt;
&amp;lt;/adf-datatable&amp;gt;&lt;/PRE&gt;&lt;P&gt;when I compile I get nothing on the&amp;nbsp;&lt;A href="http://localhost:4200/mydatatable" target="_blank" rel="noopener nofollow noreferrer"&gt;http://localhost:4200/mydatatable&lt;/A&gt;. However in the console I get this error:&lt;/P&gt;&lt;PRE&gt;core.js:4442 ERROR TypeError: Cannot read properties of undefined (reading 'executeWebScript')
    at new MydatatableComponent (mydatatable.component.ts:22)
    at NodeInjectorFactory.MydatatableComponent_Factory [as factory] (mydatatable.component.ts:55)
    at getNodeInjectable (core.js:4274)
    at instantiateRootComponent (core.js:8026)
    at createRootComponent (core.js:13542)
    at ComponentFactory$1.create (core.js:24101)
    at ViewContainerRef.createComponent (core.js:10205)
    at RouterOutlet.activateWith (router.js:5178)
    at RouterOutlet.ngOnInit (router.js:5114)
    at callHook (core.js:3281)&lt;/PRE&gt;&lt;P&gt;PS: when I try the same url on postman it works&lt;/P&gt;&lt;P&gt;What could be the problem, and how I can fix it&lt;/P&gt;&lt;P&gt;Thank you in advance&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 09:51:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-populate-the-objectdatatableadapter-with-alfresco-api/m-p/11776#M5209</guid>
      <dc:creator>KarekMedAM</dc:creator>
      <dc:date>2022-01-10T09:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate the ObjectDataTableAdapter with Alfresco api</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-populate-the-objectdatatableadapter-with-alfresco-api/m-p/11777#M5210</link>
      <description>&lt;P&gt;The tutorial may be out of date. I think the webscript has been deprecated from newer versions of the ADF and it is no longer available. I used EcmUserService and it worked.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 08:25:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-populate-the-objectdatatableadapter-with-alfresco-api/m-p/11777#M5210</guid>
      <dc:creator>KarekMedAM</dc:creator>
      <dc:date>2022-02-17T08:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate the ObjectDataTableAdapter with Alfresco api</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-populate-the-objectdatatableadapter-with-alfresco-api/m-p/11778#M5211</link>
      <description>&lt;P&gt;Hello, a have installed template:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="obraz (7).png" style="width: 481px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/122i4372DFC34C4F396C/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and did not found service/text&amp;nbsp;&lt;STRONG&gt;EcmUserService&lt;/STRONG&gt;, how to ge list of users w any component/view&lt;STRONG&gt;?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 12:47:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-populate-the-objectdatatableadapter-with-alfresco-api/m-p/11778#M5211</guid>
      <dc:creator>karol</dc:creator>
      <dc:date>2024-04-04T12:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate the ObjectDataTableAdapter with Alfresco api</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-populate-the-objectdatatableadapter-with-alfresco-api/m-p/11779#M5212</link>
      <description>&lt;P&gt;A try to get list of users service&amp;nbsp;&lt;STRONG&gt;IdentityUserService&lt;/STRONG&gt; but a have error in browser console:&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="obraz (8).png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/121iF70495543A05BF33/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;How to get list of users?&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="obraz (9).png" style="width: 442px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/124i3D2AFE1BF4DC10B3/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 13:15:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-populate-the-objectdatatableadapter-with-alfresco-api/m-p/11779#M5212</guid>
      <dc:creator>karol</dc:creator>
      <dc:date>2024-04-04T13:15:51Z</dc:date>
    </item>
  </channel>
</rss>

