Server
API Reference Guide
Product Documentation:

Visualization Server
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlsSwComponent Class Reference

This class allows you to create a Rogue Wave Views application component. More...

#include <ilmvsw/mvswcomp.h>

Inheritance diagram for IlsSwComponent:
IlsMvComponent IlsMvEndPoint IlsRtModelParser

Public Member Functions

virtual IlsTransactionId beginC2STransaction ()
 Initializes a component-to-server transaction. More...
 
virtual IlsBoolean beginS2CTransaction (IlsS2CTransStatus, IlsTransactionId)
 Called whenever a server-to-component transaction is opened. More...
 
virtual IlsTransactionId commitC2STransaction (IlsC2STransStatus=ILS_C2S_DEFAULT)
 Sends the current component-to-server transaction that was previously initialized by the beginC2STransaction() function to the server. More...
 
virtual void endS2CTransaction (IlsS2CTransStatus, IlsTransactionId)
 Called whenever a server-to-component transaction is over. More...
 
IlsString getIlvFileName (const IlsString &fileName, IlsBoolean *cancelled=0)
 Returns the full path for the file name passed as its parameter. More...
 
virtual void onNewRpModel (IlsRpModel &)
 Called each time the component receives a new or an updated dynamic representation model. More...
 
virtual IlsTransactionId rollbackC2STransaction ()
 Rolls back the current component-to-server transaction previously initialized by the beginC2STransaction() function. More...
 
- Public Member Functions inherited from IlsMvComponent
 IlsMvComponent ()
 Constructor. More...
 
IlsBoolean setC2SMT ()
 Selects the multithread mode for component-to-server transactions. More...
 
IlsBoolean isC2SMT ()
 Returns IlsTrue if multithread mode has been enabled for component-to-server transactions.
 
IlsBoolean isInC2STransaction ()
 Returns IlsTrue if a component-to-server transaction is already initialized in the component. Otherwise, it returns IlsFalse.
 
unsigned getC2SPendingTransCount ()
 Returns the number of component-to-server transactions that have not been acknowledged (or rolled back) by the server yet.
 
IlsTransactionId getTransactionId ()
 Returns the identifier of the current component-to-server transaction or 0 if no transaction has been initialized.
 
IlsTransactionId getAckTransactionId ()
 Returns the identifier of the latest component-to-server transaction that has been acknowledged by the server.
 
IlsC2STransStatus getDefaultC2STransStatus ()
 Returns the default transaction status for the transaction sent to the server by the component. More...
 
void setDefaultC2STransStatus (IlsC2STransStatus s)
 Sets the default transaction status for the transaction sent to the server by the component. More...
 
void exitOnDeletion (IlsBoolean status)
 Chooses the behavior on deletion. More...
 
IlsMvComponentId getId () const
 Returns the component identifier. More...
 
IlsRepresentationgetRepresentation (IlsRepresentationId id)
 Returns a pointer to the representation identified by id. More...
 
IlsRpModelgetRpModel (IlsRpModelId) const
 Returns a pointer to the dynamic representation model identified by id. More...
 
const IlsRpObjModelgetObjModel (IlsRpObject &collectorOwner, IlsRpAttributeId collectorId)
 Returns a pointer to the representation object model associated with the collector attribute collectorId of the collectorOwner object.
 
IlsBoolean isMatchingSvType (const IlsString &actualType, const IlsString &formalType)
 Checks matching with server type. More...
 
virtual void openView (const IlsString &objId, const IlsString &viewId, IlsMvValue *argv=0, IlsCbArgNb argc=0, IlsBoolean force=IlsFalse)
 Requests the server to open an instance of the dynamic view type viewType on the Server object previously registered with the label objLabel. More...
 
virtual void openView (const IlsString &objId, const IlsString &viewName, IlsMvValue *argv, IlsCbArgNb argc, IlsMvValue *ackArgv, IlsCbArgNb ackArgc, IlsCbArgNb resultIndex, IlsBoolean force=IlsFalse)
 Like openView(const IlsString&,const IlsString&,IlsMvValue*,IlsCbArgNb) but requests aknowledge call. More...
 
void execUserAsyncCallback (const IlsString &fun, IlsMvValue *args, IlsCbArgNb argsNb, IlsBoolean freeArgs=IlsFalse)
 Executes the callback function callbackName for the user object that is associated with the component on the server side. More...
 
IlsBoolean getObjectIds (const IlsString &objPattern, IlsBoolean caseSensitive)
 Requests objects list according to a pattern. More...
 
IlsBoolean getViewIds (const IlsString &objId, const IlsString &viewPattern, const IlsString &viewTypePattern, IlsBoolean caseSensitive)
 requests from the server a list of views. More...
 
IlsBoolean getServerModel (IlsSvModelObserver &, IlsBoolean isSync=IlsFalse)
 Retrieves the server model declared to the runtime model interpreter on the server side and invokes the API of the observer passed to this method. More...
 
IlsBoolean getViewTypes (const IlsString &objId, const IlsString &viewPattern, const IlsString &viewTypePattern, IlsBoolean caseSensitive, IlsBoolean isSync=IlsFalse)
 
IlsBoolean getViewTypes (IlsBoolean isSync=IlsFalse)
 
