Code Samples??

Ross - it's been over a monthsince any sample code has been posted. I know you guys are all about pushing professional services, but many times that is not an option, nor should it be, and we are sitting here stuck because the documentation is so poor and we are forced to depend on a Plumtree resource responding to a post to get our jobs done. We understand that sometimes code samples are incomplete and that would be a caveat, but even if you just throw us a bone by providing sample code of some of the advanced UI customizations you guys have done internally. Something, anything. The QuickStarts aren't sufficient and you only have 10 pieces total of sample code outside of the documentation, the latest sample posted over a month ago. Any news on when more is coming or what Plumtree's strategy is in that arena?
Regards,
Sarah Wheeler

I have to completely agree with Sarah's post. I have read the EDK guide, the UI Customization guide (which drove me to read a Java manual, I'm a C# developer), Setting Up the Development Portal, every bit of the online documentation (quickstarts, sample code), and most of the posts on this discussion board. To recap, I have read, sometimes multiple times, every bit of available documentation around, specifically, UI Customizations and extending the Plumtree Application.
This has done me no good, and has only proven to confuse me.
I understand the Model-View-Controller design pattern; we use it for our ASP.NET development. Plumtree's implementation of MVC is tied so closely to the PT Server API that it is impossible to decouple the two. The UI documentation goes into some detail about activity spaces, views, models, and controllers, but never explains "why" they work in relation to the Plumtree Application. There are only loose references to Plumtree's implementation of MVC, and this is Plumtree documentation! To further the confusion (and the confusion runs deep), each piece of documentation I read seems to contradict all the other documentation I've read. The setup for Visual Studio development is almost laughable there are so many steps to follow, and once again, there is never any "why" to the "how".
I really hope that PT comes up with some decent documentation and sample code to compliment what I'm sure is a very scalable architecture. Right now it seems like the blind leading the blind, not just here, but all over these discussion boards.

