NIO with SSLEngine API - Simple example required
Hi
I am trying to implement a NIO Server with SSL Engine based implementation. I went through the Https server given in the samples provided with jdk 5.0. But that is little bit more complicated (uses Handlers and other associated functionality). what I am looking for is a simple example program which can elucidate the SSL Engine API operations and the bare minium code to execute a simple Client Server communication through SSL Engine. I know it has a long learning curve, just thought if somebody has researched well and posted an article/tutorial in this regard, it would be really helpful for novice programmers like me. Please help with some sample programs..
Thanks
Unfortunately the bare minimum is extremely complicated. The JSSE samples contain some simplistic NIO code but it barely works, and doesn't cope with useClientMode=true at the server, or with re-handshakes.
There is some PD code out there if you can find it, and also several discussions in the Secure Sockets forum.
There is also an entire chapter on it in my book http://www.telekinesis.com.au/wipv3_6/FundamentalNetworkingInJava.A21.
Similar Messages
-
Need help with a very simple example. Trying to reference a value
Im very new to Sql Load and have created this very simple example of what I need to do.
I just want to reference the ID column from one table to be inserted into another table as DEV_ID.
Below are my: 1) Control File, 2) Datafile, 3) Table Description, 4) Table Description
1) CONTROL FILE:
LOAD DATA
INFILE 'test.dat'
APPEND
INTO TABLE p_ports
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
DEV_id REF(CONSTANT 'P_DEVICES',NAME),
NAME FILLER ,
PORT_NO
2) DATAFILE:
COMM881-0326ES09,6
3) TABLE DESCRIPTION:
SQL> describe p_ports
Name Null? Type
ID NOT NULL NUMBER(10)
DEV_ID NOT NULL NUMBER(10)
PORT_NO NUMBER(3)hi,
i managed to do this for my app. (think i referred to viewTransitions sample code and modified quite a bit)
i can't remember this well cos i did this quite a while back, but i will try to help as much as possible
1) from the appdelegate i initialize a root controller (view controller class)
2) this root controller actually contains two other view controllers, let's call it viewAController and viewBController, for the screens which u are going to toggle in between. and there's also a function, let's call it toggleMenu, which will set the menus to and fro. i copied this whole chunk from the sample code. it actually defines the code on what to do, i.e. if current view is A switch to B and vice versa.
3) inside the controller files, you need to implement the toggleMenu function too, which basically calls the rootController's toggleMenu
4) we also need viewA and viewB files(view class)
5) need to add the .xib files for the respective views and link them up to the controller class. i did not use the .xib files for ui layout though, because of my app's needs. however, it will not work properly without the .xib files.
5) inside the view class of both views, i.e. viewA.m and viewB.m, you need to create a button, that will call the toggleMenu function inside the respective controller class.
it will look something like this:
[Button addTarget:ViewAController action:@selector(toggleMenu:) forControlEvents:UIControlEventTouchUpInside];
so the flow is really button (in view)-> toggleMenu(viewController) -> toggleMenu(rootController)
i'm sorry it sounds pretty hazy, i did this part weeks before and can't really remember. i hope it helps. -
New developer with spacial - need simple example
Dear All
i developing an application that need to store coordinates which represented with 3 floats. i need simple demo which illustrates me how can i insert such coordinate using Oracle Spatial and the how to select it. i also need little explanation of the structure of the select and insert queries
Thanks alotWell, Ron, I think you will need to read a minimum in order to use oracle spatial. I admit that the Oracle docset can seem daunting, but I don't think you can use it without at least reading some of the Oracle Spatial Users Guide, available here (file://localhost/D:/Doc/Oracle/1020/B19306_01/appdev.102/b14255/toc.htm) in HTML and PDF.
I suggest reading at least chapters 1 (concepts) and 2 (data types) in this manual.
Albert -
Need simple example of flex2 to webservice
Hello,
I understand that so long as you don't use remote objects,
you don't have to buy the FDS! So how do I bypass using FDS and
just use HTTPS or webservices?
Can someone point me in the right direction with a
good/simple example of using flex 2.0 with https and/or
webservices?
Thanks,
K.OK - I finally get this. I guess that SAP Business One is the entry level, least expensive license. If my company buys SAP Business One, will that provide the R/3 system and BAPIs to build some demos? And can I hook up SAP Business One to the Sneak Preview SAP NewWeaver 6.40 in order to invoke the BAPIs using Java?
And I guess that if we buy SAP Busienss One, then I don't need 6.40 ABAP stack to invoke the BAPIS - or do I?
Thanks for your help. -
Explain User exit concept with simple example
Hi friends
I am new member of this forum & i am learning ABAP.
Kindly send me user exit concept with simple example to my mail ID so i can able to use it.
mail ID [email protected]
thanks in advance
Thanks & RegardsCode SE18 is used to Identify the BADI available.
Look for the string 'CL_EXITHANDLER' in the standard program. This is a class which has a method 'GET_INSTANCE' which is used to trigger BADI's from the Standard Program. The interface parameter for this static method 'EXIT_NAME' is used to pass the BADI to the method.
Open Standard Program and do a global search 'CL_EXITHANDLER'.
SE18 > give the BADI name found through above search.
CUSTOMER_ADD_DATA > which has a method SAVE_DATA.
T.Code SE19 is used to Implement BADI.
SE19 > give the implementation name > Give the Definition name as CUSTOMER_ADD_DATA and the Short Text.
Intro.....
http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
Check these links for info about badi..
BADI's
http://support.sas.com/rnd/papers/sugi30/SAP.ppt
BADI's
http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
http://support.sas.com/rnd/papers/sugi30/SAP.ppt
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
http://members.aol.com/_ht_a/skarkada/sap/
http://www.ct-software.com/reportpool_frame.htm
http://www.saphelp.com/SAP_Technical.htm
http://www.kabai.com/abaps/q.htm
http://www.guidancetech.com/people/holland/sap/abap/
http://www.planetsap.com/download_abap_programs.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
/people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
/people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
http://www.esnips.com/web/BAdI
http://www.allsaplinks.com/badi.html
New to Badi
check any fo the below links. this will def help u.
http://www.allsaplinks.com/badi.html
And also download this file....
http://www.savefile.com/files.php?fid=8913854
There are other tutorials on this site...
http://sapbrain.com/Tutorials/tuto_download.html
What are BAdIs?
-> is an anticipated point of extension these points act like sockets and exist in the original source code
-> based on ABAP Objects. BAdI defines an interface that can be implemented by BAdI-implementations that are transport objects of their own
->Important! There are 2 roles: Enhancement Option-provider & Implementer.
-> In the above context, Enhancement Implementation can be done only if option (hook) is provided by the Option-provider. In simple words there are no implicit BAdIs.
Note: In the following slides, Definitions are created so as to understand the method of BAdI definition & for example purpose. As stated above this is the role of Enhancement Option-Provider.
Classic BAdIs already exist since SAP Release 4.6
BAdIs have been Re-implemented in ECC7.0 under the new Enhancement Framework & Switch Framework
Classic BAdIs
To understand what a powerful pattern a BAdI is, we will now define & then implement a BAdI
BADI Class is created automatically.
The various options are described below in detail:
1. Enhanceable: Enhanceability of filter types can only be specified for filter-dependent BADI definitions under very special conditions. For example, the domain belonging to the filter type must be linked with a value table that is of the type E or G. A BADI implementation can then be created in one step by creating a new filter value that is automatically entered into the value table at save and also copied into the transport order of the BADI implementation. In addition, it is also possible to create a new filter value and, at the same time, a BADI implementation with the same name. Naturally, you can also specify existing filter values.
You should select this feature if there is a prerequisite that a new filter value is created together with a new BADI implementation - that is, that BADI implementations are not created solely with existing filter values, although this, too, is possible.
2. Multiple-Use
3. Filter-Dependent
Instance Methods can access all of the attributes of a class and can trigger all events of a class. Static Methods can only access static attributes and static events.
Exceptions:
Events:
Events can be defined in classes or in interfaces. Corresponding methods can trigger these events with the RAISE EVENT statement. Each class (or interface) that is going to handle the corresponding event must implement a relevant handler method, and register it using the SET HANDLER statement. When an event occurs, the system calls all of the handler methods registered for that event.
Like method definitions, events have a parameter interface. The only difference is that events may only have EXPORTING parameters.
BADI : Businees Add IN's
Business Add-Ins are SAP enhancement technique based on ABAP Objects.
Where the SAP standard program is not going to fullfill the client requirement , we are going to add our own program to SAP standard program, without changing the standard prog.
Each Business Add-In has
at least one Business Add-In definition
a Business Add-In interface
a Business Add-In class that implements the interface
Each BADI has two different Views.
1.Definition view
2.Implementation view
T.C for BADI Definition is SE18.
T.C for BADI Implementation is SE19.
There are multiple ways of searching for BADI.
Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
Finding BADI Using SQL Trace (TCODE-ST05).
Finding BADI Using Repository Information System (TCODE- SE84).
1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System->Status. Double click on the program name. Once inside the program search for CL_EXITHANDLER=>GET_INSTANCE.
Make sure the radio button In main program is checked. A list of all the programs with call to the BADIs will be listed.
The export parameter EXIT_NAME for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter INSTANCE will have the interface assigned to it. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.
2. Start transaction ST05 (Performance Analysis).
Set flag field "Buffer trace"
Remark: We need to trace also the buffer calls, because BADI database tables are buffered. (Especially view V_EXT_IMP and V_EXT_ACT)
Push the button "Activate Trace". Start transaction VA02 in a new GUI session. Go back to the Performance trace session.
Push the button "Deactivate Trace".
Push the button "Display Trace".
The popup screen "Set Restrictions for Displaying Trace" appears.
Now, filter the trace on Objects:
V_EXT_IMP
V_EXT_ACT
Push button "Multiple selections" button behind field Objects
Fill: V_EXT_IMP and V_EXT_ACT
All the interface class names of view V_EXT_IMP start with IF_EX_. This is the standard SAP prefix for BADI class interfaces. The BADI name is after the IF_EX_.
So the BADI name of IF_EX_CUSTOMER_ADD_DATA is CUSTOMER_ADD_DATA
3. Go to Maintain Transaction (TCODE- SE93).
Enter the Transaction VD02 for which you want to find BADI.
Click on the Display push buttons.
Get the Package Name. (Package VS in this case)
Go to TCode: SE84->Enhancements->Business Add-inns->Definition
Enter the Package Name and Execute.
Here you get a list of all the Enhancement BADIs for the given package MB.
Have a look at http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
http://support.sas.com/rnd/papers/sugi30/SAP.ppt
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
http://members.aol.com/_ht_a/skarkada/sap/
http://www.ct-software.com/reportpool_frame.htm
http://www.saphelp.com/SAP_Technical.htm
http://www.kabai.com/abaps/q.htm
http://www.guidancetech.com/people/holland/sap/abap/
http://www.planetsap.com/download_abap_programs.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
/people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
/people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
How to develop BADI
Rewards if useful. -
I have been looking all over for a simple "hello world"
example, on how to connect to a database, and pass a param, and
return a dataset. I would like one that does not use components.
(Actionscript only). That uses ColdFusion 7.x and Flash 8. Can
anyone point me to one?Thanks Craig, I saw that example, but it was meant for Flash
MX, and according to the Flash 8 documentation, the NetServices is
now deprecated. Anyway, I posted my question on another site and
some supplied me with a simple example. Here is the url if anyone
is interested...
sample -
I need some simple examples to start with for Oracle ESB
Hi All,
Please share some simple examples to startwith for Oracle ESB.
I need to understand, what are the files are created, once created an ESB project.
What is the use of the files how to edit them with out using JDeveloper.
Iam trying to create a simple example.
I would like to create a file which has only "HELLO" in that file, simple text file inside a folder "INPUT" in my c:\ drive.
I wanted to create a ESB service which picks up the file and add a string to it like "HELLO" + "ESB" and drop this file into "OUTPUT" folder in c:\ drive.
How do i do that. I tried to do it when i deploy the integration server connection is gettting hit badly. I dont see that connection any more and i dont see that connection in my JDeveloper.
I dont want to start with existing code.
Please help
Regards,
Vijay.B
Message was edited by:
Vijay.B
Message was edited by:
Vijay.BHi,
If you want to do it from scratch you can basically do the following:
Make sure you have created an application server and integration server connection in JDeveloper.
1) Create a new JDeveloper project of type ESB project.
2) Possibly add a ESB System/Group (open the esb file and click "Create System/Group") to group ESB projects.
3) Create an XML schema describing your input XML file. Probably one element of type xsd:string.
4) Create an example XML file which is well-formed and valid according to the XSD from step 3.
5) Create a new File adapter (inbound/read). A routing service is automatically created.
6) Create a new File adapter (outbound/write).
7) Create a routing rule in the routing service in which you invoke the write method of the outbound file adapter. Possibly add a transformation using the XSL mapper.
8) Deploy the ESB project to the server.
9) Drop your XML file (from step 4) in the directory in which the inbound file adapter is polling.
10) If it is ok, the file should be picked up, transformed and dropped in the outbound directory. A new ESB instance should be visible in the ESB console.
See what files are generated on the filesystem in each of the above steps.
Regards, Ronald -
Simple example of image with OAS 4.0.8.1 PL/SQL
Hi,
Does anyone have a simple example which reads an interMedia image (e.g. gif, jpeg stored in database) and places it on a web page using the Oracle Application Server PL/SQL cartridge ?
WebDB can do it so it must be possible!
Any help would be much appreciated.
All the Best.
Niall.I don't have any examples, but you can use the interMedia Web Agent to place URLs in an HTML file in order to retrieve images and put them on a web page.
In your HTML file, you can use images tags in the following way:
<img src="/intermedia/dbagent/mediaget/get_picture/1">
instead of
<img src="test_image.gif">
In this example, "dbagent" is your Database Agent you have defined using the interMedia Web Agent, "mediaget" is the request mode for retrieving data from the database, "get_picture" is your PL/SQL procedure, and "1" is the key value used to locate the object you are retrieving.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by niallmcp ():
Hi,
Does anyone have a simple example which reads an interMedia image (e.g. gif, jpeg stored in database) and places it on a web page using the Oracle Application Server PL/SQL cartridge ?
WebDB can do it so it must be possible!
Any help would be much appreciated.
All the Best.
Niall.<HR></BLOCKQUOTE>
null -
SSLSocket on client & NIO w/ SSLEngine on server
Hi, I have a question about NIO & SSL...
Does it make sense to use SSLSocket on the client-side to connect to a server, which uses NIO w/ SSLEngine?
In my current code the server side is set up to be non-blocking. The handshaking part on the client side seems to work fine with the server's NIO & SSLEngine code, but after that it behaves oddly on the first read for application data (on the server-side). My SSLEngineResult from the unwrap of the first read has zero bytes for both produced and consumed. Not sure why...any thoughts?Thanks for the replies.
I'm using the sample code that comes with the Java 5.0 SE. Although, I modified it a bit (the example is set up for an HTTP server).
The read method looks like this:
int read() throws IOException
SSLEngineResult result;
if (!initialHSComplete)
throw new IllegalStateException();
int pos = requestBB.position();
if (sc.read(inNetBB) == -1)
sslEngine.closeInbound(); // probably throws exception
return -1;
do
resizeRequestBB(); // guarantees enough room for unwrap
inNetBB.flip();
result = sslEngine.unwrap(inNetBB, requestBB);
inNetBB.compact();
* Could check here for a renegotation, but we're only
* doing a simple read/write, and won't have enough state
* transitions to do a complete handshake, so ignore that
* possibility.
switch (result.getStatus())
case BUFFER_UNDERFLOW:
case OK:
if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK)
doTasks();
break;
default:
throw new IOException("sslEngine error during data read: " +
result.getStatus());
} while ((inNetBB.position() != 0) &&
result.getStatus() != Status.BUFFER_UNDERFLOW);
return (requestBB.position() - pos);
}It returns from that method with the Status.BUFFER_UNDERFLOW. -
How to change Analyzer user password with Administration API?
Hi,<BR>I would like to change Analyzer user password with Administration API. Can someone post some sample commands to do the task?<BR><BR>I would just like to write an application to change end user's Analyzer password.<BR>As I see I would need to do the following:<BR>1. login with admin userid/password<BR>2. execute some method to change password for required userid. I think the input parameter should be userid (of the user I would like to change password) and new password (the new password for the user).<BR>3. logout<BR><BR>Can someone post some sample code (commands to execute)?<BR><BR>Thanks,<BR>grofaty<BR><BR>My system:<BR>Analyzer Server 7.0.1.<BR>Essbase server 7.1<BR>Windows XP SP2<BR>
<blockquote>quote:<br><hr><i>Originally posted by: <b>knightrich</b></i><BR>Hello Mr. Jordan.<BR><BR>I would like to exchange some thoughts about "housekeeping" Analyzer reports in preparation for migration from Analyzer 7.0.0.0.01472 to 9.x:<BR><BR>...<BR><BR>Did you solved such a problem or do you have an idea if it could be solved with the Admin API methods?<BR> ...<BR>Migration from 7.00 to 9.x: As we heard last week the "Migration Wizard for Reports" in 9.3 should be able to migrate reports. Do you have experience or more detailed information about that Wizard?<BR><BR>Many thanks in advance<BR><BR>knigthrich<hr></blockquote><BR><BR>knighrich, <BR>I'd like to be more help, but I have no experience with System 9. I did substantial cleanup when we migrated from Analyzer 6 to Analyzer 7.1, and even more cleanup when moving up to 7.2, but our installation is smaller in scale than yours and we didn't need to automate report cleanup.<BR><BR>You might be able to get the ownership information you need through the back door, doing a direct query on the database, but simpler might be an export users, at least from 7.0. (This facility probably doesn't exist in system 9; it was dropped in 7.2 in favor of an undocumented API) The export file is an xml file that could easily be parsed to identify reports that have the administrator as user and then a second pass to delete those with otuer ownership as well. As previously suggested, you might be able to get this by a well crafted SQL query against the repository.<BR><BR>Procedurally, we have both public reports that have the blessing of management and are widely available, owned by a "public owner", and private reports developed by indivdual users and shared or not. Our team maintains the public reports, but not the private reports. We may be asked to make a previously private report public and take over maintenance of it. <BR><BR>I hope that you can find a solution that meets your needs. Certainly a call to customer support to identify a poorly documented feature would be in order.<BR>
-
JAVA API AND ABAP API SIMPLE SCENARIO
Hello MDM gurus
I have never used any Java API or ABAP API to leverage and present MDM functionalities on front end systems like portal,etc...
Could you please give me all the required to play around with JAVA api and ABAP api's.
Points will be given to every valuable answer.
ThanksHi Nazeer,
In order to use Portal you need Java APIs and to start with refer the MDM Java docs to get the basic idea of various classes and methods to be used in developing the simple java application and access it using portal.
http://help.sap.com/saphelp_mdm550/helpdata/en/47/9f23e5cf9e3c5ce10000000a421937/frameset.htm
Sample code for Duplicating Repository
public class TestDuplicateRepository
public static ConnectionPool simpleConnection;
public static RepositoryIdentifier repIdentifier,repIdentifier1;
public static String session;
public static String connection = "MDMServer_Test";
public static String repository1 = "Test_Repository";
public static String repository2 = "Test_Duplicate";
public static DBMSType dbmsType = DBMSType.MS_SQL;
public static void main(String[] args)throws CommandException, ConnectionException
//Creating Connection.
simpleConnection = ConnectionPoolFactory.getInstance(connection);
//Establishing connection with Repository.
repIdentifier = new RepositoryIdentifier(repository1, connection, dbmsType);
repIdentifier1 = new RepositoryIdentifier(repository2, connection, dbmsType);
//Creation Sever Session.
CreateServerSessionCommand createServerSessionCmd = new CreateServerSessionCommand(simpleConnection);
createServerSessionCmd.execute();
session = createServerSessionCmd.getSession();
//Authenticating Server Session.
AuthenticateServerSessionCommand auth= new AuthenticateServerSessionCommand(simpleConnection);
auth.setSession(session);
auth.setUserName("Admin");
auth.setUserPassword("Admin");
auth.execute();
session = auth.getSession();
//Duplicate Repository Command
DuplicateRepositoryCommand duplRepCmd = new DuplicateRepositoryCommand(simpleConnection);
duplRepCmd.setDBMSUserName("sa");
duplRepCmd.setDBMSUserPassword("abc");
duplRepCmd.setSession(session);
duplRepCmd.setSourceRepositoryIdentifier(repIdentifier);
duplRepCmd.setTargetRepositoryIdentifier(repIdentifier1);
duplRepCmd.execute();
Similarly you can try with Getting server version, Archive repository and then move on to adding,modifying records etc.
For ABAP APIs refer the below link
http://help.sap.com/saphelp_mdm550/helpdata/en/44/93aa6e31381053e10000000a422035/frameset.htm
Regards,
Jitesh Talreja -
Process Instance : Update Process Variables with Java API
Hi,
I need to set a lot of process variables in a java service that is executed in a process but can't find the way to do that.
Is it possible to modify the value of a variable from a process instance with the JAVA API ?
I didn't find this type of function (for example with the ProcessManager API).
Thanks,
WillCould you place your logic in an executeScript service?
You can use native Java there.
I have had good luck getting values in and out of process varaibles with the get... set...
this is a very simple example.
import com.adobe.workflow.pat.service.*;
String allowLogging = patExecContext.getProcessDataStringValue("/process_data/@allowLogging");
patExecContext.setProcessDataStringValue("/process_data/@errorActivity", "Save Doc XML");
patExecContext.setProcessDataStringValue("/process_data/@errorMessage", "SystemException");
if (allowLogging.equalsIgnoreCase("true")) {
System.out.println("@@@@ Save Doc XML @@@@");
System.out.println("@@@@ SystemException @@@@");
}; // END allowLogging -
Simple Example of PDK Servlet and PreferenceStore
I'm currently using Portal 10g, Release 2. Unfortunately, there are no newly updated PDK samples available for this version, but I've referenced the previous Portal examples and haven't been able to find a simple example that walks through the entire process of establishing/registering a store, storing preference data, and reading preference data from a PDK Servlet.
If anyone has examples that illustrate the following, it would be greatly appreciated:
1. How to create a File-based PreferenceStore for an PDK HttpServlet
2. How to associate a preference store with the Portlet (when using the PortletRequestRender.getProviderInstance().getPreferenceStore(), I get null)
3. How to store a preference value in the store
4. How to read a preference value in the store
Note: I have been able (with far too much code given a "development kit") to use the PDK to create a File-base PreferenceStore and store values. Unfortunately the read operations look for the .dat file in a path that consists of the path that I established in the store and appends it with a value of /df/. As a result, the preferences can't be read.
Thanks for any opinions/advice on this.
JohnHi John,
You could try looking up at any sample portlets on the Portal Integration website: http://www.oracle.com/technology/products/ias/portal/point.html
All the JPDK based portlets use file preference stores.
1. How to create a File-based PreferenceStore for an
PDK HttpServlet
2. How to associate a preference store with the
Portlet (when using the
PortletRequestRender.getProviderInstance().getPreferen
eStore(), I get null)You need to use the following code:
// Get access to the PortletRenderRequest
PortletRenderRequest pReq = (PortletRenderRequest)
request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
// Get access to the user's preference store for this portlet
NameValuePersonalizationObject data = (NameValuePersonalizationObject)
PortletRendererUtil.getEditData(pReq);
// Get access to the Edit Defaults data which would be applciable to all users (who have not yet customized that attribute)
NameValuePersonalizationObject editData = (NameValuePersonalizationObject)
PortletRendererUtil.getEditDefaultData(pReq);
3. How to store a preference value in the store
4. How to read a preference value in the storeLook at the APIs for NameValuePersonalizationObject at http://www.oracle.com/technology/products/ias/portal/html/javadoc/apidoc/index.html
>
Note: I have been able (with far too much code given
a "development kit") to use the PDK to create a
File-base PreferenceStore and store values.
Unfortunately the read operations look for the .dat
file in a path that consists of the path that I
established in the store and appends it with a value
of /df/. As a result, the preferences can't be
read.
Thanks for any opinions/advice on this.
JohnI hope this helps ..
thanks,
Harsha -
Simple example of connecting SAP and VB
Hi Experts
Can anyone help me providing material or simple example program of connecting SAP and VB for data transfer.
Its being a tough task for me, pls help me out.
Thanks in advance.
Regards
RajaramForm VB.NET appliaction you have two ways to connect to SAP system and execute BAPI. Either through webservices or by using NCo. Choice depends upon you appliaction requirement.
For starting with NCo go through
http://help.sap.com/saphelp_nw04s/helpdata/en/a9/4a57c1bac80e4e977d8cd9b3ecab89/frameset.htm
OR
THIS IS ANOTHER WAY TO LOGIN TO SAP THROUGH VB TRY THIS.
Logon with the SAPLogon control, Use an RFC call from the SAP Function
Control, and get the results with the SAP Table Factory Control. . .
You must have SAPGui's FULL install on your machine for this to work (Or at
least SAPLogon and the RFC toolkit)
This VBScript example might help, it calls RFC_READ_TABLE in sap, and emails
the results back to a user from a selected query (In this case uses that are
locked out.
This should show you how this could work in practice.
Thanks,
Will
' Email Locked out SAP users details to user in a .csv file through MS
Exchange / CDO
Dim ctlTableFactory, RFC_READ_TABLE, eQUERY_TAB, tblOptions, tblData,
tblFields, funcControl, objConnection, ctlLogon
Set objFileSystemObject = CreateObject("Scripting.FileSystemObject")
Set ctlLogon = CreateObject("SAP.LogonControl.1")
Set funcControl = CreateObject("SAP.Functions")
Set ctlTableFactory = CreateObject("SAP.TableFactory.1")
Set objWindowsScriptShell = CreateObject("WScript.Shell")
Set objConnection = ctlLogon.NewConnection
Set filOutputobjFileSystemObject.CreateTextFile("E:\SAP Scripts\LockedUsers.CSV", True)
objConnection.ApplicationServerobjWindowsScriptShel l.RegRead("HKLM\Software\AccantiaEDI\SAPServer")
objConnection.SystemobjWindowsScriptShell.RegRead(" HKLM\Software\AccantiaEDI\SID")
objConnection.SystemNumber = "00"
objConnection.ClientobjWindowsScriptShell.RegRead(" HKLM\Software\AccantiaEDI\SAPClient")
objConnection.Language = "EN"
objConnection.UserobjWindowsScriptShell.RegRead("HK LM\Software\AccantiaEDI\SAPSAPUser")
objConnection.PasswordobjWindowsScriptShell.RegRead ("HKLM\Software\AccantiaEDI\SAPSAPPassword")
booReturn = objConnection.Logon(0, True)
If booReturn True Then
'MsgBox " Cannot log on! "
'MsgBox booReturn
filOutput.WriteLine "ERROR CALLING LOGGING INTO SAP - FAILED LOGINS
UNKNOWN"
Stop
Else
'MsgBox " Logon OK."
funcControl.Connection = objConnection
Set RFC_READ_TABLE = funcControl.Add("RFC_READ_TABLE")
Set strExport1 = RFC_READ_TABLE.Exports("QUERY_TABLE")
Set strExport2 = RFC_READ_TABLE.Exports("DELIMITER")
Set tblOptions = RFC_READ_TABLE.Tables("OPTIONS") '
Set tblData = RFC_READ_TABLE.Tables("DATA") '
Set tblFields = RFC_READ_TABLE.Tables("FIELDS") '
strExport1.Value = "USR02"
strExport2.Value = ","
tblOptions.AppendRow
tblOptions(1, "TEXT") = "LOCNT > 0 OR UFLAG = 128"
tblFields.AppendRow
tblFields(1, "FIELDNAME") = "BNAME"
tblFields.AppendRow
tblFields(2, "FIELDNAME") = "LOCNT"
tblFields.AppendRow
tblFields(3, "FIELDNAME") = "UFLAG"
If RFC_READ_TABLE.Call = True Then
If tblData.RowCount > 0 Then
filOutput.WriteLine "UserName,FailedLogins,LockedFlag"
' MsgBox tblData.RowCount
For intRow = 1 To tblData.RowCount
filOutput.WriteLine tblData(intRow, "WA")
Next
Else
filOutput.WriteLine "NO FAILED LOGINS OR LOCKED USERS"
End If
Else
filOutput.WriteLine "ERROR CALLING SAP REMOTE FUNCTION CALL -
FAILED LOGINS UNKNOWN"
End If
End If
Set filOutput = Nothing
MailProfile = "MS Exchange Settings"
Set objSession = CreateObject("MAPI.Session")
LogonOK = objSession.Logon(MailProfile)
Set objMessage = objSession.Outbox.Messages.Add
objMessage.Subject = "SAP Users Report - Locked Users + Failed Logins"
strSetMessage = "There are " & tblData.RowCount & " users that are
either locked due to failed logins, or have at least 1 failed login attempt
on system " & objWindowsScriptShell.RegRead("HKLM\Software\Accant iaEDI\SID")
& vbcrlf &
reward if useful -
Hi,
I am implementing a server that needs to handle a massive amount of SSL connections. Therefore I choose to use NIO in combination with SSLEngine. First I implemented the basic nio stuff including selector, buffer handling and flow control. It works and scales really well.
Now I want to add support for SSL via SSLEngine. That is where my confusion starts. Here is the situation:
I use a single Selector thread for all I/O operations to avoid thread synchronization. At a certain state the SSLEngine needs the results of delegated tasks (e.g. the generation of session keys). This tasks can be long-running/blocking. Therefore I can not execute this tasks within my central Selector thread. So I have to pass those tasks to an Executor and continue in my central Selector thread with other channels.
What I don't know is: How do I continue with the channels where the associated SSLEngine has finished its tasks? Channels get only selected when there is new data to read or write at the channel socket. But this is not the case when SSLEngine is done with its tasks.
I looked at the <jdk-home>/samples/nio/server example only to find that this problem was "left as an exercise for the reader...".
Is there still a piece missing in Sun's NIO/SSL puzzle? Do you have any hints?I think you would have to create a class implementing Runnable that first runs the Runnable provided by SSLEngine.getDelegatedTask() and then calls SSLEngine.getHandshakeStatus() to determine what to do next. If the status is NEED_WRAP or NEED_UNWRAP, then the class would register the SelectionKey for OP_WRITE or OP_READ. Then run this class from the Executor. Something like this:
class SSLTasker implements Runnable{
private Runnable task;
private SelectionKey key;
private SSLEngine engine;
SSLTasker(Runnable task,SSLEngine engine,SelectionKey key){
this.task=task;
this.key=key;
this.engine=engine;
public void run() {
task.run();
switch(engine.getHandshakeStatus()){
case NEED_WRAP:
key.interestOps(SelectionKey.OP_WRITE);
break;
case NEED_UNWRAP:
key.interestOps(SelectionKey.OP_READ);
break;
case FINISHED:
//Whatever your app needs now
break;
case NEED_TASK:
//this is tricky - it might be better just to loop through all needed tasks in one run() call
break;
default:
throw new RuntimeException();
key.selector().wakeup();
}However this actually has a problem I just realized - what if the SSLEngine wants two tasks done in a row (does this ever happen?). Therefore it would probably be better to have this:
public void run() {
Runnable r;
while ((r = engine.getDelegatedTask()) != null) {
//getDelegatedTask() return null when handshake status is no longer NEED_TASK
r.run();
}and not pass a Runnable to the constructor.
Maybe you are looking for
-
I want to know how to sync my iPhone 4 and 4s together so I can share my messages and pictures. I want both phones to receive the same message calls and pictures. Is there a way and how?
-
Has anyone else noticed a problem with moving windows around by dragging them from the title bar: It used to be possible to move them off screen right, left, and down. Movement off the screen to the top was prevented, however: The pointer remaining a
-
IP / DHCP Problems with D-Link Extreme
I have been having a lot of problems with my current set up.. D-Link router/modem -> Airport Extreme >WDS> Express. The D-Link router has the "DHCP Range" of Start: 192.168.1.2 End: 192.168.254 and Lease time of 24 hours. The Airport extreme has the
-
Use of "ViewObject.QUERY_MODE_SCAN_VIEW_ROWS" in OAF
Hello, how to do in memory searching or sorting in OAF appliation? Actual problem is: we insert rows in table, before commit we apply search(written custom search code). This search is executed on Database data not on newly created records. I have tr
-
[SOLVED] XFCE - Editing Applications Menu
Hi there, The applications menu seems to update happily in XFCE when i use pacman.. however pacman has placed some items (eg. XMMS) into an incorrect category (in this case "Other"). How can I edit the menu so that XMMS is placed into the "Multimedia