unsigned suspendS2CTrans ()
 Suspends the processing of any new transaction issued by the server. More...
 
unsigned restartS2CTrans (IlsBoolean force=IlsFalse)
 Decrements the counter incremented by the function suspendS2CUpdates(). More...
 
unsigned isSuspendedS2CTrans ()
 Returns the value of the counter maintained by the functions suspendS2CUpdates() and restartS2CUpdates() above. More...
 
unsigned getS2CPendingTransCount ()
 Returns the number of pending server-to-component transactions.
 
virtual void onNewS2CPendingTrans (IlsS2CTransStatus, IlsTransactionId)
 Called each time the processing of a server-to-component transaction is postponed. More...
 
IlsRpObjectnewInCollector (IlsRpObject &collectorOwner, IlsRpAttributeId collectorId, IlsBoolean endUpdate=IlsTrue)
 Creates a new representation object associated with a collector attribute. More...
 
IlsRpObjectnewMapping (IlsRepresentation &r, const IlsRpObjModel &model, IlsRpObject &cousin, IlsBoolean endUpdate)
 Enables the component to create a new representation object associated with a collector attribute. More...
 
virtual void recvObjectIds (IlsString const *objIds, int nb)
 Invoked asynchronoulsy after a getObjectIds() request was sent to the server. It receives the requested result. More...
 
virtual void recvViewIds (const IlsString &objId, IlsString const *viewIds, int nb)
 Invoked asynchronoulsy after a getViewIds() request was sent to the server. It receives the requested result. More...
 
virtual void disconnect ()
 Disconnects the component from the server.
 
virtual void onConnect ()
 Called after the server has been successfully connected. More...
 
virtual void onDisconnect ()
 Calls the function IlsMvEndPoint::suppress(). More...
 
virtual void connectionDenied (const IlsString &cause)
 Called when the server has refused the connection. More...
 
virtual void connectionAllowed (const IlsString &cause)
 Called if the request for connection has been accepted on the server side. More...
 
virtual void onRmIOMS ()
 Disconnects the component from the server.
 
virtual void addRepresentationListener (RepresentationListener *)
 Adds a representation listener. More...
 
virtual void removeRepresentationListener (RepresentationListener *)
 Removes a representation listener. More...
 
- Public Member Functions inherited from IlsMvEndPoint
void traceConnectionDenied (IlsBoolean b)
 Allows you to control whether an error message should be displayed when a connection is refused.
 
const IlsStringgetPeerName () const
 Returns remote process name. More...
 
const IlsStringgetPeerHost () const
 Returns host if remote connection. More...
 
IlsBoolean isComponent () const
 This member function returns IlsTrue when the object is an instance of IlsMvComponent or of a derived class. Otherwise, it returns IlsFalse.
 
IlsBoolean isLinked () const
 This member function returns IlsTrue when the component and the server are implemented in the same process. Otherwise, it returns IlsFalse.
 
virtual void suppress ()
 Call this virtual member function instead of the destructor if you want to delete an instance of IlsMvEndPoint. More...
 
IlsBoolean setEncoder (IlsMsgEncoder)
 Declares the function encoding to be applied on any message before it is sent through the connnection. More...
 
IlsBoolean setDecoder (IlsMsgDecoder)
 Declares the function encoding to be applied on any message received through the connnection. More...
 
IlsMsgEncoder getEncoder () const
 Returns the encoding function set through a call to the function setEncoder() or 0 by default.
 
IlsMsgDecoder getDecoder () const
 Returns the decoding function set through a call to the function setDecoder() or 0 by default.
 
void loadViewSpec (const IlsString &fileOrString, IlsBoolean isString, IlsBoolean useXmlParser, IlsBoolean isSync)
 Loads a dynamic view-type specification to the server. More...
 
IlsBoolean execAsyncObjectCallback (const IlsMvRef &ref, const IlsString &funNm, IlsMvValue *args, IlsCbArgNb nbArgs, IlsBoolean inTrans=IlsTrue, IlsBoolean freeArgs=IlsFalse)
 Executes an asynchronous call to the function funNm on the object identified by the reference ref. More...
 
IlsBoolean execSyncObjectCallback (const IlsMvRef &ref, const IlsString &funNm, IlsMvValue *args, IlsCbArgNb nbArgs, IlsMvValue &result, IlsBoolean freeArgs=IlsFalse)
 This callback executes a synchronous call to the callback function funNm on the object identified by the reference ref. More...
 
IlsBoolean execDuplexObjectCallback (const IlsMvRef &ref, const IlsString &funNm, IlsMvValue *args, IlsCbArgNb nbArgs, const IlsString &duplexFunNm, IlsMvValue *duplexArgs=0, IlsCbArgNb duplexNbArgs=0, IlsCbArgNb resultIndex=0, IlsBoolean inTrans=IlsTrue, IlsBoolean freeArgs=IlsFalse)
 Executes an asynchronous call to the function funNm on the "remote" object identified by the reference ref. More...
 
IlsBoolean execAsyncGlobalCallback (const IlsString &funNm, IlsMvValue *args, IlsCbArgNb nbArgs, IlsBoolean inTrans=IlsTrue, IlsBoolean freeArgs=IlsFalse)
 This callback executes an asynchronous call to the global function funNm. More...
 
