My Ellucian's Colleague playground with all tips and tricks I learned as a programmer.
Showing posts with label web UI 4. Show all posts
Showing posts with label web UI 4. Show all posts
Tuesday, March 17, 2015
UI 4 message box
CALL S_RIA_MESSAGES("", "Processing record: ": KEY.STUDENT.PROGRAMS)
S.MESSAGES options for the first parameter:
Here are the values for the first argument to S.MESSAGES: (copied from another posting)
1 = Use error processor; same effect as using other known methods of error handling in Envision processes
2 = Display message box; does not require user input to hide message; (Message will hide on its own at end of hook code)
3 = Display message; requires user interaction to hide message
4 = Same as option number 2
5 = Same as option number 3
* 1 Web version works completely, hangs in UI 2.3
* 2 UI version works completley, no message box displays on the Web
* 3 Web version works completely, hangs in UI 2.3
From <http://forums.datatel.com/viewtopic.php?f=28&t=35417&view=unread#unread>
Tuesday, May 7, 2013
Bargraph in web UI 4
* Input: GRAPH.NUM.SELECTED Used to calculate scaling factor.
* GRAPH.IDX Used to compare with scaling factor.
* GRAPH.TITLE Used to print a title at the top of the page.
* GRAPH.CLEAR Used to clear the part of the screen you
* want cleared.
* 1. Must use following inserts:
*
* $INSERT I_COMMON FROM UT.INSERTS
* $INSERT I_GRAPHIC_CHAR FROM UT.INSERTS
* $INSERT I_BAR.GRAPH FROM CORE.INSERTS
*
* 2. GRAPH.NUM.SELECTED must be set to the total number of items
* that the bar graph is being run for.
*
* 3. GRAPH.TITLE must be set. (name of the Progress Bar)
*
* 4. GRAPH.CLEAR must be set. This should be set to how much
* of the screen you wish to clear. i.e. @(-1) for the screen
* to be completely clear at the start.
*
* 4. Must use GOSUB INIT.BAR.GRAPH before the loop
*
* 5. GRAPH.IDX must be set somewhere in the process loop and should
* be set before GOSUB UPDT.BAR.GRAPH.
*
* 6. GOSUB UPDT.BAR.GRAPH should be somewhere in the main process loop.
*
* 7. There are two ways to finish the bar graph.
*
* a) GOSUB FINI.BAR.GRAPH
* (The program controls whether or not to leave the
* final statistics on the screen.)
*
* b) GOSUB FINI.BAR.GRAPH.PAUSE
* (This routine will pause after printing the final statistics.)
*
* You have to turn off "USE BAR GRAPH" on the BGP (batch global parameters) screen to manually create bargraphs
* Sub graphs are done the same way as above just with slightly different commands as illustrated below
* Note: graphs will not update correctly if HUSH is turned on when update to graph is called!
Example:
* Inserts: required
$INSERT I_COMMON FROM UT.INSERTS
$INSERT I_GRAPHIC_CHAR FROM UT.INSERTS
$INSERT I_BAR.GRAPH FROM CORE.INSERTS
$INSERT I_SUB.GRAPH FROM CORE.INSERTS
* Set or calculate max size of the graph here:
X.GRAPH.SIZE = 30
* Required, Main progress bar
* I do not believe you can change the Title/num selected without creating a new graph, clearing the correct stuff,
* re-initing a graph, etc. Probably not worth doing. Use subgraphs and graphs if you have need of a mutable graph.
GRAPH.TITLE="Progress Bar Title"
GRAPH.NUM.SELECTED=X.GRAPH.SIZE
GRAPH.IDX=0
GRAPH.CLEAR=@(-1)
GOSUB INIT.BAR.GRAPH
*Required IF you are using sub bar
SUB.GRAPH.NUM.SELECTED=@SYSTEM.RETURN.CODE
SUB.GRAPH.TITLE = "Subgraph Title"
SUB.GRAPH.IDX=0
GOSUB INIT.SUB.GRAPH
* Insert your code here.
* when you want to update the Bar count, do the following two lines:
* (note: I haven't tried counting down/backwards, I would suggest not doing so just from a design perspective)
GRAPH.IDX=*your number here
GOSUB UPDT.BAR.GRAPH
*If you want to update the sub-bar:
SUB.GRAPH.IDX=*Your number here
GOSUB UPDT.SUB.GRAPH
* finish subgraph after you are done processing the subunit (don't wait until entire process is done,
* I believe you need to call FINI.SUB.GRAPH or FINI.SUB.GRAPH.PAUSE every time you use the subgraph)
GOSUB FINI.SUB.GRAPH
* finish main graph, can use FINI.BAR.GRAPH or FINI.BAR.GRAPH.PAUSE, see documentation above
GOSUB FINI.BAR.GRAPH
Monday, May 6, 2013
Prompt user to download a file in web UI 4
Insert the following inserts:
$INSERT I_RIA_COMMON FROM UT.INSERTS
$INSERT I_RIA_TRANSFER_TYPES FROM UT.INSERTS
$INSERT I_COMMON FROM UT.INSERTS
Insert this code:
* ------------------------------------------------------------------------------------*
X.TRANS.TYPE = 'S'
X.DIRECTORY.FILE = "HOLD_SHARED_TESTDIR"
X.SOURCE.RECORD = "testFile.txt"
X.TARGET.RECORD = "testFile.txt"
X.FILE.ACTION = RIA.XFER.SAVE
X.NOTIFY.CLIENT = 1
X.ERROR.OCCURRED = ""
XL.ERROR.MSGS = ""
CALL S_RIA_TRANSFER(X.TRANS.TYPE, X.DIRECTORY.FILE, X.SOURCE.RECORD, X.TARGET.RECORD, X.FILE.ACTION, X.NOTIFY.CLIENT, X.ERROR.OCCURRED, XL.ERROR.MSGS)
IF (X.ERROR.OCCURRED) THEN
CALL S_RIA_MESSAGES("", "Save failed. Please contact admin.")
END
* ------------------------------------------------------------------------------------*
User will be prompted to save file "testFile.txt" to his/her computer. For the above code to work, directory TESTDIR must be public, or whoever runs the program needs to have write access to the folder. Directory path for HOLD_SHARED_TESTDIR is "apphome/_HOLD_/SHARED/TESTDIR"
$INSERT I_RIA_COMMON FROM UT.INSERTS
$INSERT I_RIA_TRANSFER_TYPES FROM UT.INSERTS
$INSERT I_COMMON FROM UT.INSERTS
Insert this code:
* ------------------------------------------------------------------------------------*
X.TRANS.TYPE = 'S'
X.DIRECTORY.FILE = "HOLD_SHARED_TESTDIR"
X.SOURCE.RECORD = "testFile.txt"
X.TARGET.RECORD = "testFile.txt"
X.FILE.ACTION = RIA.XFER.SAVE
X.NOTIFY.CLIENT = 1
X.ERROR.OCCURRED = ""
XL.ERROR.MSGS = ""
CALL S_RIA_TRANSFER(X.TRANS.TYPE, X.DIRECTORY.FILE, X.SOURCE.RECORD, X.TARGET.RECORD, X.FILE.ACTION, X.NOTIFY.CLIENT, X.ERROR.OCCURRED, XL.ERROR.MSGS)
IF (X.ERROR.OCCURRED) THEN
CALL S_RIA_MESSAGES("", "Save failed. Please contact admin.")
END
* ------------------------------------------------------------------------------------*
User will be prompted to save file "testFile.txt" to his/her computer. For the above code to work, directory TESTDIR must be public, or whoever runs the program needs to have write access to the folder. Directory path for HOLD_SHARED_TESTDIR is "apphome/_HOLD_/SHARED/TESTDIR"
Labels:
code,
Colleague,
datatel,
download file,
ellucian,
envision,
file,
prompted,
save file,
unibasic,
unidata,
web UI 4
Subscribe to:
Posts (Atom)