Accessing HttpSession in entity Impl.java
Can someone please tell me if it is possible (and if so how) to set a HttpSession variable from within the entity's Impl class ?
Currently I am overriding the doDML method to obtain the sequence number generated during the insert. I then want to use this later, hence need to store it somewhere
Thanks,
Brent
What I was getting at above was something like this:
protected void initializeBindingsForPage(DataActionContext ctx)
// TODO: Override this view.fwkext.BaseDataForwardAction method
// super.initializeModelForPage(ctx);
HttpServletRequest request = ctx.getHttpServletRequest();
String strRemoteUser = request.getRemoteUser();
System.out.println("remoteUser=" + strRemoteUser );
setBindingValue("CreatedByUsername"
, strRemoteUser
, ctx );
}In this case, the application was written to use FORM-based authentication, and the user then gets "stuffed" into an audit field exposed on the page's bindings. From there, you'd have it on the backend when the DML was eventually called.
Am I missing something?
Similar Messages
-
Accessing Managed Bean Variables in Entity Impl Class
How can I access managed bean variables in the entity Impl class .
While inserting a new record in DB , i want to set few entity properties values . The values of those properties are available in the managed bean .
How can i access those values from Managed Bean and set them the entity Impl class to override the create method.
Or is there any better recommended approaches ?
Jdev - 11.1.1.5>
While inserting a new record in DB , i want to set few entity properties values .
>
you can user CreateWithparams
http://www.oracle.com/technetwork/developer-tools/adf/learnmore/13-create-with-params-169140.pdf
http://andrejusb.blogspot.com/2011/02/createwithparams-operation-for-oracle.html -
How to use view objects in entity impls?
Hi!
I would like to access a view object to implement business logic
in an entity impl class method. How can this be done? More
precisely I would of course like to do this in the context of
the "current" Application Module the Entity "lives" in. I think
this has to be possible because you can use a list validator for
an entity objects attribute, which gets it's data out of a view
object.
Any help would be very welcome!
Regards
StefanStephan,
Just to make things clear, View Objects access Entity Objects
and you should implement your busines logic in the entity
objects. This is the way BC4J was designed. It allows for
reuse of your components and build different views (View
Objects) ontop of Entity Objects.
View objects do query the database and populate the entity
objects. However, it is from the cached data in the entity
objects where DML occurs (insert, update, delete). You want to
put your validation at this level because you do not want to
make a trip to the database if it does not validate.
I recommend reading a whitepaper on J2EE development and
BC4J. The URL
http://otn.oracle.com/products/jdev/htdocs/j2ee_with_bc4j/j2ee_wi
th_bc4j.html.
Happy Reading!
Hi!
I would like to access a view object to implement business logic
in an entity impl class method. How can this be done? More
precisely I would of course like to do this in the context of
the "current" Application Module the Entity "lives" in. I think
this has to be possible because you can use a list validator for
an entity objects attribute, which gets it's data out of a view
object.
Any help would be very welcome!
Regards
Stefan -
Gettting the session value in doDML() of Impl.java
I'm using ADF BC, struts, JSP.
I have the logged in user in my session variable and I want to store that in the database in the timestampfields.
I am 'overriding' doDML' method in my Impl.java. In the 'insert' operation, I want to get the session value. How do you do that. I tried setCreatedBy(session.getAttribute("user")), but it says HttpSession object/class not found.
How do you get the session value in your Impl.java.
Thanks.Hi,
You don't need to add any library or overwrite prepareSession() method. You may add values to BC session in any time and in any method in business components e.g in Application Module:
private void addToMySession(Integer currUser){
Hashtable userdata = getDBTransaction().getSession().getUserData();
if (userdata == null) {
userdata = new Hashtable();
userdata.put("CurrentUser", currUser);
Then you may get this value in any businnes component e.g. in EO:
protected void doDML(int operation, TransactionEvent e) {
if (operation == DML_INSERT) {
Hashtable userdata = getDBTransaction().getSession().getUserData();
Integer currUser = userdata.get("CurrentUser");
setUserId(currUser);
super.doDML(operation, e);
I hope that explained clearly :) and it helps.
Regards
Kuba -
Access ABAP table in Webdynpro Java application
Hi All
Is it possible to access ABAP table in Webdynpro Java application
Please provide your input
Thanks
Karthi D.Hi you will connect to the remote SAP system, the
backend, using an Adaptive RFC MOdel. To access database tables, you can make use of existing functions in terms of RFC function modules. For each function module you need, the system generates a corresponding Java proxy class. All the generated proxy classes and interface are bundled together in the RFC model and treated as part
of your Web Dynpro project
In WebDynpro java you RFC by using Model :
Adaptive RFC Model
1. automatically adapts to changes in function module signature
2 provides support for data types and extensibility
3.support for different structure definitions in different backend
systems (release dependent structures, custom adaptation)
Basic principles and guidelines
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/11c3b051-0401-0010-fe9a-9eabd9c216de
See this blog
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/faq%2b-%2bmodels%2b-%2badaptive%2brfc
http://help.sap.com/saphelp_nw04s/helpdata/en/6a/11f1f29526944e8580c5e59333d96d/frameset.htm
Thanks,
Tulasi -
Access DataControls methods in a java class
Hi All,
Jdeveloper Version 11.1.5
I have created DataControls for SessionFacade web service.
Inside the datacontrol there is a method getAllDepartments() which have a Return type which includes DaertmentId,DepartmentName,....
I want to know how can i access this method inside a Java Class and create a list of only departmentId.You would need to add the method in the data control as a method action in your pageDef.
After that, you could access the method as mentioned above.
Thanks,
Navaneeth -
http://www.oracle.com/technology/pub/articles/vohra-jdev-xmlpub.html
I used the above link to create XML's and from there a formatted report of data from the database. I accomplish this by connecting to the database inside the XMLPublisher.java file. I also have my query hard-coded inside the DataTemplate.xml to extract the info from the database. This limits my ability on what the user can accomplish with the system.
Is it possible to run my reports based on an iterator within Jdeveloper, as opposed to having to manually enter the query and connect to the database within the XMLPublisher.java file and the template.xml? ..Possibly connecting to the database and and writing queries in the *****impl.java?
Thanks.Rather than inventing your own demi-donkeyed solution I recommend you consider using Oracle's Fine-Grained Auditing which does precisely this.
Cheers, APC -
Can we access PI tables from WebDynpro Java via PI 7.1?
Hi Experts
Is it possible to fetch PI Tables (to display monitoring and alerts as dashboard on portal) from Java Stack. I got some javadocs API SAP Netweaver for PI 7.1 but i don't know how far it can help me in solving my purpose of fetching and displaying the PI monitoring data on Portal.
https://www.sdn.sap.com/irj/sdn/javadocs
Please advise if J2EE access to PI Tables is possible or RFC is the suggested solution to fetch PI Monitoring data.
Thanks
NehaHi Neha,
You can access PI tables from Webdynpro Java application using RFC or Webservices. Create RFC or Webservices which will fetch data from the PI tables.Create the required JCO's and the Webdynpro java application which uses the Adaptive RFC model or Adaptive Webservice Model to connect to the ECC system.
I found a document that speaks about fetching data from SXMB_MONI Standard Table https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b050ff4f-84c3-2b10-3d99-8f9c44f57a17
Hope this is useful.
Regards,
Seema Rane. -
I have requirement like this.
I have to update the table underlying my page and also should insert in Interface table.
Which will be best.PLSQL Entity or Java EO.Have a Java EO to insert data into your table..
Before commit insert data into the intereface table by calling a pl/sql procedure..
refer http://prasanna-adf.blogspot.com/2008/11/callable-statement.html to invoke callable statement from OAF.
--Prasanna -
Access BAPIs Using the SAP Java Resource Adapter
Hi experts,
Can someone tell me how to Access BAPIs Using the SAP Java Resource Adapter?hi Shweta,
Please refer the step by step procedure:
1. Start the deploy tool of the SAP J2EE Application Server with the DeployTool.bat in the directory //<SAP J2EE Engine Installation Directory/.../j2ee/deploying.
2. Choose Project → New Project and enter a name for the new project.
3. Click on the Deployer tab.
4. From the menu path, choose Deploy → EAR → Load Module and select the sapjra.rar file.
5. For the newly created node sapjra.rar, choose Server Settings → Identity Subjects and select Caller Impersonation as authentication type, so that the J2EE user data is used to log on to the ABAP system.
6. Make sure that the J2EE Application Server is running. Connect to the J2EE Application Server with Deploy → Connect.
7. Deploy the sapjra.rar using the menu Deploy → Deployment → Deploy Module.
8. Enter SAPJRADemo as application name and start the application.
9. Close the deploy tool.
10. Start the Visual Administrator again.
11. Select the Cluster tab and switch to <Server Node> → Services → Connector Container.
12. Click on the Runtime tab and choose sap.com/SAPJRADemo → eis/SAPJRADemoFactory.
13. Choose Managed Connection Factory → Properties. On this page, you need to specify the logon data for the ABAP system. There is already some dummy data visible in the property list if no real system data has been specified so far.
14. To change the value of a property, select the property in the list, change the value underneath it, and add the changes using the Add button. At the end, do not forget to save all changes by pressing the button Save Changes. The user configured for the SAP JRA must be the user authorized to read metadata of function modules. -
Is there a way to access total memory used by java instance?
is there a way to access total memory used by java instance?
i'm familiar with
runtime.getTotalMemory() and runtime.getFreeMemory();
and i understrnad that it is a measure of the amount of memory available for the heap used to allocate objects and the amount of memory not being used by the object heap --
but is there a way to (from java get the value that you get when you go to the windows taskmanager and look at javavm.exe
stepheni'm using java 1.4 if that helps
-
Revision: 5008
Author: [email protected]
Date: 2009-02-18 20:26:21 -0800 (Wed, 18 Feb 2009)
Log Message:
Fix for mx.accessibility.AccImpl.as causing a java.io.FileNotFoundException exception in ASDoc
QE Notes: None.
Doc Notes: None.
Bugs: SDK-19340
tests: checkintests, asdoc
Ticket Links:
http://bugs.adobe.com/jira/browse/SDK-19340
Modified Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocUtil.javaWelcome back everyone.
Hope you all had good holidays.
Cheers
glenn
tinylion development & design -
Accessing the Binding Layer from Java
Dear All
How can i Accessing the Binding Layer from Java code i need details document for it becuase i have complex binding object (object inside object)
Regards
Mohd.Weshahi know but my case is complicated :
Dear All
i have generate a human task based task flow and i create a page with payload object . i have an empiterator whcih include the following attributes :
- id
- name
- telephone
- department (Complex object) it include another attributes - dept and dept Name
my question i want to fill the empiterator by java code and fill all attributes including complex object (department ) from java code (my backing bean). \
you can download a document that describe my problems by images and details :
[http://www.4shared.com/account/document/fTREP1mv/ADF_Question__2_.html]
Regards
Wish79 -
Need coding support for Accessing MYSQL stored procedure from java
Hi every one,
I need coding support for accessing Mysql stored procedure from java and JSP.
Please help me
pranavYou'd better have a recent version of MySQL, because earlier ones didn't support stored procs.
If your MySQL and driver support stored procs, maybe you just need a JDBC stored proc tutorial.
% -
Accessing view object class (impl) method from bean (or vice versa)
Halo everyone, I am using JDeveloper 11.1.2.1.0
I have a UsersViewImpl class with a method which refresh the user table like below.
public void resetEmployeeSearch() {
removeApplyViewCriteriaName("viewCriteria");
executeQuery();
and I have a UserBean class with a method which reset the search fields values like below.
public void resetInput(ActionEvent actionEvent) {
........RichInputText = input ...
input.setValue("");
AdfFacesContext.getCurrentInstance().addPartialTarget(searchForm);
I would like to implement it in such a way that, once I press a button, both methods will be called.
I have tried to call from bean method using UsersViewImpl vs = new UsersViewImpl ..... which is wrong and wont work.
I have read about doing something like ViewObject vo = am.findViewObject("DeptView1") but I duno how to use it because I cant have a proper example.
Any suggestion on accessing view object class (impl) method from bean (or vice versa)?
Or is there any way to combine both method in the same class ?
Thank you :(User, if you get class not found exceptions you need to tell us which classes you can't find. The JSFUtils and ADFUtils classes needing some other libraries which should already be part of your Fusion Web Application template (which your adf application should be based on). If you did not use this application template, you may have to add some libraries yourself.
What is the diff of using the ADFUtils and OperationBinding way?
The ADFUtils can get you access to the application module which you then use to call exposed methods on. The disadvantage of doing this is that you have to implement your own exception framework which then handles exceptions thrown by the application module. An other thing is that if you e.g. alter a VO which you use on the page this changes are not seen on the page until you refresh the page. The binding layer does not know about these changes so the iterators (which are used on the page to show the data) are not refreshed and so you don't see the changes.
In general you should avoid using the application modul in a managed bean method and always use the binding layer (OperationBinding) to call methods. This ensures that exceptions are all handled the same way and that changes to the data model are reflected in the GUI.
Timo
Maybe you are looking for
-
How do i back up my imovies on an external hard disk?
Hello i am trying to back up my imovies on a external hard disk , i follow the instructions but everything is still in my computer!! and now when i open updates project ,they are empty!....
-
I have one app that does not show up in Launchpad
I have one app, the game Diablo II, that still shows up in my Applications folder as it always has but does not show up in Launchpad when I pull that up in Lion. All of my other apps are there in Launchpad... but not this one. Any idea how I make a
-
Map Viewer and Map Builder preview releases
Hello, You promissed new preview releases of these tools after January 2006. When dou you think they will be posted on OTN ? I ask this because I'm starting a new project. Regards, Lucian
-
Has anyone tried integrating IDM with MOSS( Microsoft Office SharePoint Server ). I'm looking for docuements that will talk about how we provision/deprovision to MOSS, from IDM 7.1.
-
How do I cancel NHL Center Ice Subscription?
If you were signed up for NHL Center ICe last year, they are automatically renewing you for this year unless you opt out. Well I haven't been able to opt out. Does anyone know how to do this? I tried talking to 2 different customer service represen