IlsBoolean execSyncGlobalCallback (const IlsString &funNm, IlsMvValue *args, IlsCbArgNb nbArgs, IlsMvValue &result, IlsBoolean freeArgs=IlsFalse)
 This callback executes a synchronous call to the global function funNm. More...
 
IlsBoolean execDuplexGlobalCallback (const IlsString &funNm, IlsMvValue *args, IlsCbArgNb nbArgs, const IlsString &duplexFunNm, IlsMvValue *duplexArgs=0, IlsCbArgNb duplexNbArgs=0, IlsCbArgNb resultIndex=0, IlsBoolean inTrans=IlsTrue, IlsBoolean freeArgs=IlsFalse)
 This callback executes an asynchronous call to the global function funNm. More...
 
IlsBoolean disconnect ()
 Closes the connection between the local end point and its peer end point, and then calls the function onDisconnect. More...
 
virtual IlsConnectionStatus testConnection (IlsTime *timeout=0)
 Can be used from server to component or from component to server to test the underlying connection between two processes. More...
 
virtual void addConnectionListener (ConnectionListener *)
 Add a connection listener.
 
virtual void removeConnectionListener (ConnectionListener *)
 Remove a connection listener.
 
IlsThreadstartSendThread ()
 Starts a thread in charge of sending the message to the peer end point. More...
 
IlsThreadthreadSending ()
 Starts a thread that sends all notification updates and other messages generated by the server to the component. More...
 
IlsBoolean stopSendThread (IlsBoolean flush)
 Stops the thread used to send messages. More...
 
IlsBoolean isSendingThread ()
 Returns IlsTrue if a special thread is started to send notification updates and other messages generated by the server to the component. More...
 
void monitorSendingQueue (IlsBoolean b)
 Allows you to monitor the sending queue. More...
 
unsigned int getPendingOutput ()
 Returns the number of output messages stored in the sending queue associated with this component, if any. More...
 
void trace (int=TRACE_TRANS)
 Selects the type of traces at one of the end points of a view server-to-component connection. More...
 
IlsBoolean isTraced (int=TRACE_TRANS)
 Tests the type of traces at one of the end points of a view server-to-component connection. More...
 
int getTraceType () const
 Returns the type of traces currently selected.
 
- Public Member Functions inherited from IlsRtModelParser
virtual void declAttribute (const IlsString &name, IlsMvDataType type, IlsRTTypes::AttributeKind kind, const IlsMvValue &defaultValue, IlsBoolean isIndexed, IlsBoolean canEdit, IlsBoolean isImplicit, IlsBoolean isExported, IlsBoolean isDynamic)
 Called by Rogue Wave Server to declare the Server attribute name. More...
 
virtual void declClass (const IlsString &name, IlsBoolean isExported, IlsBoolean isDynamic)
 Called by Rogue Wave Server to declare a Server object type. More...
 
virtual void declFunction (const IlsString &signature, IlsBoolean isImplicit, IlsBoolean isExported, IlsBoolean isDynamic, IlsBoolean global)
 Called by Rogue Wave Server to declare a Server member function. More...
 
virtual void declRelation (const IlsString &name, const IlsString &target, IlsRTTypes::RelationKind kind, const IlsString &reverseRelName, IlsBoolean canEdit, IlsBoolean isImplicit, IlsBoolean isMandatory, IlsBoolean isExported, IlsBoolean isDynamic)
 Called by Rogue Wave Server to declare the Server relation name. More...
 
virtual void declViewType (const IlsString &viewTypeName, const IlsString &viewInfo, const IlsString &filename, IlsMvViewParamInfo **params, int nbParams)
 Called for each view types received that matches the request (see the member function IlsMvComponent::getViewTypes()). More...
 

Static Public Member Functions

static IlsBoolean HasExited ()
 Returns IlsTrue if the display has already been destroyed. More...
 
Initialization
static void Initialize (IlvDisplay *, int argc=0, char **arg=0)
 Initializes the Rogue Wave Server/Rogue Wave Views component from an IlvDisplay. More...
 
static void Initialize (IlvApplication *, int argc=0, char **arg=0)
 Initializes the Rogue Wave Server/Rogue Wave Views component from an IlvApplication. More...
 
static void SetApplication (IlvApplication *appli)
 Associates an application with the component.
 
static IlvApplication * GetApplication ()
 Returns the Rogue Wave Views application that has been associated with the component if that component was initialized using the member function Initialize(IlvApplication*,int,char**).
 
Execution.
static void Run (IlvApplication *=0)
 Starts the main loop of the application component. More...
 
Connection Panel
static void SetNoConnectionPanel (IlsBoolean)
 Controls whether the connection panel is to be created. More...
 
static void HideConnectionPanelAtInit (IlsBoolean h)
 Controls whether the current connection panel, if any, is visible when the component starts.
 
View Parameters
static void DeclareViewParameterDataSource (IlsSwServerDataSource *)
 Declares a Server data source as a view parameter. More...
 
static void DeclareViewParameterContainer (IlvGadgetContainer *, const IlsString &viewName=IlsString::Null)
 Declares a gadget container as a view parameter. More...
 
