jQuery - 2.3


Compatibility: v2 v3 Express
What's new? Release Notes
ID: com.castsoftware.jquery

Description

This extension provides support for jQuery.

In what situation should you install this extension?

If your Web application contains jQuery source code and you want to view these object types and their links with other objects, then you should install this extension:

  • Creates jQuery events and access points to services:
    • jQuery events: they represent a query in DOM tree
    • jQuery access points to web services: CAST_JQuery_GetResourceService, CAST_JQuery_PutResourceService, CAST_JQuery_PostResourceService, CAST_JQuery_PatchResourceService
  • Creates links (direct or indirect) from jQuery events to jQuery access points to services (these links are created by the jQuery extension and the HTML5/JavaScript extension).
  • Links from the jQuery access points to services to different servers written in other languages are then created by the WBSlinker extension (an internal extension).
  • The following declarations will create a jQuery event:
$('#advancedLoginOptionsLink').bind('click', dm.login.toggle_advanced);
$('#advancedLoginOptionsLink').click(dm.login.toggle_advanced);
$('#advancedLoginOptionsLink').on('click', this.destroy.bind(this));....

Transaction configuration

Default entry point is the HTML file content.

Supported jQuery versions

Versions Supported?
1.0 - 3.x

Transactions

Transaction support is derived from metamodel concepts used to build CAST Imaging Blueprint and structural transaction flows. Entry Points start transactions; Exit Points include both output/boundary concepts and Data Entities manipulated by transactions.

Role Support Breakdown
Entry Point No direct concept type details
Exit Point
  • Web Services Call

Data version: 2.3.15-funcrel

ISO 5055 Structural Rules

Quality support is based on ISO 5055 structural rules available for the selected extension version.

Reliability Maintainability Security Performance Efficiency

Data version: 2.3.15-funcrel

Dependencies with other extensions

Some CAST extensions require the presence of other CAST extensions in order to function correctly. The jQuery extension requires that the following other CAST extensions are also installed (this will be handled automatically):

Download and installation instructions

The extension will be automatically downloaded and installed.

What results can you expect?

Once the analysis/snapshot generation has completed, you can view the results in the normal manner:

Objects

Type Name Description
JQuery selector jQuery Selector Represents a jQuery selector used to retrieve or manipulate DOM elements.
JQuery PATCH resource service jQuery PATCH resource service Represents a PATCH web service call made through jQuery AJAX APIs.
JQuery DELETE resource service jQuery DELETE resource service Represents a DELETE web service call made through jQuery AJAX APIs.
JQuery GET resource service jQuery GET resource service Represents a GET web service call made through jQuery APIs such as $.ajax, $.get, $.getJSON, or $.getScript, including supported SAP jQuery variants.
JQuery POST resource service jQuery POST resource service Represents a POST web service call made through jQuery APIs such as $.ajax, including supported SAP jQuery variants.
JQuery PUT resource service jQuery PUT resource service Represents a PUT web service call made through jQuery AJAX APIs.

Web Service calls

The following libraries are supported for Web Service HTTP calls:

  • $.ajax
  • $.get
  • $.post
  • jQuery.sap.syncGet
  • jQuery.sap.syncGetJSON
  • jQuery.sap.syncGetText
  • jQuery.sap.syncPost
  • Ajax.Request
  • Ext.Ajax.request
  • CQ.Ext.Ajax.request

Once the JQuery extension analysis is finished, the analyzer will give the output, i.e., the final number of web service calls created.

These web services are resolved to web service operations on the server side for the following supported frameworks: Node.js, JAX-RS, Spring MVC:

$.ajax

$.ajax({
    type: 'POST',
    url: val ? '_auth/login' : '_auth/logout',
    data: {assertion: assertion},
    success: function(res, status, xhr) { window.location.reload(); },
    error: function(xhr, status, err) {
        box.remove();
        navigator.id.logout();
        alert('Login failure: ' + err);
    }
});

$.get

$.get("ajax/test.html", function( data ) 
    { 
        $( ".result" ).html( data ); 
        alert( "Load was performed." ); 
    }
);

$.post

$.post( "ajax/test.html", function( data ) { $( ".result" ).html( data ); });

jQuery.sap.syncGet

jQuery.sap.syncGet("syncGet_url", { dataType: "json" });

jQuery.sap.syncGetJSON

jQuery.sap.syncGetJSON("syncGetJSON_url", { dataType: "json" });

jQuery.sap.syncGetText

jQuery.sap.syncGetText("syncGetText_url", { dataType: "json" });

jQuery.sap.syncPost

jQuery.sap.syncPost("syncPost_url", { dataType: "json" });

Ajax.request

new Ajax.Request('/your/url', {
  onSuccess: function(response) {
    // Handle the response content...
  }
});

Ext.Ajax.request

Ext.Ajax.request({
            url: '/api/students',
            method: 'GET',
            timeout: 60000,
            params:
            {
                id: 1 // loads student whose Id is 1
            },
            headers:
            {
                'Content-Type': 'application/json'
            },
            success: function (response) {
            
            },
            failure: function (response) {
                Ext.Msg.alert('Status', 'Request Failed.');

            }
        });

CQ.Ext.Ajax.request

CQ.Ext.Ajax.request({
   url: 'foo.php',
   success: someFn,
   failure: otherFn,
   headers: {
       'my-header': 'foo'
   },
   params: { foo: 'bar' }
});

Quality rules