So I think you're encoding it as an Authorization Header?  

In that case, you can extract this from

set Auth = %request.GetCgiEnv("HTTP_AUTHORIZATION")

then process this however you need to (for example if you have something like "Basic 123908109abc", this will unpack it and decode the Base64)

 set AuthType = $P(Auth," ",1)
  set AuthString = $P(Auth," ",2)
    set DecodeAuthString = $SYSTEM.Encryption.Base64Decode(AuthString)
    set userid = $p(DecodeAuthString,":",1)
    set token  = $p(DecodeAuthString,":",2)

If you're iterating that would typically be done with a CURSOR.  Each fetch cycle would pop the new state of the variables in, in line with each row (make sure you check for SQLCODE while doing this, to determine if there is a row to fetch).

More documentation on this is at

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

EDIT:

Mixed my dynamic SQL methods there.  You would use rset.%Next to do this iteration in %SQL.Statement, but the general theory still holds

http://localhost:57773/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_dynsql#G...

Hi Kishan

A method is attached to a specific instance of an Object class.  A Classmethod can be called without having to instantiate the object.

So, we could have a Method on a Person object to update address

do person.UpdateAddress("New address")

Whereas, for a ClassMethod, we could define a Classmethod to give us as object instance to then work on

set person = ##class(User.Person).CreatePerson("FirstName","LastName",Age)

 

Hope that helps?

I don't think this is a great idea, to mix the technologies, as both will try to manipulate the DOM, and you would likely see strange behaviour

If you are migrating the application in a modular fashion, I've found it's best to keep the functionality seperate, and tune the navigation to switch between the appropriate technologies and migrate the existing pages as you go.  The only thing to be careful about is your %session state if you do this (I've barely used %session on my Angular code, and instead try to write everything to work in a stateless fashion)

There can be more to "speed" that just execution time of your code.  If you need to add an index to help performance, then a Caché SQL query will be able to utilise it without any code changes.  If you are using $Order, then you need to spend some time writing and testing your new code.

I typically use SQL to identify objects, then Object methods to interact with them, but for simple updates of large numbers of objects, I'll usually use a simple SQL Update.  The beauty of Caché is the flexibility to use the best tool for the task at hand