{"id":13505476,"url":"https://github.com/Esri/application-base-js","last_synced_at":"2025-03-30T00:30:53.946Z","repository":{"id":20309311,"uuid":"89270854","full_name":"Esri/application-base-js","owner":"Esri","description":"A core class for creating a configurable application using JavaScript/TypeScript","archived":false,"fork":false,"pushed_at":"2022-05-26T18:13:05.000Z","size":366,"stargazers_count":20,"open_issues_count":5,"forks_count":9,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-04T12:28:18.634Z","etag":null,"topics":["arcgis-api","arcgis-js-api","boilerplate","boilerplate-application","boilerplates","javascript","javascript-applications","typescript","web-development"],"latest_commit_sha":null,"homepage":"https://developers.arcgis.com/javascript/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Esri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-24T17:57:48.000Z","updated_at":"2024-10-04T10:21:06.000Z","dependencies_parsed_at":"2022-08-24T00:30:28.772Z","dependency_job_id":null,"html_url":"https://github.com/Esri/application-base-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esri%2Fapplication-base-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esri%2Fapplication-base-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esri%2Fapplication-base-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esri%2Fapplication-base-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Esri","download_url":"https://codeload.github.com/Esri/application-base-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262490,"owners_count":20749170,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arcgis-api","arcgis-js-api","boilerplate","boilerplate-application","boilerplates","javascript","javascript-applications","typescript","web-development"],"created_at":"2024-08-01T00:01:08.736Z","updated_at":"2025-03-30T00:30:49.134Z","avatar_url":"https://github.com/Esri.png","language":"TypeScript","readme":"# Deprecated\nThis repo is no longer maintained. The functionality has been forked and is being maintained in the [Templates Common Library repo](https://github.com/Esri/templates-common-library/blob/master/src/baseClasses/ApplicationBase.ts)\n\n# ApplicationBase\n\nA class designed to handle common tasks of configurable ArcGIS Web Applications.\n\n**See [Configurable App Examples](https://github.com/Esri/configurable-app-examples-4x-js) using this class**.\n\n## Purpose\n\nThe purpose of this ApplicationBase is to handle fetching and managing ArcGIS Online information used in configurable applications. The ApplicationBase queries and maintains:\n\n- Portal information\n- User information\n- Item data (webscenes, webmaps, group information, group items)\n- Configured application information\n- URL parameters\n\nThe ApplicationBase will handle fetching this information, store it, and perform setup when necessary.\n\n# API\n\nThis is the API for the ApplicationBase class. `ApplicationBase.js`\n\n## Constructor\n\n`new ApplicationBase(ApplicationConfig: ApplicationConfig, ApplicationBaseConfig: ApplicationBaseConfig)`\n\n## Constructor Options\n\nSee [ApplicationConfig](#applicationconfig) and [ApplicationBaseConfig](#applicationbaseconfig) for more information.\n\n### ApplicationConfig\n\n|property|description|type|default|\n|---|---|---|---|\n|appid|Application ID for querying application configuration|string|\"\"|\n|group|Group ID for querying a portal group|string or string[]|\"\"|\n|webscene|WebScene ID for querying a webscene|string or string[]|\"19faa71a3bf6468cae35b4fce9393a7d\"|\n|webmap|WebMap ID for querying a webmap|string or string[]|\"\"|\n|title|Title of the application|string|\"\"|\n|portalUrl|URL to the ArcGIS Portal|string|\"https://www.arcgis.com\"|\n|oauthappid|oAuth authentication ID|string|\"\"|\n|proxyUrl|Enter the url to the proxy if needed by the application. See the [Using the proxy page](http://developers.arcgis.com/en/javascript/jshelp/ags_proxy.html) help topic for details.|string|\"\"|\n|units|Application measurement units|string|\"\"|\n|helperServices|Object containing URLs to various helper services|[HelperServices](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#helperServices)|null|\n\nExample:\n\n```json\n{\n  \"appid\": \"\",\n  \"group\": \"\",\n  \"title\": \"\",\n  \"webmap\": \"default\",\n  \"webscene\": \"\",\n  \"portalUrl\": \"https://www.arcgis.com\",\n  \"oauthappid\": \"\",\n  \"proxyUrl\": \"\",\n  \"units\": \"\",\n }\n```\n\n### ApplicationBaseConfig\n\n|property|description|type|default|\n|---|---|---|---|\n|webscene.default|The default id to query when not set|string|\"\"|\n|webscene.fetch|When true the application will query for a webscene|Boolean|true|\n|webscene.fetchMultiple|When true the application will query for multiple webscenes if necessary|Boolean|true|\n|webmap.default|The default id to query when not set|string|\"\"|\n|webmap.fetch|When true the application will query for a webmap|Boolean|false|\n|webmap.fetchMultiple|When true the application will query for multiple webmaps if necessary|Boolean|true|\n|group.fetchInfo|When true the application will query for a group's information|Boolean|false|\n|group.fetchItems|When true the application will query for a group's items|Boolean|false|\n|group.itemParams|Defines query paramaters for fetching group items|[itemParams](#itemparams)|{}|\n|group.fetchMultiple|When true the application will query for multiple groups if necessary|Boolean|true|\n|portal.fetch|When true the application will query arcgis.com for default settings for helper services, units etc. If you want to use custom settings for units or any of the helper services set this to false then enter default values for any items you need using the helper services and units properties.|Boolean|true|\n|urlParams|Defines which URL parameters should be captured and stored into the config for use within the application|String[]|See below|\n|environment.webTierSecurity|Support sending credentials with AJAX requests to specific domains. This will allow editing of feature services secured with web-tier authentication|Boolean|false|\n|environment.isEsri|Most users will not need to modify this value. For Esri hosting environments only. Will automatically create a `portalUrl` and `proxyUrl` for the application. Only set this is to true if the app is going to be stored on Esri's hosting servers. If you are using your own custom hosted portal, set the `portalUrl` in instead of setting this to true.|   Boolean|false|\n\n\nExample:\n\n```json\n{\n  \"environment\": {\n    \"isEsri\": false,\n    \"webTierSecurity\": false\n  },\n  \"localStorage\": {\n    \"fetch\": true\n  },\n  \"group\": {\n    \"default\": \"908dd46e749d4565a17d2b646ace7b1a\",\n    \"fetchInfo\": false,\n    \"fetchItems\": false,\n    \"itemParams\": {\n      \"sortField\": \"modified\",\n      \"sortOrder\": \"desc\",\n      \"num\": 9,\n      \"start\": 0\n    }\n  },\n  \"portal\": {\n    \"fetch\": true\n  },\n  \"urlParams\": [\n    \"appid\",\n    \"center\",\n    \"components\",\n    \"embed\",\n    \"extent\",\n    \"find\",\n    \"group\",\n    \"level\",\n    \"marker\",\n    \"oauthappid\",\n    \"portalUrl\",\n    \"viewpoint\",\n    \"webmap\",\n    \"webscene\"\n  ],\n  \"webmap\": {\n    \"default\": \"1970c1995b8f44749f4b9b6e81b5ba45\",\n    \"fetch\": true\n  },\n  \"webscene\": {\n    \"default\": \"e8f078ba0c1546b6a6e0727f877742a5\",\n    \"fetch\": false\n  }\n}\n```\n\n#### itemParams\n\nSee [PortalQueryParams](https://developers.arcgis.com/javascript//latest/api-reference/esri-portal-PortalQueryParams.html)\n\nExample:\n\n```json\n{\n  \"query\": \"group:\\\"{groupid}\\\" AND -type:\\\"Code Attachment\\\"\",\n  \"sortField\": \"modified\",\n  \"sortOrder\": \"desc\",\n  \"num\": 9,\n  \"start\": 0\n}\n```\n\n## Properties\n\n|property|description|type|readonly|\n|---|---|---|---|\n|config|Config created|[ApplicationConfig](#applicationconfig)|true|\n|direction|Language direction|string|true|\n|locale|Locale string|string|true|\n|isIE|True when IE11 and older boolean|boolean|true|\n|portal|`Portal` created by ApplicationBase|[Portal](https://developers.arcgis.com/javascript//latest/api-reference/esri-portal-Portal.html)|true|\n|results|ApplicationBase query results|[ApplicationBaseResults](#applicationbaseresults)|true|\n|settings|Config created|[ApplicationBaseConfig](#applicationbaseconfig)|true|\n|units|Appropriate units of measurement|string|true|\n\n\n### ApplicationBaseResult\n\n|property|description|type|\n|---|---|---|\n|error|The error returned from the query|Error|\n|value|The value returned from the query|any|\n|promise|The query promise|Promise\u0026lt;any\u0026gt;|\n\n### ApplicationBaseResults\n\n|property|description|type|\n|---|---|---|\n|applicationItem?|The application item result|[ApplicationBaseResult](#applicationbaseresult)|\n|applicationData?|The application data result|[ApplicationBaseResult](#applicationbaseresult)|\n|groupInfos?|The restults from querying group infos|[ApplicationBaseResult](#applicationbaseresult)[]|\n|groupItems?|The results from querying group items|[ApplicationBaseResult](#applicationbaseresult)[]|\n|localStorage?|The local storage configuration result|[ApplicationConfig](#applicationconfig)|\n|portal?|The Portal instance result|[Portal](https://developers.arcgis.com/javascript//latest/api-reference/esri-portal-Portal.html)|\n|urlParams?|The results from URL parameters|[ApplicationConfig](#applicationconfig)|\n|webMapItems?|The restults from querying webmap items|[ApplicationBaseResult](#applicationbaseresult)[]|\n|webSceneItems?|The restults from querying webscene items|[ApplicationBaseResult](#applicationbaseresult)[]|\n\n## Methods\n\n### load(): Promise\u0026lt;ApplicationBase\u0026gt;\n\nLoads the requested ApplicationBase resources and returns the class once complete.\n\n### queryGroupItems(groupId: string, itemParams: [itemParams](#itemparams), portal?: [Portal](https://developers.arcgis.com/javascript//latest/api-reference/esri-portal-Portal.html)) : Promise\u0026lt;any\u0026gt;\n\nQuery a group by parameters. `ApplicationBase.queryGroupItems(\"myid\", {}, myPortal)`.\n\n## Support Modules\n\nThere are helper modules and utilities you can use that contain common application functionality. See the following documentation:\n\n- [domHelper](support/domHelper.MD)\n- [itemUtils](support/itemUtils.MD)\n- [urlUtils](support/urlUtils.MD)\n\n## Requirements\n\n- [TypeScript](https://www.typescriptlang.org/)\n  - [TypeScript Setup](https://developers.arcgis.com/javascript//latest/guide/typescript-setup/index.html)\n- [NPM](https://www.npmjs.com/)\n\n## Resources\n\n* [Configurable App Examples](https://github.com/Esri/configurable-app-examples-4x-js) using this class.\n* [Community](https://developers.arcgis.com/en/javascript/jshelp/community.html)\n* [ArcGIS for JavaScript API Resource Center](https://js.arcgis.com)\n* [ArcGIS Blog](http://blogs.esri.com/esri/arcgis/)\n* [twitter@esri](http://twitter.com/esri)\n\n## Issues\n\nFind a bug or want to request a new feature?  Please let us know by submitting an issue.\n\n## Contributing\n\nEsri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](https://github.com/esri/contributing).\n\n## Licensing\n\nCopyright 2017 Esri\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\nA copy of the license is available in the repository's [license.txt](https://raw.github.com/Esri/application-base-js/master/license.txt) file.\n\n","funding_links":[],"categories":["Code samples and snippets"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEsri%2Fapplication-base-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEsri%2Fapplication-base-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEsri%2Fapplication-base-js/lists"}