static void PrepareViewParameters (const IlsString &viewName, IlsSwServerDataSource *sds, IlsMvValue *&argv, IlsCbArgNb &argc, IlsMvValue *&ackArgv, IlsCbArgNb &ackArgc, IlsCbArgNb &resIndex, IlsSwOpenViewCallbackType cb=0, IlsAny arg=0)
 Initialize the predefined view parameters. More...
 
Component Control
static IlsSwComponentGetComponent (IlsMvComponentId)
 Returns a Rogue Wave Server/Rogue Wave Views component from the component identifier.
 
static void SetUseDragDropInteractor (IlvBoolean)
 Stops the drag-and-drop interactor from being used on the table gadget – an instance of IlsSwTableGadget – and on the hyper-reference gadget – an instance of IlsSwHRefGadget. More...
 
static void SetUseDragDropInteractorFlags (IlsSwDragDropInteractorFlag)
 Allows fine control over which aspects of the drag-and-drop interactor are enabled. More...
 
Callbacks
static void AddCallback (IlvSymbol *symbol, IlsSwComponentCallbackType, IlsAny=0, IlsSwComponent *=0)
 Adds a callback to the component. More...
 
static void RemoveCallback (IlvSymbol *symbol, IlsSwComponentCallbackType, IlsAny=0, IlsSwComponent *=0)
 Removes a callback that was previously added using the static member function AddCallback().
 
Callback Symbols
static IlvSymbol * ComponentCreatedSymbol ()
 Returns the symbol for the callback that can be called when a component is created. More...
 
static IlvSymbol * ComponentDestroyedSymbol ()
 Returns the symbol for the callback that can be called when a component is destroyed.
 
static IlvSymbol * BeginC2STransactionSymbol ()
 Returns the symbol for the callback that can be called when a component transaction is started.
 
static IlvSymbol * CommitC2STransactionSymbol ()
 Returns the symbol for the callback that can be called when a component transaction is committed.
 
static IlvSymbol * RollbackC2STransactionSymbol ()
 Returns the symbol for the callback that can be called when a component transaction is rolled back.
 
Converting a Rogue Wave Server Type to a Rogue Wave Views/Data Access Type
static IlsBoolean ConvertServerType (const IlsMvValue &, IliValue &)
 Converts the instance of IlsMvValue passed as its first parameter to the instance of IliValue passed as its second argument if such a conversion is possible. More...
 
static void DeclServerConverter (const IlsString &serverType, IlsSwServerConverter conv)
 Declares a new converter that lets you convert an instance of IlsMvValue to an instance of IliValue. More...
 
static void UndeclServerConverter (const IlsString &)
 Removes a Rogue Wave Server converter that was previously declared using the static member function DeclServerConverter().
 
static IlsSwServerConverter GetServerConverter (const IlsString &userTypeName)
 Returns the current converter, if any, for the Rogue Wave Server user-defined type userTypeName.
 
Converting a Rogue Wave Views/Data Access Type to a Rogue Wave Server Type.
static void DeclInFormConverter (const IliDatatype *, IlsSwInFormConverter)
 Declares a new converter that lets you convert an instance of IliValue to an instance of IlsMvValue. More...
 
static void UndeclInFormConverter (const IliDatatype *)
 Removes a Rogue Wave Views converter that was previously declared using the static member function DeclInFormConverter().
 
static IlsSwInFormConverter GetInFormConverter (const IliDatatype *)
 Returns the current converter, if any, for a Rogue Wave Views type.
 
static IlsBoolean ConvertInFormType (const IliValue &, IlsMvValue &)
 Converts the instance of IliValue passed as its first parameter to the instance of IlsMvValue passed as its second parameter, if this conversion is possible. More...
 
- Static Public Member Functions inherited from IlsMvComponent
static IlsMvComponentNarrow (IlsMvEndPoint &ep)
 Operates a safe downcast of the reference ep into a pointer to a component. More...
 
static IlsMvComponentConnect (const IlsString &serverName=IlsString::Null, const IlsString &hostName=IlsString::Null)
 Establishes a connection with the server serverName on the machine hostName. More...
 
- Static Public Member Functions inherited from IlsMvEndPoint
static IlsMvEndPointGetInteractor ()
 Returns the current interacting component. More...
 
static void SetMT (IlsBoolean isMT)
 Call this static member function with the isMT parameter set to IlsTrue if you want to use the component API or the component interface API in a multithread context.
 
static void Trace (int=TRACE_TRANS)
 Selects the default type of traces selected. More...
 
static IlsBoolean IsTraced (int=TRACE_TRANS)
 Tests the default type of traces selected. More...
 
static int GetTraceType ()
 Returns the default type of traces.
 

Finding Data Sources

IlsSwServerDataSource ** findDataSourcesInIlv (IlvGadgetContainer *cont, const IlsString &fileName, unsigned int &count, IlsBoolean promptPath=IlsTrue)
 Loads the .ilv file passed as the fileName parameter into the gadget container passed as the first parameter. More...
 
static IlsSwServerDataSource ** FindDataSourcesInContainer (IlvGadgetContainer *, unsigned int &count)
 Retrieve an array of Server data sources that can then be declared as view parameters. More...
 

Error Handling

virtual void recvMessage (const IlsMvMessage::SvMsg &)
 Displays a message sent by the server. More...
 