Similar Messages

  • Is there a RH standard for formatting code samples?

    In the RH default style sheet, I do not see a pre HTML tag or other tag that will display code samples in a monospaced font.
    I created custom styles for a single line code sample and another style for multiline samples.
    We want our code samples to be shaded. If I shade multiple lines, each line being separated with a paragraph, there is a small amount of
    white space between each line. We do not like this either.
    I then created a custom table style with a single shaded cell. I add my multiline sample code, then I apply the custom paragraph style to get
    the font and spacing between lines that I want.
    Is there a different best practice for this, so that the code sample would be rendered correctly if viewed from other devices that read the HTML and
    may look for the pre HTML tag?
    I am using RoboHelp 9 and I provide the output as Eclipse help. Our help files are integrated into Eclipse help in the Eclipse IDE.
    Thank you.
    Cynthia

    Hi Cynthia
    As much as it pains me to say it, this is one case where using a Form element might be your best bet. I say this because often code samples are used or presented with the intent of copying and pasting into something like Windows Notepad. And if you used the TextArea form element, you can place the code there and make it pretty easy for folks to copy it for use elsewhere.
    I stand to be corrected on this because I am not a "power CSS" person. (meaning I am aware there are complete two and three day classes one might attend on all the nuances of CSS) But RoboHelp won't really do anything to help you a great deal in formatting things. But it might be possible, somehow, to configure CSS to accomplish your goal of making the code look as you want.
    Cheers... Rick

  • Java Proxy Code Sample

    Hello SAP community. Does anyone have a step-by-step code sample for creating either a jsp or web dynpro application in Netweaver to use a java proxy to connect to XI that will calls a RFC or BAPI in SAP R3?

    Hi
    See the Code sample and pdf help it the SDN samples and tutorials
    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/f0b0e990-0201-0010-cc96-d7ecd2e51715
    https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d
    Kind Regards
    Mukesh

  • Any code samples for inputting content into content manager 8.1?

    Does anybody know where to find code samples of adding content to the Content Manager
    via the Java API?
    The only code I can find is the "Content Manager Example Portlet" and it is 7.0,
    not 8.1.
    It's not clear from the documentation what the Repository and Path are supposed
    to be named. Perhaps we had a working example, this might help.
    Thanks
    Dave

    Does anybody know where to find code samples of adding content to the Content Manager
    via the Java API?
    The only code I can find is the "Content Manager Example Portlet" and it is 7.0,
    not 8.1.
    It's not clear from the documentation what the Repository and Path are supposed
    to be named. Perhaps we had a working example, this might help.
    Thanks
    Dave

  • Code Samples for SDK programming in Java

    I need a complete set of Code Samples for SDK programming in Java, like the one that is available in VB and .Net.
    For Example, if you look at the following directory of machine where SDK is installed,
    C:\ProgramFiles\SAP\SAP Business One SDK\Samples\COM DI\VB.NET
    we have following Sample programs in C Sharp, VB6, VB.Net
    01.BasicOperations
    02.MetaDataOperations
    03.UsingSBObob
    04.SerialAndBatch
    05.OrderAndInvoice
    06.ObjectsSchemas
    07.Permissions
    08.LoadFromXML
    09.BudgetEditor
    10.Messages Service
    11.Basic Company Settings
    12. Report Layout Service
    13.SaveXML
    14.ItemCycleCount
    15.ApprovalStagesAndTemplateServices
    16.Alert Management Service
    Iam looking for Samples like what is available above so that we can understand JCO better.

    Hi Sridharan,
    The only JCO samples I know of are posted in the [thread|;.
    Regards,
    Vítor Vieira

  • Explanation of some code samples

    Hello,
    can you explain me some code samples?
    First:
    try{
    wdContext.currentBapi_Flight_Getlist_InputElement().
    modelObject().execute();
    catch (Exception ex){
    ex.printStackTrace();
    wdContext.nodeOutput().invalidate();
    Second:
    Bapi_Flight_Getlist_Input input =
         new Bapi_Flight_Getlist_Input();
    wdContext.nodeBapi_Flight_Getlist_Input().bind(input);
    input.setDestination_From(new Bapisfldst());
    input.setDestination_To(new Bapisfldst());
    Thanks for your help,
    André

    Hi Andre,
    I hope you know how Rfcs work so I shall start of from there. So i shall explain with the little amount of grasp I have in the topic
    First:
    What the first code does is, to connect to the R/3 system and execute the RFC/BAPI with the input populated in the context node.
    invalidate is used to refresh the output node .
    Second:
    This part of the code is to bind the imported model of the RFC to the context model node and also to instantiate an instance of the structure to input the values into the table(input.setDestination_From(new Bapisfldst())).
    Hope this would explain a bit.
    Do reply with your feedback.
    Regards
    Noufal

  • Where is code sample of OVS in SAP's tutorials ?

    Hi everyone !!
    Please help me !!!
    Where is code sample of 'Advanced Value Help: Object Value Selector'
    in 'Web Dynpro Java Tutorials and Samples NW 2004' ?
    Code sample's link is lost.
    Web Dynpro Java Tutorials and Samples NW 2004
    Web Dynpro Java Tutorials and Samples NW 2004
    Advanced Value Help: Object Value Selector
    https://ecohub.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/wd%20java/wdjava%20archive/web%20dynpro%20valuehelp%20using%20object%20value%20selector.pdf

    Hi,
    try this link,
    Advanced Value Help: Object Value Selector :
    /docs/DOC-8061#51
    right now the code sample is not working? getting the portal runtime error.
    hope this is rectified shortly !.
    Regards,
    ramesh
    Edited by: Ramesh Babu V on Nov 13, 2008 10:14 AM

  • Delivery status notifications Code Samples

    Hi,
    I'm looking for some code samples on how to use javamail Delivery status notifications.
    Please, are there any code samples?
    ngocthan

    I accept that the recipient must actually confirm receipt but until very recently I could request a delivery status report and would get confirmation that an email had been delivered to the intended server or not as the case may be. Suddenly these confirmations have stopped and I think it unlikely that all the receiving servers have simultaneously been programmed not to send delivery status confirmation. Confirmation of delivery to the receiving server is important, sometimes vital, in my work to demonstrate that non-receipt is a problem at the receiving end and that a document or email was actually sent.

  • Laura, I need some code samples you mentioned...

    Laura,
    I posted a message a few days ago regarding calling Stored Procedures in my JDev 3.1 (JDK 1.2.2) BC4J application. I need to be able to call them two different ways. The first involves passing some parameters to the SP and recieving back the ResultSet. In the other instance I simply need to make a call to them to perform some tasks on the DB side. Nothing will be returned from these SP's. You discussed implementing the SQL as a VO and gave me some code showing me how I might do this. You also mentioned that it is possible to create a method on the AppMod and call this from the JSP client. I need to know which method should work best for me and to get the code samples for the second option.
    Thanks.
    Rob

    Hi,
    Here is the code I used for the custom method on my VO (same could be used from the app module rather than a specific VO). The stored procedure I am calling here performs some calculations and returns an integer value:
    public int getTotalHits(String mon, String year) {
    CallableStatement stmt = null;
    int total;
    String totalhits = "{? = call walkthru.total_hits(?,?)}";
    stmt = getDBTransaction().createCallableStatement(totalhits, 1);
    try
    // Bind the Statement Parameters and Execute this Statement
    stmt.registerOutParameter(1,Types.INTEGER);
    stmt.setString(2,mon);
    stmt.setString(3,year);
    stmt.execute();
    total = stmt.getInt(1);
    catch (Exception ex)
    throw new oracle.jbo.JboException(ex);
    finally
    try
    stmt.close();
    catch (Exception nex)
    return total;
    After adding the custom method to your appmoduleImpl.java file and rebuilt your BC4J project, do the following:
    1. Select the Application Module object and choose Edit from the context menu.
    2. Click on the Client Methods page. You should see the method you added in the Available list.
    3. Select the method and shuttle it to the Selected list.
    4. Click Finish. You should see a new file generated under the application module object node in the Navigator named appmodule.java that contains the client stubs for your method.
    5. Save and rebuild your BC4J project.
    I wrote a custom web bean to use from my JSP page to call the method on my VO:
    public class GetTotals extends oracle.jdeveloper.html.DataWebBeanImpl {
    public void render() {
    int totalhits;
    try
    Row[] rows;
    // Retrieve all records by default, the qView variable is defined in the base class
    qView.setRangeSize(-1);
    qView.first();
    rows = qView.getAllRowsInRange();
    // instantiate a view object for our exported method
    // and call the stored procedure to get the total
    ViewObject vo = qView.getViewObject();
    wtQueryView theView = (wtQueryView) vo;
    totalhits = theView.getTotalHits(session.getValue("m").toString(),session.getValue("y").toString());
    out.println(totalhits);
    } catch(Exception ex)
    throw new RuntimeException(ex.getMessage());
    I just call the render method on this custom web bean from the JSP. I am not passing parameters to the render method of the bean, but instead access the parameters I need from the session:
    session.getValue("m").toString()
    I set these session parameters from the JSP that is called when the user submits their query criteria form. For example:
    // get the view parameter from the form String month = request.getParameter("month");
    String year = request.getParameter("year");
    // store the information for reference later session.putValue("m", month); session.putValue("y", year);
    Hope this helps.

  • Code sample of sendRedirect using Web Dynpro NetWeaver 6.4

    Hi ALL,
      I’m building a Web Dynpro application under Netweaver Developer Studio 6.4 and I need to redirect to another URL while the client click on a button. 
      I know it should be something like request.getServletResponse(true).sendRedirect("myURL");
    But I’m not sure how to get the request, or the response in order to apply the sendRedirect method.
      Do you have any code sample or Web documentation I could use to redirect my Web Dynpro application?
    Best regards,

    Hello Jean-François,
    To navigate to http://www.yahoo.com you have 2 options:
    1) Call
    WDClientUser.forceLogoffClientUser("http://www.yahoo.com");
    2) Define Outbound plug with name Url in interface view, mark it as exit, define parameter Url with type String. Add usage of interface view in your view and add something like this in action handler:
    wdThis.wdGet...InterfaceViewController().wdFirePlugUrl("http://www.yahoo.com");
    Best regards, Maksim Rashchynski.

  • Why do so many code samples here use Arrays?

    I've seen many code samples here use Arrays. Why? I much prefer to use ArrayLists, and Vectors if I need synchronization or HashSets if I require uniqueness. I don't understand why people are using Arrays when the Collection classes are so useful. You can change the underlying datastructure without changing any of the access code.

    I guess they are faster...
    public class Test1 {
         public static void main(String[] args) {
                Integer zero = new Integer(0);
                   long start = System.currentTimeMillis();
                   for (int j = 0; j < 1000; j++) {
                        Integer[] array = new Integer[10000];
                        for (int i = 0; i < 10000; i++) {
                             array[i] = zero;
                   long finish = System.currentTimeMillis();
                   System.out.println(finish - start);
                   start = System.currentTimeMillis();
                   for (int j = 0; j < 1000; j++) {
                        ArrayList arrayList = new ArrayList();
                        for (int i = 0; i < 10000; i++) {
                             arrayList.add(zero);
                   finish = System.currentTimeMillis();
                   System.out.println(finish - start);
    }~460 ms for array
    ~1600 for ArrayList
    Still, the benefit of the Collections interface and the better OO design of code that uses these classes is probably worth it in most cases, IMO.

  • Tutorial & Code Sample for Developping Composites with CAF

    Do you have tutorials & Code samples for developping composites with CAF like Webdypro for Java as on this SDN site:
    https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d
    Thanls, regards, peter

    Take a look at https://www.sdn.sap.com/irj/sdn/developerareas/xapps?rid=/webcontent/uuid/7b9b3834-0801-0010-6a9a-dc53e0db37f2">the [original link is broken] [original link is broken].
    cheers,
    Marilyn

  • Code samples for all

    I just wanted to share with the community there is a huge code base at
    koders.com
    Over 2 million lines of code....
    that has tonz of examples from almost every language. Check it out. It's pretty neat stuff if you have time to search through the code.

    Choosing between CMP or BMP depends on the business requirements.
    If your application has a lesser complex mapping, development time is less or there is no benefit is achieving a greater control over database transactions, CMP would be preferred. However, if you wish to have a greater degree of control over the database transactions and/or the database has complex mappings, it is better to opt for BMP.
    As for the code samples, you coild find hundreds of them if you do a Google search.
    Regards
    xH4x0r

  • My Code Samples Don't Always Display

    I have table that contain code samples. The help system
    renders everything except the code. If I reload, the code appears:
    http://help.marketbright.com/index.html#adding_tracking_codes.htm
    What's the proper way of "wrapping" code samples so that it's
    not considered part of the help topic's html? I don't know if
    that's the cause, but I thought I'd ask.
    Thank you,
    Angela

    I'm not clear on the problem here. I followed your link and
    the code displays OK. Please explain where things are not working.
    Putting code in a table as you have done and letting the
    table force the wrapping is an accepted way of displaying code.

  • InterMedia Code Samples Error

    Hi,
    I'm trying to install "Oracle8i interMedia Text 8.1.x Code Samples" and I'm experiencing problems when I run the spider.
    The spider.pl files contains the following lines:
    # open the parameter file 'params'
    open(PARAMS, "params") &#0124; &#0124; print STDERR "cannot open the parameter file\n";
    while(<PARAMS>)...
    The issue is that it cannot find the "params" file. Neither can I in the archive I downloaded from technet.
    Thanks for help
    Dan
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by just searching:
    Hi
    Created a table called Content
    with columns
    id Number(100,
    description varchar2(2000),
    Doc doctype
    where doctype is
    document BLOB,mimetype varchar2(100),
    Doc is used to load only HTML content
    Found that text index does not get created properly on doctype.document column.
    Also if we create a text index on description
    , then if we have to delete some rows from content we get this wrror
    ERROR at line 1:
    ORA-29876: failed in the execution of the ODCIINDEXDELETE routine
    ORA-20000: ConText error:
    DRG-10602: failed to queue DML change to column DESCRIPTION for primary key AAADFLAAFAAAAD9AAB
    DRG-50857: oracle error in drekqkd(execute k_stmt)
    ORA-00942: table or view does not exist
    any solutions
    thank you
    just searching
    <HR></BLOCKQUOTE>
    try to create primary key constraint
    alter table tablename
    add ( primary key id number )
    null

  • Code Sample: cardinfo for JCOP41V22 Card

    Listed below is the code sample, cardinfo.java, deduced from loader.java for JCOP41V22 card:
    import java.io.*;
    import com.ibm.jc.*;
    import com.ibm.jc.terminal.*;
    * Sample cardinfo. Demonstrates how to use the offcard API to list applets informatoin,
    * JCOP41V22 by shrinking the loader.java code.
    * Modified by: freiheit / 13/10/2005
    public class cardinfo{
         protected static final byte[] JCOP_CARD_MANAGER_AID = { (byte) 0xa0, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00};
         protected static final byte defaultInstallParam[] = { -55, 0 }; // don't know what it's for
         public static void main(String[] args){
         if (args.length == 0){
         System.out.println("cardinfo.main(): missing cap-file argument");
         System.exit(1);
         try{
         cardinfo l = new cardinfo();
         //l.load(args[0]);
         l.getcardinfo();
         }catch(Exception e){
         System.err.println("EX: msg " + e.getMessage() + ", class " + e.getClass());
         e.printStackTrace(System.err);
         System.exit(0);
    private cardinfo(){}
    //private void load(String capFileName) throws Exception{
    private void getcardinfo() throws Exception{
         //CapFile capFile = new CapFile(capFileName, null);
    /*CapFile capFile = new CapFile("C:\\Documents and Settings\\Seah Peng Chew\\workspace\\Helloworld\\bin\\com\\acme\\helloworld\\javacard\\helloworld.cap", null);
         System.out.println("Package name: " + capFile.pkg);
         byte[][] applets = capFile.aids;
         if ((applets == null) || (applets.length == 0)){
         throw new RuntimeException("no applets in cap file");
         // Get connection to terminal, we look for the simulation.
         // As you might want to use "pcsc", "4" or "tcl", "10" in case of
         // Windows or "PCSC", null in case of Linux, you should pass the name
         // of the terminal on the command line or in a properties file
         System.out.println("Open terminal ...");     
         //Make sure the simulator jcop.exe is activated before unmark this satement
         //before running
         //Issue /close command at "cm" prompt if the card is in use,, ie it should
         //have "-" prompt.
         JCTerminal term = JCTerminal.getInstance("Remote", null);
         //For real JCOP41V22 card, please unmark this statement before running
         //Issue /close command at "cm" prompt if the card is in use,, ie it should
         //have "-" prompt.
         //JCTerminal term = JCTerminal.getInstance("pcsc:4", null);
         term.open();
         term.waitForCard(5000);
         TraceJCTerminal _term = new TraceJCTerminal();
         _term.setLog(new PrintWriter(System.out));
         _term.init(term);
         term = _term;
         System.out.println("Get card ...");
         JCard card = new JCard(term, null, 2000);
         System.out.println("Select card manager ...");
         CardManager cardManager = new CardManager(card, CardManager.daid);     
         cardManager.select();
         byte[] dfltKey = c2b("404142434445464748494a4b4c4d4e4f");
         cardManager.setKey(new OPKey(255, 1, OPKey.DES_ECB, dfltKey));
         cardManager.setKey(new OPKey(255, 2, OPKey.DES_ECB, dfltKey));
         cardManager.setKey(new OPKey(255, 3, OPKey.DES_ECB, dfltKey));
         System.out.println("Authenticate to card manager ...");
         cardManager.initializeUpdate(255, 0, CardManager.SCP_UNDEFINED);
         cardManager.externalAuthenticate(OPApplet.APDU_CLR);
         cardManager.update();
         JCInfo info = JCInfo.INFO;
         System.out.println("\nCardManager AID : " + JCInfo.dataToString(cardManager.getAID()));
         System.out.println("CardManager state : " + info.toString("card.status", (byte) cardManager.getState()) + "\n");
         Object[] app = cardManager.getApplets(1, 0, true);
         if (app == null) {
         System.out.println("No applets installed on-card");
         } else {
         System.out.println("Applets:");
         for (int i = 0; i < app.length; i++) {
              System.out.println(info.toString("applet.status", (byte) ((OPApplet) app).getState()) + " " + JCInfo.dataToString(((OPApplet) app[i]).getAID()));
         Object[] lf = cardManager.getLoadFiles(0, true);
         if (lf == null) {
         System.out.println("No packages installed on-card");
         } else {
         System.out.println("Packages:");
         for (int i = 0; i < lf.length; i++) {
              System.out.println(info.toString("loadfile.status", (byte)((LoadFile) lf[i]).getState()) + " " + JCInfo.dataToString(((LoadFile) lf[i]).getAID()));
         term.close();
    static String numbers = "0123456789abcdef";
    private byte[] c2b(String s) {
         if (s == null) return null;
         if (s.length() % 2 != 0) throw new RuntimeException("invalid length");
         byte[] result = new byte[s.length() / 2];
         for (int i = 0; i < s.length(); i += 2) {
         int i1 = numbers.indexOf(s.charAt(i));
         if (i1 == -1) throw new RuntimeException("invalid number");
         int i2 = numbers.indexOf(s.charAt(i + 1));
         if (i2 == -1) throw new RuntimeException("invalid number");
         result[i / 2] = (byte) ((i1 << 4) | i2);
         return result;
    I have tested the code with JCOP Plug-in 3.1.1a in Windows environment.
    Please give your comments and feedback.

    The posted code had some errors in the part which enumerate the installed applets and packages. I corrected that.
    Second I changed the class name from "cardinfo" to "CardInfo", because of java code style.
    import java.io.PrintWriter;
    import com.ibm.jc.CardManager;
    import com.ibm.jc.JCInfo;
    import com.ibm.jc.JCTerminal;
    import com.ibm.jc.JCard;
    import com.ibm.jc.LoadFile;
    import com.ibm.jc.OPApplet;
    import com.ibm.jc.OPKey;
    import com.ibm.jc.terminal.TraceJCTerminal;
    * Sample cardinfo. Demonstrates how to use the offcard API to list applets informatoin, JCOP41V22
    * by shrinking the loader.java code. Modified by: freiheit / 13/10/2005
    public class CardInfo {
        protected static final byte[] JCOP_CARD_MANAGER_AID = { (byte) 0xa0, 0x00, 0x00, 0x00, 0x03,
                0x00, 0x00, 0x00 };
        protected static final byte defaultInstallParam[] = { -55, 0 }; // don't know what it's for
        public static void main(String[] args) {
             * if (args.length == 0){ System.out.println("cardinfo.main(): missing cap-file argument");
             * System.exit(1); }
            try {
                CardInfo l = new CardInfo();
                // l.load(args[0]);
                l.getcardinfo();
            } catch (Exception e) {
                System.err.println("EX: msg " + e.getMessage() + ", class " + e.getClass());
                e.printStackTrace(System.err);
            System.exit(0);
        private CardInfo() {
        // private void load(String capFileName) throws Exception{
        private void getcardinfo() throws Exception {
            // CapFile capFile = new CapFile(capFileName, null);
             * CapFile capFile = new CapFile("C:\\Documents and Settings\\Seah Peng
             * Chew\\workspace\\Helloworld\\bin\\com\\acme\\helloworld\\javacard\\helloworld.cap",
             * null); System.out.println("Package name: " + capFile.pkg); byte[][] applets =
             * capFile.aids; if ((applets == null) || (applets.length == 0)){ throw new
             * RuntimeException("no applets in cap file"); }
            // Get connection to terminal, we look for the simulation.
            // As you might want to use "pcsc", "4" or "tcl", "10" in case of
            // Windows or "PCSC", null in case of Linux, you should pass the name
            // of the terminal on the command line or in a properties file
            System.out.println("Open terminal ...");
            // Make sure the simulator jcop.exe is activated before unmark this satement
            // before running
            // Issue /close command at "cm" prompt if the card is in use,, ie it should
            // have "-" prompt.
            JCTerminal term = JCTerminal.getInstance("Remote", null);
            // For real JCOP41V22 card, please unmark this statement before running
            // Issue /close command at "cm" prompt if the card is in use,, ie it should
            // have "-" prompt.
            // JCTerminal term = JCTerminal.getInstance("pcsc:4", null);
            term.open();
            term.waitForCard(5000);
            TraceJCTerminal _term = new TraceJCTerminal();
            _term.setLog(new PrintWriter(System.out));
            _term.init(term);
            term = _term;
            System.out.println("Get card ...");
            JCard card = new JCard(term, null, 2000);
            System.out.println("Select card manager ...");
            CardManager cardManager = new CardManager(card, CardManager.daid);
            cardManager.select();
            byte[] dfltKey = c2b("404142434445464748494a4b4c4d4e4f");
            cardManager.setKey(new OPKey(255, 1, OPKey.DES_ECB, dfltKey));
            cardManager.setKey(new OPKey(255, 2, OPKey.DES_ECB, dfltKey));
            cardManager.setKey(new OPKey(255, 3, OPKey.DES_ECB, dfltKey));
            System.out.println("Authenticate to card manager ...");
            cardManager.initializeUpdate(255, 0, CardManager.SCP_UNDEFINED);
            cardManager.externalAuthenticate(OPApplet.APDU_CLR);
            cardManager.update();
            JCInfo info = JCInfo.INFO;
            System.out.println("\nCardManager AID : " + JCInfo.dataToString(cardManager.getAID()));
            System.out.println("CardManager state : "
                    + info.toString("card.status", (byte) cardManager.getState()) + "\n");
            OPApplet[] app = (OPApplet[]) cardManager.getApplets(1, 0, true);
            if (app == null) {
                System.out.println("No applets installed on-card");
            } else {
                System.out.println("Applets:");
                for (int i = 0; i < app.length; i++) {
                    System.out.println(info.toString("applet.status", (byte) app.getState()) + " "
    + JCInfo.dataToString(app[i].getAID()));
    LoadFile[] lf = cardManager.getLoadFiles(0, true);
    if (lf == null) {
    System.out.println("No packages installed on-card");
    } else {
    System.out.println("Packages:");
    for (int i = 0; i < lf.length; i++) {
    System.out.println(info.toString("loadfile.status", (byte) lf[i].getState()) + " "
    + JCInfo.dataToString(lf[i].getAID()));
    term.close();
    static String numbers = "0123456789abcdef";
    private byte[] c2b(String s) {
    if (s == null)
    return null;
    if (s.length() % 2 != 0)
    throw new RuntimeException("invalid length");
    byte[] result = new byte[s.length() / 2];
    for (int i = 0; i < s.length(); i += 2) {
    int i1 = numbers.indexOf(s.charAt(i));
    if (i1 == -1)
    throw new RuntimeException("invalid number");
    int i2 = numbers.indexOf(s.charAt(i + 1));
    if (i2 == -1)
    throw new RuntimeException("invalid number");
    result[i / 2] = (byte) ((i1 << 4) | i2);
    return result;

Maybe you are looking for

  • Sales Order Total Weight

    Hi All, Can any one help me in this requirement like i want to get the Total Gross weight and volume of a Sales order how to get this for that i use this like i have taken all the weights and volumes for that line items of a particular sales order an

  • Networking software for mac similar to Novelle?

    The IT guy at my work said that he would be willing to explore using macs at my work if there was some networking software availalble for mac. I know nothing about this, though he mentioned an application named "Novelle." Does anyone know if there ar

  • Adding Airport Express to an existing Windows WEP enabled wireless network

    I have can't find anything to help me add my new Airport Express to my existing WEP network. All I want is to use to play my Itunes through the sitting room stereo. I've upgraded the firmware on my Netgear 802.11b wireless access point so I can have

  • VL06F

    Hi Everyone, I need to add certain fields to transaction <b>VL06F</b> like Creation date (time)     LIKP-ERDAT, LIKP-ERZET Created by          LIKP-ERNAM Changed by          LIKP-AENAM (this is only the LAST changed by) Changed date          LIKP-AED

  • Polling at intervals

    Where do we require to mention time for polling the data automatically by communication channel? I know we go with planning availability times for adapter to poll automatically, but where we define the time interval to poll the data?