How to Modify Ektron JS/CSS QueryString for DB Lookup

  • Updated

This article describes how to affect a change or reset orders to the registered css and js files by the Ektron API. An example of a load url with query string is seen below.

Javascript
http://<mysite.com>/WorkArea/FrameworkUI/js/ektron.javascript.ashx?id=-569449246+
-1939951303+-1080527330+-1687560804+-1793043690+-1189826226+
-1660625290+825525963+-1823320997+-1377047657+-687746024+
-2119520991+609931254+1200042959+986521766+-1799470022
+-733086262+586636464+-729461897+-473082503+1873998555+1082217212

CSS
http://<mysite.com>/WorkArea/FrameworkUI/css/ektron.stylesheet.ashx?id=1808975075+331793731+
1718398281+1833304528+-1102171416+1217741438+-1674036448+1982044299+
-797538360+1757478745+1613283725+-1531013100+
-2129247136+-300771134+1985268503+1260906209+1573820346+
1902164205+-1651877840+-399940767+-661901297+-1122867811

The list of ids in the query string allows a database look up to be done to extract the css or js file path and is stored in the ektron db table registration_tbl.

For example in the database

RegistrationId: 342
FileId: 178692105
FilePath: /widgets/realisecontentblock/layouts/productfeatures/productfeatures.css
DateAdded: 2014-10-15 15:50:58.980

The query string values are based on a hash of the filename that was registered. If the customer wants to change the URL, they could register an additional file, or change one of the existing filenames. Clearing the database table is fine to do, but it won't regenerate with different ids, so it should be irrelevant here.

In summary there are three ways to change that URL:

  • Register another file
  • Change the order
  • Change one of the filenames that is being registered