static void HandleMessage (const IlsMvMessage::SvMsg &)
 Displays an error message. More...
 
static void HandleMessage (const IlsString &)
 Adds the error message to the message log.
 
static void HandleWarning (const IlsString &)
 Displays the error message in a pop-up warning dialog box and adds it to the message log.
 
static void HandleError (const IlsString &)
 Displays the error message in a pop-up error dialog box and adds it to the message log.
 

Opening a New View

virtual void openSwView (const IlsString &objId, const IlsString &viewId, IlsSwServerDataSource *sds, IlsMvValue *argv=0, IlsCbArgNb argc=0, IlsBoolean force=IlsFalse, IlsSwOpenViewCallbackType cb=0, IlsAny arg=0)
 Calls the second openSwView() function (described below) with a data source and without any container as its parameters.
 
virtual void openSwView (const IlsString &objId, const IlsString &viewId, IlvGadgetContainer *cont, IlsSwServerDataSource *sds, IlsMvValue *argv, IlsCbArgNb argc, IlsMvValue *ackArgv, IlsCbArgNb ackArgc, IlsCbArgNb resultIndex, IlsBoolean force=IlsFalse, IlsSwOpenViewCallbackType cb=0, IlsAny arg=0)
 Opens the view viewId on the object objId. More...
 
virtual void ackOpenView (const IlsMvValue *ackArgv, IlsCbArgNb ackArgc)
 called by Rogue Wave Server when a view has been opened on the server. More...
 
virtual void openingViewFromConnectionPanel (const IlsString &objId, const IlsString &viewId, IlsBoolean force)
 Called by the connection panel when the user opens a view. More...
 
static IlvGadgetContainer * GetContainerPtr (int)
 Retrieves the address of the container from its index. More...
 
static IlsSwServerDataSourceGetDataSourcePtr (int)
 Retrieves the address of the Server Data Source from its index. More...
 

Blocking Mode

IlsBoolean getBlockingMode () const
 Returns IlsTrue if the component is running in blocking mode.
 
void setBlockingMode (IlsBoolean b)
 Turns blocking mode on or off in the component. More...
 
static IlsBoolean GetDefaultBlockingMode ()
 Returns the default value for the blocking mode.
 
static void SetDefaultBlockingMode (IlsBoolean b)
 Sets the default value for the blocking mode.
 

Additional Inherited Members

- Public Types inherited from IlsMvEndPoint
enum  TraceType {
  NO_TRACE, TRACE_TRANS, TRACE_MSG , TRACE_TAG_ERR,
  TRACE_TAG_PRINT
}
 Specifies the type of trace attached to interactions between an object server and its components. See the trace functions of the class IlsMvEndPoint for more information. More...
 
- Protected Member Functions inherited from IlsMvComponent
virtual ~IlsMvComponent ()
 Destructor. More...
 
void declParentClass (IlsString derived, IlsString parent)
 Called by Rogue Wave Server to declare that the Server type derived derives directly from the Server type parent. More...
 
virtual IlsRepresentationnewRepresentation (IlsRpModel &)
 Called to create a new representation if no subtype of the class IlsRepresentation is specified in the associated dynamic view type. More...
 

Detailed Description

This class allows you to create a Rogue Wave Views application component.

Library: mvsw

This component has a predefined behavior.

See also
IlsMvMessage, IlsRepresentation, IlsSwComponentFactory.

Member Function Documentation

◆ ackOpenView()

virtual void IlsSwComponent::ackOpenView ( const IlsMvValue ackArgv,
IlsCbArgNb  ackArgc 
)
virtual

called by Rogue Wave Server when a view has been opened on the server.

The first element of the ackArgv array contains a value of type char which stores an IlsOpenViewStatus status value. This status indicates whether the view has been opened. If the opening of the view has failed or if the view was already opened on the same origin, the ackOpenView() function triggers the IlsSwOpenViewCallbackType callback. See the function IlsMvComponent::ackOpenView() for more information.

Reimplemented from IlsMvComponent.

◆ AddCallback()

static void IlsSwComponent::AddCallback ( IlvSymbol *  symbol,
IlsSwComponentCallbackType  ,
IlsAny  = 0,
IlsSwComponent = 0 
)
static

Adds a callback to the component.

The parameter symbol identifies which callback is to be added. If the component is null, the callback is called for all instances of IlsSwComponent.

◆ beginC2STransaction()

virtual IlsTransactionId IlsSwComponent::beginC2STransaction ( )
virtual

Initializes a component-to-server transaction.

A local buffer is created to store the requests emitted by the component, the representations or the representation objects until they are sent to the server. Actually, these requests are not sent until the commitC2STransaction() function is called.

If a component-to-server transaction has already been initialized, the function does not create a new transaction. However, when the multithreaded transaction mode has been selected using the member function setC2SMT(), each thread can concurrently initialize its own component-to-server transaction.

When no transaction has been previously initialized, the functions beginC2STransaction() and commitC2STransaction() are implicitly called each time a transaction on a representation is committed or the opening of a dynamic view is requested by the component. See the function IlsRepresentation::commitC2STransaction() for details.

Returns
This function returns either the new transaction identifier, or 0 when a component-to-server transaction has already be initialized. In this case, it only increments an internal transaction depth counter which will be used to balance the calls to commitC2STransaction().

