<?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 Property 'webScript' does not exist on type 'AlfrescoApi' in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/property-webscript-does-not-exist-on-type-alfrescoapi/m-p/12830#M5646</link>
    <description>&lt;P&gt;I am going through the tutorial "Working with a Data Table"&lt;BR /&gt;&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;When I am trying to run the code in "Playing with the data source" section, I get a error said&lt;/P&gt;&lt;P&gt;"&lt;BR /&gt;ERROR in app/src/app/mydatatable/mydatatable.component.ts:17:35 - error TS2339: Property 'webScript' does not exist on type 'AlfrescoApi'.&lt;/P&gt;&lt;P&gt;17 this.apiService.getInstance().webScript.executeWebScript(&lt;BR /&gt;"&lt;/P&gt;&lt;P&gt;How to fix it? or any materials I should read?&lt;/P&gt;&lt;P&gt;My mydatatable.component.ts code:&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: 'aca-mydatatable',
  templateUrl: './mydatatable.component.html',
  styleUrls: ['./mydatatable.component.scss']
})
export class MydatatableComponent implements OnInit {


  data = new ObjectDataTableAdapter([],[]);

  constructor(private apiService: AlfrescoApiService) {
    this.apiService.getInstance().webScript.executeWebScript(
      'GET',
      'people',
      [],
      null,
      '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.id);
  }

}&lt;/PRE&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jan 2022 22:12:24 GMT</pubDate>
    <dc:creator>Upladder</dc:creator>
    <dc:date>2022-01-31T22:12:24Z</dc:date>
    <item>
      <title>Property 'webScript' does not exist on type 'AlfrescoApi'</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/property-webscript-does-not-exist-on-type-alfrescoapi/m-p/12830#M5646</link>
      <description>&lt;P&gt;I am going through the tutorial "Working with a Data Table"&lt;BR /&gt;&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;When I am trying to run the code in "Playing with the data source" section, I get a error said&lt;/P&gt;&lt;P&gt;"&lt;BR /&gt;ERROR in app/src/app/mydatatable/mydatatable.component.ts:17:35 - error TS2339: Property 'webScript' does not exist on type 'AlfrescoApi'.&lt;/P&gt;&lt;P&gt;17 this.apiService.getInstance().webScript.executeWebScript(&lt;BR /&gt;"&lt;/P&gt;&lt;P&gt;How to fix it? or any materials I should read?&lt;/P&gt;&lt;P&gt;My mydatatable.component.ts code:&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: 'aca-mydatatable',
  templateUrl: './mydatatable.component.html',
  styleUrls: ['./mydatatable.component.scss']
})
export class MydatatableComponent implements OnInit {


  data = new ObjectDataTableAdapter([],[]);

  constructor(private apiService: AlfrescoApiService) {
    this.apiService.getInstance().webScript.executeWebScript(
      'GET',
      'people',
      [],
      null,
      '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.id);
  }

}&lt;/PRE&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 22:12:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/property-webscript-does-not-exist-on-type-alfrescoapi/m-p/12830#M5646</guid>
      <dc:creator>Upladder</dc:creator>
      <dc:date>2022-01-31T22:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Property 'webScript' does not exist on type 'AlfrescoApi'</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/property-webscript-does-not-exist-on-type-alfrescoapi/m-p/12831#M5647</link>
      <description>&lt;P&gt;&lt;SPAN&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;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 08:39:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/property-webscript-does-not-exist-on-type-alfrescoapi/m-p/12831#M5647</guid>
      <dc:creator>KarekMedAM</dc:creator>
      <dc:date>2022-03-28T08:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Property 'webScript' does not exist on type 'AlfrescoApi'</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/property-webscript-does-not-exist-on-type-alfrescoapi/m-p/12832#M5648</link>
      <description>&lt;P&gt;hei sorry to bother can you give a example of the new solution ?&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 11:27:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/property-webscript-does-not-exist-on-type-alfrescoapi/m-p/12832#M5648</guid>
      <dc:creator>AlfrescoZZZ</dc:creator>
      <dc:date>2022-05-25T11:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Property 'webScript' does not exist on type 'AlfrescoApi'</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/property-webscript-does-not-exist-on-type-alfrescoapi/m-p/12833#M5649</link>
      <description>&lt;P&gt;Use the&amp;nbsp;EcmUserService.&lt;/P&gt;&lt;PRE&gt;  constructor(private userService:EcmUserService) { 
   
  }

getAllUsers(): void {


    this.userService.peopleApi.listPeople().then(
      (data:any) =&amp;gt; {
        data = data.list.entries;    
      },
      (error: HttpErrorResponse) =&amp;gt; {
      console.log (error.name + ' ' + error.message);
      });
  }&lt;/PRE&gt;&lt;P&gt;Then use data however you like to, just like any variable in angular.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 07:56:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/property-webscript-does-not-exist-on-type-alfrescoapi/m-p/12833#M5649</guid>
      <dc:creator>KarekMedAM</dc:creator>
      <dc:date>2022-06-01T07:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Property 'webScript' does not exist on type 'AlfrescoApi'</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/property-webscript-does-not-exist-on-type-alfrescoapi/m-p/12834#M5650</link>
      <description>&lt;P&gt;Hi! Could you explain to me where you found these? The EcmUserService isn't listed verbatim in the documentation?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 20:07:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/property-webscript-does-not-exist-on-type-alfrescoapi/m-p/12834#M5650</guid>
      <dc:creator>justinmccune</dc:creator>
      <dc:date>2022-06-27T20:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Property 'webScript' does not exist on type 'AlfrescoApi'</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/property-webscript-does-not-exist-on-type-alfrescoapi/m-p/12835#M5651</link>
      <description>&lt;P&gt;look at these links:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.alfresco.com/abn/adf/docs/core/services/ecm-user.service/#" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.alfresco.com/abn/adf/docs/core/services/ecm-user.service/#&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Alfresco/alfresco-ng2-components/blob/develop/lib/core/services/ecm-user.service.ts" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/Alfresco/alfresco-ng2-components/blob/develop/lib/core/services/ecm-user.service.ts&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and use it in this way:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;constructor&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;private&lt;/SPAN&gt; &lt;SPAN&gt;userService&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;EcmUserService&lt;/SPAN&gt;&lt;SPAN&gt;) { &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//this for example will get all the users in ECM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;this&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;userService&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;peopleApi&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;listPeople&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Jun 2022 12:50:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/property-webscript-does-not-exist-on-type-alfrescoapi/m-p/12835#M5651</guid>
      <dc:creator>KarekMedAM</dc:creator>
      <dc:date>2022-06-30T12:50:57Z</dc:date>
    </item>
  </channel>
</rss>

