
Static Public Member Functions | |
| static | buildConstraints ($req, $limit, $blah) |
| INSERT BRIEF DESCRIPTION HERE. | |
| static | getAlignments ($req) |
| Retrieves XML listing of standard/textbooks/words aligned to given resource(s). | |
| static | getAlignmentsByStatus ($req, $keyOn= 'resource', $asXML=false) |
| INSERT BRIEF DESCRIPTION HERE. | |
| static | getRelationships ($req, $asXML=true) |
| Retrieves a list of resources related to a give resource. | |
| static | getResourcesAligned ($type, $id, $mode=TSDRequest::MODE_APPROVED, $offset=false, $limit=false) |
| Retrieves list of resources aligned to a given standard/textbook/word. | |
| static | getTree ($rootType, $rootId= '', $recursive=true) |
| Retrieves XML describing some portion of the standards/textbook/dictionary tree. | |
Static Private Member Functions | |
| static | treeListing ($root, $types, $where, $depth= '', $multiResource=false, $op= '', $limitClause= '') |
| Generates XML trees for public functions above. | |
If you are accessing TSD directly in your project, you should use the other TSD classes. This class is only meant to be used by SDR to provide information for remote requests, such as would be used by the Advanced Search Service.
Definition at line 12 of file TSDService.php5.
| static TSDService::buildConstraints | ( | $ | req, | |
| $ | limit, | |||
| $ | blah | |||
| ) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
| $req | [TYPE]: DESCRIPTION | |
| $limit | [TYPE]: DESCRIPTION | |
| $blah | [TYPE]: DESCRIPTION |
Definition at line 496 of file TSDService.php5.
References TSD::MODE_ALL, TSD::MODE_APPROVED, TSD::MODE_CHANGED, TSD::MODE_DELETED, TSD::MODE_DEV, TSD::MODE_DEV_ACTIVE, TSD::MODE_DEV_UNAPPROVED, TSD::MODE_LIVE, and TSD::MODE_NEW.
| static TSDService::getAlignments | ( | $ | req | ) | [static] |
Retrieves XML listing of standard/textbooks/words aligned to given resource(s).
The XML is hierarchical and includes information about the ancestors of the actual aligned items. For example, if a standard objective is aligned to the resource, then the XML for that would be:
<organization>
<id>2</id>
<name>Foobar</name>
...
<grade>
<id>1337</id>
<name>6th</name>
<category>
<id>605</id>
<name>Algebra</name>
<objective>
<id>314</id>
<name>Teaching stuff</name>
</objective>
</category>
</grade>
</organization>
And if there were multiple alignments, they would be put in the appropriate places in the tree, possibly resulting in additional organizations, categories, etc. being in the XML. The same rules are true for textbooks. Words have no hierarchy, so the XML is simply a list of word ~ definition pairs:
<word> <word>foo</name> <definition>First canonical metasyntactic variable</definition> </word>
For each resource ID provided, there will be an entry in the return array containing the XML trees as described above, surrounded by the tags <alignments>...</alignments>.
All parameters are provided through a TSDRequest object. This method looks at the mode, types and resourceIds parameters in TSDRequest.
| $req | [TSDRequest]: request object providing parameters for this method |
Definition at line 62 of file TSDService.php5.
References TSD::MODE_ALL, TSD::MODE_APPROVED, TSD::MODE_CHANGED, TSD::MODE_DELETED, TSD::MODE_DEV, TSD::MODE_DEV_ACTIVE, TSD::MODE_DEV_UNAPPROVED, TSD::MODE_LIVE, and TSD::MODE_NEW.
| static TSDService::getAlignmentsByStatus | ( | $ | req, | |
| $ | keyOn = 'resource', |
|||
| $ | asXML = false | |||
| ) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
| $req | [TYPE]: DESCRIPTION | |
| $keyOn | [TYPE]: DESCRIPTION | |
| $asXML | [TYPE]: DESCRIPTION |
Definition at line 371 of file TSDService.php5.
References TSD::getDBI(), SObject::getError(), TSD::MODE_ALL, TSD::MODE_APPROVED, TSD::MODE_CHANGED, TSD::MODE_DELETED, TSD::MODE_DEV, TSD::MODE_DEV_ACTIVE, TSD::MODE_DEV_UNAPPROVED, TSD::MODE_LIVE, and TSD::MODE_NEW.
| static TSDService::getRelationships | ( | $ | req, | |
| $ | asXML = true | |||
| ) | [static] |
Retrieves a list of resources related to a give resource.
For each specified resource ID, the following XML tree is generated, with one <relationship> entry for each relationship to that resource ID:
<relationships>
<resourceId>42</resourceId>
<relationship>
<resourceId>17</resourceId>
<description>foo</description>
<version>dev</version>
<status>approved</status>
</relationship>
<relationship>
...
</relationship>
<relationship>
...
</relationship>
</relationships>
The TSDRequest object that must be passed as an argument must provide the mode, and resourceIds parameters.
| $req | [TSDRequest]: request object providing parameters for this operation | |
| $asXML | [boolean]: if true, returns XML as described above, if false, returns nested array with the same information |
Definition at line 157 of file TSDService.php5.
References TSD::getDBI(), SObject::getError(), TSD::MODE_ALL, TSD::MODE_APPROVED, TSD::MODE_CHANGED, TSD::MODE_DELETED, TSD::MODE_DEV, TSD::MODE_DEV_ACTIVE, TSD::MODE_DEV_UNAPPROVED, TSD::MODE_LIVE, and TSD::MODE_NEW.
| static TSDService::getResourcesAligned | ( | $ | type, | |
| $ | id, | |||
| $ | mode = TSDRequest::MODE_APPROVED, |
|||
| $ | offset = false, |
|||
| $ | limit = false | |||
| ) | [static] |
Retrieves list of resources aligned to a given standard/textbook/word.
| $type | [string]: one of 'section' (for textbooks), 'objective' (for standards) or 'word' (for dictionary) | |
| $id | [int]: the section, objective id, or word that we are checking alignments against | |
| $mode | [int]: trim down results based on status of alignment (see TSDRequest::MODE_* constants) | |
| $offset | [int]: if provided, use as the offset for a LIMIT clause | |
| $limit | [int]: if provided, use as the count for a LIMIT clause |
Definition at line 298 of file TSDService.php5.
References TSD::getDBI(), SObject::getError(), TSD::MODE_ALL, TSD::MODE_APPROVED, TSD::MODE_CHANGED, TSD::MODE_DELETED, TSD::MODE_DEV, TSD::MODE_DEV_ACTIVE, TSD::MODE_DEV_UNAPPROVED, TSD::MODE_LIVE, and TSD::MODE_NEW.
| static TSDService::getTree | ( | $ | rootType, | |
| $ | rootId = '', |
|||
| $ | recursive = true | |||
| ) | [static] |
Retrieves XML describing some portion of the standards/textbook/dictionary tree.
This function is used to get information about available standards, textbooks and dictionary words. It does not return information about alignments or resource relationships. The resultset can be large, so avoid querying, e.g., the entire standards tree (which is over 400KB of XML).
There are three distinct trees: standards, textbooks and the dictionary. You cannot have the results of all three or any combination thereof in a single resultset (that is, you can only get results for all or part of one of the trees). If you specify the $rootType to be 'book', 'organization' or 'word', you will get the whole standards, textbooks or dictionary trees (respectively) unless you also specify a $rootId, which will only give the tree for a given book, organization or word. If you specify a $rootType that is lower than the top level, then information will still be given about the higher levels of the tree, but only for ancestry purposes. For example, if you want to list all objectives in a given category, you will still given information about that category's grade and that grade's organization. But you will not get information about other categories, grades or organizations. This is the same behavior as in TSDService::getAlignments().
The $recursive option determines whether information about sublevels should be returned as well. If it is false, then only information about the given $rootType and $rootId is returned. If $rootId is empty, then you get a listing of all $rootType items in the tree, regardless of parentage. A more flexible system may be implemented in the future.
| $rootType | [string]: one of 'book', 'chapter', 'section', 'organization', 'grade', 'category', 'objective' or 'word'. This gives the top level of the tree (but, see explanation above). | |
| $rootId | [int]: ID of top element in result tree, or empty for all items of the root type or for when query the top level of the tree. | |
| $recursive | [boolean]: whether to return details about levels in the tree lower than the one selected by $rootType |
Definition at line 621 of file TSDService.php5.
| static TSDService::treeListing | ( | $ | root, | |
| $ | types, | |||
| $ | where, | |||
| $ | depth = '', |
|||
| $ | multiResource = false, |
|||
| $ | op = '', |
|||
| $ | limitClause = '' | |||
| ) | [static, private] |
Generates XML trees for public functions above.
For internal use only.
| $root | [string]: name of root level ('organization', 'grade', etc.) | |
| $types | [array]: the keys indicate which of standard, textbooks and words should be returned. If the 'alignments' key is set, then the queries are joined against the alignment tables to get alignment information. | |
| $where | [string]: WHERE clause | |
| $depth | [string]: do not generate XML for node types lower than this one (e.g., if $depth is 'category', then no XML will be generated for 'objective'). If blank, there is no limit. | |
| $op | [string]: if 'count' then just return the count of alignments in the tree, otherwise, return the normal XML | |
| $multiResource | [boolean]: if false, assume a single resource in tree, otherwise, it should contain an array of resource IDs (NOTE: only TSDService::getTree() uses false here, the other methods always provide an array of resourceId's) | |
| $limitClause | [string]: will be used as a LIMIT clause, if provided |
Definition at line 662 of file TSDService.php5.
1.5.6