Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Documentation
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rachael Hu
Documentation
Commits
920a744e
Commit
920a744e
authored
Apr 07, 2016
by
Tom Laudeman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates for behavior and function of delete, user account data
parent
9dc97418
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
DBUser API.md
Requirements/DBUser API.md
+1
-1
DBUtil API.md
Specifications/DBUtil API.md
+13
-14
No files found.
Requirements/DBUser API.md
View file @
920a744e
...
@@ -225,7 +225,7 @@ Add a role to the User via table appuser_role_link. Return true on success.
...
@@ -225,7 +225,7 @@ Add a role to the User via table appuser_role_link. Return true on success.
---
---
`
listRoles
()`
`
roleList
()`
List all system roles. The simpliest form would be an associative list with keys: id, label, description.
List all system roles. The simpliest form would be an associative list with keys: id, label, description.
...
...
Specifications/DBUtil API.md
View file @
920a744e
...
@@ -152,21 +152,21 @@ $versionList = allVersion($mainID);
...
@@ -152,21 +152,21 @@ $versionList = allVersion($mainID);
```
```
public function readConstellation($mainID, $version)
`public function readConstellation($mainID, $version)`
Returns a full constellation, or false upon failure. The UI can be built from the full constellation as
Returns a full constellation, or false upon failure. The UI can be built from the full constellation as
necessary. This is better than having functions specifically only returning partial data for the UI, but full
necessary. This is better than having functions specifically only returning partial data for the UI, but full
data for other uses. The functions that return ID and version work alongside readConstellation() as part of a
data for other uses. The functions that return ID and version work alongside readConstellation() as part of a
small tool kit.
small tool kit.
public function writeConstellation($argObj, $note)
`public function writeConstellation($argObj, $note)`
Writes a constellation to the database, returning the same constellation with ID and versions as
Writes a constellation to the database, returning the same constellation with ID and versions as
appropriate. It will probably crash if the first argument is not a constellation. The constellation must pass
appropriate. It will probably crash if the first argument is not a constellation. The constellation must pass
validation tests which writeConstellation() calls before doing any other work.
validation tests which writeConstellation() calls before doing any other work.
public function readPublishedConstellationByARK($arkID)
`public function readPublishedConstellationByARK($arkID)`
public function readPublishedConstellationByID($mainID)
`public function readPublishedConstellationByID($mainID)`
Given an ARK/ID, return the current publicly available constellation ID and version. This will only return the
Given an ARK/ID, return the current publicly available constellation ID and version. This will only return the
current published version. Returns a single constellation or false upon failure.
current published version. Returns a single constellation or false upon failure.
...
@@ -174,7 +174,7 @@ current published version. Returns a single constellation or false upon failure.
...
@@ -174,7 +174,7 @@ current published version. Returns a single constellation or false upon failure.
Functions return the most recent version so that a user can continue editing where they left off. By
Functions return the most recent version so that a user can continue editing where they left off. By
definition, a locked-for-edit constellation is not public.
definition, a locked-for-edit constellation is not public.
public function listConstellationsLockedToUser($status=null)
`public function listConstellationsLockedToUser($status=null)`
The SNAC dashboard will call listConstellationsLockedToUser() or the logical equivalent, which returns a list
The SNAC dashboard will call listConstellationsLockedToUser() or the logical equivalent, which returns a list
of constellations. The dashboard web page is populated from this list of constellations. The user who has the
of constellations. The dashboard web page is populated from this list of constellations. The user who has the
...
@@ -185,17 +185,17 @@ We may want a function that returns the X most recently updated constellations,
...
@@ -185,17 +185,17 @@ We may want a function that returns the X most recently updated constellations,
would also be useful on the dashboard. We are already planning for listConstellationsLockedToUser() to take a
would also be useful on the dashboard. We are already planning for listConstellationsLockedToUser() to take a
status parameter, which will be usefor for the dashboard.
status parameter, which will be usefor for the dashboard.
public function readConstellationStatus($mainID, $version=null)
`public function readConstellationStatus($mainID, $version=null)`
Read the status for constellation ID $mainID, with optional $version arg. If no version then it defaults to
Read the status for constellation ID $mainID, with optional $version arg. If no version then it defaults to
the most recent version, deleted or not (logically) since 'deleted' is one of the status values. Returns false
the most recent version, deleted or not (logically) since 'deleted' is one of the status values. Returns false
on failure.
on failure.
public function writeConstellationStatus($mainID, $status, $note="")
`public function writeConstellationStatus($mainID, $status, $note="")`
Modify the status of a constellation. Returns the new version number for the status update, or false on
Modify the status of a constellation. Returns the new version number for the status update, or false on
failure.
Cannot set a status to 'deleted', but can modify a deleted status to some other value. Only known
failure.
Writing a constellation status of deleted will "functionally delete" that constellation.
status values are accepted.
```
```
private $statusList = array('published' => 1,
private $statusList = array('published' => 1,
...
@@ -203,12 +203,13 @@ status values are accepted.
...
@@ -203,12 +203,13 @@ status values are accepted.
'rejected' => 1,
'rejected' => 1,
'locked editing' => 1,
'locked editing' => 1,
'bulk ingest' => 1,
'bulk ingest' => 1,
'deleted' =>1);
'deleted' =>1,
'currently editing' => 1);
```
```
Valid status values are stored in a private var in DBUtil.php.
Valid status values are stored in a private var in DBUtil.php.
public function allVersion($mainID)
`public function allVersion($mainID)`
Returns all versions (in order, from lowest to highest) in a list for a given ID. This is a utility function
Returns all versions (in order, from lowest to highest) in a list for a given ID. This is a utility function
available to build user interfaces for diff of two versions, or reversion to a previous version.
available to build user interfaces for diff of two versions, or reversion to a previous version.
...
@@ -226,15 +227,13 @@ have made these functions private.
...
@@ -226,15 +227,13 @@ have made these functions private.
Many other functions in DBUtil have no use case outside the class and are private.
Many other functions in DBUtil have no use case outside the class and are private.
private function editList()
`private function editList()`
Return a list of the mainID and version that are currently "locked editing" for the user. DBUtil determines
Return a list of the mainID and version that are currently "locked editing" for the user. DBUtil determines
who is the current user. Long term, the code calling DBUtil will probably feed the user id to DBUtil.
who is the current user. Long term, the code calling DBUtil will probably feed the user id to DBUtil.
### Utility functions
### Utility functions
A number of functions exist in DBUtil for testing.
A number of functions exist in DBUtil for testing.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment