Cannot get Read Only Condition to work on Oracle Apex page - oracle-apex

Trying to add a read condition to my page. Nothing I am doing works. I would like to use the PL/SQL Expression condition type but cannot get it to evaluate properly. My app is a workflow application and I want the page to display in READ mode when the status is not DRAFT. So, naturally I try to code the Expression as:
:P2_PDD_STATUS_CD != 'DRAFT'
This results in the page being opened in edit mode no matter what the status value. What am I missing? I've verified the column name several times. As a matter of testing, I was not able to get the Expression 1 = Expression 2 condition type to work either.

Getting APEX Page Item Conditional Properties to Work as Designed:
The Quick Answer: Wherever you place the page item that influences the READ-ONLY state of the text field page/region item, the change in its value/state has to happen sequentially before the event that fetches and displays the conditionally read-only text field...
The best way to make sure the state you have changed "sticks" is to associate a page redirect with that field so that the rest of the page items and dependent properties has an opportunity to recognize that the read-only page indicator value has been altered (from DRAFT to non-DRAFT, etc.)
The Test Data Schema: Speech Writer's Block App
This example uses a single table. The text-document is an oversized VARCHAR2 typed field, though it really could be anything... even a LOB/CLOB typed value for larger capacity. The schema:
The PAGE Design and Layout
The example is designed in a single page. Two regions: The speech catalog (top) and the speech editor form (bottom) are processed in the following order:
Query the speech catalog for the report display (fetch)
If a SPEECH_ID value was designated at page-load (or reload) fetch all fields for the speech document record where the speech id = the page item containing the speech id value.
If a SPEECH_Id was recently chosen (after the page is rendered), then redirect the page to itself setting page item SPEECH ID = selected speech id #.
The FORM Region Design
This defines what the "edit" button does from the report output of possible speech selections. Notice that selecting this button value sets an automatic redirect to the same page, containing the revised STATUS-MODEvalue.
Rendering Sequence Design
The rendering of the page passes through each region and design block once. If a item value is upstream (i.e., processed before) from a defining item value (such as the STATUS: DRAFT, ARCHIVE, etc.)... or it can be changed after the page render is completed, a redirect action would help in this case.
The Conditional READ-ONLY Page ITEM Property
Output and Results
Normal Speech Edit (DRAFT) Mode
Archive Mode for READ ONLY Speech Text Access
Discussion of Alternative Designs
It is possible to do this with a workflow that spans multiple pages. It might even be easier that way. For example, the determining, incoming page item properties should be set at ANY time prior to when the previous page is redirected to it.
Additional Comments (aside)
Sorry in advance for the slightly abnoxious-sized watermark-credits text on my screen-captures. I'm set up with a new tool (Skitch) and it is nearly impossible to get a sense of scale when it's finally home within a Stack Overflow post...
Enjoy anyways: Onward!

Related

Document has been modified or corrupted since signed! (data)

