Why would an ADF Business Components Entity Attribute render as "updatable while new" when all relevant configurations are set for "updatable always?" - oracle-adf

Background
The application in question is a WebCenter 11g in-house development project using ADF Business Components, JSF 2.0, and Facelets, and is being developed using JDeveloper 11g Release 2, version 11.1.2.4.0. The model project contains an Entity Object with many values for reviewing business projects. The view controller project contains a single page within a bounded task flow, which houses an input form referencing these values for creating and editing reviews. ADF Security features are enabled across the application. In the context of these reviews, intended functionality indicates one class of users can only edit certain "S.E." values, while other users can edit all values and create new reviews. To facilitate this, Entity Attribute-level security has been implemented for the reviews.
The Issue
The review form renders correctly, with the exception of a small, random selection of the values' input elements (eight out of 40) that render as read-only/disabled only when editing an existing record, but have no issue when creating a new record. When testing using the AppModule testing functionality, the same results are observed: the same eight values can be edited by the test user only for new records, while all other values are editable for new and existing records.
Specifics
The View Object and Entity Object Attributes for these values are all configured with the Updatable property set to Always. These values include some of the aforementioned "S.E." values, but not all of them - nor are all of the values at issue included within the "S.E." value group. The test user is set as an administrator for the application, an Application Role to which all Resource Entitlements are granted.
Failed Resolutions
I've attempted changing the View Object and Entity Object Attributes' Updatable attributes to While New and Never, then switching them back to Always - confirming that the changes were made in the XML file with each switch. I've checked and rechecked the ADF Security configuration several times, and confirmed the security for each of those values is identical to that of the other values in the same form/Entity for which the issue does not occur. I've cleaned the application and rebuilt the projects (model and vc) individually before deploying to a freshly launched Integrated WebLogic Server; I've closed and relaunched JDeveloper before rebuilding and redeploying; I've even restarted the computer, as sometimes the nature of my enterprise causes odd issues with JDeveloper that are only resolved by a log out or restart of the entire system. I've also confirmed that the issue occurs on my coworker's machine.
Ground Rules
Due to the nature of my environment, I cannot divulge explicit details of the application, and the following suggestions are unacceptable.
Upgrading JDeveloper
Upgrading Java
Upgrading WebLogic/WebCenter
Upgrading ADF, JSF, or any other library

As it turns out, this issue was caused by an ADF Security/JDeveloper SNAFU. The Entity Attributes in question were renamed (refactored) at some point, and for some reason this change propagated to everything ... except the Attributes' permission configuration. The Attributes and all other references to them held the new names, but their Permission elements in the Entity XML file still held the old names. This was not apparent until reviewing the XML directly, as the JDeveloper UI for ADFBC Entities does not reflect the warning state shown in the XML editor. The solution, then, was to either disable and re-enable Attribute-level security for those Attributes or to manually adjust the Permission elements' parameters within the XML.

Related

Cancelling and discard changes in Entity Framework and WPF

I am developing a system where the user have forms to fill and this info is stored in a database. In one of the screens I have the following flow:
Inside a project he can add multiple orders.
Each added order opens a configuration screen which internal information of the order can be set. Also it is possible to add items to the order.
Each added item opens a configuration screen that allows user to set internal informations.
To sum up, the flow is Project -> Order -> Item, where "A -> B" means A contains 0, 1 or more Bs.
This project is being developed using WPF with Entity Framework to manage the database access. I am binding entities from Entity database mapping directly into the screens. This way we have some "advantages" with WPF, as not null fields are painted red, for example. Moreover, the code is much simpler. The entities are only updated (or added) to the database when the project is saved. Therefore, items can be edited, then orders can be edited and they are only saved when the project is saved, since they are dependent of the project ID to be saved.
However, using mapped entities directly has a huge problem: let's say the user edits an Item inside an Order. Then, he edits it again, but this time, instead of pressing "OK", the user presses "Cancel". The changes must be reverted. However, the previous state was lost, since it was not updated in the database and were changed because of WPF binding.
What is the best approach to prevent this problem? I don't know if creating clones work well in Entity Framework. And creating variables that only transfer their values to the object when the confirm command is clicked would be against the MVVM pattern, and would make me lose the "advantages" I have already talked about.
Please help me!
Thanks!

Creating a custom column: "Append-Only" File Upload

