How to find functions, methods, variables and some explanations about classes? API?

Hi,

normally i would type "java api string" into google and easy find the String-Class API for that.

As i understood till now there is not API for Identity Manager. Is that correct?

So lets say i have this code, based on some single-line copies out of your SDK-ScriptSamples:

    Dim qPerson2 = Query.From("Person") _
                  .Where(Function(c) c.Column("FirstName") = Firstname).SelectCount()
    
    ' Load a collection of Person objects
    colPersons = Session.Source.GetCollection(qPerson2)
    ' Run through the list
    For Each colElement As IEntity In colPersons

        ' Create a full Person object from the list element.
        ' Attention: This triggers a database SELECT operation
        ' to get the missing values in most cases.
        dbPerson = colElement.Create(Session, EntityLoadType.Interactive)
        colElement.PutValue("Firstname", "Paula2")
    Next

Line 1 was from 01 Simple collections.vb, but i changed "Paula" to variable Firstname.

Line 13 was from me

The other lines where from 01 Simple collections.vb as well but form the other method.

Now compiler says: compiled successfully.

Runtimeerror says: Exception has been thrown by the target of an invocation.

[...]

Count or Exists queries are not valid for this operation

[...]

First question: There are no line numbers told or even a copy of the line where the exception ocurred. How to debug this in a long code base? No chance to find where the problem occurs.

Second question: Lets say i figured out that the problem is at line 2. I delete "SelectCount()" and hit CTRL+Space to get some auto-suggestions. But sadly no appear. at least "SelectCount()" should appear at this point. I don't understand how to program under this circumstances. I have no API and not auto-suggestions. How to even know what i can access and what the methods i access actually do?

My boss told me that i won't get Microsoft Visual Studio. He says i need to use the Designer -> Script Library to program or the ObjectBrowser.

So i don't understand how to access information that help me to understand which classes are available, which methods and variables are available and what they all do.

Thanks - Michael

