Method of contextual annotation based on third-party application programming interfaces
Techniques are described for contextual annotation based on third party application programming interfaces. In an embodiment, metadata that represents a configuration of an organization-specific instance of a web application and comprising a plurality of objects pertaining to the configuration is received. The URL of a resource of the web-based application, i.e. the URL of a web page, is parsed to determine a particular object that is associated with the resource. The resource associated with the URL and the received metadata are used to determine text element(s) from the resource that correspond to one or more fields of the particular object. Annotation code is injected into the resource that is associated with the URL of the web-based application. A web page is displayed that includes a graphical display of the text element(s) annotated with selectable icons that correspond to the annotation code.
1 . A computer-implemented method comprising:
receiving, via a programming interface, metadata, the metadata representing a configuration of an organization-specific instance of a web application and comprising a plurality of objects pertaining to the configuration, each object of the plurality of objects comprising one or more fields;
determining, based on a universal resource locator (URL) of a resource of the web application and the plurality of objects, a particular object that is associated with the resource;
determining, based on the resource associated with the URL and the metadata, one or more text elements from the resource that correspond to one or more fields of the particular object;
injecting annotation code into the resource that is associated with the URL of the web application, the annotation code based on the one or more text elements;
causing display of a web page that is associated with the URL of the web application, the web page including the one or more text elements annotated with icons that correspond to the annotation code.
2 . The computer-implemented method of claim 1 , further comprising:
determining, using a container mapping, one or more known containers that exist within the resource that is associated with the URL of the web application;
determining, based on the one or more known containers, one or more containerized text elements from the resource that correspond to one or more fields of one or more objects that are associated with the one or more known containers;
wherein the annotation code that is injected into the resource that is associated with the URL of the web application is further based on the one or more containerized text elements;
wherein the display of the web page that is associated with the URL of the web application includes the one or more containerized text elements annotated with selectable icons that correspond to the annotation code.
3 . The computer-implemented method of claim 1 , wherein the resource comprises source code of the web page that is associated with the URL of the web application.
4 . The computer-implemented method of claim 1 , wherein the web application comprises a customer relationship management system.
5 . The computer-implemented method of claim 1 , wherein the metadata describes a structure of one or more web pages of the web application.
6 . The computer-implemented method of claim 1 , wherein the injecting annotation code into the resource that is associated with the URL of the web application comprises transmitting a request to a Document Object Model (DOM) Application Programming Interface (API) of the web page that is associated with the URL of the web application.
7 . The computer-implemented method of claim 1 , wherein the determining, based on the resource associated with the URL and the metadata, one or more text elements from the resource that correspond to one or more fields of the particular object includes querying text elements identified in the resource against the metadata.
8 . The computer-implemented method of claim 1 , further comprising:
receiving a selection of selectable icons that correspond to the annotation code;
in response to the selection, causing display of a window that includes metadata definition data, the metadata definition data providing information about the one or more fields of the particular object.
9 . A system comprising:
one or more processors;
one or more storage devices operatively coupled to the one or more processors;
instructions, stored on the one or more storage devices, which, when executed by the one or more processors, cause:
receiving, via a programming interface, metadata, the metadata representing a configuration of an organization-specific instance of a web application and comprising a plurality of objects pertaining to the configuration, each object of the plurality of objects comprising one or more fields;
determining, based on a URL of a resource of the web application and the plurality of objects, a particular object that is associated with the resource;
determining, based on the resource associated with the URL and the metadata, one or more text elements from the resource that correspond to one or more fields of the particular object;
injecting annotation code into the resource that is associated with the URL of the web application, the annotation code based on the one or more text elements;
causing display of a web page that is associated with the URL of the web application, the web page including the one or more text elements annotated with selectable icons that correspond to the annotation code.
10 . The system of claim 9 , wherein the instructions further comprise instructions, which, when executed by the one or more processors, cause:
determining, using a container mapping, one or more known containers that exist within the resource that is associated with the URL of the web application;
determining, based on the one or more known containers, one or more containerized text elements from the resource that correspond to one or more fields of one or more objects that are associated with the one or more known containers;
wherein the annotation code that is injected into the resource that is associated with the URL of the web application is further based on the one or more containerized text elements;
wherein the display of the web page that is associated with the URL of the web application includes the one or more containerized text elements annotated with icons that correspond to the annotation code.
11 . The system of claim 9 , wherein the resource comprises source code of the web page that is associated with the URL of the web application.
12 . The system of claim 9 , wherein the web application comprises a customer relationship management system.
13 . The system of claim 9 , wherein the metadata describes a structure of one or more web pages of the web application.
14 . The system of claim 9 , wherein the injecting annotation code into the resource that is associated with the URL of the web application comprises transmitting a request to a DOM API of the web page that is associated with the URL of the web application.
15 . The system of claim 9 , wherein the determining, based on the resource associated with the URL and the metadata, one or more text elements from the resource that correspond to one or more fields of the particular object includes querying text elements identified in the resource against the metadata.
16 . The system of claim 9 , wherein the instructions further comprise instructions, which, when executed by the one or more processors, cause:
receiving a selection of the selectable icons that correspond to the annotation code;
in response to the selection, causing display of a window that includes metadata definition data, the metadata definition data providing information about the one or more fields of the particular object.