I'm working in HCL Notes application. I have developed a summary view to show calculated figures to the user. Then the user clicks one of the action buttons and I open a detailed view, but for that view I setup Selection Formula on the fly so that it shows the records filtered specific to that button conditions. It was working almost fine for a few days, but now most of the time it shows some previously shown (filtered) data no matter what button the user has clicked. Means it doesn't set the Selection Formula of the view and shows the view with the old formula and it won't get back to normal condition even if they restart Notes application.
When the user is stuck in this particular condition, and they peep through the status bar it shows this message:
Document has been modified or corrupted since signed! (data).
The necessary code-snippet is as below:
*Set dtlView = db.GetView("Report_Dtl")
dtlView.SelectionFormula =formula
Call dtlView.Refresh()*
where formula is the dynamically built formula. Looks like the line
dtlView.SelectionFormula =formula
is unable to update the selection formula and then the line below generates the above error message:
Call uidb.OpenView(dtlView.Name,,False, False)
Please help!
Thanks
For "on the fly" modification of the view selection formula your user need "Designer"- access to the database, and that is never a good idea. The help document to the function you are using is explicitly stating that this is not a good idea (emphasise of mine):
This is not a good way to display a selected set of documents for a specific user. When you use this property to change the view selection, it applies to all users of the view.
There are problems with using this method to make a view display a new selection of documents for an end user:
Do not give end-users Designer access to an application.
If it is a shared view, users will interfere with each other's searches.
The NotesĀ® client caches design information, and there's no way to tell it to update its cache (except for outlines). Exiting and re-entering the application usually works, but it's hard to programmatically ensure the user exited the application entirely.
In addition the modification of the view selection formula can break the signature of the design element and then other errors occur.
Better use another approach:
Use a Folder for every user and put the selected documents in there (after doing a NotesDatabase.Search with the formula
Use a separate view for every user and let a server agent manipulate its selection formula with a user that has access.
For having a separate view / folder for every user you could use "Shared, Private on first use"- views (they are not easy to maintain), or any process that generates them and is able to assign every view to the users they belong to... in both cases this needs some effort, but at least it will work.

Oracle Apex: "Type: Hidden" vs "Server-side Condition: Never"

Type:
"Hidden:
Items that are included within the page source but are not rendered. Hidden item values are saved in session state. They are generally used to store values required by page processing or other page items, but should not be displayed to the end user."
Server side condition:
"Never:
The component is never rendered."
If an item's type is set to hidden, is it necessary to set the server side condition to never? Or is that superfluous?
Thanks in advance.
If the question is just about show or don't show, yes. it's unnecessary!
But a hidden item still existing in the page, it's just not showed to the user. You can see it pressing F12 and checking then in your HTML page. You can use hidden items on pl/sql process, dynamic actions or acessing it with javascript or jquery.
The server side condition remove the item of your HTML page and you can do nothing in these items.

Kentico 10 - Use a repeater to display multiple page types

We are currently use the oob page types for Blog, News and Event. We have one page for each of these types that includes a repeater to show a list of the pages of that type. We would also like to have a page that includes a repeater that shows all blog, news and event pages in one spot, sorted by their created date.
I have seen some old comments (here, here) on devnet saying that although a repeater can render multiple page types, the fields rendered must be identical across each of those page types. The workarounds suggested are either to create the same fields in each page type, or to create a custom SQL query and use a query repeater to render the data. I've done this and it works just fine, but it was pretty cumbersome to create and will be difficult to maintain. (If we want to add other page types, for example.) Can anyone suggest a more out-of-the-box method available in Kentico 10?
Update:
I'm trying to accomplish this as Brenden described, but am running into trouble.
My page structure is as follows:
Root
.RollupPage (CMS.MenuItem)
..BlogPosts (CMS.Blog)
...January 2017 (CMS.BlogMonth)
....blog post 1 (CMS.BlogPost)
...February 2017 (CMS.BlogMonth)
....blog post 2 (CMS.BlogPost)
..Events (CMS.MenuItem)
...Event1 (CMS.BookingEvent)
...Event2 (CMS.BookingEvent)
I've attempted to use a universal viewer, but failed to get it to return any data.
I configured it with:
Path: /RollupPage/%
Page types: CMS.BlogPost;CMS.BookingEvent
Hierarchical Transformation: CMS.MenuItem.HierTrans1
HierTrans1 has the following transformations:
CMS.BlogPost.Default (Item transformation for type CMS.BlogPost)
CMS.BookingEvent.EventCalendarItem (Item transformation for type CMS.BookingEvent)
These aren't customized at all; they are standard OOB transformations just so I can see it work.
When I view the RollupPage, the universal viewer displays nothing.
I attempted to use a Hierarchical Viewer with the same settings as I did with the Universal Viewer. It kind-of worked. It displayed my booking events but did not display any blog posts. Yet using the same blog post transformation (CMS.BlogPost.default) with hierarchical viewer whose Path was set to /RollupPage/BlogPosts/% displayed my blog posts correctly but, obviously, did not display my booking events.
The results I've gotten so far makes me think a) something about the way I've created my pages is stopping the universal viewer from traversing the whole tree and/or b) the hierarchical viewer either only goes a couple of levels deep, or maybe it is being blocked from traversing the tree too... No events are recorded when I edit or view these web parts.
Any idea what I may be doing wrong?
For this scenario use a universal viewer. Reason being is you can create a hierarchical transformation which will have different transformations for each of your unique page types. You most likely won't use the hierarchy at all but you can simply add 3 different item transformations for the different page types.
You can use the Hierarchical viewer or the Universal viewer, as Brenden Kehren mentioned, to achieve the goal you are describing.
When configuring the web part you must select all the Page types that are included in the hierarchy, in your case: CMS.MenuItem, CMS.Blog, CMS.BlogMonth, CMS.BlogPost and CMSBookingEvent.
Create a Hierarchical transformation to be used with your viewer and add an Item transformation for each of the items you wish to display. Also make sure the Level setting for each transformation is configured properly (-1 applies the transformation to all levels).
For Universal viewer it is necessary to check the property Load hierarchical data in the section Extended settings of the configuration.
As an additional note, you can leave the path property empty in case you are viewing the child documents of the current page.
For reference there is also an example on the Corporate Site example site in the content tree path Examples > Web Parts > Listings and viewers > Pages > Hierarchical viewer (or Universal viewer).
Hope this helps!
The other ways are this
Evaluate right fieldname by check object classname inside the transformation and assign appropriate value.
Dynamically assign transformation by checking the object classname