Reimplemented from IlsMvComponent.

◆ beginS2CTransaction()

virtual IlsBoolean IlsSwComponent::beginS2CTransaction ( IlsS2CTransStatus  status,
IlsTransactionId  id 
)
virtual

Called whenever a server-to-component transaction is opened.

Parameters
statusshows the transaction type (see Transaction Control).
idprovides the identifier of the component-to-server transaction that triggered the current server-to-component transaction. The value of this argument is 0 for a notification transaction.
Returns
always returns IlsTrue. When it is overridden and returns IlsFalse, the transaction is aborted. Otherwise, modification, acknowledgement, or rollback events are propagated to the representations. See also the IlsRepresentation::beginC2STransaction() member function.

Reimplemented from IlsMvComponent.

◆ commitC2STransaction()

virtual IlsTransactionId IlsSwComponent::commitC2STransaction ( IlsC2STransStatus  tStat = ILS_C2S_DEFAULT)
virtual

Sends the current component-to-server transaction that was previously initialized by the beginC2STransaction() function to the server.

Parameters
tStatassociates a status with that transaction. This status specifies how the transaction must be executed in the server. See the type definition IlsC2STransStatus for more information on the possible values of the tStat parameter.
When the value of tStat is set to ILS_C2S_DEFAULT, the actual status is assigned a value depending on the default transaction status associated with the component (see the member function setDefaultC2STransStatus()). If this default transaction status has not been redefined, the tStat parameter is set to ILS_C2S_ALL, thus requiring notification and acknowledgement and allowing transaction rollback.
Returns
the transaction identifier, except when the internal transaction depth counter is greater than one, which means that the function has been called several times. In this case, the function does nothing but decrements the counter and returns 0.

Reimplemented from IlsMvComponent.

◆ ComponentCreatedSymbol()

static IlvSymbol* IlsSwComponent::ComponentCreatedSymbol ( )
static

Returns the symbol for the callback that can be called when a component is created.

A component is considered created when it has been connected.

◆ ConvertInFormType()

static IlsBoolean IlsSwComponent::ConvertInFormType ( const IliValue &  ,
IlsMvValue  
)
static

Converts the instance of IliValue passed as its first parameter to the instance of IlsMvValue passed as its second parameter, if this conversion is possible.

The function returns IlsFalse if the conversion is not possible.

◆ ConvertServerType()

static IlsBoolean IlsSwComponent::ConvertServerType ( const IlsMvValue ,
IliValue &   
)
static

Converts the instance of IlsMvValue passed as its first parameter to the instance of IliValue passed as its second argument if such a conversion is possible.

This function returns IlsFalse if the conversion is not possible.

◆ DeclareViewParameterContainer()

static void IlsSwComponent::DeclareViewParameterContainer ( IlvGadgetContainer *  ,
const IlsString viewName = IlsString::Null 
)
static

Declares a gadget container as a view parameter.

When a view is opened through one of the functions IlsSwComponent::openSwView(), IlsSwRow::onSwDereference() or IlsSwTable::onSwDereference(), the appropriate gadget container is supplied as a view parameter.

  • If you provide the view name, the gadget container will be used only for that view.
  • If you do not provide a view name, the panel will be used for all views.

◆ DeclareViewParameterDataSource()

static void IlsSwComponent::DeclareViewParameterDataSource ( IlsSwServerDataSource )
static

Declares a Server data source as a view parameter.

Such a data source is also referred to as a "preregistered data source".

When a view is opened through one of the functions IlsSwComponent::openSwView(), IlsSwRow::onSwDereference() or IlsSwTable::onSwDereference(), the appropriate Server data source is supplied as a view parameter. You do not need to associate a preregistered data source with a representation name: the mvsw library automatically uses the right data source.

◆ DeclInFormConverter()

static void IlsSwComponent::DeclInFormConverter ( const IliDatatype *  ,
IlsSwInFormConverter   
)
static

Declares a new converter that lets you convert an instance of IliValue to an instance of IlsMvValue.

If you use Rogue Wave Views types that are not supported by the Rogue Wave Server/Rogue Wave Views mapping, you must declare a converter.

The following Rogue Wave Views types are supported by default:

  • IliStringType
  • IliIntegerType
  • IliBooleanType
  • IliDoubleType
  • IliFloatType
  • IlsSwHRefType

◆ DeclServerConverter()

static void IlsSwComponent::DeclServerConverter ( const IlsString serverType,
IlsSwServerConverter  conv 
)
static

Declares a new converter that lets you convert an instance of IlsMvValue to an instance of IliValue.

This function allows you to map Rogue Wave Server types to Rogue Wave Views types for use in dynamic view type specifications.

Once the converter has been declared, Rogue Wave Server will call it each time a Rogue Wave Views cell needs to be assigned a value of the Rogue Wave Server user-defined type.

For the conversion to take place, you must also previously create an association between the Rogue Wave Server type and a Rogue Wave Views type using the static member function IlsSwUtility::AddNameAssociation().

Parameters
serverTypethe name of the Rogue Wave Server user-defined type.
convthe converter that will be used to convert a value of this Rogue Wave Server type to a value of a Rogue Wave Views type.

◆ endS2CTransaction()

