Web API Reference MapGuide Open Source

MgLongTransactionReader Class Reference
[MgLongTransactionReader]

Provides forward-only, read-only functionality for describing a set of long transactions that exist in the feature source. More...

Inherits MgSerializable.

List of all members.


Public Member Functions

void Close ()
 Closes the MgLongTransactionReader object, freeing any resources it may be holding.
MgLongTransactionReaderGetChildren ()
 
MgDateTimeGetCreationDate ()
 
STRING GetDescription ()
 
STRING GetName ()
 Gets the name of the long transaction currently being read.
STRING GetOwner ()
 
MgLongTransactionReaderGetParents ()
 
bool IsActive ()
 
bool IsFrozen ()
 Specifies whether the long transaction currently being read is frozen.
bool ReadNext ()
 Advances the reader to the next long transaction.

Detailed Description

Provides forward-only, read-only functionality for describing a set of long transactions that exist in the feature source.

Remarks:
You must call ReadNext before you can access any data. Calling ReadNext() gives you access to the information about one long transaction. See the example code. MgFeatureService::GetLongTransactions returns an MgLongTransactionReader object.
Example (PHP)
The code in this example has not been tested. It's a start.
 <?php
 function printLongTransactionReader($longTransactionReader)
 {
    global $logFileHandle;
    $i = 0;
    fwrite($logFileHandle, "Printing long transaction readern");
    while ($longTransactionReader->ReadNext())
    {
       $i++;
       $name = $longTransactionReader->GetName();
       fwrite($logFileHandle, "Name: $namen");
       $desc = $longTransactionReader->GetDescription();
       fwrite($logFileHandle, "Description: $descn");
       $owner = $longTransactionReader->GetOwner();
       fwrite($logFileHandle, "Owner: $ownern");
       $dateTime = $longTransactionReader->GetCreationDate();
       $printableDateTime = printDateTime($dateTime);
       fwrite($logFileHandle, "Creation Date: $printableDateTimen");
       $isActive = $longTransactionReader->IsActive();
       $printableIsActive = prtBool($isActive);
       fwrite($logFileHandle, "IsActive: $printableIsActiven");
       $isFrozen = $longTransactionReader->IsFrozen();
       $printableIsFrozen = prtBool($isFrozen);
       fwrite($logFileHandle, "IsFrozen: $printableIsFrozenn");
       $parentLongTransactionReader = $longTransactionReader->GetParents();
       if ($parentLongTransactionReader == NULL)
       {
          fwrite($logFileHandle, "There is no parent long transactionn");
       }
       else
       {
          fwrite($logFileHandle, "Printing parent long transaction readern");
          printLongTransactionReader($parentLongTransactionReader);
          $parentLongTransactionReader->Close();
       }
       $childrenLongTransactionReader = $longTransactionReader->GetChildren();
       if ($childrenLongTransactionReader == NULL)
       {
          fwrite($logFileHandle, "There are no child long transactionsn");
       }
       else
       {
          fwrite($logFileHandle, "Printing children long transaction readern");
          printLongTransactionReader($childrenLongTransactionReader);
          $childrenLongTransactionReader->Close();
       }
    }
    fwrite($logFileHandle, "Printed $i long transaction(s)n");
 }
 ?>

Comments or suggestions? Send us feedback.