BMLTiOSLib
public class BMLTiOSLib : NSObject
This class represents the public interface to the BMLTiOSLib framework.
This class needs to be instantiated with a URI to a valid Root Server (the same URI used to log in), and a BMLTiOSLibDelegate object.
Instantiation immediately starts a communication process, and the result will be reflected in the delegate’s bmltLibInstance(_:BMLTiOSLib,serverIsValid:Bool) callback.
If this instance fails to connect to a valid Root Server, it should be deleted, and reinstantiated for a new connection.
Once a connection is established, the HTTP session is maintained until the instance is deinstantiated.
The session is required to be maintained for Semantic Administration. You cannot share a session across instances of BMLTiOSLib.
-
Declaration
Swift
public var searchCriteria: BMLTiOSLibSearchCriteria! { get }
Return Value
a reference to the internal SearcCriteria object.
-
Accessor for our internal Distance Units.
Declaration
Swift
public var distanceUnits: BMLTiOSLibDistanceUnits { get }
-
Accessor for our internal Distance Units.
Declaration
Swift
public var distanceUnitsString: String { get }
-
These are the available value keys for use when querying meeting data.
Declaration
Swift
public var availableMeetingValueKeys: [String] { get }
-
This is set to true if emails sent to the server are enabled (Goes to meeting contacts).
Declaration
Swift
public var emailMeetingContactsEnabled: Bool { get }
-
This is set to true if emails sent to the meeting contacts also send a copy to the Service body Admin for that meeting.
Declaration
Swift
public var emailServiceBodyAdminsEnabled: Bool { get }
-
This is number of changes stored per meeting.
Declaration
Swift
public var changeDepth: Int { get }
-
This is the server Google API Key
Declaration
Swift
public var googleAPIKey: String { get }
-
This returns the delegate object for this instance. The delegate can only be set at instantiation taime, so this is a read-only dynamic property.
Declaration
Swift
public var delegate: BMLTiOSLibDelegate! { get }
Return Value
a reference to an object that follows the BMLTiOSLibDelegate protocol.
-
This returns the Root Server URI used by the instance.
Declaration
Swift
public var rootServerURI: String { get }
Return Value
a String, with the URI.
-
This is a simple Boolean test to see if the instance successfully connected.
Declaration
Swift
public var isConnected: Bool { get }
Return Value
a Bool, true if the instance is successfully connected.
-
This returns an error String (if any)
Declaration
Swift
public var errorString: String! { get }
Return Value
an optional String object. This will be a code that can be used to key a localized String.
-
This returns true, if the Semantic Administration interface has an administrator logged in.
Declaration
Swift
public var isAdminLoggedIn: Bool { get }
Return Value
a Bool, true, if the administrator is logged in.
-
This returns the Root Server version, as an easily readable String.
Declaration
Swift
public var versionAsString: String { get }
Return Value
a String, with the version, in “X.Y.Z” form, where X is the major version, Y is the minor version, and Z is the fix version
-
This returns the Root Server version, as an integer. This allows easy version level checking.
The format is XXXYYYZZZ, with XXX being the major version, YYY being the minor version, and ZZZ being the fix version.
The result has no leading zeroes (It’s an Int), so, for example, 2.8.1 is represented as “2008001”.
Declaration
Swift
public var versionAsInt: Int { get }
Return Value
an Int, with the version packed into integer form.
-
This returns whether or not the Root Server is capable of supporting Semantic Administration.
Declaration
Swift
public var isAdminAvailable: Bool { get }
Return Value
a Bool, true, if the Root Server supports Semantic Administration.
-
This returns the Root Server center coordinates.
Declaration
Swift
public var defaultLocation: CLLocationCoordinate2D { get }
Return Value
a CLLocationCoordinate2D object, with the coordinates (default Server coordinates).
-
This returns a flat (non-hierarchical) array of Service Body nodes.
This returns every Service body on the server. Each will be in a node, with links to its parents and children (if any).
Declaration
Swift
public var serviceBodies: [BMLTiOSLibHierarchicalServiceBodyNode] { get }
Return Value
an Array of BMLTiOSLibHierarchicalServiceBodyNode objects, each of which represents one Service body.
-
This returns a flat (non-hierarchical) array of Service Body nodes that can be observed.
This returns every Service body on the server that the current user can observe. Each will be in a node, with links to its parents and children (if any).
Declaration
Swift
public var serviceBodiesICanObserve: [BMLTiOSLibHierarchicalServiceBodyNode] { get }
Return Value
an Array of BMLTiOSLibHierarchicalServiceBodyNode objects, each of which represents one Service body.
-
This returns a flat (non-hierarchical) array of Service Body nodes that can be edited or observed.
This returns every Service body on the server that the current user can observe or edit. Each will be in a node, with links to its parents and children (if any).
Declaration
Swift
public var serviceBodiesICanEdit: [BMLTiOSLibHierarchicalServiceBodyNode] { get }
Return Value
an Array of BMLTiOSLibHierarchicalServiceBodyNode objects, each of which represents one Service body.
-
This returns a flat (non-hierarchical) array of Service Body nodes that can be observed.
This returns every Service body on the server that the current user can observe, edit or administer. Each will be in a node, with links to its parents and children (if any).
Declaration
Swift
public var serviceBodiesICanAdminister: [BMLTiOSLibHierarchicalServiceBodyNode] { get }
Return Value
an Array of BMLTiOSLibHierarchicalServiceBodyNode objects, each of which represents one Service body.
-
This returns a hierarchical linked list of Service Body nodes.
This returns every Service body on the server, in a doubly linked list.
Declaration
Swift
public var hierarchicalServiceBodies: BMLTiOSLibHierarchicalServiceBodyNode { get }
Return Value
a BMLTiOSLibHierarchicalServiceBodyNode object that is the root of the hierarchy. Look in its “children” property.
-
This contains all of the possible meeting formats.
Declaration
Swift
public var allPossibleFormats: [BMLTiOSLibFormatNode] { get }
-
This contains the response from our get server languages call (nil, by default).
Declaration
Swift
public var availableServerLanguages: [BMLTiOSLibServerLang] { get }
-
This is the default initializer. This is required. You need to supply a valid URI and a valid delegate.
After this is called, the BMLTiOSLib attempts to connect to the Root Server.
IMPORTANT: YOU SHOULD NOT DO ANYTHING MORE WITH THIS BMLTiOSLib INSTANCE UNTIL THE DELEGATE CALLBACK IS INVOKED!
The callback is the bmltLibInstance(_:BMLTiOSLib,serverIsValid:Bool) method in your delegate instance.
You need to wait until this callback is invoked with serverIsValid set to true.
If serverIsValid is false, then this instance of BMLTiOSLib is no longer usable, and should be discarded.
Each instance of BMLTiOSLib has a lifetime associated with its HTTPS connection session.
Declaration
Swift
public init(inRootServerURI: String, inDelegate: BMLTiOSLibDelegate)
Parameters
inRootServerURI
A String, with the URI to a valid BMLT Root Server
inDelegate
A reference to an object that follows the BMLTiOSLibDelegate protocol.
-
Disconnects the session, and removes all local storage.
Declaration
Swift
public func clearStorage()
-
Fetches a Service body node by its ID.
Declaration
Swift
public func getServiceBodyByID(_ inID: Int) -> BMLTiOSLibHierarchicalServiceBodyNode!
Parameters
inID
The ID for the requested Service body.
-
Fetches a format node by its shared ID.
Declaration
Swift
public func getFormatByID(_ inID: Int) -> BMLTiOSLibFormatNode!
Parameters
inID
The ID for the requested format.
Return Value
an optional format node object.
-
Fetches a format node by its string key.
Declaration
Swift
public func getFormatByKey(_ inKey: String) -> BMLTiOSLibFormatNode!
Parameters
inKey
The key for the requested format.
Return Value
an optional format node object.
-
Called to get every format actually used by meetings in the database (usually a subset of the entire format list).
Declaration
Swift
public func getAllUsedFormats()
-
This performs a meeting search, based on the search criteria that currently exists.
Declaration
Swift
public func performMeetingSearch(_ inSearchResultsType: BMLTiOSLibSearchCriteria.SearchCriteriaExtent = .BothMeetingsAndFormats)
Parameters
inSearchResultsType
The type of result[s] you’d like. Defaults to both meetings and formats.
-
This performs a meeting search, based on a list of meeting IDs.
The BMLT Root Server has a special case, where a CSV list of integers is interpreted as a list of meeting IDs.
Declaration
Swift
public func getMeetingsObjectsByID(_ inMeetingIDArray: [Int], searchType inSearchResultsType: BMLTiOSLibSearchCriteria.SearchCriteriaExtent = .BothMeetingsAndFormats)
Parameters
inMeetingIDArray
An array on Int, with each integer being a BMLT ID of a meeting.
searchType
The type of result[s] you’d like. Defaults to both meetings and formats.
-
Called to get meeting change records for deleted meetings only from the Root Server.
Declaration
Swift
public func getDeletedMeetingChanges(fromDate inFromDate: Date?, toDate inToDate: Date?, serviceBodyIDs inServiceBodyIDs: [Int]?)
Parameters
fromDate
This is a Date object that contains a date/time that represents the first meeting change instance. It can be nil for no Start Date.
toDate
This is a Date object that contains a date/time that represents the last meeting change instance. It can be nil for no End Date.
serviceBodyIDs
An Array of Int, with the ID of one or more Service Bodies for which we want to get changes. It can be nil for all meeting changes within the given date range.
-
Called to get meeting change records for deleted meetings only from the Root Server.
Declaration
Swift
public func getDeletedMeetingChanges(fromDate inFromDate: Date?, toDate inToDate: Date?, serviceBodyID inServiceBodyID: Int?)
Parameters
fromDate
This is a Date object that contains a date/time that represents the first meeting change instance. It can be nil for no Start Date.
toDate
This is a Date object that contains a date/time that represents the last meeting change instance. It can be nil for no End Date.
serviceBodyID
An Int, with the ID of one Service Body for which we want to get changes. It can be nil for all meeting changes within the given date range.
-
Called to get meeting change records for deleted meetings only from the Root Server for a particular Service body.
Declaration
Swift
public func getDeletedMeetingChanges(serviceBodyID inServiceBodyID: Int?)
Parameters
serviceBodyID
An Int, with the ID of one Service Body for which we want to get changes. It can be nil for all meeting changes within the given date range.
-
Called to get meeting change records for deleted meetings only from the Root Server for a particular Service body.
Declaration
Swift
public func getDeletedMeetingChanges(serviceBodyIDs inServiceBodyIDs: [Int]?)
Parameters
serviceBodyIDs
An Array of Int, with the ID of one or more Service Bodies for which we want to get changes. It can be nil for all meeting changes within the given date range.
-
Called to get all meeting change records for deleted meetings only from the Root Server.
Declaration
Swift
public func getDeletedMeetingChanges()
-
Called to get meeting change records from the Root Server.
Declaration
Swift
public func getAllMeetingChanges(fromDate inFromDate: Date?, toDate inToDate: Date?, serviceBodyID inServiceBodyID: Int?, meetingID inMeetingID: Int?, userID inUserID: Int?)
Parameters
fromDate
This is a Date object that contains a date/time that represents the first meeting change instance. It can be nil for no Start Date.
toDate
This is a Date object that contains a date/time that represents the last meeting change instance. It can be nil for no End Date.
serviceBodyID
An Int, with the ID of one Service Body for which we want to get changes. It can be nil for all meeting changes within the given date range.
meetingID
An Int, with the ID of one meeting for which we want to get changes. It can be nil for all meeting changes within the given date range.
userID
An Int, with the ID of one Admin User for which we want to get changes. It can be nil for all meeting changes within the given date range. This is only valid for logged-in users.
-
Called to get meeting change records from the Root Server.
Declaration
Swift
public func getAllMeetingChanges(fromDate inFromDate: Date?, toDate inToDate: Date?, serviceBodyID inServiceBodyID: Int?, meetingID inMeetingID: Int?)
Parameters
fromDate
This is a Date object that contains a date/time that represents the first meeting change instance. It can be nil for no Start Date.
toDate
This is a Date object that contains a date/time that represents the last meeting change instance. It can be nil for no End Date.
meetingID
An Int, with the ID of one meeting for which we want to get changes. It can be nil for all meeting changes within the given date range.
serviceBodyID
An Int, with the ID of one Service Body for which we want to get changes. It can be nil for all meeting changes within the given date range.
-
Called to get meeting change records from a meeting within a date range from the Root Server.
Declaration
Swift
public func getAllMeetingChanges(fromDate inFromDate: Date?, toDate inToDate: Date?, meetingID inID: Int?)
Parameters
fromDate
This is a Date object that contains a date/time that represents the first meeting change instance. It can be nil for no Start Date.
toDate
This is a Date object that contains a date/time that represents the last meeting change instance. It can be nil for no End Date.
meetingID
An Int, with the ID of one meeting for which we want to get changes. It can be nil for all meeting changes within the given date range.
-
Called to get meeting change records from a Service body within a date range from the Root Server.
Declaration
Swift
public func getAllMeetingChanges(fromDate inFromDate: Date?, toDate inToDate: Date?, serviceBodyID inServiceBodyID: Int?)
Parameters
fromDate
This is a Date object that contains a date/time that represents the first meeting change instance. It can be nil for no Start Date.
toDate
This is a Date object that contains a date/time that represents the last meeting change instance. It can be nil for no End Date.
serviceBodyID
An Int, with the ID of one Service Body for which we want to get changes. It can be nil for all meeting changes within the given date range.
-
Called to get all meeting change records within a date range from the Root Server.
Declaration
Swift
public func getAllMeetingChanges(fromDate inFromDate: Date?, toDate inToDate: Date?)
Parameters
fromDate
This is a Date object that contains a date/time that represents the first meeting change instance. It can be nil for no Start Date.
toDate
This is a Date object that contains a date/time that represents the last meeting change instance. It can be nil for no End Date.
-
Called to get meeting change records for one single meeting from the Root Server.
Declaration
Swift
public func getAllMeetingChanges(meetingID inID: Int)
Parameters
meetingID
An Int, with the ID of one meeting for which we want to get all of the last changes (It fetches all the stored changes, which are limited in scope).
-
Called to get meeting change records for one single meeting from the Root Server, with delivery of the changes to that meeting.
Declaration
Swift
public func getAllMeetingChanges(meeting inMeetingNode: BMLTiOSLibMeetingNode?)
Parameters
meetingID
An Int, with the ID of one meeting for which we want to get all of the last changes (It fetches all the stored changes, which are limited in scope).
-
Called to get meeting change records for one single Service body from the Root Server.
Declaration
Swift
public func getAllMeetingChanges(serviceBodyID inServiceBodyID: Int)
Parameters
serviceBodyID
An Int, with the ID of one Service Body for which we want to get changes. It can be nil for all meeting changes within the given date range.
-
Called to log into a server that has semantic admin turned on.
Declaration
Swift
public func adminLogin(loginID inLoginID: String, password inPassword: String) -> Bool
Parameters
inLoginID
This is a string, with the login ID.
inPassword
This is a string, with the password.
Return Value
a Bool, which is true, if the connection is to a valid server with semantic admin on.
-
Called to log out of a server that has semantic admin turned on.
Declaration
Swift
public func adminLogout() -> Bool
Return Value
a Bool, which is true, if the connection is to a valid server with semantic admin on.
-
Declaration
Swift
public func permissions(forServiceBody inServiceBody: BMLTiOSLibHierarchicalServiceBodyNode) -> BMLTiOSLibPermissions
Return Value
If we are logged in as an admin, this will indicate the level of permission we have with a given Service body.
-
This is called to set a meeting change.
Declaration
Swift
public func saveMeetingChanges(_ inMeetingObject: BMLTiOSLibEditableMeetingNode)
Parameters
inMeetingObject
an editable meeting object.
-
This is called to set a meeting change.
Declaration
Swift
public func rollbackMeeting(_ inMeetingID: Int, toBeforeChange inChangeID: Int) -> Bool
Parameters
inMeetingObject
an ID of an editable meeting object.
Return Value
true, if the operation was dispatched successfully.
-
Saves the meeting as a copy (does not save or set changes in current meeting).
Declaration
Swift
public func saveMeetingAsCopy(_ inMeetingObject: BMLTiOSLibEditableMeetingNode)
-
Called to delete a meeting.
We have to assume the logged-in admin has rights. If they don’t, it will be stopped at the server.
Declaration
Swift
public func deleteMeeting(_ inMeetingID: Int)
Parameters
inMeetingID
An Int, with the ID of the meeting to be deleted.
-
Called to restore a deleted meeting.
This instructs the Root Server to find the last deletion record for the meeting, and restore it to the state it was in just prior to deletion.
However, it is more ideal to find the latest deletion record, and restore its “before” instance (See discussion above).
Declaration
Swift
public func restoreDeletedMeeting(_ inMeetingID: Int) -> Bool
Parameters
inMeetingID
An Int, with the ID of the meeting to be restored.
Return Value
true, if the operation was dispatched successfully.