virtual void IlsSwComponent::endS2CTransaction ( IlsS2CTransStatus  status,
IlsTransactionId  id 
)
virtual

Called whenever a server-to-component transaction is over.

Parameters
statusshows the transaction type (see Transaction Control).
idprovides the identifier of the component-to-server transaction that triggered the current server-to-component transaction. The value of this argument is 0 for a notification transaction.

Reimplemented from IlsMvComponent.

◆ FindDataSourcesInContainer()

static IlsSwServerDataSource** IlsSwComponent::FindDataSourcesInContainer ( IlvGadgetContainer *  ,
unsigned int &  count 
)
static

Retrieve an array of Server data sources that can then be declared as view parameters.

This array must be freed using delete [] when done.

◆ findDataSourcesInIlv()

IlsSwServerDataSource** IlsSwComponent::findDataSourcesInIlv ( IlvGadgetContainer *  cont,
const IlsString fileName,
unsigned int &  count,
IlsBoolean  promptPath = IlsTrue 
)

Loads the .ilv file passed as the fileName parameter into the gadget container passed as the first parameter.

If the parameter promptPath is set to IlsTrue, the function opens a file browser that lets you locate the file if it is not on its path. Any new directories used to find a file are added to the local path of the component.

This function returns an array of all the Server data sources loaded into the gadget container. The array must be freed using delete [] when done.

◆ GetContainerPtr()

static IlvGadgetContainer* IlsSwComponent::GetContainerPtr ( int  )
static

Retrieves the address of the container from its index.

When a view is opened by a call to the function openSwView(), a container is passed as an index which is received by the instance of IlsSwRepresentation. In that case, the static member function GetContainerPtr() helps you retrieve the address of the container from the index. This function returns 0 if the panel has already been destroyed.

◆ GetDataSourcePtr()

static IlsSwServerDataSource* IlsSwComponent::GetDataSourcePtr ( int  )
static

Retrieves the address of the Server Data Source from its index.

When a view is opened by a call to the function openSwView(), the Server Data Source is passed as an index which is received by the instance of IlsSwRepresentation during its creation. In that case, the static member function GetDataSourcePtr() helps you retrieve the address of the Server Data Source from the index. This function returns 0 if the Server Data Source has already been destroyed.

◆ getIlvFileName()

IlsString IlsSwComponent::getIlvFileName ( const IlsString fileName,
IlsBoolean cancelled = 0 
)

Returns the full path for the file name passed as its parameter.

This method opens a file browser and adds the new directory where the file was found to the local component path.

◆ HandleMessage()

static void IlsSwComponent::HandleMessage ( const IlsMvMessage::SvMsg )
static

Displays an error message.

Depending on the severity of the error, it just calls one of the functions HandleError(), HandleWarning(), or HandleMessage().

◆ HasExited()

static IlsBoolean IlsSwComponent::HasExited ( )
static

Returns IlsTrue if the display has already been destroyed.

It may means that the application is currently exiting.

◆ Initialize() [1/2]

static void IlsSwComponent::Initialize ( IlvApplication *  ,
int  argc = 0,
char **  arg = 0 
)
static

Initializes the Rogue Wave Server/Rogue Wave Views component from an IlvApplication.

This static member function takes a valid IlvApplication object as its first argument. The other two arguments argc and argv are used to interpret some specific command-line options.

This application is used to store all the panels that have been created implicitly. A panel is said to be implicitly-created when a Rogue Wave Server/Rogue Wave Views view is opened without any container or Server-data-source view parameters being specified.

◆ Initialize() [2/2]

static void IlsSwComponent::Initialize ( IlvDisplay *  ,
int  argc = 0,
char **  arg = 0 
)
static

Initializes the Rogue Wave Server/Rogue Wave Views component from an IlvDisplay.

This static member function takes a valid Rogue Wave Views IlvDisplay object as its first argument. It must be called to initialize the Rogue Wave Server/Rogue Wave Views component before opening any dynamic views that are using classes from the Rogue Wave Server/Rogue Wave Views library.

◆ onNewRpModel()

virtual void IlsSwComponent::onNewRpModel ( IlsRpModel )
virtual

Called each time the component receives a new or an updated dynamic representation model.

Before creating a representation for a given dynamic representation model, the object server sends a copy of this model to the component.

This function is empty and can be overridden.

Reimplemented from IlsMvComponent.

◆ openingViewFromConnectionPanel()

virtual void IlsSwComponent::openingViewFromConnectionPanel ( const IlsString objId,
const IlsString viewId,
IlsBoolean  force 
)
virtual

Called by the connection panel when the user opens a view.

By default, this method opens the view by calling the member function openSwView().

◆ openSwView()

virtual void IlsSwComponent::openSwView ( const IlsString objId,
const IlsString viewId,
IlvGadgetContainer *  cont,
IlsSwServerDataSource sds,
IlsMvValue argv,
IlsCbArgNb  argc,
IlsMvValue ackArgv,
IlsCbArgNb  ackArgc,
IlsCbArgNb  resultIndex,
IlsBoolean  force = IlsFalse,
IlsSwOpenViewCallbackType  cb = 0,
IlsAny  arg = 0 
)
virtual

Opens the view viewId on the object objId.

