Loading...
 

CX_OBJECT_MANAGER::NewDatabase

CX_OBJECT_MANAGER::NewDatabase

Description:

This class function creates a database interactively.(Example)

Code example:
InstantView®-Code für die interaktive Definition neuer Datenbanken, neuer Segmente und Root-EP-Collections

    Var(omgr)
    Var(segment, repCollection)

    GetManager(OBJECT) -> omgr  // we need the object manager   

    Group(groupDB, SELECT_MULTIPLE, 11, 5, 470, 45, "Database")
    {
      Prompt(11, 11, "Path")
      String(CXS_DATABASE::path, 120, 11, 300)  // to enter path of database file

      Button(FONT(0), 18, 28, 70, 7, "create")
      [ SELECT: omgr Call(NewDatabase) // create new CXS_DATABASE object
                DrainWindow(, groupDB)  // write input data from GUI into object
                SendMsg(UPDATE_DATABASES) // update list of database below (in next group)
      ]
    }

    Group(groupSeg, SELECT_MULTIPLE, 11, 50, 470, 70, "Segment")
    {
      Prompt(11, 11, "Name")
      String(CXS_SEGMENT::name, 120, 11, 300)  // to enter the name of the segment

      Prompt(11, 24, "in Database")
      ObjectCombobox(CXS_SEGMENT::database, 120, 24, 300, 32)   // to specify the database
      [ INITIALIZE:
        UPDATE_DATABASES: ClearObox
                          omgr Call(GetDatabases) FillObox  // display all databases to allow for interactive selection
      ]

      Prompt(11, 37, "Split threshold")
      Integer(CXS_SEGMENT::threshold, 120, 37, 80)  // to enter threshold value for segment splitting


      Button(b0, DEFAULT, 18, 52, 70, 7, "create")
      [ SELECT: omgr Call(NewSegment) -> segment  // create new CXS_SEGMENT object
                segment DrainWindow(, groupSeg)  // write input data from GUI into object
                SendMsg(UPDATE_SEGMENTS)        // update list of segments below (in next group)
      ]
    }

    Group(groupColl, SELECT_MULTIPLE, 11, 125, 470, 70, "Collection")
    {
      Prompt(11, 11, "Name")
      String(CXS_REP_COLLECTION::name, 120, 11, 300)  // to enter the root entry point name

      Prompt(11, 24, "in Segment")
      ObjectCombobox(CXS_REP_COLLECTION::segment, 120, 24, 300, 32) // to select a segment to store the collection
      [ INITIALIZE:
        UPDATE_SEGMENTS: ClearObox
                         omgr Call(GetSegments) FillObox  // disply all segments to allow for interactive selection
      ]

      Prompt(11, 37, "Type")
      Enum(CXS_REP_COLLECTION::type, 100, 37, 80, 35)  // to select a type: SET, LIST, BAG, or ARRAY

      Button(FONT(0), 18, 52, 70, 7, "create")
      [ SELECT: omgr Call(NewREPCollection) -> repCollection   // create new CXS_REP_COLLECTION object
                repCollection DrainWindow(, groupColl) // and write input data from GUI into object
      ]
    }

Stack
Stack Position Object type Brief description
Stack(In) Top CX_OBJECT_MANAGER
Stack(Out) Top CXS_DATABASE
Function call: Call(NewDatabase)