Expected usage of Page Editor's Experience date

I'm trying to understand the expected author experience in Page Editor when working with multiple versions of pages. If an author sets the date on the Experience tab to set a page in the future, it sticks and stays that way when opening other pages in Page Editor. We have authors who are opening the page in Page Editor and not seeing the content they expect because of the date setting. Is it expected that they have to manually manage this date when going from page to page? This seems very cumbersome.
More specific info: The specific issue we're having has to do with the fact that there appears to be no way to reset the button back to its default ( automatically showing the current date/time on each page load). If you manually set it back to "now" it sticks at that point in time. We have situations where authors attempt to get back to "now" by setting the date/time to the current date/time. This works for that moment, but then when they make a change to a page (causing a new version to be created with the current date/time as it's publishing restriction) and save, they're changes appear to disappear on save because the "now" they manually set in Page Editor is no longer now.
We're in the middle or rolling out workflow and this scenario is causing mass confusion with our authors.
Is there a way to reset it to automatic? Could I somehow create a custom button to do this?
My understanding is this feature works this way to allow you to preview the site and navigate it around it as if it was another date in the future. If you had to reset it every time you went to a new page, that flow would be very cumbersome.
You are just finding the other side of the cumbersome because it is being used for an alternative flow.

Sitecore saveUI processor redirecting to item page after moving it

I have implemented a Sitecore saveUI processor for moving news items to a specific location inside a year/month hierarchical structure. It does the job well, except for the fact that when used inside the Page Editor (navigating to an item's page and then trying to save, and implicitly move, the item) I am redirected to our 404 page, since Sitecore expects the original item's url to still be valid after the operation.
Is there any way to tell Sitecore that the item has been moved? I'm thinking at some property in SaveArgs, but any solution would do, as long as it's somewhat maintainable (for example, I'd prefer a server-side solution, not a client-side JavaScript-based one, if possible).
Off the top of my head, make sure your processor the last one in the pipeline and add the following code to the end of the process method:
if(Sitecore.Context.PageMode.IsPageEditor)
{
var item = args.SavedItems.First() // or perhaps Context.Item;
var url = LinkManager.GetItemUrl(item);
HttpContext.Current.Response.Redirect(url);
}
Have you tried using the Sitecore Newsmover Module?
This works seamlessly and could be the way to go instead of creating custom movers. We have used this plenty of times and it does seem to work well in all conditions.
Sample config for this:
<template id="User Defined/News Article" sort="Descending">
<DateField>Posted Date</DateField>
<YearTemplate formatString="yyyy">User Defined/Folders/Article Year Folder</YearTemplate>
<MonthTemplate formatString="MMMM">User Defined/Folders/Article Month Folder</MonthTemplate>
</template>