The view uses the supplied container and Server data source if the parameters cont and sds are supplied.

  • If the container is not provided, the Server data source holder is used instead.
  • If neither the Server data source nor the container are provided, Rogue Wave Server looks for a preregistered data source for this view (see the member function DeclareViewParameterDataSource()).
  • If a Server data source is not found, a new panel is created when the view opens.

The argument IlsSwOpenViewCallbackType is a callback function that is called when the view is opened on the component side. This callback is called after all the representation objects that represent subscribed objects have been created. This means that the callback is not called until the creation notification has been fully processed on the component side.

Actually, it is called at the end of the first notification cycle for this view, that is, during the first call to IlsSwRepresentation::endS2CTransaction(). It means that all representation objects related to this view are created when this callback is called.

This callback uses arg as an extra argument. Rogue Wave Server uses the ackArgv parameter from the virtual member function IlsMvComponent::openView() to send an internal index, which is resent later by the server through one of the member functions IlsSwRepresentation::onCreation() or IlsMvComponent::ackOpenView(). This internal index is used to trigger the openView callback. Among the possible values:

  • ackArgv[0] is reserved for the result of openView, and
  • ackArgv[1] stores this internal index.
Note
The member functions IlsSwRepresentation::endS2CTransaction() and IlsSwRepresentation::onCreation() are therefore inherited from the class IlsRepresentation; therefore, you must call them if you derive that class and override the method.

◆ PrepareViewParameters()

static void IlsSwComponent::PrepareViewParameters ( const IlsString viewName,
IlsSwServerDataSource sds,
IlsMvValue *&  argv,
IlsCbArgNb argc,
IlsMvValue *&  ackArgv,
IlsCbArgNb ackArgc,
IlsCbArgNb resIndex,
IlsSwOpenViewCallbackType  cb = 0,
IlsAny  arg = 0 
)
static

Initialize the predefined view parameters.

This static member function can be used to initialize the predefined view parameters before calling one of the functions IlsMvComponent::openView(), IlsRpObject::openView(), or IlsRpObject::onDereference() to open a view that uses Rogue Wave Server/Rogue Wave Views classes. The view will be opened using the provided Server Data Source, if any.

  • If the parameter sds is null, Rogue Wave Server tries to find a pre-registered Server Data Source for viewName.
  • If the parameter cb is not null, this method also installs a callback, which is called when the corresponding view is opened.

The function PrepareViewParameters() should be called only once before the view-opening function is called, which means that you should use the returned parameter arrays when calling IlsMvcomponent::openView(), IlsRpObject::openView(), or IlsRpObject::onDereference().

This function assigns values to the parameters argc and ackArgc, as well as to the parameter resIndex, and allocates new arrays to the parameters argv and ackArgv. You must call delete [] after having used these arrays if the corresponding number of elements is not null. However, if you have provided arrays for argv and ackArgv, they will not be deleted by the function PrepareViewParameters(). The parameters you pass to these arrays are copied into the new arrays and they are positioned after the standard parameters installed by the function.

◆ recvMessage()

virtual void IlsSwComponent::recvMessage ( const IlsMvMessage::SvMsg )
virtual

Displays a message sent by the server.

By default, this function just calls the static member function HandleMessage().

Reimplemented from IlsMvComponent.

◆ rollbackC2STransaction()

virtual IlsTransactionId IlsSwComponent::rollbackC2STransaction ( )
virtual

Rolls back the current component-to-server transaction previously initialized by the beginC2STransaction() function.

  • If the asynchronous mode is enabled, a rollback request is sent to the server. The server then triggers within a server-to-component transaction all modifications needed to revert the representations in the component to a consistent state.
  • If the asynchronous rollback mode is disabled, a synchronous rollback transaction is performed by the component.
Returns
the identifier of the currently initialized transaction or defaults to 0.

Reimplemented from IlsMvComponent.

◆ Run()

static void IlsSwComponent::Run ( IlvApplication *  = 0)
static

Starts the main loop of the application component.

If an instance of IlvApplication is passed, this function calls the run() method of the application, otherwise it calls the global function IlvMainLoop().

◆ setBlockingMode()

void IlsSwComponent::setBlockingMode ( IlsBoolean  b)

Turns blocking mode on or off in the component.

Blocking mode for the component means that the watch cursor is set when a component transaction is committed and no more component transactions is allowed until the first transaction is finished. Committing a second component transaction while the component is blocked results in an error message and the rollback of the second transaction.

◆ SetNoConnectionPanel()

static void IlsSwComponent::SetNoConnectionPanel ( IlsBoolean  )
static

Controls whether the connection panel is to be created.

This static member function can be called before the application component has been initialized to control whether the connection panel is to be created.

◆ SetUseDragDropInteractor()

static void IlsSwComponent::SetUseDragDropInteractor ( IlvBoolean  )
static

Stops the drag-and-drop interactor from being used on the table gadget – an instance of IlsSwTableGadget – and on the hyper-reference gadget – an instance of IlsSwHRefGadget.

By default, this interactor is active.

◆ SetUseDragDropInteractorFlags()

static void IlsSwComponent::SetUseDragDropInteractorFlags ( IlsSwDragDropInteractorFlag  )
static

Allows fine control over which aspects of the drag-and-drop interactor are enabled.

By default, all interactions are enabled.