I'm trying to make a custom column (for a custom list), where the users can upload files without overwriting the previous - this way they can keep past versions of the files and upload newer ones and the new ones append. There already exist "append only" comment columns and file upload columns that I can see.
I'm working with Sharepoint designer 2007 (2010 doesn't work with the site), and I'm referencing this code I found online somewhere (http://pastebin.com/raw.php?i=0qN89meu), trying to research the Sharepoint documentation on MSDN. I can open the site in designer, but don't know where to go from there (it's already running on a web server, not opening it locally).
I'm just not clear on how to start, I thought there'd be a simple "right+click -> new column" feature but I can't find it. If someone could point me in the right direction to where I could start creating columns on the site, that would be great. Thanks!
An untested idea :
Create a document library with a lookup column to the custom list.
Create an event receiver (ItemAdded and ItemUpdated) than will take the attached files and move them to the other list (with the correct lookup value). --> Code with Visual Studio
Grant to this document library only read permissions.
Adapt the view to display the related documents in the dispform of the custom list.
Advantages:
this seems to answer to your need
you gain all the usability of a document library (nothing prevent you to grant edit rights to other users, force check out, etc.)
Disadvantages:
you have to play with lookup. Can be tricky sometimes, if you play with features
you split one business entity to two entities. You will have to deal with cascading delete (if you need it).

Using a Reference Table Service in a WPF Application

For past projects(the last few have been web using asp.net mvc) we created a service that caches our reference tables(as required) to be used primarily for dropdown lists.
Now I'm working on a desktop application.An upgrade from vb6/sybase to vb.net/sql server
I'm trying out WPF.
I started down the same path building up my DAL. one entity for each reference table.
I'm at the stage now where I want to setup the business layer (some reference tables can be edited)
And I'm not sure if I should follow the same process which is to use ReferenceTableService to "manage" the reference tables.(interacts with the DAL, Controller)
This will be an application that sits on a share that multiple users run.
What's the best way to deal with the reference tables? Caching them doesn't seem to be an option. Should I simply load them as each user opens up a new form in the application? Perhaps using a "ReferenceTableService"?
In this case, the Reference Table Service is thin layer in the application. Not a process running elsewhere.
I haven't done much WPF (be interesting to see what the WPF Gurus think) but I think your existing approach is sound and I don;t see why you should deviate from it.
Loading up on app start sounds reasonable; you just have to think about the expected lifetime of a user session vs the expected frequency of changes to the reference data.
Caching: if the data comes from a central service you could always introduce caching there.

Renaming CoreData classes while allowing App updates

I have made the mistake when starting the coding an iPhone App of not adding a prefix to my classnames, and as such have a conflict (A CoreData class called Category). The project build fine until the recent update of Xcode, and only now I realize the mistake.
Is it possible to rename CoreData classes while keeping a working system after update?
If I add a new version to the Datamodel and rename the class, the App updates, but it seems that the old table is deleted and a new (empty) one created. Obviously all the links subsequently are broken. I would like to maintain the data while making the change.
In Java EE you can overrule the table name if I remember correctly, and as such I could stick to the old class name to name the table. Is there any such possibility with CoreData?
Thanks in advance! I have to find a way to update the DB without all the Apps out in the field breaking.
Actually, it i documented quite well by Apple:
If you rename an entity or property,
you can set the renaming identifier in
the destination model to the name of
the corresponding property or entity
in the source model. You typically set
the renaming identifier using the
Xcode Data Modeling tool, (for either
an NSEntityDescription or an
NSPropertyDescription object). In
Xcode, the renaming identifier is in
the User Info pane of the Detail Pane,
below the version hash modifier (see
The Browser View in Xcode Tools for
Core Data). (Mac OS X Developer Library )
But actually for me it seems to work just to change the Classname and leave the rest of the model alone.

Adding additional entities to a Entity Framework backed Domain Service

We're investigating using RIA Services (July 09 Preview) to expose parts of an existing EF model. We've added a Domain Service class to our web application and specified the EF model to use and selected a few of the entities we wish to make available via the domain service (some have editing enabled, most do not).
We build and everything is great, but if we want to add an additional entity to the domain service how do we do that. Is it a case of delete your current class and re-add and this hole will be plugged when RIA Services hits RTM?
I agree, that's annoying to type in all that manually every time the DB changes. What i end up doing is creating a new temporary domain service classes (and metadata) and cut&pasting the code into the existing domain service and then removing the temp service from the project.
Another option can be (didn't try it) to make the generated file a partial class, put all the new queries into a separate file and every time the DB Schema changes just blow away the generated file and recreate it using the wizard. Just a thought
You can just add the code for the new entities... just add the right methods, query, and depending on which operations you need, insert, update, delete and custom ones.
Yoiu shouldn't have to delete your current class, which theoretically contains a bunch of interesting app logic (I'd imagine) just because you want to add an entity.
My solution to this problem was to create a code snippet that does most of the work.
I only have to type efdsmethods, tab twice, and replace the EntitySet name, EntityType name, and entity variable for the methods to use and then I'm done. It makes adding the 4 standard methods very easy.
I've submitted my snippet as a patch (#10154) to the Silverlight Contrib project on codeplex, but it hasn't been accepted yet. Until then you can download the snippet from here.
Hope this helps you.

Resources