Parents
  • You may want to check if the Visual Studio Community Edition applies in your case https://visualstudio.microsoft.com/de/vs/community/

    And, as I have written in other threads, you may want to use the video series as well to learn how to use the object layer API from One Identity Manager. In the Designer you can also access a snipper library (F2) to get the source code snippets for the most common use cases.

    The script editor in Designer has some IntelliSense capabilities but nothing in comparison to the full power of an IDE like Visual Studio, sorry.

    In regards to your code sample. The Query object uses a fluent interface. And by using SelectCount() you are telling the query object you just want to get the count of the specified list of objects. But then you are using this Query object to load a complete collection and work with the entities in that collection, which makes no sense.

  • a)

    Currently i am working on the

    Free Virtual Trial provided on https://www.oneidentity.com/register/64187/

    So for the moment there is no software installation possible. I asked for a test environment but i don't have some yet

    b)

    Yes i will check on that video series again. i paused watching them because after i have seen the first 2 videos i was not able to follow them because my problems start earlier. (Hello World is actually not working).

    c) Yes this was only an example with SelectCount(). I am aware of the fact that SelectCount() is not good in this case. But after deleting it and hitting CTRL+Space nothing was shown what i could take. And as there is no API of 1IM i can not look in the API. So i have no clue what to type instead of SelectCount().

    d) For all reading this later: You have to push F2 while in editing mode of a script and then you get the possiblility of inserting code snippets. This refers to page 338 in OneIM_Configuration.pdf

      

    As you are an employee of 1IM and Quest: This is what we newbees need easily findable in the internet over google and/or in the technical documentation to do our first steps. Please make cool tutorials with additional explainations (so that we understand whats going on) out of that code and put it on a "Scripting in 1IM Tutorials" Website on your main website.

    Or in german:

    Ich schlage vor aus diesen Codeschnippseln ausgearbeitete Tutorials mit zusätzlichen Erklärungen zu den 1IM-spezifischen Klassen zu machen und diese auf eurer Hauptwebseite und in den technischen Dokumenten zu veröffentlichen.

    This is actually one part of what i search for the whole time. This is not easy to find. Should be more prominent. These do not replace an API (i actually don't understand why there is no) as the snippets do not replace enhanced tutorials but they are better than nothing (i had nothing till now)

    Thanks - Michael

  • In regards to c)

    If you open the fly-out of the ScriptEditor in Designer with the little caret on the lower right-hand corner you will see more toolbar icons that allow you to trigger for example WordCompletion (CTRL+SPace you are seeking). I do not know the keyboard shortcut.

    In regards to d)

    I can push this down to the team for investigation in regard to tutorials.

    But I do not get your point that there is no API. You do have the .NET API (aka Object Layer) and you do have a REST-API.

  • Disclaimer: I had to remove all links to text only (and delete http) so they are not clickable. Reason: Forum will mark my post as spam instantly if i post links. You should think about changing the forum rules. It is very hard to work productive like that!
    Original Post:

    Sadly API has two meanings. So talking about API can be confusing.

    First API can mean "possiblity to access functions from a webservice without using the website, but by using program code". For example a REST-API.

    I am not talking about this type of "technical access to functions".

    Second API in context of programming can mean that there is a website where you can see information about classes, functions, variables. You can see explantions, and maybe code examples.

    For example for Java-programming-language you can quickly search for "java api" in google and find docs.oracle.com/javase/8/docs/api/

    For example we can be interested in the "String" class of Java and open that: docs.oracle.com/javase/8/docs/api/index.html?java/lang/String.html

    It will provide us much information about the String class:

    - Where did it inherit from? (java.lang.Object)
    - Which interfaces are implementes by String?
    - Coding examples
    - Field Summary (With at least 1 sentence of explanation!)
    - Constructor Summary (With at least 1 sentence of explanation!)
    - Method Summary (With at least 1 sentence of explanation!)
    - Methods inherited from ...
    - Details on Fields, Contructors, Methods (With several sentences of explanation!)

    In Java we call this the "JavaDoc". (I come from the Java-World)

    And if somebody created a product that he sells (or a open source product) then he will provide an API (an javadoc) for that product. For example a Logging Framework for Java is "Log4J"

    Easily by google "java log4j api" we can find: logging.apache.org/log4j/2.x/javadoc.html and resulting from that logging.apache.org/log4j/2.x/javadoc/log4j-api/index.html as well as logging.apache.org/log4j/2.x/javadoc/log4j-core/index.html .

    For example if we want to know that a Loglevel is, then we go to logging.apache.org/log4j/2.x/javadoc/log4j-api/org/apache/logging/log4j/Level.html

    Now we can read on top of the document that there are 8 Log levels:

    Name Description
    OFF No events will be logged.
    FATAL A fatal event that will prevent the application from continuing.
    ERROR An error in the application, possibly recoverable.
    WARN An event that might possible lead to an error.
    INFO An event for informational purposes.
    DEBUG A general debugging event.
    TRACE A fine-grained debug message, typically capturing the flow through the application.
    ALL All events should be logged.

    These kind of information are very important, to know how to use the product, framework, the classes. In addition the article provides similar information about Methods, Fields, Constructors, Inheritation, Interfaces as told above.

    Now the i will show the corresponding technologies:

    - Java corresponds to VB NET as it is the programming language that we are programming in (the syntax)

    - Log4J corresponds to One Identity Manager as it is the framework, the product that we want to use and provides more predefined classes than only the underlining programming language.

    For VB NET i go to learn.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.dateandtime?view=net-8.0 and have an API description explaining the content and usage of each class that is contained in VB NET. Now its my job to learn VB NET, i should not ask you how to use VB NET-functions because that should be my part.

    But One Identity should tell us (in an API description - "JavaDoc") how to use their framework.

    I am searching for the 1IM API since several weeks. Nobody could show me one till now.

    Thanks - Michael

