Thursday, April 23, 2015

Delphi XE8's GetIt

In XE8 there is menu Tools\GetIt to easily get and install some products.

How Delphi IDE access to GetIt store?

It does POST requests, you can check these REST APIs

http://getit.embarcadero.com/

POST /catalog/info Return an array of matching elements by text
POST /catalog/infobyids Return an array of matching elements by id
POST /catalog/dependencyinfo Return dependencies Ids separated by ';'

There are parameters

Search (for filtering), Personalities (Delphi or C Builder), CatalogVersion, Start, End to get only needed items by ID.

Result is JSON array which is parsed by IDE and items shown.

TypeId defines what is kind of the catalog item obtained.

There are item id, name, description, vendor, vendor url, image url, version, tags, supported platforms



For example here's one image right from cloud



And info

    "Id": "Abbrevia-10.0",
    "Name": "Abbrevia",
    "Version": "10.0",
    "Description": "Abbrevia is a compression toolkit for Delphi, C++Builder, Kylix and Free Pascal.\r\n\r\nSupported on platforms: Windows, Android, OS X, iOS.",
    "Vendor": "TurboPack",
    "VendorUrl": "http://www.turbopack.net",
    "Image": "https://d13fw8on3rob2n.cloudfront.net/images/Abbrevia3.png",
    "TypeId": "1",
    "TypeDescription": "Library",
    "Tags": "Abbrevia",
    "LibLicense": "https://d13fw8on3rob2n.cloudfront.net/licenses/MPL1.0.txt",
    "LibUrl": "https://d13fw8on3rob2n.cloudfront.net/libraries/Abbrevia.zip",
    "LibProjectUrl": "https://github.com/TurboPack/Abbrevia/",
    "Modified": "2015-03-18 08:26:38",
    "LibLicenseName": "MOZILLA PUBLIC LICENSE",
    "State": "1",
    "LibCode": "1",
    "LibCodeName": "Delphi.Personality",
    "LibPlatforms": [
      {
        "Id": "1",
        "Name": "x86"
      },
      {
        "Id": "4",
        "Name": "x64"
      }


IDE does download and unzip catalogs to its repository, located at

<user documents> \embarcadero\studio\16.0\CatalogRepository\<ItemName>

There are Actions node in JSON data to know how installation must be done.

For example

        "Id": "1",
        "ActionId": "6",
        "ActionName": "CompileProject",
        "Type": "2",
        "Description": "Compile AbbreviaD.dproj",
        "Parameter": [
          {
            "Parameter": "packages\\Delphi\\AbbreviaD.dproj"
          }
        ]

or 

        "Id": "6",
        "ActionId": "7",
        "ActionName": "InstallPackage",
        "Type": "3",
        "Description": "Installs AbbreviaVCLDDesign.bpl package",
        "Parameter": [
          {
            "Parameter": "AbbreviaVCLDDesign.bpl"
          }
        ]

or

        "Id": "7",
        "ActionId": "1",
        "ActionName": "AddOptionPath",
        "Type": "3",
        "Description": "Add library path for Delphi",
        "Parameter": [
          {
            "Parameter": "source\\"
          },
          {
            "Parameter": "cPasLibraryPath"
          },
          {
            "Parameter": "Delphi.Personality"
          }
        ]

or

      {
        "Id": "11",
        "ActionId": "8",
        "ActionName": "UninstallPackage",
        "Type": "5",
        "Description": "Uninstalls AbbreviaVCLDDesign.bpl package",
        "Parameter": [
          {
            "Parameter": "AbbreviaVCLDDesign.bpl"
          }
        ]
      },

or

        "Id": "12",
        "ActionId": "2",
        "ActionName": "RemoveOptionPath",
        "Type": "5",
        "Description": "Remove library path for Delphi",
        "Parameter": [
          {
            "Parameter": "source\\"
          },
          {
            "Parameter": "cPasLibraryPath"
          },
          {
            "Parameter": "Delphi.Personality"
          }
        ]

No comments:

Post a Comment