Table of Contents
1. Installation! ................................................................................................................................................................4 1.1. Download & Unzip Class Files!.................................................................................................................4 1.2. Login to Your Workspace!...........................................................................................................................4 1.3. Import the Starter Application!..................................................................................................................4 JavaScript & Ajax!....................................................................................................................................................6 2.1. onload Events: Display an Alert!...............................................................................................................6 2.2. onblur Events: Change Case to Upper!....................................................................................................7 2.3. onblur Events: Change Background Color!.............................................................................................8 2.4. onkeypress Events: Character Counter & Hide/Show !.......................................................................10 2.5. Modify conrmDelete Parameters!.........................................................................................................13 2.6. Item Validations!........................................................................................................................................14 2.7. Hide & Show Regions! ...............................................................................................................................16 Ajax! ...........................................................................................................................................................................18 3.1. Create an AutoAssign Function!..............................................................................................................18 3.2. Automatically Set Status to Closed!.........................................................................................................21 Security!....................................................................................................................................................................23 4.1. Session Timeout!.........................................................................................................................................23 4.2. Encrypted Session State!............................................................................................................................26 4.3. Save Session State Before Branching! .......................................................................................................28 4.4. Autocomplete!.............................................................................................................................................29 4.5. Monitoring APEX Logs!............................................................................................................................31 Performance Tuning !.............................................................................................................................................32 5.1. Debug Mode! ...............................................................................................................................................32 5.2. Timings! ........................................................................................................................................................35 5.3. Page & Region Caching!............................................................................................................................36 Developer Tools!.....................................................................................................................................................37 6.1. Page Locks!..................................................................................................................................................37 6.2. Page Groups! ...............................................................................................................................................41 6.3. Build Options!.............................................................................................................................................44 User Interface!.........................................................................................................................................................46 7.1. Import the Theme Starter Application!...................................................................................................46 7.2. Create a New Theme!.................................................................................................................................47 7.3. Set Up a Custom Directory on the HTTP Server!..................................................................................49 7.4. Create a Page Template!............................................................................................................................50 7.5. Create Region Templates!..........................................................................................................................56 7.6. Create List Templates! ................................................................................................................................58 7.7. Create Regions!...........................................................................................................................................59
2.
3.
4.
5.
6.
7.
Page 2
Conventions
The following typeset conventions are used throughout this document: Plain Text Plain text is nothing more than standard, narrative text. No special actions are required. Fixed Width! Fixed width is used to denote input required from the user. When something is in the fixed width font, that text should be entered into the corresponding eld or region. Bold Bold is used to indicate that you should perform an action, such as clicking a link or pressing a button, which corresponds to the value of the Bold text. Bold Underline Bold Underline is used to refer to a label or section of a page. Bold Underline labels will typically denote where an action should occur, not the action itself.
Copyright Information
This document is Copyright 2009-2010, by Sumneva. None of it in part or in whole may be reproduced without prior written consent from Sumneva.
Page 3
1.
INSTALLATION
Page 4
7) Make sure that Install Supporting Objects is set to Yes and click Next. 8) Click Install. At this point, you should see the following screen:
If there is any warning or error message present, please notify your instructor. Your application should have four users: Username Scott Shannon Isabella Owen Password sumneva sumneva sumneva sumneva Privilege Administrator Edit Edit View
Administrators will be able to do everything in the system, including managing users and access control lists. Edit users will be able to change any data, but will not be able to manage users and access control lists. All view users will be able to do is view transactional data. 9) Run your application and sign on as Scott. Take some time to become familiar with the application, if you have not done so already.
Page 5
2.
JAVASC R I P T
&
A JAX
3) In the Display Attributes region, set the Cursor Focus to Do Not Focus Cursor.
4) Locate and open the le 2.1_javascript.txt. This le can be found where you unzipped the class les in Exercise 1.2. 5) Copy the entire content of the le into the Page HTML Body Attribute region, which is part of the HTML Body Attribute region and click Apply Changes.
Now, run page 2, and notice that a JavaScript alert will popup as soon as the page renders.
Page 6
5) Run Page 2 and enter some lowercase text into the Created On eld and hit the tab key. Notice that the entire string should now be in uppercase.
Page 7
5) Edit the item P2_DESCR by clicking on its name. 6) Copy the contents of 2.3_javascript_item.txt - which should still be in your buffer into the HTML Form Element Attributes, which is in the Element region and click Apply Changes. 7) Edit the item P2_CREATED_BY by clicking on its name. 8) Locate and open the le 2.3_javascript_item_created_by.txt. This le can be found where you unzipped the class les in Exercise 1.2. 9) Copy the contents of 2.3_javascript_item_created_by.txt into the HTML Form Element Attributes and click Apply Changes.
10) Click Apply Changes. At this point, we have added the onblur event to all three display items on the page. Next, well have to add the actual function that it refers to. 11) Create a new Region by clicking on the corresponding icon. 12) Select HTML and click Next. 13) Select HTML again and click Next.
Page 8
14) Enter JavaScript - itemNotNull for the Title, set the Region Template to No Template, set the Display Point to Before Footer, enter 0 for the Sequence and click Next.
15) Locate and open the le 2.3_javascript_function.txt. This le can be found where you unzipped the class les in Exercise 1.2. 16) Copy the contents of that le into the Enter HTML Text Region Source and click Create Region.
Run your application and tab through each eld, leaving them all blank. You should notice that as you leave a blank eld, it immediately turns pink. If you go back and enter any text in a pink eld and then leave it, it will return to its normal white background color.
Page 9
3) Locate and open the le 2.4_javascript_body.txt. This le can be found where you unzipped the class les in Exercise 1.2. 4) Copy the entire content of the le into the Page HTML Body Attribute region, replacing all text that is there, and click Apply Changes.
Now that weve modied the onload JavaScript, lets create the DIV, which will be associated with the P2_DESCR item. 5) Edit P2_DESCR by clicking on its name. 6) Locate and open the le 2.4_form_element_attribute.txt. This le can be found where you unzipped the class les in Exercise 1.2.
Page 10
7) Copy the entire contents of the le into the HTML Form Element Attribute item - which can be found in the Element region - replacing any and all text that is there.
8) Locate and open the le 2.4_div.txt. This le can be found where you unzipped the class les in Exercise 1.2. 9) Copy the entire contents of the le into the Post Element Text item - which can be found in the Element region - and click Apply Changes.
Finally, we have to add another JavaScript function to the page which will be called when any characters are added or removed from the P2_DESC item. 10) Create a new Region by clicking on the corresponding icon. 11) Select HTML and click Next. 12) Select HTML again and click Next.
Page 11
13) Enter JavaScript - countCharacters for the Title, set the Region Template to No Template, set the Display Point to Before Footer, enter 0 for the Sequence and click Next.
14) Locate and open the le 2.4_javascript_function.txt. This le can be found where you unzipped the class les in Exercise 1.2. 15) Copy the contents of that le into the Enter HTML Text Region Source and click Create Region.
Run your application. Once you enter 225 characters in the Description eld, you should see the warning appear and the text will change to red. If you continue and enter 250 characters, you will get an error message and not be allowed to add any additional text.
Page 12
4) Scroll to the top of the page and click Apply Changes. Run page 210 and click on the Delete button. Notice that you should now see your custom message in the conrm dialog.
Page 13
6) Edit the Create button under the Tickets region by clicking on its name. This should be the rst Create button in the list, as there are two of them. 7) In the Optional URL Redirect region, set the Target is a to URL. 8) Locate and open the le 2.6_create.txt. This le can be found where you unzipped the class les in Exercise 1.2. 9) Copy the contents of that le into the URL Target and click Apply Changes. Next, we have to add the validateItems JavaScript to the page. Well again use an HTML region for this. 10) Create a new Region by clicking on the corresponding icon. 11) Select HTML and click Next. 12) Select HTML again and click Next.
Page 14
13) Enter JavaScript - validateItems for the Title, set the Region Template to No Template, set the Display Point to Before Footer, enter 0 for the Sequence and click Next.
14) Locate and open the le 2.6_javascript_function.txt. This le can be found where you unzipped the class les in Exercise 1.2. 15) Copy the contents of that le into the Enter HTML Text Region Source and click Create Region.
Run your application and attempt to either create or save a ticket without specifying a Subject and/or Description. Notice that not only will you get an alert, but the eld(s) in question will be highlighted pink.
Page 15
4) 5) 6) 7)
Create a new Button by clicking the corresponding icon. Select Tickets (1) 10 and click Next. Select Create a button in a region position and click Next. Enter TOGGLE_DETAILS for the Button Name, Toggle Details for the Label, set the Action to Redirect to URL without submitting page and click Next.
Page 16
9) Set the Position to Region Template Position #CLOSE#, enter 10 for the Sequence and click Next.
10) Set Target is a to URL. 11) Locate and open the le 2.7_toggle.txt. This le can be found where you unzipped the class les in Exercise 1.2. 12) Copy the contents of that le into the URL Target and click Next.
13) Set the Condition Type to Value of Item in Expression 1 is NOT NULL, enter P210_TICKET_ID in Expression 1 and click Create Button. Run your application and edit any ticket. When you see the tickets information, click on Toggle Details. The Ticket Details region should disappear. Clicking on Toggle Details again should restore the Ticket Details region.
Page 17
3.
A JAX
6) Set the Label Template to Optional Label, enter the following text for the Label and click Next: <a href="javascript:autoAssign();">Auto-Assign</a> 7) Click Create Item. The Auto-Assign link is at the bottom of the form. It makes more sense to have it immediately to the right of the Assigned To item. 8) Click on the two triangles icon in the Items region. 9) Using the upwards-pointing icon, move the P210_AUTO_ASSIGN item so that it appears just after the P210_ASSIGNED_TO item.
Page 18
10) Set both the New Line and New Field values to No for P210_AUTO_ASSIGN and click Apply Changes.
Next, well add an HTML region that will house the actual JavaScript function. 11) 12) 13) 14) Create a new Region by clicking on the corresponding icon. Select HTML and click Next. Select HTML again and click Next. Enter JavaScript - autoAssign for the Title, set the Region Template to No Template, set the Display Point to Before Footer and the Sequence to 0 and click Next.
15) Locate and open the le 3.1_javascript.txt. This le can be found where you unzipped the class les in Exercise 1.2. 16) Copy the contents of that le into the Enter HTML Text Region Source and click Create Region. Now that we have the link and JavaScript function, the nal step is to add the Application Process. 17) Edit the Shared Components of your application. 18) In the Logic region click Application Processes. 19) Click Create.
Page 19
20) Enter autoAssign for the Name, set the Point to On Demand: Run this application process when requested by a page process and click Next.
21) Locate and open the le 3.1_process.txt. This le can be found where you unzipped the class les in Exercise 1.2. 22) Copy the contents of that le into the Process Text and click Next.
23) Click Create Process. Run your application and click on the Auto-Assign link, which should be located immediately to the right of the Assigned To item. The value of Assigned To should change to the Tech who has the least amount of tickets assigned to them.
Page 20
Next, well add another HTML region that will house the actual JavaScript function. 5) 6) 7) 8) Create a new Region by clicking on the corresponding icon. Select HTML and click Next. Select HTML again and click Next. Enter JavaScript - setStatusClosed for the Title, set the Region Template to No Template, set the Display Point to Before Footer and the Sequence to 0 and click Next.
9) Locate and open the le 3.2_javascript.txt. This le can be found where you unzipped the class les in Exercise 1.2. 10) Copy the contents of that le into the Enter HTML Text Region Source and click Create Region. Now that we have the link and JavaScript function, the nal step is to add another Application Process.
Copyright 2009-2010 Sumneva
Page 21
Edit the Shared Components of your application. In the Logic region click Application Processes. Click Create. Enter setStatusClosed for the Name, set the Point to On Demand: Run this application process when requested by a page process and click Next.
15) Locate and open the le 3.2_process.txt. This le can be found where you unzipped the class les in Exercise 1.2. 16) Copy the contents of that le into the Process Text and click Next.
17) Click Create Process. Run your application and edit a ticket whose status is not Closed. Set a closed date with the Date Picker and notice that as soon as you select the date, the status will automatically be changed to Closed.
Page 22
4.
SEC U R ITY
Page 23
11) Locate and open the le 4.1_idle_timeout.txt. This le can be found where you unzipped the class les in Exercise 1.2. 12) Copy the contents of that le into the Enter HTML Text Region Source and click Next.
13) Set the Condition Type to Request = Expression 1 and enter the following for Expression 1: IDLE_TIMEOUT
14) Click Create Region. The next region will be almost identical to the rst, but it will be used the when the session itself is exceeded. 15) 16) 17) 18) 19) 20) 21) 22) Create a new HTML region by clicking on the corresponding icon. Select HTML and click Next. Select HTML again and click Next. Enter Session Time Exceeded for the Title, set the Region Template to No Template, set the Display Point to After Header and click Next. Locate and open the le 4.1_session_timeout.txt. This le can be found where you unzipped the class les in Exercise 1.2. Copy the contents of that le into the Enter HTML Text Region Source and click Next. Set the Condition Type to Request = Expression 1 and enter the following for Expression 1: SESSION_TIMEOUT Click Create Region.
Page 24
All thats left is to test your applications session timeout values. 23) Run your application and click Logout. 24) Simply click around your application, counting off 20 seconds. Once the 20 second maximum session time is exceeded, you should be logged out and the Session Timeout message should be displayed.
25) Login to your application again. This time, do nothing but count to 10 or so. 26) Click on any tab or link. This time, you should be logged out, but the message will note that the session idle time was exceeded.
Before we nish this exercise, lets reset the session timeout parameters to less articial levels. 27) 28) 29) 30) Navigate to the Shared Components of your application. In the Application region, click on Denition. Click on the Security tab. In the Session Timeout region, enter the following values: Maximum Session Length in Seconds Session Timeout URL Maximum Session Idle Time in Seconds Idle Timeout URL 31) Click Apply Changes. 100000
Page 25
We can also inspect the same values as an APEX Administrator. 9) Click on the Home link in the developers toolbar at the bottom of the page. 10) In the Administration region on the right side of page, click on Monitor Activity.
11) Under Sessions, click Active Sessions. 12) Locate the Session ID that you were using while running your application. It may help to sort by Owner or Created. Once found, click on the Session ID. 13) Notice that in the Session State Item Values report, the item P210_SUBJECT should be present and contain a clear text value, just as it did in the session state window.
Now that we have see the session state two different ways, lets enable session state encryption for P210_SUBJECT. 14) Edit Page 210 of your application. 15) Edit the item P210_SUBJECT by clicking on its name.
Page 26
16) In the Security region, set Store value encrypted in session state to Yes and click Apply Changes.
Run your application and logout. Log back into your application and edit any ticket, then click Apply Changes. Click on the Session link in the developers toolbar at the bottom of the page. Enter 210 for the Page and click Go. Notice that the value for P210_SUBJECT is no longer visible, as it is represented by *****.
We can also check the item via the Administrators reports. 21) 22) 23) 24) Click on the Home link in the developers toolbar at the bottom of the page. In the Administration region on the right side of page, click on Monitor Activity. Under Sessions, click Active Sessions. Locate the Session ID that you were using while running your application. It may help to sort by Owner or Created. Once found, click on the Session ID. 25) Notice that in the Session State Item Values report, the item P210_SUBJECT should be present and contain *****, as the value is now encrypted.
At this point, the value for P210_SUBJECT for all users will be stored in an encrypted format in the database, making it impossible for even an administrator or DBA to view the data.
Page 27
6) 7) 8) 9)
Edit the second Before Computation Branch. In the Action region, check save session state before branching and click Apply Changes. Run your application and edit any ticket. Click either the Next or Previous record button. Notice the URL no longer includes any reference to P210_TICKET_ID.
Page 28
4.4. Autocomplete
Autocomplete is an HTML feature that will remember previous entries that you have made & submitted. Its designed in order to make things more convenient for the end user, with the goal of less typing in mind. However, this feature quickly becomes a liability when sensitive data is not only stored on the client but is easily recalled. In APEX 3.2, we can now easily disable Autocomplete at the page level simply by changing an option. 1) Run Page 210 of your application. 2) Create a new Ticket and remember the value that you used for the Subject. For this example, well enter Windows Update Failed.
3) Create another Ticket and enter part of the previous subject and hit the down arrow key. In our example, well just enter Win. Notice how the previous Subjects that started with Win are displayed. You can press the down arrow, select a previous entry, and hit return to accept it.
Page 29
Next, well disable Autocomplete and try to enter another Subject that starts with win. 4) Edit Page 210 of your application. 5) Edit the Page Attributes. 6) In the Security region, set Form Auto Complete to Off and click Apply Changes.
Lets try to enter Win again and see what happens now that Autocomplete is disabled. 7) Run Page 210 of your application. 8) Create another Ticket and enter part of the previous subject and hit the down arrow key. Notice that this time, you will not see any previous values.
Page 30
Next, lets recreate our authentication function and include calls to the SET_AUTHENTICATION_RESULT API call. 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) 20) 21) Edit any page of your application. Click on the SQL Workshop tab. Click on SQL Commands. Locate and open the le 4.5_function.txt. This le can be found where you unzipped the class les in Exercise 1.2. Copy the contents of that le into the SQL Workshop and click Run. Navigate back to the Application Builder by clicking its tab. Click on your application. Click on the Run icon. Login with an invalid password. Login with a non-existent username, such as FAKE_USER. Click Home in the developers toolbar. Under the Administration region, click on Monitor Activity. In the Login Attempts region, click Login Attempts. Notice that both of our unsuccessful login attempts were recorded properly this time:
Page 31
5.
P E R F O R MA NCE
T U N I N G
3) Click on the Debug link in the developer toolbar 4) The page will refresh and present you with the debug information appropriate to the page you were on. For the purposes of this exercise we assume you were on Page 1 of the Help Desk application.
Page 32
5) 6) 7) 8)
Work your way from top to bottom of the page and read through the debug information. Identify how long it took to render the different sections of the page. Did this page have an ACCEPT section in its debug section? Why or why not? Click on the No Debug link to turn the debug output off.
2) The resulting URL will look something like this: http://localhost/apex/f?p=118:2:3233657250736565::NO:2:: 3) Change the NO to a YES, so that your URL now looks like this: http://localhost/apex/f?p=118:2:3233657250736565::YES:2:: Note: Your Session ID will be different than the one above; do not attempt to alter that. 4) With your cursor still in the Location Bar, hit return to re-run the page. This time you should be able to see the Debug information inline with the rest of the page. Again, work your way from top to bottom of the page and read through the debug information. 5) Next, ll in the form with the following information: Subject: Debug Test Description: This is a test of debug mode. Created By: SCOTT
Page 33
6) Click the Create Ticket button. The new ticket will be created and the screen will refresh with debug mode turned off. 7) Return to debug mode using either the Developer Toolbar or by editing the URL. 8) Examine the debug information presented, looking specically for the ACCEPT section, assignment of values, validations, processes and branches. Below is sample debug output from inserting a record into the TICKETS table from Page 2:
0.07: A C C E P T: Request="CREATE" 0.09: Metadata: Fetch application definition and shortcuts 0.09: NLS: wwv_flow.g_flow_language_derived_from=FLOW_PRIMARY_LANGUAGE: wwv_flow.g_browser_language=en-us 0.09: alter session set nls_language="AMERICAN" 0.09: alter session set nls_territory="AMERICA" 0.09: NLS: CSV charset=WE8MSWIN1252 0.09: ...NLS: Set Decimal separator="." 0.09: ...NLS: Set NLS Group separator="," 0.09: ...NLS: Set date format="DD-MON-RR" 0.09: ...Setting session time_zone to -04:00 0.09: Setting NLS_DATE_FORMAT to application date format: DD-MON-YYYY 0.09: ...NLS: Set date format="DD-MON-YYYY" 0.09: ...Determine if user "SSPENDOL" workspace "6934514976401972" can develop application "118" in workspace "6934514976401972" 0.09: Session: OK to reuse builder session for user:nobody 0.10: Fetch session state from database 0.10: ...Check session 3233657250736565 owner 0.10: Setting NLS_DATE_FORMAT to application date format: DD-MON-YYYY 0.10: ...NLS: Set date format="DD-MON-YYYY" 0.10: ...Check for session expiration: 0.10: ...Metadata: Fetch Page, Computation, Process, and Branch 0.10: Session: Fetch session header information 0.10: ...Metadata: Fetch page attributes for application 118, page 2 0.11: ...Validate item page affinity. 0.11: ...Validate hidden_protected items. 0.12: ...Check authorization security schemes 0.12: Session State: Save form items and p_arg_values 0.12: ...Session State: Save Item "P2_TICKET_ID" newValue="" "escape_on_input="N" 0.12: ...Session State: Save Item "P2_SUBJECT" newValue="Debug Mode" "escape_on_input="N" 0.14: ...Session State: Save Item "P2_DESCR" newValue="This is a test of debug mode." "escape_on_input="N" 0.14: ...Session State: Save Item "P2_CREATED_BY" newValue="SCOTT" "escape_on_input="N" 0.14: ...Session State: Save Item "P2_STATUS_ID" newValue="2" "escape_on_input="N" 0.15: Processing point: ON_SUBMIT_BEFORE_COMPUTATION 0.15: Branch point: BEFORE_COMPUTATION 0.15: Computation point: AFTER_SUBMIT 0.15: Tabs: Perform Branching for Tab Requests 0.15: Branch point: BEFORE_VALIDATION 0.15: Perform validations: 0.16: ...Item Not Null Validation: P2_SUBJECT 0.16: ...Item Not Null Validation: P2_CREATED_BY 0.16: ...Item Not Null Validation: P2_DESCR 0.16: Branch point: BEFORE_PROCESSING 0.16: Processing point: AFTER_SUBMIT 0.16: ...Process "Process Row of TICKETS": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER#:TICKETS:P2_TICKET_ID:TICKET_ID|I 0.23: ...Process "reset page": CLEAR_CACHE_FOR_PAGES (AFTER_SUBMIT) 2 0.23: Nulling cache for application "118" page: 2 0.24: Branch point: AFTER_PROCESSING 0.24: ...Evaluating Branch: AFTER_PROCESSING type: "REDIRECT_URL" button: (No Button Pressed) branch: (Unconditional) 0.24: ...Unconditional branch taken
Page 34
5.2. Timings
To report the time it takes to render a specic region, you can use the #TIMING# substitution variable in the footer of the region. The #TIMING# string will print out the duration that it took to create the respective region at the bottom of the region. This is a useful technique to keep you as a developer in check, as if you deploy this in production, alert users may notice if the time it takes to render a region increases. 1) Edit Page 1 of your application. 2) Edit the Current Open Issues region by clicking on its name. 3) In the Header and Footer region, enter the following in the Region Footer: This report took #TIMING# seconds to render. 4) Scroll to the top of the page and click Apply Changes. 5) Run Page 1 and notice the new timing information at the bottom of the report:
Page 35
4) 5) 6) 7)
Run Page 1 and make a mental note of the number of records. Navigate to the Edit Tickets page, and either delete a ticket or change the subject of a ticket. Quickly navigate back to the Home page, and notice that your changes are not yet visible. Run the Home Page in debug mode; note that the Current Open Issues region is being retrieved from the cache.
8) Wait roughly 1 minute and reload the Home page. At this point, you should see your changes. 9) If you wait another minute and run the page in debug mode, you should see the following:
Page 36
6.
DE V E LO PE R
T O O LS
6) In the Developer privileges region, ensure that User is a developer is set to Yes and User is a workspace administrator is set to No.
Page 37
7) In the Account Control region, ensure that Require Change of Password On First Use is set to No and click Create User.
3) Click the Login link. 4) Login using the credentials that you just created.
5) Navigate to Page 200 of your application. 6) In the upper right hand corner of the Application Builder, click on the Open Lock icon to initiate a page lock.
7) Click on the check box associated with Page 200 to select it as the page you wish to lock.
Page 38
8) Click the Lock Checked button to lock the selected page. 9) APEX will require you to enter a Comment about the page(s) that you are about to lock. Enter a comment and click Lock Page(s).
10) If you edit Page 200 now, the lock icon should be closed; this indicates that this page is locked.
11) Logout of your workspace and log back in as the Workspace Administrator. These are the credentials that were provided to you at the beginning of the class. 12) Edit Page 200 of your application. Notice that the lock icon is closed, as this page is locked by the other developer. If you hover your cursor over the lock, it will display which user owns the lock. Also, notice that all of the create icons are not being displayed. You can still edit components on this page, but no changes will be allowed. 13) Click on the closed lock icon. You should see the following:
Page 39
3) Click the Edit icon for Page 200. 4) Change the Comment and set Locked By to the user that you are currently logged in as and click Apply Changes.
5) Notice that your changes will be displayed in the Locked Pages report:
Lastly, well remove the lock from Page 200. 6) Click the Edit icon for Page 200. 7) Click the Unlock button. 8) The Locked Pages report should not have any records. Navigate to Page 200 and notice that the lock icon is unlocked and all of the Add icons are visible again.
Page 40
5) Repeat steps 3 & 4 to create the following Page Groups: Public Pages Reporting Special Pages Ticket Management Upon completion you should have 5 groups:
Page 41
Next, well assign pages to each of these groups. 6) Under the Tasks region, click on Manage Assignments. 7) Using the form on the Manage Page Group Assignments page, make the following Assignments: Page Group Administration Public Pages Reporting Special Pages Ticket Management Assigned Pages 600, 610 & 620 1, 2 & 3 300, 400 & 500 0 & 101 200, 210, 220 & 230
Page group assignments can be made by selecting a Page Group, checking the corresponding pages and then clicking Assign Checked. The resulting report should look like this:
Page 42
We can use these new groups to view pages in our application in a number of different ways. 8) Navigate to your application home page. 9) Set Group to Public Pages and click Go.
We now see only those pages that are associated with the page group Public Pages. 10) Next, set View to By Group and click Go again.
This time, we see the page groups as folders. The number in parenthesis denotes the number of pages within that group.
Page 43
Next, well associate this build option to the Interactive Report on Page 300. 5) Edit Page 300 of your application. 6) Edit the Page Attributes. 7) In the Conguration region, set the Build Option to Development and click Apply Changes.
Notice that APEX will automatically create the opposite build option for each build option that you create. 8) Next, edit the Analysis tab, which can be found in the Shared Components region. 9) In the Conguration region, set the Build Option to Development and click Apply Changes.
Page 44
At this point, we can copy this application to see the Build Option take effect. Exporting and reimporting the application would also have the same result. 10) Navigate to the home page of your application. The quickest way to do this is to click on Application XXX in the breadcrumb region, where XXX represents your Application ID. 11) In the Tasks region on the right side of the page, click Copy Application. 12) Enter Help Desk Copy for the New Application Name and click Next.
13) Click Copy Application. When the copy is complete, run the new application. After you sign on, you should notice that the Analysis tab is not rendering. You can, however, edit Page 300, as it is still a part of your application.
Page 45
7.
U SER
INTERFACE
7) Make sure that Install Supporting Objects is set to Yes and click Next. 8) Click Install. At this point, you should see the following screen:
Page 46
You will now have two themes in your application - Red and Extreme Theme. Next, well create a new Page Template. 1) Edit the starter applications Shared Components. 2) Click Templates. 3) Click Create. 4) Select Page and click Next. 5) Select From Scratch and click Next. 6) Enter Main Page for the Name, select the Theme that you just created, and set the Template Class to One Level Tabs and click Create.
Next, well switch themes. This will set the starter application to use the new Theme that you just created.
Copyright 2009-2010 Sumneva
Page 47
1) Edit the starter applications Shared Components. 2) Click Themes. 3) Click Switch Theme. 4) Select Extreme Theme and click Next. 5) Conrm that there are no errors and click Next. 6) Click Switch Theme. Since our Page Template is completely blank, running the application at this point will produce a blank screen. This is expected behavior.
Page 48
Page 49
6) Open the le body.html from the Template Assets directory, select all of it, and paste it into the Body region, replacing whats there. 7) Click Apply Changes. 8) Run your application. You should see something similar to the following:
At this point, you can see that the template is working within APEX. However, it is 100% static, and clicking on any of the tabs will do nothing, since all of the content is currently coming from the template itself.
Copyright 2009-2010 Sumneva
Page 50
The #TAB_CELLS# string in the above template will be replaced with the actual standard tabs that are dened in your application. Next, well dene the Standard Tabs sub-templates. There are two templates - one for the current tab, and one for the non-current tabs. 6) Scroll down to the Standard Tab Attributes region and paste the following text into the Current Tab region: <li><a id="active" href="#TAB_LINK#">#TAB_LABEL#</a></li>
Page 51
7) Paste the following into the Non Current Standard Tab region and then click Apply Changes.
<li><a href="#TAB_LINK#">#TAB_LABEL#</a></li>
If you run your application now, youll notice that as you click on each tab, you will end up on the corresponding page. Also, the current tab will change to the corresponding tab as you click on it.
Page 52
<div id="left">#REGION_POSITION_01#</div>
Page 53
11) Next, locate and select the following text in the Body region: <div id="right"> <div class="box"> <h3 class="firsth3">Terms of use</h3> <div class="boxleft1"><img src="/c/extreme/images/sample.jpg" width="370" height="217" alt="" /></div> <div class="boxright1"> <p>#BOX_BODY#The template is released under the <a href="http://creativecommons.org/licenses/by/2.5/" target="_blank">Creative Commons Attribution 2.5</a> license. This means it can be used for both private and commercial purposes, edited freely or redistributed as long as you keep the link back to Alpha Studio. The link, however, can be moved to any other place of the site.</p> <p>Do not use the template in connection with sex, violence, discrimination and for other immoral or illegal purposes.</p> </div> <div class="clearing"> </div> </div> <div class="box"> <div class="boxleft2"> <h3>Lorem ipsum</h3> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla hendrerit lacus at metus. Maecenas venenatis rhoncus nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos.</p> <p>Proin lobortis nisi nec nisi. Morbi mattis fermentum lectus. Nam vestibulum arcu vulputate ante. Maecenas rutrum dui nec quam.</p> </div> <div class="boxright2"> <h3>Cum sociis natoque</h3> <p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean rutrum tortor a purus. Quisque convallis nisl ac augue. Nulla aliquam dui. Etiam convallis enim tincidunt erat dapibus tincidunt.</p> <p>Maecenas venenatis rhoncus nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos.</p> </div> <div class="clearing"> </div> </div> </div>
Page 54
<div id="right">#BOX_BODY#</div>
13) Click Apply Changes. Your page template now has two xed region positions that we can associate regions with via the Application Builder. Running your application now will yield something similar to this, as you do not yet have any content dened:
Page 55
7) Edit the List Region template that was just created. 8) Replace all of the text in the Template region with the following and click Apply Changes:
<h3>#TITLE#</h3>#BODY#
Next, well create a region template that can be used for any type of content. 1) Edit the starter applications Shared Components. 2) Click Templates 3) Click Create. 4) Select Region and click Next. 5) Select From Scratch and click Next.
Page 56
6) Enter Narrow Content Region for the Title, set the Theme to Extreme Theme, set the Template Class to Custom 1 and click Create.
7) Edit the Narrow Content Region template that was just created. 8) Replace all of the text in the Template region with the following and click Apply Changes:
Page 57
9) Under the Template Denition region, enter the following for both List Template Current and List Template Noncurrent, replacing any existing text:
<li><a href="#LINK#">#TEXT#</a></li>
10) Under the After List Entry region, enter the following for the List Template After Rows:
</ul>
Page 58
The two regions are quite close to one another. We can add a little space by altering a Page Template Attribute called Region Table. 1) Edit the starter applications Shared Components. 2) Click Templates 3) Edit the Main Page template. 4) Under the region Multi Column Region Table Attributes, enter the following for the Region Table attributes and click Apply Changes:
cellspacing="20"
Re-run your application, and notice that there is more white space surrounding the two regions:
Finally, well create a new list based on a pre-congured list in your application.
Copyright 2009-2010 Sumneva
Page 59
1) Edit Page 1 of your application. 2) Create a new Region by clicking on the + icon. 3) Select List and click Next. 4) Enter Cities for the Title, set the Region Template to List Region, set the Display Point to Page Template Region Position 1 and click Next.
5) Set the List to Cities and click Create List Region. Re-run your application, and notice that the list in the upper-left looks similar to the original static lists.
At this point, you have the beginnings of a custom APEX theme - all without having to write a single line of HTML or edit a single image. These steps can be applied to almost any static HTML template that you would like to use in APEX. Keep in mind that in order to make your APEX custom theme complete functional, you will need to create additional template types - such as report, label, button and breadcrumb. These can be created using similar techniques discussed in this document.
Page 60