|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.sandev.TaskHeap.TaskHeapUI.DemoDataSetup
public class DemoDataSetup
Helper class that creates a new tutorial heap for demonstration purposes. The class makes use of the heap import file processing in order to create tasks and plans that are already old, otherwise it is difficult to demonstrate the activity chromacoding. Because we are using batch load, the main access method is synchronized to avoid conflicts trying to load multiple heaps at the same time. Helper class to populate or remove demo data. The demo data is assumed to be created at startup, and then reset on demand at any point after that. The data consists of a tutorial, which looks something like:
| Field Summary | |
|---|---|
protected HeapAssociation |
ha
|
protected HeapAttributes |
heap
|
protected static java.lang.String |
newline
When writing text information we need to store the encoded newline character for it to show up. |
protected static java.lang.String |
para
A new paragraph is two newlines chained together. |
protected TaskHeapUINode |
uinode
|
| Constructor Summary | |
|---|---|
DemoDataSetup()
|
|
| Method Summary | |
|---|---|
protected void |
createHeapAttributes(Account user)
Create or reset the tutorial heap for this user. |
protected void |
createTutorial(long uniqueIDCounter,
java.util.ArrayList al,
java.util.Date creationTime,
Plan immediate)
Create the instances making up the tutorial. |
HeapAssociation |
createTutorialHeap(TaskHeapUINode uinode,
Account user)
Create a new tutorial heap for the given user and return their HeapAssociation for access. |
protected void |
debug(java.lang.String text)
Utility wrapper for dumping a debug message via our uinode ref. |
protected void |
debugDumpMessages(org.sandev.basics.structs.SandPersistMessage[] spms)
Dump the given messages to the log |
protected void |
deleteHeapContents(HeapAttributes heap)
Delete the specified heap contents. |
protected void |
deletionSort(org.sandev.basics.structs.SandInstanceMessage[] instances)
Have to delete the parent after the children or the deletion process will fail due to orphaning. |
protected HeapAttributes |
getExistingHeapByName(java.lang.String heapname,
Account user)
Retrieve the existing tutorial heap with this name, or null if not found. |
protected org.sandev.basics.structs.SandPersistMessage[] |
getTutorialComponents()
Return an array of all the components for the tutorial. |
protected void |
importHeap(java.io.File heapfile,
Account user)
Import the demo data from the given file. |
protected void |
matchDelete(org.sandev.basics.structs.SandQueryMessage sqm,
org.sandev.basics.util.AuthUser user)
Delete all the instances matching the given query. |
protected void |
resetTopLevelPlanChildRefs(long heapID,
long authUserID)
Clear the children from the top level plans for the given heap |
protected java.io.File |
serializeMessages(org.sandev.basics.structs.SandPersistMessage[] msgs)
Serialize the given message array and write it to file, returning the filename. |
protected void |
uncacheMessages(org.sandev.basics.structs.SandPersistMessage[] msgs)
Remove the given messages from cache so we don't reference an old version. |
protected void |
verifyHeapAssociation(org.sandev.basics.sandmessages.AggregateUpdate au,
Account user)
Verify our admin association for our tutorial heap. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String newline
When doing the translation for display on a windows box, the newlines don't show up unless you use a crlf. So to have the data look like what it looks like post editing, we do crlf here. This will presumably work on most systems.
protected static final java.lang.String para
protected TaskHeapUINode uinode
protected HeapAttributes heap
protected HeapAssociation ha
| Constructor Detail |
|---|
public DemoDataSetup()
| Method Detail |
|---|
public HeapAssociation createTutorialHeap(TaskHeapUINode uinode,
Account user)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void createTutorial(long uniqueIDCounter,
java.util.ArrayList al,
java.util.Date creationTime,
Plan immediate)
protected org.sandev.basics.structs.SandPersistMessage[] getTutorialComponents()
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void createHeapAttributes(Account user)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected HeapAttributes getExistingHeapByName(java.lang.String heapname,
Account user)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void verifyHeapAssociation(org.sandev.basics.sandmessages.AggregateUpdate au,
Account user)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void deleteHeapContents(HeapAttributes heap)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void matchDelete(org.sandev.basics.structs.SandQueryMessage sqm,
org.sandev.basics.util.AuthUser user)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void resetTopLevelPlanChildRefs(long heapID,
long authUserID)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandExceptionprotected void deletionSort(org.sandev.basics.structs.SandInstanceMessage[] instances)
protected java.io.File serializeMessages(org.sandev.basics.structs.SandPersistMessage[] msgs)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandException
protected void importHeap(java.io.File heapfile,
Account user)
throws org.sandev.basics.structs.SandException
org.sandev.basics.structs.SandExceptionprotected void uncacheMessages(org.sandev.basics.structs.SandPersistMessage[] msgs)
protected void debugDumpMessages(org.sandev.basics.structs.SandPersistMessage[] spms)
protected void debug(java.lang.String text)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||