Reply
  • Disclaimer: I had to remove all links to text only (and delete http) so they are not clickable. Reason: Forum will mark my post as spam instantly if i post links. You should think about changing the forum rules. It is very hard to work productive like that!
    Original Post:

    Sadly API has two meanings. So talking about API can be confusing.

    First API can mean "possiblity to access functions from a webservice without using the website, but by using program code". For example a REST-API.

    I am not talking about this type of "technical access to functions".

    Second API in context of programming can mean that there is a website where you can see information about classes, functions, variables. You can see explantions, and maybe code examples.

    For example for Java-programming-language you can quickly search for "java api" in google and find docs.oracle.com/javase/8/docs/api/

    For example we can be interested in the "String" class of Java and open that: docs.oracle.com/javase/8/docs/api/index.html?java/lang/String.html

    It will provide us much information about the String class:

    - Where did it inherit from? (java.lang.Object)
    - Which interfaces are implementes by String?
    - Coding examples
    - Field Summary (With at least 1 sentence of explanation!)
    - Constructor Summary (With at least 1 sentence of explanation!)
    - Method Summary (With at least 1 sentence of explanation!)
    - Methods inherited from ...
    - Details on Fields, Contructors, Methods (With several sentences of explanation!)

    In Java we call this the "JavaDoc". (I come from the Java-World)

    And if somebody created a product that he sells (or a open source product) then he will provide an API (an javadoc) for that product. For example a Logging Framework for Java is "Log4J"

    Easily by google "java log4j api" we can find: logging.apache.org/log4j/2.x/javadoc.html and resulting from that logging.apache.org/log4j/2.x/javadoc/log4j-api/index.html as well as logging.apache.org/log4j/2.x/javadoc/log4j-core/index.html .

    For example if we want to know that a Loglevel is, then we go to logging.apache.org/log4j/2.x/javadoc/log4j-api/org/apache/logging/log4j/Level.html

    Now we can read on top of the document that there are 8 Log levels:

    Name Description
    OFF No events will be logged.
    FATAL A fatal event that will prevent the application from continuing.
    ERROR An error in the application, possibly recoverable.
    WARN An event that might possible lead to an error.
    INFO An event for informational purposes.
    DEBUG A general debugging event.
    TRACE A fine-grained debug message, typically capturing the flow through the application.
    ALL All events should be logged.

    These kind of information are very important, to know how to use the product, framework, the classes. In addition the article provides similar information about Methods, Fields, Constructors, Inheritation, Interfaces as told above.

    Now the i will show the corresponding technologies:

    - Java corresponds to VB NET as it is the programming language that we are programming in (the syntax)

    - Log4J corresponds to One Identity Manager as it is the framework, the product that we want to use and provides more predefined classes than only the underlining programming language.

    For VB NET i go to learn.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.dateandtime?view=net-8.0 and have an API description explaining the content and usage of each class that is contained in VB NET. Now its my job to learn VB NET, i should not ask you how to use VB NET-functions because that should be my part.

    But One Identity should tell us (in an API description - "JavaDoc") how to use their framework.

    I am searching for the 1IM API since several weeks. Nobody could show me one till now.

    Thanks - Michael

Children
  • An API is an API and the documentation of an API is the documentation. If you are comparing Java, search for VB(.NET) or Microsoft .NET Framework Classes. They both have very detailed documentation.

    The SDK Script samples, I have pointed you, showing how to deal with the objects, collections, and such.

    The ObjectLayer.chm file I have pointed you to has information about constructors etc. and some (very few I admit) examples.

    If you compare Log4J, you should compare it to NLOG which OneIM is using, and they do have a lot of stuff on their page as well https://github.com/nlog/nlog/wiki

    In regards to the OneIM API, I hope I have pointed you in the right direction. As I have said, the video series is key, and some basics about the system architecture in general which can be found in the documentation or in the video series.

    I admit that there is no beginner's walkthrough available.