IlsSwRepresentation
 
IlsSwRepresentation
Category 
Dynamic view-related class (Server/Views component)
Inheritance Path 
IlsRpObject
IlsRepresentation
IlsSwRepresentation
Description 
This class implements the set of IlsSwTable representation objects associated with a given dynamic view.
Library 
<mvsw>
Header File 
#include <ilmvsw/repres.h>
Synopsis 
class IlsSwRepresentation : public IlsRepresentation
{
public:
IlsSwRepresentation(IlsMvComponent& component,
const IlsRpModel& model);
virtual ~IlsSwRepresentation();
Opening Views/Creating Panels
virtual void onCreation(const IlsMvValue* ackArgv,
IlsCbArgNb ackArgc);
IlsBoolean ownsPanel();
void ownsPanel(IlsBoolean);
virtual void onNewRpInSds(const IlsString& viewName);
Raising a Panel
virtual void setSelection();
void raiseOnSetSelection(IlsBoolean b);
IlsBoolean raiseOnSetSelection() const;
Accessors
static IlsBoolean IsPropertyDataSource(IliDataSource*);
IlsBoolean isBad();
virtual IlvGadgetContainer* getPanel() const;
IlsSwTable** getTables(int& count);
IliMemoryDataSource* getMainDataSource(const IlsString& name);
IliMemoryDataSource* getPropertyDataSource
(const IlsString& tableRepresentationName);
const IlsString& getResourceName();
IlsSwServerDataSource* getServerDataSource();
const IlsString& getViewType();
Execution Callbacks
static IlsSwExecCallbackType GetExecCallback(const IlsString&);
static void DeclareExecCallback(const IlsString&,
IlsSwExecCallbackType,
IlsSwRepresentation* = 0);
Other Callbacks
static void AddCallback(IlvSymbol* symbol,
IlsSwRepresentationCallbackType,
IlsAny = 0,
IlsSwRepresentation* = 0);
static void AddCallback(IlvSymbol* symbol,
IlsSwRepresentationContainerCallbackType,
IlsAny = 0,
IlsSwRepresentation* = 0);
static void RemoveCallback(IlvSymbol* symbol,
IlsSwRepresentationCallbackType,
IlsAny = 0,
IlsSwRepresentation* = 0);
static void RemoveCallback
(IlvSymbol* symbol,
IlsSwRepresentationContainerCallbackType,
IlsAny = 0,
IlsSwRepresentation* = 0);
static void CbDestroy(IlvView*, IlvAny);
void addActivateCallback(IlsBoolean b);
IlsBoolean addActivateCallback();
Callback Symbols
static IlvSymbol* RepresentationCreatedSymbol();
static IlvSymbol* RepresentationDestroyedSymbol();
static IlvSymbol* IlvReadCallbackSymbol();
static IlvSymbol* GadgetContainerInitializedCallbackSymbol();
static IlvSymbol* BeginC2STransactionSymbol();
static IlvSymbol* CommitC2STransactionSymbol();
static IlvSymbol* RollbackC2STransactionSymbol();
static IlvSymbol* BeginS2CTransactionSymbol();
static IlvSymbol* EndS2CTransactionSymbol();
Index Conversion
IlvInt serverIndexToInFormIndex(IlsSvInt i);
IlsSvInt inFormIndexToServerIndex(IlvInt i);
Representation Attributes
virtual void setTitle(const IlsString&);
virtual void setIconTitle(const IlsString&);
Closing Representations
virtual void onCloseSDS();
void closeOnNewRpInSDS(IlsBoolean b);
IlsBoolean closeOnNewRpInSDS();
static void CloseRepresentationsInPanel(IlvContainer*,
IlsBoolean notify=IlsTrue);
Miscellaneous Functions
public:
virtual void endS2CUpdate(IlsS2CTransStatus status,
IlsTransactionId id);
protected:
virtual void transferState(IlsSwRepresentation& oldRepres,
IlsBoolean transferCallbacks);
};
Constructor 
IlsSwRepresentation(IlsMvComponent& component,
const IlsRpModel& model);
This constructor is called by Rogue Wave Server when a dynamic view specified using Rogue Wave Server Studio is opened. If you derive this class, you must call this constructor with component and model arguments.
Destructor 
virtual ~IlsSwRepresentation();
This is the public virtual destructor for this class.
Member Functions 
Opening Views/Creating Panels
[virtual] void onCreation(const IlsMvValue* ackArgv, IlsCbArgNb ackArgc);
This virtual member function (which is inherited from the class IlsRepresentation) is called by Rogue Wave Server when the representation is created. It triggers the IlsSwOpenViewCallbackType callback installed when opening the view.
IlsBoolean ownsPanel();
This member function returns IlsTrue if the representation owns the panel. The representation is said to own the panel if it has been created without a panel or a Server data source. This means that the representation itself has created the panel and will destroy it when it closes.
Note: The representation also installs a deletion callback for this panel, which is the static member function CbDestroy.
void ownsPanel(IlsBoolean);
This member function sets or unsets ownership of the panel to the representation. When the representation loses ownership, it removes the destroy callback that this representation had previously installed on the panel.
[virtual] void onNewRpInSds(const IlsString& viewName);
This virtual member function is called when a new view is about to be opened and the representation contains a Server data source as a view parameter. By default, this function closes the previous representation in which the Server data source was displayed. This method can be overridden to change the default behavior.
Raising a Panel
[virtual] void setSelection();
If the raiseOnSetSelection property is true (which is its default value), this virtual member function brings the window or panel associated with the representation to the front—and deiconifies it if necessary. This function is called whenever the opening of a view is requested for the same view and server object as the current representation. See IlsRepresentation for more information.
void raiseOnSetSelection(IlsBoolean b);
This member function specifies whether the associated panel must be raised when the function setSelection is called.
IlsBoolean raiseOnSetSelection() const;
This member function returns IlsTrue if the associated panel is raised when the function setSelection is called.
Accessors
[static] IlsBoolean IsPropertyDataSource(IliDataSource*);
This static member function returns:
*IlsTrue if the data source parameter is the property data source,
*IlsFalse if the data source is null or if it is the main data source.
IlsBoolean isBad();
This member function returns IlsTrue if the view has been opened and closed again immediately because its initiatialization has failed (due to the component being wrong, or the Server Data Source or panel having been destroyed before the representation was created).
[virtual] IlvGadgetContainer* getPanel() const;
This virtual member function can be used to retrieve the gadget container that is associated with the representation. This gadget container can be one of the following:
*either the container that was passed to the openView function (either explicitly or implicitly via a call to IlsSwComponent::DeclareViewParameterContainer),
*or the container that was created by the representation from the resource name (the name of the .ilv file if the view was created in Rogue Wave Server Studio),
*or the container of the provided Server Data Source.
IlsSwTable** getTables(int& count);
This member function returns an array and count of all instances of IlsSwTable representations that are contained by the IlsSwRepresentation object. The array must be freed using delete[]when finished with.
IliMemoryDataSource* getMainDataSource(const IlsString& name);
This member function returns the main data source associated with the table representation name declared in the view specification.
IliMemoryDataSource* getPropertyDataSource
(const IlsString& tableRepresentationName);
This member function returns the property data source associated with the table representation name declared in the view specification.
const IlsString& getResourceName();
This member function returns the name of the resource file used to create the associated panel as specified in the dynamic-view specification file.
IlsSwServerDataSource* getServerDataSource();
This member function returns the corresponding Server data source.
Note: This information is not available until the end of the first notification cycle on this representation, that is until the function IlsSwRepresentation::endS2CUpdate (inherited from the parent class IlsRpObject) has been called once.
const IlsString& getViewType();
This member function returns the value of the default representation property. If no value has been supplied for this property through Rogue Wave Server Studio, the value is InFormView.
Execution Callbacks
[static] IlsSwExecCallbackType GetExecCallback(const IlsString&);
This static member function returns the execution callback name or 0 if no execution callback was declared.
[static] void DeclareExecCallback(const IlsString&,
IlsSwExecCallbackType,
IlsSwRepresentation* = 0);
This static member function declares an execution callback by its name. This name can be used in Rogue Wave Server Studio as the generic callback name on the gadget. The callback function passed as parameter is called when the gadget is activated. The name to be used in the Rogue Wave Server Studio should be prefixed by @IlsRpCallback:. Hence, if we declare a callback of name doIt, the name to be set in Rogue Wave Server Studio is @IlsRpCallback:doIt.
Other Callbacks
[static] void AddCallback(IlvSymbol* symbol,
IlsSwRepresentationCallbackType,
IlsAny = 0,
IlsSwRepresentation* = 0);
[static] void AddCallback(IlvSymbol* symbol,
IlsSwRepresentationContainerCallbackType,
IlsAny = 0, IlsSwRepresentation* = 0);
These static member functions add a callback to the representation. The parameter symbol identifies which callback is to be added. If the representation is null, the callback is called for all instances of IlsSwRepresentation.
[static] void RemoveCallback(IlvSymbol* symbol,
IlsSwRepresentationCallbackType,
IlsAny = 0,
IlsSwRepresentation* = 0);
[static] void RemoveCallback(IlvSymbol* symbol,
IlsSwRepresentationContainerCallbackType,
IlsAny = 0,
IlsSwRepresentation* = 0);
These static member functions remove a callback that was previously added using one of the AddCallback functions.
[static] void CbDestroy(IlvView*, IlvAny);
This static member function is installed as the destroy callback of the panel, if Rogue Wave Server creates the panel. The panel is created if the view is opened with no panel or Server data source supplied as parameters.
You can remove this callback using the standard Rogue Wave Views method IlvView::removeDestroyCallback or by calling the member function IlsSwRepresentation::ownsPanel with its Boolean parameter set to IlsFalse.
void addActivateCallback(IlsBoolean b);
This member function sets the property addActivateCallback to the Boolean value b. When this property is set, all data source-aware gadgets of the associated panel are assigned an activate callback which will trigger the validation of the underlying data source—if this data source has been initialized in autocommit mode in the Server Data Source inspector. By default, this property is set to IlsTrue.
If you want to change this value, you must do it before the IlsRpObject::endS2CUpdate function is called for this representation.
Warning: The following data source-aware gadgets cannot be assigned an activate callback: IliDbGrapher, IliDbGant, IliDbChart, IliDbPieChart, IliDbTree.
The callback installed on these gadgets is the static member function IlsSwRepresentation::CbActivate(IlvGraphic*, IlvAny) (which is not documented).
IlsBoolean addActivateCallback();
This member function returns IlsTrue if the addActivateCallback property is set to IlsTrue.
Callback Symbols
[static] IlvSymbol* RepresentationCreatedSymbol();
This static member function returns the symbol for the callback that can be called when a representation is created.
This callback is of type IlsSwRepresentationCallbackType.
[static] IlvSymbol* RepresentationDestroyedSymbol();
This static member function returns the symbol for the callback that can be called when a representation is destroyed.
This callback is of type IlsSwRepresentationCallbackType.
[static] IlvSymbol* IlvReadCallbackSymbol();
This static member function returns the symbol for the callback that can be called when an .ilv file is read by the representation during the opening of a view. This callback is of type IlsSwRepresentationContainerCallbackType.
[static] IlvSymbol* GadgetContainerInitializedCallbackSymbol();
This static member function returns the symbol for the callback that can be called when a gadget container is initialized by the representation during the opening of a view. This callback is of type IlsSwRepresentationContainerCallbackType.
[static] IlvSymbol* BeginC2STransactionSymbol();
This static member function returns the symbol for the callback that can be called when a component transaction is started.
[static] IlvSymbol* CommitC2STransactionSymbol();
This static member function returns the symbol for the callback that can be called when a component transaction is committed.
[static] IlvSymbol* RollbackC2STransactionSymbol();
This static member function returns the symbol for the callback that can be called when a component transaction is rolled back.
[static] IlvSymbol* BeginS2CTransactionSymbol();
This static member function returns the symbol for the callback that can be called when a server transaction is started.
This callback is of type IlsSwRepresentationS2CCallbackType.
[static] IlvSymbol* EndS2CTransactionSymbol();
This static member function returns the symbol for the callback that can be called when a component transaction is finished.
This callback is of type IlsSwRepresentationS2CCallbackType.
Index Conversion
IlvInt serverIndexToInFormIndex(IlsSvInt i);
This member function returns an Rogue Wave Views index from the server index i.
IlsSvInt inFormIndexToServerIndex(IlvInt i);
This member function returns an Rogue Wave Server index from the Rogue Wave Views index i.
Representation Attributes
[virtual] void setTitle(const IlsString&);
This virtual member function is called by Rogue Wave Server when the representation attribute title is notified. By default, this function sets the title of the associated panel.
[virtual] void setIconTitle(const IlsString&);
This virtual member function is called by Rogue Wave Server when the representation attribute title is notified. By default, this function sets the title of the associated panel.
Closing Representations
[virtual] void onCloseSDS();
This virtual member function is called when the Server data source is closed without notification. By default, this function deletes the representation. See also IlsSwServerDataSource::close.
void closeOnNewRpInSDS(IlsBoolean b);
This member function controls whether the representation must be closed if a new view is opened on the same Server Data Source.
IlsBoolean closeOnNewRpInSDS() const;
This member function returns IlsTrue if the representation is configured to be closed when a new view is opened on the same Server Data Source.
[static] void CloseRepresentationsInPanel(IlvContainer*,
IlsBoolean notify=IlsTrue);
This static member function closes all opened representations in this panel. Each representation is closed with or without notification, depending of the value of the last parameter.
Miscellaneous Functions
[virtual] void endS2CUpdate(IlsS2CTransStatus status, IlsTransactionId id);
This virtual member function (which is inherited from the class IlsRpObject through the class IlsSwRepresentation) is called by Rogue Wave Server at the end of the notification cycle for this object. The first time this function is called, it creates the panel if no panel or Server Data Source has been supplied.
[virtual] void transferState(IlsSwRepresentation& oldRepres,
IlsBoolean transferCallbacks);
This protected virtual member function transfers the state of a representation to the representation for which it is called. If oldRepres has ownership of the panel, ownership is transferred to the new representation.
This function must be called before the end of the first notification cycle for the representation—more precisely in the endS2CUpdate function defined for a derived class and before calling the function IlsSwRepresentation::endS2CUpdate.
If the parameter transferCallbacks is set to IlsTrue, the callbacks on the current instance are transferred to the new representation.
See Also 
@CloseRepres, IlsMvComponent, IlsRepresentation, IlsRpObject, IlsSwComponent, IlsSwExecCallbackType, IlsSwTable, IliTable, Basic Types

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.